nadolskimm-max/sf-skills/sf-ai-agentscript

Claude Code and agent skill by nadolskimm-max/sf-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Creates Agent Script DSL files for defining conversational flows using finite state machine patterns. Use when writing .agent script files, designing conversation state machines, defining agent dialog trees, or working with Agent Script syntax. Do NOT use for Agent Builder configuration (use sf-ai-agentforce) or persona design (use sf-ai-agentforce-persona).

Install

npx vskill@latest install nadolskimm-max/sf-skills/sf-ai-agentscript

SKILL.md

The same SKILL.md was published earlier as nadolskimm-max/sf-skills/sf-ai-agentscript.

Agent Script DSL

Core Responsibilities

  1. Write Agent Script files (.agent) using the DSL syntax
  2. Design finite state machine (FSM) conversation flows
  3. Define states, transitions, conditions, and actions
  4. Integrate script-defined flows with Agentforce agents
  5. Validate script syntax and logic

Agent Script Syntax

Basic Structure
agent CustomerSupport {
description: "Handles customer support inquiries"
version: "1.0"
state Start {
entry {
say "Hello! How can I help you today?"
}
on "order" -> OrderInquiry
on "return" -> ReturnProcess
on "billing" -> BillingHelp
fallback -> Clarify
}
state Clarify {
entry {
say "I can help with orders, returns, or billing. Which area do you need help with?"
}
on "order" -> OrderInquiry
on "return" -> ReturnProcess
on "billing" -> BillingHelp
max_attempts: 3
on_max_attempts -> Escalate
}
state OrderInquiry {
entry {
ask "What is your order number?"
store -> orderNumber
}
validate {
match orderNumber /^ORD-\d{4,}$/
on_invalid {
say "Please provide a valid order number (e.g., ORD-1001)"
retry
}
}
action {
invoke OrderLookupAction(orderNumber: orderNumber)
store result -> orderDetails
}
on success -> ShowOrderDetails
on error -> OrderNotFound
}
state ShowOrderDetails {
entry {
say "Your order {{orderDetails.status}}. Expected delivery: {{orderDetails.deliveryDate}}"
say "Is there anything else I can help with?"
}
on "yes" -> Start
on "no" -> End
}
state OrderNotFound {
entry {
say "I couldn't find that order number. Let me connect you with a specialist."
}
-> Escalate
}
state ReturnProcess {
entry {
ask "What is the order number for the item you'd like to return?"
store -> returnOrderNumber
}
action {
invoke InitiateReturnAction(orderNumber: returnOrderNumber)
}
on success -> ReturnConfirmed
on error -> Escalate
}
state ReturnConfirmed {
entry {
say "Your return has been initiated. You'll receive an email with a shipping label."
}
-> End
}
state Escalate {
entry {
say "Let me connect you with a team member who can help further."
handoff reason: "Agent script escalation"
}
}
state End {
entry {
say "Thank you for contacting us. Have a great day!"
close
}
}
}

DSL Elements

States
KeywordDescription
state <Name>Define a named state
entry { }Actions executed when entering the state
on "<trigger>" -> <State>Transition on user input match
fallback -> <State>Default transition for unmatched input
-> <State>Unconditional transition
Actions
KeywordDescription
say "<message>"Send message to user
ask "<question>"Prompt user for input
store -> <variable>Store user response in variable
invoke <Action>(params)Call an external action
handoff reason: "<text>"Escalate to human agent
closeEnd the conversation
Control Flow
KeywordDescription
validate { }Input validation block
match <var> /<regex>/Regex validation
on_invalid { }Handler for invalid input
retryRe-prompt for input
max_attempts: <n>Max retries before fallback
on_max_attempts -> <State>Transition after max retries
Conditions
KeywordDescription
on success -> <State>Transition on action success
on error -> <State>Transition on action failure
when <condition> -> <State>Conditional transition

FSM Design Patterns

Linear Flow
Start -> CollectInfo -> Process -> Confirm -> End
Branching Flow
Start -> Classify
├── Topic A -> Process A -> Confirm -> End
├── Topic B -> Process B -> Confirm -> End
└── Unknown -> Clarify -> Start
Loop with Retry
AskInput -> Validate
├── valid -> Process
└── invalid -> AskInput (max 3, then Escalate)

Best Practices

  • Keep state names descriptive and PascalCase
  • Every script must have Start and End states
  • Always include an Escalate state as safety net
  • Use fallback transitions to prevent dead ends
  • Validate user input before passing to actions
  • Limit max_attempts to prevent infinite loops (3 is typical)
  • Store all action results for use in later states

Cross-Skill References

  • For Apex invocable actions referenced by invoke: see sf-apex
  • For agent configuration in Agent Builder: see sf-ai-agentforce
  • For testing conversation flows: see sf-ai-agentforce-testing

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/nadolskimm-max/sf-skills/sf-ai-agentscript/badge)](https://verified-skill.com/skills/nadolskimm-max/sf-skills/sf-ai-agentscript)

Something wrong with this skill or its page? Tell us.