Skip to content

Instantly share code, notes, and snippets.

View msrivastav13's full-sized avatar
🎯
Focusing

Mohith Shrivastava msrivastav13

🎯
Focusing
View GitHub Profile
---
name: write-spec
description: "Generate an implementation-specification MARKDOWN document from a plain-English requirement, in the easy to understand format using ASD-STE100 english. It calls the platform-headless-360 MCP for the grounded, structured change set (the component list — create/update/delete — plus grounding facts) and formats it into the fixed section layout, saving to the design/ folder. TRIGGER when the user asks to create/write/produce an implementation spec or specification for a Salesforce change, or invokes /write-spec. The MCP supplies the components (JSON); THIS skill owns the format and the prose. DO NOT TRIGGER to implement the feature or deploy metadata."
allowed-tools: Read, Write, mcp__platform-metadata_grounding__fetch_metadata, mcp__platform-headless-360__list_specs
argument-hint: "<requirement prompt> (e.g. Create an implementation specification for proactive firmware-failure detection ...)"
metadata:
version: "1.0"
domains: ["Developer Experience"]
---
@msrivastav13
msrivastav13 / w27RatingStars.js
Created October 2, 2026 01:10
w27-rating-stars: a framework-free web component used with lwc:external (Salesforce Winter '27 developer guide)
/* A tiny framework-free web component, standing in for a third-party library. */
(function () {
if (customElements.get('w27-rating-stars')) return;
class W27RatingStars extends HTMLElement {
static get observedAttributes() { return ['value', 'max']; }
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
get value() { return Number(this.getAttribute('value') || 0); }
@msrivastav13
msrivastav13 / ontology.yaml
Created September 23, 2026 16:55
ontology.yaml
version: 1
project: radiant homes
purpose: minimal_semantic_disambiguation
usage:
- Consult this file only when interpreting business/domain language.
- Prefer repository metadata and code for ordinary Salesforce schema facts.
- Do not invent a 1:1 Salesforce mapping when a term is marked context_dependent.
terms:
@msrivastav13
msrivastav13 / update.sh
Last active September 3, 2026 00:12
update.sh
#!/bin/bash
# =============================================================================
# Salesforce dev-tools UPGRADER for macOS — upgrade-only, never fresh-installs.
#
# Upgrades, in order, ONLY what is already installed:
# 1. Node.js (official .pkg, to latest LTS) 2. npm (latest)
# 3. Salesforce CLI 4. Visual Studio Code
# 5. Salesforce Extension Pack
#
# It also ensures the "Metadata Visualizer" VS Code extension is present:
#!/bin/bash
#
# setup_tdx_av.sh
# Creates TDX_AV/ with two SFDX projects (Todo: standard, Pronto: reactexternalapp),
# logs in via `sf org login web`, sets the org as default for both projects,
# and runs `npm install` in each.
#
# Supports offline npm install via pre-warmed cache — see prep_npm_cache.sh.
# Set TDX_NPM_CACHE to override the default cache path (/opt/tdx/npm-cache).
#
@msrivastav13
msrivastav13 / CertificatePdfGenerator.apex
Created January 12, 2026 04:36
Demonstrates Blob.toPdf() with Visualforce PDF Rendering
/**
* CertificatePdfGenerator - Demonstrates Blob.toPdf() with Visualforce PDF Rendering
*
* Spring '26 Release Update:
* Blob.toPdf() now uses the Visualforce PDF rendering service which provides:
* - Expanded font support including multibyte characters (CJK - Chinese, Japanese, Korean)
* - Default font changed from serif to sans-serif
* - Consistent rendering across the Salesforce Platform
* When: Enforced in Summer '26. Check Trust Status for your instance's upgrade date.
*
@msrivastav13
msrivastav13 / apex-best-practice-guide.md
Created May 29, 2025 03:50
apex-best-practice-guide.md

Rule: Apex Best Practices

Description: Enforce naming and formatting standards for Apex code.

Applies to: **/*.cls

Guidelines:

  • Class names must be PascalCase (e.g., AccountService, OpportunityHelper)
  • Method names must be camelCase (e.g., calculateTax, fetchOpportunities)
  • Variable names must be camelCase and descriptive (e.g., accountList, isClosed)
@msrivastav13
msrivastav13 / AgentAIInvoker.cls
Last active May 21, 2026 10:28
Sample code that shows how to invoke an Agentforce Agent from Apex
public with sharing class AgentAIInvoker {
public static void invokeAIAgent() {
try {
// Create an instance of the invocable action with type 'generateAiAgentResponse' and name 'Agentforce_Service_Agent_new'
Invocable.Action action = Invocable.Action.createCustomAction(
'generateAiAgentResponse',
'Agentforce_Service_Agent_new'
);
action.setInvocationParameter('userMessage', 'Summarize my case');
@msrivastav13
msrivastav13 / Resources for Implementing Agentforce Service Agents.md
Last active January 4, 2025 22:27
Resources for Implementing Agentforce Service Agents

Resources for Setting Agentforce Service Agents

Below are key resources and a recorded video link to guide you through the implementation process,
from setup to advanced customization.


Recorded Video Session

Watch the recordings of the live-stream for a comprehensive walkthrough:

@msrivastav13
msrivastav13 / Boost Your Developer Productivity with Modern Tools.md
Last active July 17, 2024 14:34
Boost Your Developer Productivity with Modern Tools

Code Builder

Sign up for a Salesforce org

  1. Follow the instructions of your instructor to get a Salesforce org provisioned with Code Builder.

  2. Make sure you write down your user id and password. You'll need them again later in this workshop.

  3. In your browser, go to login.salesforce.com and log in to your org.