Salesforce AI Agentforce
by @dsouza-anush
Agentforce Builder metadata path for Builder-managed topics/actions, Prompt Builder templates, GenAiFunction/GenAiPlugin, Models API, and custom Lightning ty...
clawhub install sf-ai-agentforceπ About This Skill
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 .agent file β 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:
GenAiFunction, GenAiPlugin, or GenAiPromptTemplate metadataDo not use it for:
.agent files or deterministic FSM design β sf-ai-agentscriptRequired Context to Gather First
Ask for or infer:
.agent authoring bundleTwo 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
1. Confirm this is a Builder / Setup UI project
2. Pick Service Agent vs Employee Agent
3. For Service Agents, provision the running user (prefer sf org create agent-user)
4. For Employee Agents, plan visibility with a Permission Set containing
5. Define topics with strong descriptions, scope, and instructions
6. Prepare supporting actions (Flow, Apex, Prompt Builder template)
7. Configure inputs / outputs carefully
8. Validate dependencies and template status
9. 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: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
GenAiPromptTemplate is the current Metadata API type for source-driven template work.genAiPromptTemplates/*.genAiPromptTemplate-meta.xml.{!$Input:TargetRecord} or {!$Input:AdditionalContext}.Supporting metadata deploys first
Before publishing the agent itself, deploy the supporting stack: 1. metadata / fields if needed 2. Apex if needed 3. Flows if needed 4.GenAiPromptTemplate / GenAiFunction / GenAiPlugin
5. then publish the agentService Agent running user
For Service Agents, prefer the native GA command:sf org create agent-user --target-org --json
Use the returned username in the running-user configuration.Employee Agent visibility
For Employee Agents, ensure end users receive a Permission Set containing. 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, runsf agent activate separately.
For automation, prefer sf agent activate --api-name --version --target-org --json so the rollout is deterministic and machine-readable.Metadata Guidance
GenAiFunction
Use when registering a single callable action. Validate:GenAiPlugin
Use when grouping related functions into one logical package.GenAiPromptTemplate
Use for generated content, not deterministic business rules.Prefer the current metadata shape:
GenAiPromptTemplategenAiPromptTemplates/.genAiPromptTemplate-meta.xmltemplateVersionsModels 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 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 permission set | ../sf-permissions/references/agent-access-guide.md |
Reference Map
Start here
Terminology and template planning
Rubric
Cross-skill reads
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