# Agentforce Generate

Build, modify, audit, repair, optimize, debug, and deploy agents with Agentforce Agent...

- Repository: https://github.com/forcedotcom/sf-skills (1134 stars)
- Category: Testing
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add forcedotcom/sf-skills --skill agentforce-generate -g -a claude-code -y`
Codex: `npx skills add forcedotcom/sf-skills --skill agentforce-generate -g -a codex -y`
Cursor: `npx skills add forcedotcom/sf-skills --skill agentforce-generate -g -a cursor -y`
Gemini CLI: `npx skills add forcedotcom/sf-skills --skill agentforce-generate -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add forcedotcom/sf-skills`

## Description

Build, 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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Agent Script Skill

## What This Skill Is For

This skill is for developing Agentforce agents, primarily with Agent Script, Salesforce's scripting language for AI agents.

Org-backed workflows require an Agentforce license, API v66.0 or later, and an
Einstein Agent User. Static authoring and review can proceed without org access.

**CRITICAL:** Agent Script is NOT AppleScript, JavaScript, Python, or any other
language. Do NOT confuse Agent Script syntax or semantics with any other
language you have been trained on.

Agent Script agents are defined by `AiAuthoringBundle` metadata: an
`<ApiName>.agent` file (agent behavior) plus a sibling
`<ApiName>.bundle-meta.xml` file (bundle metadata). The directory and both
filenames must use the same case-sensitive API name; a literal
`bundle-meta.xml` filename is not deployable. Actions can be implemented with
invocable Apex, autolaunched Flows, Prompt Templates, and other supported types.

This skill covers the full Agent Script lifecycle: designing agents,
writing Agent Script code, validating and debugging, deploying and
publishing, and testing.

## How to Use This Skill

This file maps user intent to task domains and relevant reference files in `references/`. Treat this file as the execution router for end-to-end agent development, and use references for deep detail.

Identify user intent from task descriptions. Read only the reference explicitly
required by the active step or needed for the current decision. Every
**Reference Files** section is a lookup index, not a preload list; do not load
files for later or inapplicable steps.

For a comprehensive health check, common-pitfall audit, or audit-fix-evaluate
loop over an existing agent, use the **Audit and Repair an Existing Agent**
task domain below as part of the same authoring lifecycle.

## Rules That Always Apply

The rest: https://github.com/forcedotcom/sf-skills/blob/HEAD/plugins/builder/agentforce-adlc/skills/agentforce-generate/SKILL.md
