
Developing Agentforce
Author a structured Agentforce agent spec—purpose, subagent routing diagram, variables, and Apex/Flow/Prompt-backed actions—before implementing in Salesforce.
Overview
Developing Agentforce is an agent skill for the Build phase that helps you draft a complete Agentforce agent specification with subagent maps, variables, and backed actions before implementation.
Install
npx skills add https://github.com/forcedotcom/afv-library --skill developing-agentforceWhat is this skill?
- Structured Agent Spec sections: purpose, behavioral intent, variables, and actions with backing targets
- Mermaid subagent map conventions including router, ambiguous, off-topic, and escalation paths
- Action tables for Apex, Flow, and Prompt Template targets with EXISTS/NEEDS STUB/NEEDS IMPLEMENTATION status
- Input property tables tying agent actions to typed parameters and sources
- Guardrails and cross-subagent state guidance in behavioral intent
Adoption & trust: 1.4k installs on skills.sh; 512 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need a Salesforce service agent but only have fragmented notes about topics, routing, and which Apex, Flow, or prompts actually power each action.
Who is it for?
Salesforce-focused builders defining multi-topic Agentforce agents with clear routing, guardrails, and action-to-logic mapping.
Skip if: Teams not on Salesforce Agentforce, or agents that need no structured spec beyond a single prompt with no subagents or backed actions.
When should I use this skill?
You are designing or extending a Salesforce Agentforce agent and need a formal Agent Spec before implementation.
What do I get? / Deliverables
You leave with a filled Agent Spec—diagram, variables, and action inventory with backing status—ready for stub generation or direct implementation in Agentforce.
- Agent Spec document with subagent Mermaid map
- Variables and actions tables with backing status
- Behavioral intent and guardrail notes
Recommended Skills
Journey fit
Agentforce specs are written while designing and implementing Salesforce AI agents, which sits in the build phase’s agent-tooling shelf. The skill is a spec template for multi-subagent routers, actions, and backing logic types typical of in-product agent tooling rather than generic app frontend work.
How it compares
Use as a spec-first Agentforce workbook instead of improvising agent topics and actions only inside the Salesforce UI.
Common Questions / FAQ
Who is developing-agentforce for?
It is for indie developers and small teams building Salesforce Agentforce agents who want a written contract before Apex, Flow, and prompt work.
When should I use developing-agentforce?
Use it during Build (agent-tooling) when you are scoping a new agent API, drawing subagent routing, or listing actions that need Apex, Flow, or prompt backing.
Is developing-agentforce safe to install?
Review the Security Audits panel on this Prism page and your org’s policies before installing; the skill is documentation-heavy and does not by itself call external APIs.
SKILL.md
READMESKILL.md - Developing Agentforce
# Agent Spec: Agent_API_Name ## Purpose & Scope Describe the agent's purpose in 1-2 sentences. What does it help users do? What domain does it operate in? ## Behavioral Intent Describe the key behavioral rules that govern the agent: - What must the agent know before taking action? - What backing logic types are used (Apex, Flow, Prompt Template)? - What guardrails apply (off-topic handling, escalation)? - What information persists across subagent switches? ## Subagent Map ```mermaid %%{init: {'theme':'neutral'}}%% graph TD A[start_agent<br/>agent_router] A -->|description of routing condition| B[subagent_name<br/>Subagent] A -->|unclear intent| C[ambiguous_question<br/>Subagent] A -->|out of scope| D[off_topic<br/>Subagent] A -->|needs escalation| E[escalation<br/>Subagent] ``` Expand the diagram to show actions, gating logic, and variable state changes within each subagent. See the Subagent Map Diagrams reference for conventions. ## Variables - `variable_name` (mutable type = default) — What this variable tracks. Set by: which action or utility. Read by: which topics for gating or conditional instructions. ## Actions & Backing Logic ### action_name (subagent_name subagent) - **Target:** `apex://ClassName` or `flow://FlowName` or `prompt://PromptTemplateName` - **Backing Status:** EXISTS / NEEDS STUB / NEEDS IMPLEMENTATION #### Inputs | Name | Type | Required | Source | |------|------|----------|--------| | property_id | string | Yes | User input | | max_results | integer | No | Defaults to 10 | #### Outputs | Name | Type | Visible to User? | Source | Notes | |------|------|-------------------|--------|-------| | property | object | Yes | `Property__c` | Complete property details | | related_applications | list[object] | Yes | `Application__c` | Records for this property | | active_listing | boolean | Yes | `Listing__c` | Listing status | | hasData | boolean | No | Computed | Internal empty-result flag | > **"Visible to User?"** maps to `filter_from_agent` in the `.agent` file: Yes → `filter_from_agent: False`, No → `filter_from_agent: True`. #### Stubbing Requirement If NEEDS STUB: - Apex class name and inner class wrappers needed - `complex_data_type_name` for each `object`/`list[object]` output - Key queries or computation logic the stub must implement Repeat for each action. ## Gating Logic - `action_name` visibility: `available when @variables.variable_name != ""` — Rationale for why this gate exists. List all gating conditions with their rationale. ## Architecture Pattern State the architecture pattern: hub-and-spoke, chain, hybrid, etc. Describe the routing strategy and how topics relate to each other. ## Agent Configuration - **developer_name:** `Agent_API_Name` - **agent_label:** `Agent Display Name` - **agent_type:** `AgentforceEmployeeAgent` or `AgentforceServiceAgent` — state the reasoning based on prompt signals (e.g., "accessible by employees" → Employee, "customer-facing channel" → Service) - **default_agent_user:** Required for `AgentforceServiceAgent`. Forbidden for `AgentforceEmployeeAgent`. If specified, MUST be **user name**. MUST NEVER be **user ID**. User MUST have `Einstein Agent` license. # Hello World Agent # The minimal viable Agentforce agent - start here! # # This template shows the absolute minimum structure required for a working agent. # Use this as your starting point when learning Agent Script. # # ★ Why This Structure? # - system: Sets agent personality and default messages # - config: Required metadata for deployment (agent_name must be unique) # - variables: Linked variables connect to Messaging context (required for deployment) # - language: Locale settings (required for deployment) # - start_agent: Entry point subagent (exactly one required) # # ★ Key Validation Points (from 100-point scoring): # - [10 pts] config block with all 4 required fields # - [10 pts] 3 linked variables (EndUserId, RoutableId, ContactId) # - [