agentforce-generate

Build, debug, and deploy Salesforce Agentforce agents using Agent Script and CLI workflows.

Updated Jul 2, 2026
One-click install
npx skills add https://github.com/padjei/SF_Build --skill agentforce-generate-padjei
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agentforce-generate
Source: https://github.com/padjei/SF_Build/tree/main/.claude/skills/agentforce-generate
Command: npx skills add https://github.com/padjei/SF_Build --skill agentforce-generate-padjei

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve? Agent Script is Salesforce's 2025 language for authoring AI agents on the Atlas Reasoning Engine, but it has zero training data in any AI model, so coding assistants cannot write or debug it accurately without structured reference material. ## Core Features & Use Cases - Full Agent Lifecycle: Create, modify, comprehend, deploy, publish, activate, test, and delete Agentforce agents defined by AiAuthoringBundle metadata and .agent files. - Diagnosis Workflows: Diagnose compilation errors, behavioral issues via live preview session traces, and production issues like credit overconsumption and reserved keyword conflicts. - Design Governance: Enforces Agent Spec creation with a hard user-approval gate, backing logic scanning for @InvocableMethod Apex and AutoLaunchedFlow, and subagent map diagrams. - Use Case: Ask the assistant to build a customer service agent with order lookup and escalation; it drafts an Agent Spec, generates the authoring bundle, stubs invocable Apex actions, validates compilation, previews with live actions, and publishes after your approval. ## Quick Start Ask the assistant to create a new Agentforce agent for your use case and let it draft an Agent Spec for your approval before generating any code.

Frequently Asked Questions about agentforce-generate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an Agentforce agent with Agent Script?▼

Start by drafting an Agent Spec describing purpose, subagents, and actions, then get user approval. Generate the authoring bundle with sf agent generate authoring-bundle, write the .agent code, validate compilation, stub backing Apex logic, preview with live actions, then publish and activate.

How do I debug an Agentforce agent that routes to the wrong subagent?▼

Start a preview session with sf agent preview start --use-live-actions, send test utterances per subagent, then analyze the session traces. Traces reveal subagent selection, action I/O, and LLM reasoning so you can match behavior against the Agent Spec before changing code.

What backing logic can Agent Script actions call?▼

Actions can target invocable Apex classes with @InvocableMethod, autolaunched Flows, Prompt Templates, external services, and standard invocable actions via protocols like apex://, flow://, and generatePromptResponse://. Input and output names must exactly match the @InvocableVariable field names.

What are the prerequisites for using Agent Script?▼

You need a Salesforce org with an Agentforce license, API version 66.0 or later, Salesforce CLI v2.x, and a configured target org. Service agents additionally require an active Einstein Agent User, while employee agents must not define default_agent_user.

Why does my Agentforce agent fail at publish with an unknown error?▼

Common causes include setting default_agent_user on an employee agent, input or output names that do not match Apex @InvocableVariable fields, or actions with inputs but no outputs block. Check the known issues and production gotchas references for the full checklist.

When should I not use this skill?▼

Do not use it for general Apex development, Flow building, Prompt Template authoring, Experience Cloud configuration, or Salesforce CLI tasks unrelated to Agent Script. It is scoped specifically to .agent files and AiAuthoringBundle metadata.