skills/sf-ai-agentforce/SKILL.md
Agentforce Builder metadata path for Builder-managed topics/actions, Prompt Builder templates, GenAiFunction/GenAiPlugin, Models API, and custom Lightning types. TRIGGER when: user maintains or configures Builder metadata agents, creates topics/actions, works with Prompt Builder templates, or touches .genAiFunction, .genAiPlugin, or .genAiPromptTemplate metadata XML files. DO NOT TRIGGER when: Agent Script DSL .agent files (use sf-ai-agentscript), agent testing (use sf-ai-agentforce-testing), or persona design (use sf-ai-agentforce-persona).
npx skillsauth add jaganpro/sf-skills sf-ai-agentforceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill for the Setup UI / Agent Builder path: declarative topics, Builder-managed actions, GenAiFunction / GenAiPlugin metadata, Prompt Builder templates stored as GenAiPromptTemplate metadata, Models API usage from Apex, and custom Lightning types.
For new code-first agent development, prefer sf-ai-agentscript.
If the work produces or edits a
.agentfile — including Builder Script / Canvas work that results in an authoring bundle — use sf-ai-agentscript.
Use sf-ai-agentforce when the user is:
GenAiFunction, GenAiPlugin, or GenAiPromptTemplate metadataDo not use it for:
.agent files or deterministic FSM design → sf-ai-agentscriptAsk for or infer:
.agent authoring bundle| Path | Skill | Best fit |
|---|---|---|
| Builder metadata path | sf-ai-agentforce | Declarative maintenance, existing Builder agents, metadata-driven action registration |
| Agent Script authoring bundle path | sf-ai-agentscript | Code-first .agent authoring, deterministic routing, version-controlled agent logic |
If the user is starting from scratch and wants strong control over flow/state, route to Agent Script.
sf org create agent-user)<agentAccesses>Expanded workflow: references/builder-workflow.md
Topic descriptions are routing instructions for the planner. They must be:
| Target type | Typical use | Registered via |
|---|---|---|
| Flow | safest default for Builder actions | GenAiFunction |
| Apex | complex business logic via @InvocableMethod | GenAiFunction |
| Prompt Builder template | generated summaries / drafts / recommendations | GenAiFunction |
GenAiPromptTemplate is the current Metadata API type for source-driven template work.genAiPromptTemplates/*.genAiPromptTemplate-meta.xml.{!$Input:TargetRecord} or {!$Input:AdditionalContext}.Before publishing the agent itself, deploy the supporting stack:
GenAiPromptTemplate / GenAiFunction / GenAiPluginFor Service Agents, prefer the native GA command:
sf org create agent-user --target-org <alias> --json
Use the returned username in the running-user configuration.
For Employee Agents, ensure end users receive a Permission Set containing <agentAccesses>. Without this, the agent can be active but still invisible in Lightning Experience.
See ../sf-permissions/references/agent-access-guide.md.
After publish, run sf agent activate separately.
For automation, prefer sf agent activate --api-name <AgentName> --version <n> --target-org <alias> --json so the rollout is deterministic and machine-readable.
Use when registering a single callable action. Validate:
Use when grouping related functions into one logical package.
Use for generated content, not deterministic business rules.
Prefer the current metadata shape:
GenAiPromptTemplategenAiPromptTemplates/.genAiPromptTemplate-meta.xmltemplateVersionsUse when the solution belongs in Apex-driven AI orchestration rather than Builder-only actions.
Use when the action needs richer structured input or output presentation.
Expanded references:
sf-metadata → sf-apex → sf-flow → sf-ai-agentforce → sf-deploy
| Requirement | Delegate to | Why |
|---|---|---|
| Create / fix Flows | sf-flow | Action target creation and Flow validation |
| Create / fix Apex actions | sf-apex | @InvocableMethod and Apex correctness |
| Deploy / publish | sf-deploy | Deployment orchestration |
| Test the agent | sf-ai-agentforce-testing | Formal test execution and assertions |
| Employee Agent visibility / access | sf-permissions | Permission Set <agentAccesses> setup |
| Symptom | Likely cause | Read next |
|---|---|---|
| Action not available in Builder | target metadata missing or not deployed | references/metadata-reference.md |
| Prompt action fails during publish or activation | template is Draft, missing inputs, or old metadata shape is being used | references/genaiprompttemplate.md |
| Need more than 5 template inputs | flex template input limit hit | references/genaiprompttemplate.md |
| Apex AI logic times out | Models API work placed in the wrong context | references/models-api.md |
| Rich input/output UI not rendering | Lightning type config or prerequisites are incomplete | references/custom-lightning-types.md |
| Agent publishes but is not usable | forgot explicit activation | references/cli-commands.md |
| Service Agent publish/runtime failure | missing or invalid running user | ../sf-ai-agentscript/references/agent-user-setup.md |
| Employee Agent active but not visible to users | missing <agentAccesses> permission set | ../sf-permissions/references/agent-access-guide.md |
| Score | Meaning | |---|---| | 90+ | Ready to deploy | | 80–89 | Strong, minor cleanup only | | 70–79 | Review before deploy | | 60–69 | Needs work | | < 60 | Block deployment |
Full rubric: references/scoring-rubric.md
development
Lightning Web Components with PICKLES methodology and 165-point scoring. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use sf-apex), Aura components, or Visualforce.
tools
Use this skill whenever users want to build, inspect, debug, automate, or publish workflows in Agentforce Grid (AI Workbench) using Salesforce plus the Grid MCP or direct Grid REST calls. Trigger it for Grid workbook creation, worksheet setup, Object/Reference/AI/Agent/AgentTest/Evaluation/PromptTemplate/InvocableAction column design, prompt drafting inside Grid, worksheet execution troubleshooting, Grid YAML `apply_grid` specs, and Windows-specific Grid setup issues. Also use it when users mention AI Workbench, Grid Studio, workbook IDs, worksheet IDs, Grid Connect, or ask for recipes like "top opportunities with AI email drafts", "agent test suite in Grid", or "build this worksheet from YAML". Do not use it for generic Salesforce work unrelated to Agentforce Grid.
development
Salesforce Flex Credit estimation for Agentforce and Data Cloud workloads. TRIGGER when: user needs cost projections, scenario planning, budget sizing, or architecture tradeoff analysis for Agentforce prompts/actions, Data Cloud meters, or monthly Flex Credit usage. DO NOT TRIGGER when: user is building Agentforce metadata or .agent files themselves (use sf-ai-agentforce or sf-ai-agentscript), implementing Data Cloud assets (use sf-datacloud-*), or asking for contract-specific commercial approval that depends on non-public pricing terms.
testing
Permission Set analysis, hierarchy viewer, and access auditing. TRIGGER when: user asks "who has access to X?", analyzes permission sets/groups, or touches .permissionset-meta.xml / .permissionsetgroup-meta.xml files. DO NOT TRIGGER when: creating new metadata (use sf-metadata), deploying permission sets (use sf-deploy), or Apex sharing logic (use sf-apex).