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 bundlePathSkillBest fitBuilder metadata pathsf-ai-agentforceDeclarative maintenance, existing Builder agents, metadata-driven action registrationAgent Script authoring bundle pathsf-ai-agentscriptCode-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 typeTypical useRegistered viaFlowsafest default for Builder actionsGenAiFunctionApexcomplex business logic via @InvocableMethod``GenAiFunctionPrompt Builder templategenerated summaries / drafts / recommendationsGenAiFunction
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:
text
sf-metadata → sf-apex → sf-flow → sf-ai-agentforce → sf-deploy
RequirementDelegate toWhyCreate / fix Flowssf-flowAction target creation and Flow validationCreate / fix Apex actionssf-apex@InvocableMethod and Apex correctnessDeploy / publishsf-deployDeployment orchestrationTest the agentsf-ai-agentforce-testingFormal test execution and assertionsEmployee Agent visibility / accesssf-permissionsPermission Set <agentAccesses> setup
SymptomLikely causeRead nextAction not available in Buildertarget metadata missing or not deployedreferences/metadata-reference.mdPrompt action fails during publish or activationtemplate is Draft, missing inputs, or old metadata shape is being usedreferences/genaiprompttemplate.mdNeed more than 5 template inputsflex template input limit hitreferences/genaiprompttemplate.mdApex AI logic times outModels API work placed in the wrong contextreferences/models-api.mdRich input/output UI not renderingLightning type config or prerequisites are incompletereferences/custom-lightning-types.mdAgent publishes but is not usableforgot explicit activationreferences/cli-commands.mdService Agent publish/runtime failuremissing or invalid running user../sf-ai-agentscript/references/agent-user-setup.mdEmployee Agent active but not visible to usersmissing <agentAccesses> permission set../sf-permissions/references/agent-access-guide.md
ScoreMeaning90+Ready to deploy80–89Strong, minor cleanup only70–79Review before deploy60–69Needs work< 60Block deployment
Full rubric: references/scoring-rubric.md