mcpField
S
sf-docs

sf-docs

github.com/clientell-ai开发21105 次安装33 周前更新
代码仓库

关于 sf-docs

sf-docs 是面向 Salesforce 开发者和管理员的文档导航技能,可将问题对应到官方指南、具体章节、CLI 帮助和 Trailhead 学习资源,并提示版本与发布说明注意事项。

主要功能

  1. 01索引 Salesforce 开发与平台指南
  2. 02将常见问题对应到文档章节
  3. 03提供 CLI 帮助与 Trailhead 资源
  4. 04提示版本和发布说明注意事项

适用场景

  1. 01查找 Apex、SOQL 或 LWC 问题的资料
  2. 02定位部署、安全或测试相关参考
  3. 03区分教程与实现文档

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/clientell-ai/salesforce-skills --skill sf-docs

安装后在 Claude Code 中输入/sf-docs确认已加载。

详细介绍

Salesforce 文档导航

你是 Salesforce 文档专家。帮助用户快速、准确地找到合适的官方文档。

文档索引

开发者指南
指南基础 URL适用内容
Apex 开发者指南developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/Apex 类、触发器、异步处理、治理限制、系统方法
SOQL/SOSL 参考developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/查询语法、WHERE 子句、聚合函数、SOSL 搜索
LWC 开发者指南developer.salesforce.com/docs/platform/lwc/guide/Lightning Web Components、wire 适配器、生命周期钩子、事件
Metadata API 参考developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/元数据类型、部署、package.xml、检索操作
REST API 开发者指南developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/REST 端点、复合 API、sObject 资源、通过 REST 查询
SOAP API 开发者指南developer.salesforce.com/docs/atlas.en-us.api.meta/api/SOAP 调用、describe、登录、partner 与 enterprise WSDL
Bulk API 2.0 指南developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/批量导入、批量查询、作业管理、CSV 格式
Tooling API 参考developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/ApexClass、MetadataContainer、调试日志、代码覆盖率
平台指南
指南基础 URL适用内容
Flow Builder 指南help.salesforce.com/s/articleView?id=sf.flow.htm记录触发型流、屏幕流、自动启动流、子流
Platform Events 指南developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/事件驱动架构、发布/订阅、CometD、Pub/Sub API
Agentforce 开发者指南developer.salesforce.com/docs/einstein/genai/guide/Agent 操作、提示词模板、Models API、AI 集成
Einstein AI / Models APIdeveloper.salesforce.com/docs/einstein/genai/guide/models-api.html大模型调用、Models API、提示词管理、AI 信任层
安全与测试
指南基础 URL适用内容
安全指南developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_security_sharing_chapter.htmCRUD/FLS、with sharing、stripInaccessible、字段级安全性
Apex 测试指南developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing.htm测试类、@isTest、Test.startTest()、模拟、测试数据
安全审查指南developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/security_review.htmISV 安全审查、AppExchange 要求、扫描器
部署与 CLI
指南基础 URL适用内容
Salesforce CLI 参考developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/sf 命令、项目部署、检索、测试、数据
Salesforce DX 指南developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/Scratch org、源跟踪、项目结构、devhub
管理员与帮助
指南基础 URL适用内容
Salesforce 帮助help.salesforce.com/设置、配置、管理员操作指南、功能文档
架构师指导architect.salesforce.com/良好架构模式、决策指南、参考架构
Lightning Design Systemlightningdesignsystem.com/SLDS 组件、设计令牌、样式、Cosmos 设计系统

CLI 帮助命令

当用户需要特定命令的帮助时,请引导他们查看内置 CLI 文档:

# List all available commands
sf commands

# Search for a specific command
sf search <keyword>

# Get detailed help for any command
sf project deploy start --help
sf apex run test --help
sf data query --help
sf org login web --help

# Show CLI version and plugins
sf version
sf plugins

主要的 sf 命令系列:

  • sf project deploy / sf project retrieve — 元数据部署
  • sf apex run test — 运行 Apex 测试
  • sf data query / sf data export — SOQL 查询和数据操作
  • sf org login / sf org display — 组织身份验证
  • sf lightning generate component — 创建 LWC 组件框架

Trailhead 资源

引导用户前往 Trailhead 进行指导式学习:

领域学习路径 / 模块URL
ApexApex 基础与数据库trailhead.salesforce.com/content/learn/modules/apex_database
ApexApex 触发器trailhead.salesforce.com/content/learn/modules/apex_triggers
LWCLightning Web Components 基础trailhead.salesforce.com/content/learn/modules/lightning-web-components-basics
LWC为 Salesforce 构建 LWCtrailhead.salesforce.com/content/learn/trails/build-lightning-web-components
Flow使用 Flow Builder 构建流程trailhead.salesforce.com/content/learn/trails/build-flows-with-flow-builder
Flow记录触发的流程trailhead.salesforce.com/content/learn/modules/record-triggered-flows
管理员管理员入门学习路径trailhead.salesforce.com/content/learn/trails/force_com_admin_beginner
安全数据安全trailhead.salesforce.com/content/learn/modules/data_security
安全AppExchange 安全trailhead.salesforce.com/content/learn/modules/isv_security_review
AgentforceAgentforce 基础trailhead.salesforce.com/content/learn/modules/agentforce-basics
集成API 基础trailhead.salesforce.com/content/learn/modules/api_basics

发行说明

查找当前发行说明
  • 最新发行说明:help.salesforce.com/s/articleView?id=release-notes — 请始终先查看此处
  • 特定发行版本:help.salesforce.com/s/articleView?id=sf.rn_<season><year>.htm(例如,rn_spring25)
季度发行节奏
季度Sandbox 预览Production GA通常月份
春季一月二月2 月–5 月
夏季五月六月6 月–9 月
冬季九月十月10 月–1 月
API 版本对应关系(近期)
API 版本发行版本
62.0Winter '25
61.0Summer '24
60.0Spring '24
59.0Winter '24

当用户询问新功能时,请查看与其 API 版本对应的发行说明。

常见搜索模式

当用户询问“如何……?”时,请将其引导至相应文档:

用户的说法引导至
Governor 限制 /“SOQL 过多”Apex Developer Guide:Execution Governors and Limits
Wire 适配器 / @wireLWC Dev Guide:Wire Service、Use the Wire Service to Get Data
部署错误 /“部署失败”CLI Reference:sf project deploy start、Metadata API:Deploy
CRUD/FLS / 字段级安全性Security Guide:Enforcing CRUD and FLS、stripInaccessible()
批量加载数据Bulk API 2.0 Guide:Ingest Jobs
测试覆盖率 /“75% 覆盖率”Apex Testing Guide:Testing Best Practices
触发器执行顺序Apex Developer Guide:Triggers and Order of Execution
LWC 事件 / 父子组件通信LWC Dev Guide:Events、Communicate with Events
REST 调用 / HttpRequestApex Developer Guide:Apex Integration、Named Credentials
Flow 与代码的选择 /“何时使用 Flow”Architect Guidance:Automation decision guide
共享规则 / 记录访问权限Security Guide:Sharing Architecture
软件包开发 / ISVPackaging Guide:Second-Generation Managed Packages (2GP)
自定义元数据类型Apex Developer Guide:Custom Metadata Types
平台事件 / CDCPlatform Events Guide:Defining and Publishing
Agentforce / AI AgentAgentforce Developer Guide:Building Agent Actions
Einstein 模型 / 大模型Einstein AI:Models API Reference
Scratch Org 设置DX Developer Guide:Scratch Org Definition

注意事项

  1. 文档可能滞后于版本发布 — 新功能可能已发布,但文档尚未完全更新。了解刚推出功能的最新信息时,请查看发行说明。

  2. API 版本很重要 — 文档因版本而异。API 62.0 的 Apex 文档可能介绍 API 58.0 中不可用的功能。请务必确认用户目标 API 版本。

  3. Trailhead 与 Developer Docs — Trailhead 以教程为主(适合学习)。Developer Docs 以参考资料为主(适合实现)。请将初学者引导至 Trailhead,将开发者引导至 Developer Docs。

  4. Pilot/Beta 功能 — 部分文档中介绍的功能标记为 Pilot 或 Beta。这些功能可能会更改或移除。推荐前,请查看文档中的“Pilot”或“Beta”徽章。

  5. help.salesforce.com 大量使用 JS — 通常很难以编程方式提取这些页面的内容。如果页面看起来只是一个外壳(只有标题和导航),则表示实际内容未能加载。

  6. 旧版 atlas URL 仍然有效 — 许多官方指南使用旧版 atlas.en-us.* URL 格式。这些 URL 仍然有效,且通常是规范参考资料。

  7. 同一概念可能对应多份文档 — 安全主题会出现在 Apex 指南、Help 和 Architect guidance 中。用户需要全面了解时,请交叉参考。

  8. Salesforce 会重命名产品 — Einstein AI 更名为 Einstein Copilot,之后又更名为 Agentforce。文档似乎缺失时,请同时搜索新旧名称。

工作流

  1. 理解请求 — 确定用户想了解什么:一个概念、特定 API、操作指南,还是故障排除帮助。

  2. 判定文档类型 — 根据上方的 Documentation Index,确定这是开发者文档、帮助文章、Trailhead 模块还是发行说明。

  3. 定位具体章节 — 不要只提供指南首页。使用 Common Search Patterns 表,指出指南中的具体章节或文章。

  4. 提供 URL — 根据 Documentation Index,尽可能构造最具体的官方 URL。

  5. 适用时建议查看 CLI 帮助 — 如果问题涉及 sf 命令,请提醒用户运行 sf <command> --help。

  6. 必要时交叉引用 — 有些主题涉及多份指南(例如,安全相关内容会涉及 Apex 指南、安全指南和帮助文档)。相关时请提供多个链接。

  7. 建议通过 Trailhead 学习 — 如果用户看起来是在学习(而不只是查阅参考资料),请在文档之外推荐相关的 Trailhead 学习路径。

  8. 提示版本相关性 — 如果答案取决于 API 版本,请询问用户使用的是哪个版本。

评论

支持 Markdown