sf-ai-agentforce
jaganpro/sf-skills
Salesforce Agentforce Builder metadata, topics, actions, and Prompt Builder templates for declarative agent development.
What is sf-ai-agentforce?
This skill manages Salesforce Agentforce Builder-based agents via Setup UI, including topic/action configuration, GenAiFunction/GenAiPlugin metadata, Prompt Builder templates, and Models API integration. Use it when maintaining existing Builder agents or working with declarative metadata; for code-first Agent Script development (.agent files), use sf-ai-agentscript instead.
- Configure and maintain Builder-managed topics, actions, and agent metadata in Setup UI
- Create and deploy GenAiFunction, GenAiPlugin, and GenAiPromptTemplate metadata for agent actions
- Wire Builder topics to Flow, Apex, and Prompt Builder template actions
- Manage Service Agent and Employee Agent visibility, running users, and permission sets
- Deploy supporting metadata stack (fields, Flows, Apex, templates) before publishing agents
- Publish and activate agents using declarative Builder workflows
How to install sf-ai-agentforce
npx skills add https://github.com/jaganpro/sf-skills --skill sf-ai-agentforce- Salesforce org with API v66.0+ (Spring '26)
- Access to Setup → Agentforce → Agents UI
- For Service Agents: ability to create agent users via sf org create agent-user
- For Employee Agents: Permission Set with <agentAccesses> configuration
How to use sf-ai-agentforce
- 1.Confirm whether this is a Builder/Setup UI project or code-first Agent Script project
- 2.Determine agent type: Service Agent or Employee Agent
- 3.For Service Agents, provision a running user; for Employee Agents, plan visibility via Permission Sets
- 4.Define topics with specific, scenario-based descriptions and non-overlapping scope
- 5.Prepare supporting actions: create Flows, Apex @InvocableMethod methods, or Prompt Builder templates
- 6.Register actions via GenAiFunction or GenAiPlugin metadata with matching input/output contracts
- 7.Deploy supporting metadata stack (fields, Flows, Apex, templates) before publishing
- 8.Configure agent topics, actions, and inputs/outputs in Builder UI
Use cases
- Maintaining an existing Service Agent with Flow-based actions and Prompt Builder templates
- Creating Employee Agent topics with Apex-backed actions and custom Lightning types
- Registering a new GenAiPromptTemplate for agent-generated summaries or recommendations
- Configuring topic routing and action inputs/outputs in the Builder UI
- Deploying supporting metadata and publishing an agent version for activation
- Salesforce admins maintaining Builder-based Agentforce agents
- Developers working on declarative agent metadata and action registration
- Teams using Setup UI for agent configuration rather than code-first authoring
- Architects planning Service Agent vs Employee Agent deployments
sf-ai-agentforce FAQ
Use sf-ai-agentforce for Builder/Setup UI projects and existing Builder agents. Use sf-ai-agentscript for code-first development with .agent authoring bundles and deterministic FSM design.
Prompt Template is the UI term in Prompt Builder; GenAiPromptTemplate is the Metadata API type. Prefer the current source format: genAiPromptTemplates/*.genAiPromptTemplate-meta.xml with content under templateVersions.
Yes. Deploy the supporting stack in order: metadata/fields, Apex, Flows, GenAiPromptTemplate/GenAiFunction/GenAiPlugin, then publish the agent.
Employee Agents require end users to receive a Permission Set containing <agentAccesses>. Publishing does not automatically grant visibility; configure the Permission Set separately.
No. Publish and activate are separate steps. After publish, run sf agent activate --api-name <AgentName> --version <n> to activate the agent.
Full instructions (SKILL.md)
Source of truth, from jaganpro/sf-skills.
name: sf-ai-agentforce description: > 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). license: MIT compatibility: "Requires API v66.0+ (Spring '26)" metadata: version: "2.2.0" author: "Jag Valaiyapathy"
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.
If the work produces or edits a
.agentfile — including Builder Script / Canvas work that results in an authoring bundle — use 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
- whether the user is editing Builder metadata or a
.agentauthoring bundle - 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 |
|---|---|---|
| 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.
Builder Workflow Summary
- Confirm this is a Builder / Setup UI project
- Pick Service Agent vs Employee Agent
- For Service Agents, provision the running user (prefer
sf org create agent-user) - For Employee Agents, plan visibility with a Permission Set containing
<agentAccesses> - 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
Service Agent running user
For 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.
Employee Agent visibility
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.
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:
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 |
| Employee Agent visibility / access | sf-permissions | Permission Set <agentAccesses> setup |
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 |
| 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 |
Reference Map
Start here
- references/builder-workflow.md
- references/metadata-reference.md
- references/genaiprompttemplate.md
- references/cli-commands.md
Terminology and template planning
Rubric
Cross-skill reads
- sf-ai-agentscript
- sf-ai-agentforce-testing
- sf-flow
- sf-apex
- sf-permissions
- 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
Related skills
More from jaganpro/sf-skills and the wider catalog.

sf-ai-agentforce-observability
Extract and analyze Salesforce Agentforce session traces from Data 360 for observability and debugging.

sf-ai-agentforce-persona
Design AI agent personas for Salesforce Agentforce with structured 50-point scoring framework.

sf-ai-agentforce-testing
Test Salesforce Agentforce agents with multi-turn API and CLI workflows, coverage analysis, and 100-point scoring.

sf-ai-agentscript
Code-first DSL for deterministic Salesforce Agentforce agents with FSM-based routing and slot filling.

sf-apex
Generate and review production Salesforce Apex code with 150-point quality scoring.

sf-connected-apps
Salesforce OAuth and Connected Apps configuration with security hardening and ECA/legacy support.