sf-ai-agentscript

Author and validate deterministic Salesforce Agentforce agents using Agent Script DSL.

1|Updated May 7, 2026
One-click install
npx skills add https://github.com/amanpraaj/sf-skill-hub --skill sf-ai-agentscript-amanpraaj
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sf-ai-agentscript
Source: https://github.com/amanpraaj/sf-skill-hub/tree/main/skills/salesforce/sf-ai-agentscript
Command: npx skills add https://github.com/amanpraaj/sf-skill-hub --skill sf-ai-agentscript-amanpraaj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve? Building reliable Salesforce Agentforce agents requires precise control over topic routing, state transitions, and action execution that prompt-only approaches cannot guarantee. This Skill guides the authoring, validation, and publishing of deterministic .agent files using the Agent Script DSL, preventing common syntax errors and publish failures. ## Core Features & Use Cases - Agent Script Authoring: Write .agent files with FSM-based topic architecture, deterministic guards (available when), variable state management, and target-backed actions (Flow, Apex, Prompt Templates). - Validation & Publish Workflow: Run sf agent validate authoring-bundle, preview smoke tests, and publish/activate agents via Salesforce CLI with org-aware checks for Service vs Employee Agents. - 100-Point Scoring System: Evaluate agent quality across six categories including structure, deterministic logic, instruction resolution, and deployment readiness. - Use Case: A developer needs a customer service agent that verifies identity before processing refunds. The Skill generates a scored .agent file with verification gates, escalation routing, and Flow-backed actions, then validates and publishes it to the target org. ## Quick Start Ask the AI to create an Agent Script agent for your use case, for example: write a .agent file for a customer support agent that verifies identity, looks up orders via a Flow action, and escalates to a human when verification fails.

Frequently Asked Questions about sf-ai-agentscript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a deterministic Salesforce Agentforce agent with Agent Script?▼

Author a .agent file with config, system, start_agent, and topic blocks, then define target-backed actions using flow://, apex://, or prompt:// protocols. Validate with sf agent validate authoring-bundle and publish with sf agent publish authoring-bundle via Salesforce CLI.

What is the difference between Agent Script and Agent Builder in Agentforce?▼

Agent Script is the code-first path using .agent files and AiAuthoringBundle metadata, while Agent Builder uses the UI with GenAiPlannerBundle and GenAiFunction metadata. Agent Script gives deterministic control over routing, guards, and transitions without GenAiFunction wrappers.

Does Agent Script require an Einstein Agent User?▼

An Einstein Agent User (default_agent_user) is required only for Service Agents. Employee Agents do not need a dedicated running user but require end-user visibility through permission sets when surfaced in Lightning Experience.

Why does my agent publish fail with invalid input or output parameters?▼

This usually means the target prompt template is in Draft status or I/O names do not exactly match the @InvocableVariable field names in the Apex class. Publish the template in Setup first and verify exact case-sensitive name matching.

Can Agent Script call Apex classes directly as actions?▼

Yes, use the apex://ClassName target with an @InvocableMethod that uses @InvocableVariable wrapper classes for inputs and outputs. Bare List<String> parameters without wrapper classes are incompatible with Agent Script actions.

What syntax is not allowed in Agent Script conditionals?▼

Agent Script does not support else if, nested if statements, or the <> not-equal operator. Use compound conditions with and/or, sequential if blocks, and the != operator instead.