developing-agentforce

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

1|Updated May 7, 2026
One-click install
npx skills add https://github.com/amanpraaj/sf-skill-hub --skill developing-agentforce-amanpraaj
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: developing-agentforce
Source: https://github.com/amanpraaj/sf-skill-hub/tree/main/skills/salesforce/developing-agentforce
Command: npx skills add https://github.com/amanpraaj/sf-skill-hub --skill developing-agentforce-amanpraaj

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 Agentforce AI agents, but it has zero training data in any AI model, so coding assistants cannot write, fix, or deploy it accurately without structured guidance. ## Core Features & Use Cases - Full Agent Lifecycle: Create agents from an approved Agent Spec, generate AiAuthoringBundle metadata, write .agent code, validate compilation, and publish and activate via sf CLI commands. - Trace-Based Debugging: Diagnose compilation errors, behavioral issues, and production failures using live-action previews and session trace analysis before modifying code. - Backing Logic Integration: Wire actions to invocable Apex classes, autolaunched Flows, and Prompt Templates with exact I/O name matching and complex data type mapping. - Use Case: A developer asks the assistant to build a customer service agent with order lookup and escalation; the skill guides spec design, environment validation, bundle generation, Apex stub creation, live preview testing, and final publish and activation. ## Quick Start Ask the assistant to create a new Agentforce agent that answers order status questions, and it will draft an Agent Spec for your approval before generating and deploying the agent.

Frequently Asked Questions about developing-agentforce

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 covering purpose, subagents, actions, and gating, then get user approval. Generate the authoring bundle with sf agent generate authoring-bundle, write the .agent code, validate compilation, and preview with live actions before publishing.

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 via apex://, autolaunched Flows via flow://, and Prompt Templates via prompt:// or generatePromptResponse://. Input and output names in the .agent file must exactly match the @InvocableVariable field names in the Apex wrapper classes.

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

Common causes include setting default_agent_user on an employee agent, missing outputs blocks on actions, or Apex targets in namespaced packages. Validate the bundle first, check the environment prerequisites for your agent type, and consult the known issues reference.

Does Agent Script work without an Agentforce license?▼

No. The skill requires a Salesforce org with an Agentforce license, API version 66.0 or later, and Salesforce CLI v2. Service agents additionally require an active Einstein Agent User configured as the default agent user.