Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/Sf ai agentscript/Minimal-examples
Reference · Sf ai agentscript

Minimal-examples

Part of Sf ai agentscript. Install the skill and your agent reads this page when it needs the depth.

<!-- Parent: sf-ai-agentscript/SKILL.md -->

Minimal Working Examples

Hello-World Agent Script

A complete, deployable agent with one topic, one action, and conditional logic:

config:
  developer_name: "simple_agent"
  description: "A minimal working agent example"
  agent_type: "AgentforceServiceAgent"
  default_agent_user: "agent_user@yourorg.com"

system:
  messages:
    welcome: "Hello! How can I help you today?"
    error: "Sorry, something went wrong."
  instructions: "You are a helpful customer service agent."

variables:
  customer_verified: mutable boolean = False

topic main:
  description: "Main conversation handler"
  reasoning:
    instructions: ->
      if @variables.customer_verified == True:
        | You are speaking with a verified customer.
        | Help them with their request.
      else:
        | Please verify the customer's identity first.
    actions:
      verify: @actions.verify_customer
        description: "Verify customer identity"
        set @variables.customer_verified = @outputs.verified

start_agent entry:
  description: "Entry point for all conversations"
  reasoning:
    instructions: |
      Greet the customer and route to the main topic.
    actions:
      go_main: @utils.transition to @topic.main
        description: "Navigate to main conversation"

Key Points

Personalized Welcome Message

Use quoted strings for static system messages, but switch welcome / error to template/block form when you need interpolation:

variables:
  user_preferred_name: linked string
    source: @MessagingSession.UserPreferredName__c
    description: "Example linked variable source for first-turn personalization"

system:
  messages:
    welcome: |
      Hi {!@variables.user_preferred_name}! How can I help you today?
    error: "Sorry, something went wrong."
  instructions: "You are a helpful customer service agent."

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.