
Developing Agentforce
Turn vague Agentforce ideas into a structured agent spec with subagents, variables, actions, and backing logic targets before you implement in Salesforce.
Install
npx skills add https://github.com/forcedotcom/sf-skills --skill developing-agentforceWhat is this skill?
- Agent spec scaffold: purpose, behavioral intent, guardrails, and escalation rules in one document
- Mermaid subagent map with routing for on-topic, ambiguous, off-topic, and escalation paths
- Variables section with mutability, set-by, and read-by wiring for gating and instructions
- Actions table linking each action to Apex, Flow, or Prompt Template targets with EXISTS / NEEDS STUB status
- Input property tables per action so backing logic stubs stay aligned with the router design
Adoption & trust: 693 installs on skills.sh; 513 GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Agentforce development is creation work—you are specifying routers, subagents, and integrations before the agent ships to users. Agent-tooling is the right shelf because the skill is a spec template for Salesforce conversational agents, not generic CRM data modeling or launch distribution.
Common Questions / FAQ
Is Developing Agentforce safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
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) # - [