
Sf Ai Agentscript
Author deterministic Agentforce agents in Agent Script (.agent files) with FSM topics, CLI validate/preview/publish, and slot-filling patterns on Salesforce API v66+.
Overview
sf-ai-agentscript is an agent skill for the Build phase that helps you write Agent Script (.agent) deterministic Agentforce agents and run the sf agent authoring-bundle CLI workflow.
Install
npx skills add https://github.com/jaganpro/sf-skills --skill sf-ai-agentscriptWhat is this skill?
- Triggers on .agent file edits, Agent Script CLI (generate, validate, preview, publish, activate authoring-bundle)
- Scored quality rubric: 100 points across 6 categories for generated agents
- Validation metadata: PASS status, 24 validation agents, 0-shot generation tested against representative samples
- Explicit DO NOT TRIGGER boundaries: Builder metadata (sf-ai-agentforce), testing, persona design
- Activation checklist and deterministic FSM topic flows for Service and Employee agent scenarios
- 100 points across 6 categories scoring rubric
- 24 validation agents with PASS validation status
- Skill metadata version 2.9.0, API v66.0+ requirement
Adoption & trust: 1.2k installs on skills.sh; 418 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need deterministic Agentforce behavior in version-controlled .agent files but keep mixing Builder metadata, testing, and persona work into the wrong workflow.
Who is it for?
Salesforce builders with Agentforce license who want FSM-based, repeatable agent logic and CLI publish paths instead of UI-only Agent Builder edits.
Skip if: Agentforce Builder-only metadata changes, agent test automation without script authoring, or persona copy without .agent DSL work.
When should I use this skill?
User writes or edits .agent files, builds FSM-based agents, uses Agent Script CLI (generate, validate, preview, publish, activate authoring-bundle), or asks about deterministic agent patterns, slot filling, or instructio
What do I get? / Deliverables
You produce validated, publishable Agent Script bundles with FSM topics, clear slot filling, and CLI-driven preview and activate steps aligned to the skill rubric.
- .agent authoring bundle files with deterministic topic FSMs
- CLI-validated and publish-ready Agent Script package with activation checklist completed
Recommended Skills
Journey fit
Agent Script is code-first agent construction—canonical shelf is Build where you implement agent behavior, not persona workshops or Builder-only metadata. agent-tooling fits DSL authoring, sf agent CLI bundles, and deterministic routing—distinct from generic CRM customization or ship-phase testing.
How it compares
Agent Script DSL and CLI path—not the Agent Builder metadata skill or persona-design companion.
Common Questions / FAQ
Who is sf-ai-agentscript for?
Developers and admins on Salesforce Agentforce who author .agent files, finite-state topics, and CLI authoring bundles with API v66.0+ and appropriate licensing.
When should I use sf-ai-agentscript?
During Build agent-tooling when you edit .agent files, run sf agent validate or publish authoring-bundle, or ask about deterministic routing, slot filling, or instruction resolution—not for Builder-only or testing-only tasks.
Is sf-ai-agentscript safe to install?
Check the Security Audits panel on this Prism page; the skill targets org-side agent publish flows—review OAuth, agent user setup, and production activate steps before enabling in live orgs.
SKILL.md
READMESKILL.md - Sf Ai Agentscript
# SF-AI-AgentScript Skill 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](references/activation-checklist.md) > > Migrating from the Builder UI? Use [references/migration-guide.md](references/migration-guide.md) ## When This Skill Owns the Task Use `sf-ai-agentscript` when the work involves: - creating or editing `.agent` files - deterministic topic routing, guards, and transitions - Agent Script CLI workflows (`sf agent generate authoring-bundle`, `sf agent validate authoring-bundle`, `sf agent preview`, `sf agent publish authoring-bundle`, `sf agent activate`) - slot filling, instruction resolution, post-action loops, or FSM design Delegate elsewhere when the user is: - maintaining Builder metadata agents (`GenAiFunction`, `GenAiPlugin`, `GenAiPromptTemplate`, Models API, custom Lightning types) → [sf-ai-agentforce](../sf-ai-agentforce/SKILL.md) - designing persona / tone / voice → [sf-ai-agentforce-persona](../sf-ai-agentforce-persona/SKILL.md) - building formal test plans or coverage loops → [sf-ai-agentforce-testing](../sf-ai-agentforce-testing/SKILL.md) If the user is in Builder Script / Canvas view but the outcome is a `.agent` authoring bundle, keep the work in `sf-ai-agentscript`. --- ## Right-Size Determinism - Determinism is a dial, not a destination. - Use Agent Script when “mostly right” is not acceptable: gates, mandatory sequencing, explicit state transitions, compliance, or drift control. - If a workflow is fully static and linear, use Flow or Apex instead of scripting the conversation. - Prefer a deterministic envelope: deterministic entry/gate → flexible middle → deterministic closeout. - More determinism is not automatically better. Start minimal, then harden only the parts that show routing drift, sequencing failures, or compliance risk. --- ## Required Context to Gather First Ask for or infer: - agent purpose and whether Agent Script is truly the right fit - Service Agent vs Employee Agent - target org and publish intent - expected actions / targets (Flow, Apex, PromptTemplate, etc.) - whether the request is authoring, validation, preview, or publish troubleshooting --- ## Activation Checklist Before you author or fix any `.agent` file, verify these first: 1. **Exactly one `start_agent` block** 2. **No mixed tabs and spaces** 3. **Booleans are `True` / `False`** 4. **No `else if` and no nested `if`** 5. **No top-level `actions:` block** 6. **No `@inputs` in `set` expressions** 7. **`linked` variables have no defaults** 8. **`linked` variables do not use `object` / `list` types** 9. **Use explicit `ag