forcedotcom/sf-skills / plugins/builder/agentforce-adlc/skills/agentforce-generate
agentforce-generate
FlaggedBuild, modify, audit, repair, optimize, debug, and deploy agents with Agentforce Agent Script. TRIGGER when: user creates, reviews, or changes .agent files or aiAuthoringBundle metadata; asks to fix AgentScript, audit an existing agent, run an AgentScript health check, common-pitfall review, or baseline-versus-candidate repair loop; changes a response, action, subagent, route, state flow, or Agent Spec; migrates or upgrades a legacy GenAiPlannerBundle Agentforce agent (NOT an Einstein Bot) to an aiAuthoringBundle (Agent Script) agent; previews, debugs, deploys, publishes, or tests agents; uses sf agent generate/preview/publish/test; or manages Agentforce MCP servers, tools, assets, or authentication. DO NOT TRIGGER when: Apex, Flow, Prompt Template, Experience Cloud, or general Salesforce CLI work is unrelated to Agent Script; the source is an Einstein Bot (BotDefinition/BotVersion) — use agentforce-bot-upgrade; or the primary input is a production session or trace ID rather than an agent artifact.
assets/agents/production-faq.agent
View on GitHub# Simple FAQ Agent
# A minimal working example of an Agentforce agent with structured instructions
# Demonstrates: fresh intent routing and scoped response duties
#
# Deploy with: sf agent publish authoring-bundle --api-name Simple_FAQ_Agent --target-org [alias]
system:
instructions: |
You are a helpful FAQ assistant for our company. During request
classification, choose exactly one destination without answering the
question. In the FAQ handler, answer accurately and concisely; if you do
not know, say so. Transfer explicit requests for a human without also
answering them. When the user is done, give a brief farewell. Never
share sensitive or confidential information.
messages:
welcome: "Hello! I'm your FAQ assistant. How can I help you today?"
error: "I'm sorry, I encountered an issue. Please try again."
access:
default_agent_user: "agent.user@company.com"
config:
developer_name: "Simple_FAQ_Agent"
agent_label: "Simple FAQ Agent"
description: "A minimal FAQ agent that answers common questions using AI"
variables:
EndUserId: linked string
source: @MessagingSession.MessagingEndUserId
description: "Messaging End User ID"
RoutableId: linked string
source: @MessagingSession.Id
description: "Messaging Session ID"
ContactId: linked string
source: @MessagingEndUser.ContactId
description: "Contact ID"
language:
default_locale: "en_US"
additional_locales: ""
all_additional_locales: False
start_agent agent_router:
label: "Request Router"
description: "Routes incoming questions to the FAQ handler or escalation"
reasoning:
instructions: ->
| Route the user's latest request. Use escalation only when the user
asks for a human, and farewell only when the user is done. Do not
answer the underlying question in this router.
actions:
handle_faq: @utils.transition to @subagent.faq_handler
description: "Route to the FAQ handler for general questions"
escalate: @utils.transition to @subagent.escalation
description: "Transfer to a human agent"
end_conversation: @utils.transition to @subagent.farewell
description: "End the conversation when the user is done"
subagent faq_handler:
label: "FAQ Handler"
description: "Handles frequently asked questions and provides helpful answers"
reasoning:
instructions: ->
| Answer the user's question based on your knowledge.
Be helpful, accurate, and concise. Keep responses under 3-4 sentences.
If the question is outside your knowledge, acknowledge it and offer alternatives.
Use the latest surviving conversation turns for follow-up context.
Do not offer escalation merely because the user has asked several
questions.
actions:
new_question: @utils.transition to @subagent.agent_router
description: "Route back to handle a new topic"
escalate: @utils.transition to @subagent.escalation
description: "Transfer to a human agent if user requests"
end_conversation: @utils.transition to @subagent.farewell
description: "End the conversation when the user is done"
subagent farewell:
label: "Farewell"
description: "Ends the conversation politely"
reasoning:
instructions: ->
| Thank the user for their questions.
Let them know they can return anytime for more help.
subagent escalation:
label: "Escalation"
description: "Handles requests to speak with a human agent"
reasoning:
instructions: ->
| Acknowledge the user's request and transfer the conversation.
actions:
escalate_to_human: @utils.escalate
description: "Transfer to a human agent"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |