sf-ai-agentforce

Configure Agentforce Builder agents, GenAiFunction actions, and GenAiPromptTemplate metadata for Salesforce.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building and maintaining Agentforce agents through the Setup UI and Agent Builder involves scattered metadata types, unclear deployment ordering, and confusing terminology between Prompt Builder templates and GenAiPromptTemplate metadata, leading to failed publishes and invisible agents. ## Core Features & Use Cases - Builder Metadata Guidance: Create and validate GenAiFunction, GenAiPlugin, and GenAiPromptTemplate metadata with correct folder structure, input contracts, and the 5-input flex template limit. - Agent Lifecycle Operations: Provision Service Agent running users with sf org create agent-user, configure Employee Agent visibility via Permission Sets with agentAccesses, and handle the separate publish and activate steps. - Apex AI Integration: Implement Models API (aiplatform.ModelsAPI) patterns with Queueable and Batch Apex, plus custom LightningTypeBundle UIs for structured agent action inputs and outputs. - Use Case: When registering an Apex discount calculator as an agent action, this Skill walks you through creating the GenAiFunction metadata, matching input/output contracts, deploying supporting metadata first, and activating the agent deterministically. ## Quick Start Ask the agent to set up a GenAiFunction for your Apex or Flow action and wire it into an Agentforce Builder agent.

Frequently Asked Questions about sf-ai-agentforce

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

FAQPage Schema
How do I create a GenAiFunction for an Apex or Flow action in Agentforce?▼

Create a GenAiFunction metadata XML file that references your Flow or Apex @InvocableMethod target, then validate that input and output names match the target contract exactly. Deploy the supporting Flow or Apex first, then the GenAiFunction, before publishing the agent.

What is the difference between Prompt Template and GenAiPromptTemplate in Salesforce?▼

Prompt Template is the plain-English UI term used in Prompt Builder, while GenAiPromptTemplate is the current Metadata API type for source-driven work. Store templates under genAiPromptTemplates/ with the .genAiPromptTemplate-meta.xml suffix and versioned content inside templateVersions.

When should I use Agent Script instead of Agentforce Builder?▼

Use Agent Script (sf-ai-agentscript) when the work produces or edits .agent files or authoring bundles, or when you need code-first deterministic routing and version-controlled agent logic. Use the Builder path for declarative maintenance of existing Setup UI agents.

Why is my Employee Agent active but not visible to users in Lightning Experience?▼

Employee Agents require end users to have a Permission Set containing the agentAccesses element. Without this permission, the agent can be active yet remain invisible, so verify the Permission Set assignment after activation.

What is the input limit for flex prompt templates in Prompt Builder?▼

Flex templates support a maximum of 5 inputs. When you need more, consolidate related text into a single structured context input, pass an SObject input to read multiple fields, or pre-aggregate data in Flow or Apex before invoking the template.

Why does my agent publish but not become usable in Salesforce?▼

Publishing does not activate the agent; activation is a separate step. Run sf agent activate with the api-name and version flags after publishing, preferably with --json for deterministic CI/CD rollout.