Agent skill
sf-ai-agentforce
Agentforce platform agent building via Setup UI. TRIGGER when: user maintains or configures agents via the legacy Setup UI / Agent Builder path, 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).
Install this agent skill to your Project
npx add-skill https://github.com/Jaganpro/sf-skills/tree/main/skills/sf-ai-agentforce
Metadata
Additional technical details for this skill
- author
- Jag Valaiyapathy
- version
- 2.2.0
SKILL.md
sf-ai-agentforce: Standard Agentforce Platform Development
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.
When This Skill Owns the Task
Use sf-ai-agentforce when the user is:
- maintaining existing Builder-based agents
- working in Setup → Agentforce → Agents
- creating or fixing
GenAiFunction,GenAiPlugin, orGenAiPromptTemplatemetadata - wiring Builder topics to Flow / Apex / Prompt Builder actions
- using Models API or LightningTypeBundle in the context of Builder-based agents
Do not use it for:
.agentfiles or deterministic FSM design → sf-ai-agentscript- agent test suites and coverage loops → sf-ai-agentforce-testing
- persona / voice design → sf-ai-agentforce-persona
Required Context to Gather First
Ask for or infer:
- whether this is a Builder / Setup UI project or a code-first Agent Script project
- agent type: Service Agent or Employee Agent
- whether the work targets topics, actions, Prompt Builder templates, Models API, or custom Lightning types
- what supporting Flow / Apex / metadata dependencies already exist
- whether the user needs authoring help, publish help, or troubleshooting
Two Agentforce Paths
| Path | Skill | Best fit |
|---|---|---|
| Setup UI / Agent Builder | sf-ai-agentforce |
Declarative maintenance, existing Builder agents, metadata-driven action registration |
| Agent Script DSL | 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.
Builder Workflow Summary
- Confirm this is a Builder / Setup UI project
- Pick Service Agent vs Employee Agent
- Define topics with strong descriptions, scope, and instructions
- Prepare supporting actions (Flow, Apex, Prompt Builder template)
- Configure inputs / outputs carefully
- Validate dependencies and template status
- Publish, then activate
Expanded workflow: references/builder-workflow.md
Key Platform Rules
Topic quality matters
Topic descriptions are routing instructions for the planner. They must be:
- specific
- scenario-based
- non-overlapping with sibling topics
Actions are wrappers around real targets
| 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 |
Prompt Template vs GenAiPromptTemplate
- Prompt Template is the plain-English / UI term used in Prompt Builder.
GenAiPromptTemplateis the current Metadata API type for source-driven template work.- Prefer current source format:
genAiPromptTemplates/*.genAiPromptTemplate-meta.xml. - For flexible Prompt Builder templates, plan around the 5-input maximum and consolidate inputs when needed.
- Prompt content should reference inputs with the current merge-field shape, e.g.
{!$Input:TargetRecord}or{!$Input:AdditionalContext}.
Supporting metadata deploys first
Before publishing the agent itself, deploy the supporting stack:
- metadata / fields if needed
- Apex if needed
- Flows if needed
GenAiPromptTemplate/GenAiFunction/GenAiPlugin- then publish the agent
Publish does not activate
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.
Metadata Guidance
GenAiFunction
Use when registering a single callable action. Validate:
- target exists
- target is active / deployable
- input names match the target contract
- output names match the target contract
- capability text clearly says when the action should be used
GenAiPlugin
Use when grouping related functions into one logical package.
GenAiPromptTemplate
Use for generated content, not deterministic business rules.
Prefer the current metadata shape:
- metadata type:
GenAiPromptTemplate - folder:
genAiPromptTemplates/ - file suffix:
.genAiPromptTemplate-meta.xml - content lives under
templateVersions - use published template versions before wiring actions that depend on them
Models API
Use when the solution belongs in Apex-driven AI orchestration rather than Builder-only actions.
Custom Lightning Types
Use when the action needs richer structured input or output presentation.
Expanded references:
- references/metadata-reference.md
- references/genaiprompttemplate.md
Cross-Skill Integration
Recommended Orchestration Order
sf-metadata → sf-apex → sf-flow → sf-ai-agentforce → sf-deploy
Required delegations
| 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 |
High-Signal Failure Patterns
| 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 |
Reference Map
Start here
- references/builder-workflow.md
- references/metadata-reference.md
- references/genaiprompttemplate.md
- references/cli-commands.md
Terminology and template planning
- references/prompt-templates.md
- references/models-api.md
- references/custom-lightning-types.md
Rubric
- references/scoring-rubric.md
Cross-skill reads
- sf-ai-agentscript
- sf-ai-agentforce-testing
- sf-flow
- sf-apex
- sf-deploy
Score Guide
| 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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
sf-diagram-mermaid
Salesforce architecture diagrams using Mermaid with ASCII fallback. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use sf-diagram-nanobananapro), or asks about non-Salesforce systems.
sf-integration
Salesforce integration architecture with 120-point scoring. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use sf-connected-apps), Apex-only logic (use sf-apex), or data import/export (use sf-data).
sf-deploy
Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex/LWC code (use sf-apex/sf-lwc), creating metadata XML (use sf-metadata), or querying org data (use sf-data).
sf-industry-commoncore-omnistudio-analyze
Cross-cutting OmniStudio analysis skill for namespace detection, dependency visualization, and impact analysis across OmniScripts, FlexCards, Integration Procedures, and Data Mappers. TRIGGER when: user asks about OmniStudio dependencies, wants namespace detection (Core vs vlocity_cmt vs vlocity_ins), needs impact analysis, or requests dependency diagrams. DO NOT TRIGGER when: authoring OmniScripts (use sf-industry-commoncore-omniscript), building FlexCards (use sf-industry-commoncore-flexcard), creating Integration Procedures (use sf-industry-commoncore-integration-procedure), or configuring Data Mappers (use sf-industry-commoncore-datamapper).
sf-industry-commoncore-callable-apex
Salesforce Industries Common Core (OmniStudio/Vlocity) Apex callable generation and review with 120-point scoring. TRIGGER when: user creates or reviews System.Callable classes, migrates `VlocityOpenInterface` / `VlocityOpenInterface2`, or builds Industries callable extensions used by OmniStudio, Integration Procedures, or DataRaptors. DO NOT TRIGGER when: generic Apex classes/triggers (use sf-apex), building Integration Procedures (use sf-industry-commoncore-integration-procedure), authoring OmniScripts (use sf-industry-commoncore-omniscript), configuring Data Mappers (use sf-industry-commoncore-datamapper), or analyzing namespace/dependency issues (use sf-industry-commoncore-omnistudio-analyze).
sf-datacloud-act
Salesforce Data Cloud Act phase. TRIGGER when: user manages activations, activation targets, data actions, or downstream delivery of Data Cloud audiences and data. DO NOT TRIGGER when: the task is segment creation (use sf-datacloud-segment), data retrieval/search work (use sf-datacloud-retrieve), or STDM/session tracing (use sf-ai-agentforce-observability).
Didn't find tool you were looking for?