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/README.md
View on GitHub# Complete Agent Templates
Templates for building complete, deployable agents.
## Learning Path
| Template | Complexity | Description |
|----------|------------|-------------|
| `hello-world.agent` | Beginner | Minimal viable agent - start here |
| `simple-qa.agent` | Beginner | Single-scope Q&A agent with direct escalation |
| `template-single-subagent.agent` | Beginner | Compatibility-named focused starter with one execution block and no router |
| `template-multi-subagent.agent` | Intermediate | Copy-and-modify starter with multiple subagents |
| `router-first.agent` | Intermediate | Router-first architecture pattern |
| `verification-gate.agent` | Advanced | Security gate before protected subagents |
| `knowledge-grounded.agent` | Advanced | Agent wired to a Data Library (ADL) |
| `order-service.agent` | Advanced | Complex real-world example |
| `production-faq.agent` | Advanced | Production-ready FAQ with escalation |
| `local-info-agent-annotated.agent` | Reference | Fully annotated example covering all major constructs |
## Quick Start
1. Copy a template to your SFDX project:
```bash
mkdir -p force-app/main/default/aiAuthoringBundles/My_Agent
cp hello-world.agent force-app/main/default/aiAuthoringBundles/My_Agent/My_Agent.agent
cp ../bundle-meta.xml force-app/main/default/aiAuthoringBundles/My_Agent/My_Agent.bundle-meta.xml
```
2. Validate and deploy:
```bash
sf agent validate authoring-bundle --json --api-name My_Agent --target-org your-org
sf project deploy start --json --source-dir force-app --target-org your-org
sf agent preview start --json --use-live-actions --authoring-bundle My_Agent --target-org your-org
```
3. Publish and activate only when ready to release:
```bash
sf agent publish authoring-bundle --json --api-name My_Agent --target-org your-org
sf agent activate --json --api-name My_Agent --target-org your-org
```
## Core Blocks
AgentScript does not require one fixed top-level block order. A deployable agent
normally contains the following blocks, with `access` and `variables` included
only when the agent's type or data flow requires them:
| Block | Purpose |
|-------|---------|
| `system:` | Agent personality and default messages |
| `access:` | Agent-user access for service agents; omit when the agent type does not require it |
| `config:` | Deployment metadata (`developer_name`, label, type, etc.) |
| `variables:` | Optional linked data and justified deterministic state |
| `language:` | Locale configuration |
| `start_agent` | Required entry execution block (exactly one) |
## Next Steps
- [patterns/](../patterns/) - Advanced patterns for complex behaviors
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 |