sf-ai-agentforce by jaganpro/sf-skills
npx skills add https://github.com/jaganpro/sf-skills --skill sf-ai-agentforce将此技能用于 Setup UI / Agent Builder 路径:声明式主题、Builder 管理的操作、GenAiFunction / GenAiPlugin 元数据、存储为 GenAiPromptTemplate 元数据的 Prompt Builder 模板、来自 Apex 的 Models API 使用以及自定义 Lightning 类型。
对于新的代码优先智能体开发,请优先使用 sf-ai-agentscript。
当用户进行以下操作时,请使用 sf-ai-agentforce:
GenAiFunction、GenAiPlugin 或 GenAiPromptTemplate 元数据广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
请勿将其用于:
.agent 文件或确定性 FSM 设计 → sf-ai-agentscript询问或推断:
| 路径 | 技能 | 最佳适用场景 |
|---|---|---|
| Setup UI / Agent Builder | sf-ai-agentforce | 声明式维护、现有的 Builder 智能体、元数据驱动的操作注册 |
| Agent Script DSL | sf-ai-agentscript | 代码优先的 .agent 创作、确定性路由、版本控制的智能体逻辑 |
如果用户从零开始并希望对流程/状态有更强的控制,请引导至 Agent Script。
主题描述是规划器的路由指令。它们必须:
| 目标类型 | 典型用途 | 注册方式 |
|---|---|---|
| Flow | Builder 操作最安全的默认选择 | GenAiFunction |
| Apex | 通过 @InvocableMethod 实现的复杂业务逻辑 | GenAiFunction |
| Prompt Builder 模板 | 生成的摘要 / 草稿 / 建议 | GenAiFunction |
GenAiPromptTemplate 是当前用于源代码驱动模板工作的 Metadata API 类型。genAiPromptTemplates/*.genAiPromptTemplate-meta.xml。{!$Input:TargetRecord} 或 {!$Input:AdditionalContext}。在发布智能体本身之前,部署支持性堆栈:
GenAiPromptTemplate / GenAiFunction / GenAiPlugin发布后,需要单独运行 sf agent activate。
用于注册单个可调用操作。验证:
用于将相关功能分组到一个逻辑包中。
用于生成内容,而非确定性业务规则。
优先使用当前的元数据格式:
GenAiPromptTemplategenAiPromptTemplates/.genAiPromptTemplate-meta.xmltemplateVersions 下当解决方案属于 Apex 驱动的 AI 编排而非仅限 Builder 的操作时使用。
当操作需要更丰富的结构化输入或输出呈现时使用。
扩展参考:
sf-metadata → sf-apex → sf-flow → sf-ai-agentforce → sf-deploy
| 需求 | 委托给 | 原因 |
|---|---|---|
| 创建 / 修复 Flows | sf-flow | 操作目标创建和 Flow 验证 |
| 创建 / 修复 Apex 操作 | sf-apex | @InvocableMethod 和 Apex 正确性 |
| 部署 / 发布 | sf-deploy | 部署编排 |
| 测试智能体 | sf-ai-agentforce-testing | 正式测试执行和断言 |
| 症状 | 可能原因 | 阅读下一步 |
|---|---|---|
| 操作在 Builder 中不可用 | 目标元数据缺失或未部署 | references/metadata-reference.md |
| 提示操作在发布或激活期间失败 | 模板是草稿、缺少输入或使用了旧的元数据格式 | references/genaiprompttemplate.md |
| 需要超过 5 个模板输入 | 达到灵活模板输入限制 | references/genaiprompttemplate.md |
| Apex AI 逻辑超时 | Models API 工作放置在错误的上下文中 | references/models-api.md |
| 丰富的输入/输出 UI 未渲染 | Lightning 类型配置或先决条件不完整 | references/custom-lightning-types.md |
| 智能体已发布但不可用 | 忘记显式激活 | references/cli-commands.md |
| 分数 | 含义 |
|---|---|
| 90+ | 准备部署 |
| 80–89 | 良好,仅需少量清理 |
| 70–79 | 部署前需审查 |
| 60–69 | 需要改进 |
| < 60 | 阻止部署 |
完整评分标准:references/scoring-rubric.md
每周安装量
225
代码库
GitHub 星标数
219
首次出现
2026年1月22日
安全审计
安装于
opencode217
codex217
gemini-cli215
github-copilot215
cursor215
amp214
Use this skill for the Setup UI / Agent Builder path: declarative topics, Builder-managed actions, GenAiFunction / GenAiPlugin metadata, Prompt Builder templates stored asGenAiPromptTemplate metadata, Models API usage from Apex, and custom Lightning types.
For new code-first agent development, prefer sf-ai-agentscript.
Use sf-ai-agentforce when the user is:
GenAiFunction, GenAiPlugin, or GenAiPromptTemplate metadataDo not use it for:
.agent files or deterministic FSM design → sf-ai-agentscriptAsk for or infer:
| Path | Skill | Best fit |
|---|---|---|
| Setup UI / Agent Builder | sf-ai-agentforce | Declarative maintenance, existing Builder agents, metadata-driven action registration |
| Agent Script DSL | sf-ai-agentscript | Code-first .agent authoring, deterministic routing, version-controlled agent logic |
If the user is starting from scratch and wants strong control over flow/state, route to Agent Script.
Expanded workflow: references/builder-workflow.md
Topic descriptions are routing instructions for the planner. They must be:
| Target type | Typical use | Registered via |
|---|---|---|
| Flow | safest default for Builder actions | GenAiFunction |
| Apex | complex business logic via @InvocableMethod | GenAiFunction |
| Prompt Builder template | generated summaries / drafts / recommendations | GenAiFunction |
GenAiPromptTemplate is the current Metadata API type for source-driven template work.genAiPromptTemplates/*.genAiPromptTemplate-meta.xml.{!$Input:TargetRecord} or {!$Input:AdditionalContext}.Before publishing the agent itself, deploy the supporting stack:
GenAiPromptTemplate / GenAiFunction / GenAiPluginAfter publish, run sf agent activate separately.
Use when registering a single callable action. Validate:
Use when grouping related functions into one logical package.
Use for generated content, not deterministic business rules.
Prefer the current metadata shape:
GenAiPromptTemplategenAiPromptTemplates/.genAiPromptTemplate-meta.xmltemplateVersionsUse when the solution belongs in Apex-driven AI orchestration rather than Builder-only actions.
Use when the action needs richer structured input or output presentation.
Expanded references:
sf-metadata → sf-apex → sf-flow → sf-ai-agentforce → sf-deploy
| Requirement | Delegate to | Why |
|---|---|---|
| Create / fix Flows | sf-flow | Action target creation and Flow validation |
| Create / fix Apex actions | sf-apex | @InvocableMethod and Apex correctness |
| Deploy / publish | sf-deploy | Deployment orchestration |
| Test the agent | sf-ai-agentforce-testing | Formal test execution and assertions |
| Symptom | Likely cause | Read next |
|---|---|---|
| Action not available in Builder | target metadata missing or not deployed | references/metadata-reference.md |
| Prompt action fails during publish or activation | template is Draft, missing inputs, or old metadata shape is being used | references/genaiprompttemplate.md |
| Need more than 5 template inputs | flex template input limit hit | references/genaiprompttemplate.md |
| Apex AI logic times out | Models API work placed in the wrong context | references/models-api.md |
| Rich input/output UI not rendering | Lightning type config or prerequisites are incomplete | references/custom-lightning-types.md |
| Score | Meaning |
|---|---|
| 90+ | Ready to deploy |
| 80–89 | Strong, minor cleanup only |
| 70–79 | Review before deploy |
| 60–69 | Needs work |
| < 60 | Block deployment |
Full rubric: references/scoring-rubric.md
Weekly Installs
225
Repository
GitHub Stars
219
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode217
codex217
gemini-cli215
github-copilot215
cursor215
amp214
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
109,600 周安装
| Agent publishes but is not usable | forgot explicit activation | references/cli-commands.md |