Agent Script DSL for deterministic Agentforce agents. TRIGGER when: user writes or edits .agent files, builds FSM-based agents, uses Agent Script CLI (sf agent generate authoring-bundle, sf agent validate authoring-bundle, sf agent preview, sf agent publish authoring-bundle, sf agent activate), or asks about deterministic agent patterns, slot filling, or instruction resolution. DO NOT TRIGGER when: Builder metadata work (use sf-ai-agentforce), agent testing (use sf-ai-agentforce-testing), or persona design (use sf-ai-agentforce-persona).
Agent Script is the code-first path for deterministic Agentforce agents. Use this skill when the user is authoring .agent files, building finite-state topic flows, or needs repeatable control over routing, variables, actions, and publish behavior.
Start with the shortest guide first: references/activation-checklist.md
Migrating from the Builder UI? Use references/migration-guide.md
Use sf-ai-agentscript when the work involves:
.agent filessf agent generate authoring-bundle, , , , )sf agent validate authoring-bundlesf agent previewsf agent publish authoring-bundlesf agent activateDelegate elsewhere when the user is:
GenAiFunction, GenAiPlugin, GenAiPromptTemplate, Models API, custom Lightning types) → sf-ai-agentforceIf the user is in Builder Script / Canvas view but the outcome is a .agent authoring bundle, keep the work in sf-ai-agentscript.
Ask for or infer:
Before you author or fix any .agent file, verify these first:
start_agent blockTrue / Falseelse if and no nested ifactions: block@inputs in set expressionslinked variables have no defaultslinked variables do not use object / list typesagent_type@actions. prefixes consistentlyrun @actions.X only when X is a topic-level action definition with target:@system_variables.user_input contains/startswith/endswith for intent routingis_displayable: False + is_used_by_planner: True@outputs.X is scalar — inspect the output schema before branching or assignmentFor the expanded version, use references/activation-checklist.md.
| Agent type | Required | Forbidden / caution |
|---|---|---|
AgentforceServiceAgent | Valid default_agent_user, correct permissions, target-org checks, prefer sf org create agent-user | Publishing without a real Einstein Agent User |
AgentforceEmployeeAgent | Explicit agent_type | Supplying default_agent_user |
Full details: references/agent-user-setup.md
Use this order for consistency in this skill's examples and reviews: