Agent SDK 中技能文件的加载与调用机制

该文档说明 Agent SDK 如何把技能定义为 SKILL.md 文件,从文件系统发现并加载,并区分模型自主调用与用户通过斜杠命令直接调用,同时介绍用 skills 选项限定可调用技能范围。

特工技能将克劳德扩展至克劳德,具有克劳德在相关时所援引的专门能力。 `SKILL.md` 包含指令、描述和可选支持资源的文件。此页面还覆盖 [在代理 SDK 会话中的命令](<https://code.claude.com/docs/en/agent-sdk/skills#commands-in-agent-sdk-sessions>)关于技能的更多信息,包括惠益、架构和撰写准则,请参见: [代理技能概览](<https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview>). ## 与特工SDK的技巧如何运作 当使用克劳德特工SDK时,技能是: - **被定义为文件系统文物**: 将每种技能创建为 `SKILL.md` 在自己的目录中的文件,例如 `.claude/skills/<name>/SKILL.md` - **从文件系统装入**: SDK 从文件系统位置加载技能 `settingSources` (TypeScript) 或 (中文(简体) ). `setting_sources` (彼贤). - **自动发现**: 一旦文件系统设置加载, SDK 在启动时从用户和项目目录中发现技能元数据, 当克劳德引用技能时加载全部内容 - **使用模型**: Claude根据上下文自主选择何时使用它们 - **用户输入**:您通过发送直接发送技能 `/<name>` 立即赶来,看 [代理 SDK 会话中的命令](<https://code.claude.com/docs/en/agent-sdk/skills#commands-in-agent-sdk-sessions>) - **范围通过 `skills` 选项**: 默认启用已发现的技能。通过一个技能名称列表, `"all"`,或 `[]` 控制Claude能够引用的技巧 与子剂不同,您可以在 [`agents` 选项](<https://code.claude.com/docs/en/agent-sdk/subagents#programmatic-definition-recommended>),您在磁盘上创建技能。 SDK没有为注册提供程序 API 。 技能通过文件系统设置源来发现。默认情况下 `query()` 选项,则 SDK 载入用户和项目源,所以技能 `~/.claude/skills/`, `<cwd>/.claude/skills/`,以及 `.claude/skills/` 在任何父目录中 `<cwd>` 最多可使用寄存器根。项目源也涵盖 `<dir>/.claude/skills/` 在您通过的每一目录中 `additionalDirectories` (TypeScript) 或 (中文(简体) ). `add_dirs` (Python),因为SDK将这些目录传递到克劳德代码为: [`--add-dir`](<https://code.claude.com/docs/en/skills#skills-from-additional-directories>)。如果设置 `settingSources` 明确,包括 `'project'` * 保持项目和附加指导技能; `'user'` 保持你的个人技能,或使用 [`plugins` 选项](<https://code.claude.com/docs/en/agent-sdk/plugins>) 从特定路径装入技能。 ## 与 SDK 代理使用技能 设定 `skills` 打开选项 `query()` 来控制主对话中Claude可以引用哪些技能。省略时,启用了已发现的技能,并提供了技能工具,匹配CLI行为。 `"all"` 让克劳德引用每一个发现的技巧, 一个技能名称列表,只允许这些,或者 `[]` 例如,只让Claude 引用两种有名的技巧: ``` options = ClaudeAgentOptions(skills=["pdf", "docx"]) ``` ``` const options = { skills: ["pdf", "docx"] }; ``` ### 在会话中设置技能 准备时 `skills`, SDK 添加了您所具备的技能 `allowedTools` 自动。如果您也通过一个明示 `tools` 列表,包括 `"Skill"` 在列表中, Claude 可以引用技能。 配置后, Claude 从文件系统中自动发现技能, 并在与用户请求相关时引用这些技能。 下面的例子可以让每个发现的技能在一个会话中实现, 并预先批准通常需要的工具。 示例集 `cwd` 到进程当前的工作目录,所以从一个有 `.claude/skills/` 当前目录中或寄存器根前的任何父目录 : ``` import asyncio import os from claude_agent_sdk import query, ClaudeAgentOptions async def main(): options = ClaudeAgentOptions( cwd=os.getcwd(), # .claude/skills/ here or in a parent directory setting_sources=["user", "project"], # Load skills from filesystem skills="all", # Let Claude invoke every discovered skill allowed_tools=["Read", "Write", "Bash"], ) async for message in query( prompt="Help me process this PDF document", options=options ): print(message) asyncio.run(main()) ``` ``` import { query } from "@anthropic-ai/claude-agent-sdk"; for await (const message of query({ prompt: "Help me process this PDF document", options: { cwd: process.cwd(), // .claude/skills/ here or in a parent directory settingSources: ["user", "project"], // Load skills from filesystem skills: "all", // Let Claude invoke every discovered skill allowedTools: ["Read", "Write", "Bash"] } })) { console.log(message); } ``` ### 确认技能已装入 在流的开始附近, SDK 生成带有子类型的系统消息 `init`。检查它的 `skills` 数组以确认您在克劳德开始工作前所加载的技能。该数组包括您用一个定义的用户可用技能 `description` 或 时 间 `when_to_use` 前题字段, 以及 [包括Claude代码在内的捆绑技能](<https://code.claude.com/docs/en/skills#bundled-skills>)。该数组只列出用户可用技能。 [`user-invocable: false`](<https://code.claude.com/docs/en/skills#control-who-invokes-a-skill>) 在它的前置负载中, 克劳德仍然可以使用, 但阵列中并没有出现。 阵列列出了相同的技能, 无论是否属于您 `skills` 列表中选项。 ### 仅允许特定技能 让克劳德只引用特定的技能, 传他们的名字在 `skills` 列表 : - **你自己的本领**: 技能目录名称 - **插件技能**: `plugin:skill` - **名称冲突 `additionalDirectories` 或 时 间 `add_dirs`**: 其中一个目录中的技能得到一个 [前缀名称](<https://code.claude.com/docs/en/skills#how-a-skill-gets-its-command-name>) 当名称与企业、个人或项目技能或先前添加的目录中的一个名称发生冲突时。用该名称列出。 `verify` 技术 `../api` 财务报告和财务报告 `../web`,按此顺序添加,没有其他 `verify` 技能,将其列为 `verify` 财务报告和财务报告 `web:verify`。要求克劳德代码 v2.1.309 或稍后 如果一个条目不能作为准确的名字, `query()` 在会话开始前拒绝列表 。 [无效的技能名称错误](<https://code.claude.com/docs/en/agent-sdk/skills#invalid-skill-name-error>) 用于命名规则和每个 SDK 引起的错误。该模型没有看到未列出的技能,而技能工具拒绝了这些技能,而其文件则留在磁盘上,并通过 Read 和 Bash 保持联系。限制列表并不限制子代理或 [按名称发送](<https://code.claude.com/docs/en/agent-sdk/skills#dispatch-commands-by-name>)让克劳德引用所有发现的技巧,通过 `skills: "all"` 而不是一个通配符。 ## 代理 SDK 会话中的命令 此区域是 SDK 的命令文档。 命令是您发送的任意操作文件 。 `/<name>` 命令表面的条目在背面有不同之处: - **内建命令**: 执行编码为 Claude 代码进程的逻辑, 例如 SDK 运行 `/compact` - **包扎技能**:例如,克劳德密码中包含的即时文物 `/code-review` - **你的技能**: 提示您所撰写的文物, 每个目录中包含一个 `SKILL.md` 文件。一个用户提示技能的名称会自动加入表面,所以会自动发送 `/security-check` 以同样的方式运行内置工作 - **自定义命令文件**: 具有相同行为的更古老的文物形式, 平面的Markdown文件 in `.claude/commands/` 文件名成为命令名 。 技能是推荐的继任者 。 默认情况下,您和克劳德都可以引用任何技能。您可以通过该技能限制任一路径 [前题](<https://code.claude.com/docs/en/skills#control-who-invokes-a-skill>)关于指挥和技能的定义,见词汇表。 [命令](<https://code.claude.com/docs/en/glossary#command>) 财务报告和财务报告 [技能](<https://code.claude.com/docs/en/glossary#skill>) 条目。见 [Claude 代码中的命令](<https://code.claude.com/docs/en/commands>) 用于每个内置和 [以技能扩展克劳德](<https://code.claude.com/docs/en/skills>) 两种工艺品的完整指南。 ### 发现可用的命令 您可以通过 SDK 发送没有交互式终端命令。 `system/init` 信件中列出您会话中可用的 `slash_commands` 字段。需要交互终端的指令,例如 `/theme` 财务报告和财务报告 `/terminal-setup`,不要在列表中出现。在会话开始时访问字段: ``` import { query } from "@anthropic-ai/claude-agent-sdk"; for await (const message of query({ prompt: "Hello Claude", options: { maxTurns: 1 } })) { if (message.type === "system" && message.subtype === "init") { console.log("Available commands:", message.slash_commands); } } ``` ``` import asyncio from claude_agent_sdk import query, ClaudeAgentOptions, SystemMessage async def main(): async for message in query(prompt="Hello Claude", options=ClaudeAgentOptions(max_turns=1)): if isinstance(message, SystemMessage) and message.subtype == "init": print("Available commands:", message.data["slash_commands"]) asyncio.run(main()) ``` 打印列表混合了内置命令,捆绑技能,您的用户可引用技能,以及 `.claude/commands/` 文档 : ``` Available commands: ["clear", "compact", "context", "usage", "code-review", "verify", "security-check", ...] ``` 一个技能与 [`user-invocable: false`](<https://code.claude.com/docs/en/skills#control-who-invokes-a-skill>) 它的前题不在此列表中或 `skills` 数组从 [确认技能已装入](<https://code.claude.com/docs/en/agent-sdk/skills#confirm-skills-loaded>)配置的会话 [MCP 服务器](<https://code.claude.com/docs/en/agent-sdk/mcp>) 也可以暴露 [MCP 提示为命令](<https://code.claude.com/docs/en/mcp#use-mcp-prompts-as-commands>). ### 以名称命名的调度命令 发送命令时将它包含在您的提示字符串中, 就像您发送正则文本一样。 调度不依赖于 `skills` 选项。发送 `/<name>` 运行一个用户可用技能,即使您 `skills` 列表中省略它。根据对话历史行事的指令,例如 `/compact`中,需要先行信息才能与之合作。 `/<name>` 既不匹配会话中的命令, 也不匹配内置的 Claude 代码命令不会失败查询。 Claude 代码将提示作为普通信件发送给 Claude, 并注明命令没有运行, 因此查询会花费一个模型转弯并返回 Claude 的回复 。 在 v2.1.274 之前, a `/<name>` 匹配的无返回 `Unknown command: /<name>` 结果没有模型转弯。 `/<name>` 匹配会话中没有的 Claude 内置代码命令, 例如 `/theme`返回时 `/theme isn't available in this environment.` 结果是没有模型转弯。 当一个命令到达 `maxTurns` / `max_turns` 限制,查询以错误结果结束,而不是 `success`。关于错误结果合同,见 [处理结果](<https://code.claude.com/docs/en/agent-sdk/agent-loop#handle-the-result>)。如果你的命令可能达到极限,请做其中之一: - 设定 `maxTurns` 足够高,工作才能完成。 - 包装 `query()` 循环 `try`/`catch` 在 TypeScript 中,或 `try`/`except` 在Python语中。 ### 与 `/compact` 密码 `/compact` 命令在保留重要上下文的同时,通过对旧信件进行归纳来缩小您对话历史的大小。压缩需要已有的对话,并有足够的前置信件进行总结。此示例首先有对话,然后压缩并读取 `compact_boundary` 报告结果的系统信息: ``` import { query } from "@anthropic-ai/claude-agent-sdk"; // Compaction needs existing history, so have a conversation first try { for await (const message of query({ prompt: "Explain what this project does", options: { maxTurns: 2 } })) { if (message.type === "result" && message.subtype === "success") { console.log(message.result); } } } catch (error) { // A single-shot query() throws after yielding an error result, // so the follow-up query below still runs. console.error(`Session ended with an error: ${error}`); } // Compact the same conversation for await (const message of query({ prompt: "/compact", options: { continue: true, maxTurns: 1 } })) { if (message.type === "system" && message.subtype === "compact_boundary") { console.log("Compaction completed"); console.log("Pre-compaction tokens:", message.compact_metadata.pre_tokens); console.log("Trigger:", message.compact_metadata.trigger); // Example output: // Compaction completed // Pre-compaction tokens: 1842 // Trigger: manual } } ``` ``` import asyncio from claude_agent_sdk import query, ClaudeAgentOptions, ResultMessage, SystemMessage async def main(): # Compaction needs existing history, so have a conversation first try: async for message in query( prompt="Explain what this project does", options=ClaudeAgentOptions(max_turns=2), ): if isinstance(message, ResultMessage) and message.subtype == "success": print(message.result) except Exception as error: # A single-shot query() raises after yielding an error result, # so the follow-up query below still runs. print(f"Session ended with an error: {error}") # Compact the same conversation async for message in query( prompt="/compact", options=ClaudeAgentOptions(continue_conversation=True, max_turns=1), ): if isinstance(message, SystemMessage) and message.subtype == "compact_boundary": print("Compaction completed") print("Pre-compaction tokens:", message.data["compact_metadata"]["pre_tokens"]) print("Trigger:", message.data["compact_metadata"]["trigger"]) # Example output: # Compaction completed # Pre-compaction tokens: 1842 # Trigger: manual asyncio.run(main()) ``` A `compact_boundary` 消息只在压缩运行时才发出。当持续会话有消息但无消息时 `/compact` 可以概括,运行仍然以 `success` 结果而不是错误,而不是 `compact_boundary` 消息到达。结果文本随即带出原因,例如 `Not enough messages to compact.` 当会议召开时,克劳德立即作出答复,但还没有答复。 `query()` 调用从空上下文开始, 因此在前一个回合的会话中使用此模式, 例如: [流媒体输入模式](<https://code.claude.com/docs/en/agent-sdk/streaming-vs-single-mode>) 或复会时。 ### 重置上下文为 `/clear` 密码 `/clear` 命令将对话重置为空上下文, 因此随后的提示开始没有先前的对话历史。 前一次的对话仍然在磁盘上。 您可以通过将其会话 ID 传递到 [`resume` 选项](<https://code.claude.com/docs/en/agent-sdk/sessions#resume-by-id>). `/clear` 用于 [流媒体输入模式](<https://code.claude.com/docs/en/agent-sdk/streaming-vs-single-mode>)中,您通过一个连接发送多个提示。 `query()` 调用, 每个调用已经从空上下文开始, 所以发送 `/clear` 没有实际效果 。 开始一个新的 `query()` 换句话说。 ## 创造技能 创建每个技能作为包含一个的目录 `SKILL.md` 文件有 YAML 前题和 Markdown 内容。 `description` 字段决定克劳德何时引用你的技能。 **示例目录结构**: ``` .claude/skills/security-check/ └── SKILL.md ``` ### 选择发现级别 将技能保存在最常见的两种技能中的任何一种 [发现水平](<https://code.claude.com/docs/en/skills#where-skills-live>): - **项目技能**: `.claude/skills/`,仅在当前项目中提供 - **个人技能**: `~/.claude/skills/`,可在您所有项目中找到 如果您在其中拥有已有自定义命令文件 `.claude/commands/`,它们继续工作。 `.claude/commands/deploy.md` 创建 `/deploy` 并且工作的方式与技能一样 `.claude/skills/deploy/SKILL.md` 如果命令文件和技能共享一个名称,请查看 [共享名称的解析技能](<https://code.claude.com/docs/en/skills#resolve-skills-that-share-a-name>) 一个运行。 SDK 负载 `.claude/commands/` 财务报告和财务报告 `~/.claude/commands/` 与技能相同的两个范围的文件。见 [以技能扩展克劳德](<https://code.claude.com/docs/en/skills>) 两种工艺品的完整指南。 ### 创建和发送您的第一个技能 要看到全流,创造 `.claude/skills/security-check/SKILL.md`: ``` --- name: security-check description: Run a security vulnerability scan --- Analyze the codebase for security vulnerabilities including: - SQL injection risks - XSS vulnerabilities - Exposed credentials - Insecure configurations ``` 一旦文件存在,该技能可以通过SDK提供. Claude在请求与其描述相符时引用它,你可以直接发送: ``` import { query } from "@anthropic-ai/claude-agent-sdk"; for await (const message of query({ prompt: "/security-check", options: { maxTurns: 10 } })) { if (message.type === "result" && message.subtype === "success") { console.log(message.result); } } ``` ``` import asyncio from claude_agent_sdk import query, ClaudeAgentOptions, ResultMessage async def main(): async for message in query( prompt="/security-check", options=ClaudeAgentOptions(max_turns=10) ): if isinstance(message, ResultMessage) and message.subtype == "success": print(message.result) asyncio.run(main()) ``` 成功运行结束于 `success` 文本带有扫描结果的结果。针对一个带有种子问题的小型Express应用程序,结果文本开始: ``` **Security scan of `app.js` — 4 findings (most severe first):** 1. **SQL Injection** (line 8) — `req.query.name` is concatenated directly into the SQL string. Trivially exploitable (`' OR '1'='1`, `'; DROP TABLE users;--`). **Fix:** use parameterized queries, e.g. `db.query("SELECT * FROM users WHERE name = ?", [req.query.name], cb)`. ... ``` 该技能的名字也出现在init信息中 `slash_commands` 数组。 Claude代码包括捆绑 `code-review` 财务报告和财务报告 `verify` 技能。如果您命名为 `.claude/commands/` 例如,在其中之一之后的文件 `.claude/commands/code-review.md`中,文件命令将捆绑的技能阴影化, `slash_commands` 列出名称一次。 ## 预先批准的技能工具 在 SDK 课程中,您可以预选项目工具或个人技能 [`allowed-tools`](<https://code.claude.com/docs/en/skills#pre-approve-tools-for-a-skill>) 前题或与 `allowedTools` 选项( C)`allowed_tools` 在 Python 中),在查询配置中。如果组织设置 [`allowManagedPermissionRulesOnly`](<https://code.claude.com/docs/en/settings-reference#allowmanagedpermissionrulesonly>) 在管理下的环境下,Claude Code忽略了两者。 [由Claude.ai同步制作.](<https://code.claude.com/docs/en/skills#how-claude-code-handles-the-frontmatter-of-a-synced-skill>) 遵守他们自己的前题规则。 技能与会话工具一起运行。下面的例子预先批准 `Read`, `Grep`,以及 `Glob` 与 `allowedTools` (`allowed_tools` 在 Python 中,这样克劳德就可以在运行文件时检查文件 [安全检查技能](<https://code.claude.com/docs/en/agent-sdk/skills#create-and-dispatch-your-first-skill>) 无需停止批准: ``` import asyncio from claude_agent_sdk import query, ClaudeAgentOptions options = ClaudeAgentOptions( setting_sources=["user", "project"], # Load skills from filesystem skills="all", allowed_tools=["Read", "Grep", "Glob"], ) async def main(): async for message in query(prompt="Check this project for security issues", options=options): print(message) asyncio.run(main()) ``` ``` import { query } from "@anthropic-ai/claude-agent-sdk"; for await (const message of query({ prompt: "Check this project for security issues", options: { settingSources: ["user", "project"], // Load skills from filesystem skills: "all", allowedTools: ["Read", "Grep", "Glob"] } })) { console.log(message); } ``` 在流中,技能引用作为技能工具的使用出现,然后是Read在项目文件中的调用。运行结束为 a `success` 文本中包含结果的结果。列表预先批准指定的工具,而不是限制其他工具。对于全部许可流,包括许可模式和许可方式。 `canUseTool` 调用, 看 [权限](<https://code.claude.com/docs/en/agent-sdk/permissions>). ## 解决问题 ### 未找到技能 **检查 settingSources 配置**: SDK通过 `user` 财务报告和财务报告 `project` 设置源。如果设置 `settingSources`/`setting_sources` SDK 明确且省略这些来源, ``` # Skills not loaded: setting_sources excludes user and project options = ClaudeAgentOptions(setting_sources=[], skills="all") # Skills loaded: user and project sources included options = ClaudeAgentOptions( setting_sources=["user", "project"], skills="all", ) ``` ``` // Skills not loaded: settingSources excludes user and project const optionsWithoutSkills = { settingSources: [], skills: "all" }; // Skills loaded: user and project sources included const optionsWithSkills = { settingSources: ["user", "project"], skills: "all" }; ``` 每个源装入的关于哪个技能目录,参见 [文件系统源表](<https://code.claude.com/docs/en/agent-sdk/claude-code-features#control-filesystem-settings-with-settingsources>)。详细情况如下: `settingSources`/`setting_sources`,参见 [TypeScript SDK 参考文献](<https://code.claude.com/docs/en/agent-sdk/typescript#settingsource>) 或 时 间 [Python SDK 参考文献](<https://code.claude.com/docs/en/agent-sdk/python#settingsource>). **检查工作目录**: SDK 装入技能来自 `.claude/skills/` 输入 `cwd` 选项,并在每个父目录中直到寄存器根。 `cwd` 在目录中或以下的点 `.claude/skills/`,在同一存储库内: ``` # Ensure your cwd points to the directory containing .claude/skills/ options = ClaudeAgentOptions( cwd="/path/to/project", # .claude/skills/ here or in a parent directory setting_sources=["user", "project"], # Loads skills from these sources skills="all", ) ``` ``` // Ensure your cwd points to the directory containing .claude/skills/ const options = { cwd: "/path/to/project", // .claude/skills/ here or in a parent directory settingSources: ["user", "project"], // Loads skills from these sources skills: "all" }; ``` 见 [与 SDK 代理使用技能](<https://code.claude.com/docs/en/agent-sdk/skills#use-skills-with-the-agent-sdk>) 完整图案。 **校验文件系统位置**: ``` # Check project skills ls .claude/skills/*/SKILL.md # Check personal skills ls ~/.claude/skills/*/SKILL.md ``` ### 没有使用技能 **检查一下 `skills` 选项**: 如果你通过了一个 `skills` 列表中,请确认技能名称。当克劳德试图引用未列出的技能时,技能工具返回 `Skill <name> is not in this session's skills allowlist`。将名称添加到您的列表中,或者通过发送直接发送技能 `/<name>` 在一个不列清单的提示中。 **检查描述**:确保它具体,并包括相关的关键词。见 [技能最佳做法](<https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices#writing-effective-descriptions>) 关于撰写有效说明的指导意见。 ### 无效的技能名称错误 当您的名字 `skills` 列表不能作为精确的技巧名称, `query()` 启动 Claude 代码进程前拒绝此列表。 触发拒绝的名称包括: - 空名称 - 包含括号、逗号或控件字符的名称 - 添加白空格的名称 - 像赤裸一样的通配符形式 `*` 或一个 `:*` 后缀 每个SDK对拒绝的表观不同: - TypeScript - Python 键 TypeScript SDK 抛出一个 `Error` 说明该条目已中断的规则。例如, `skills: ["docs:*"]` 掷出 : ``` Invalid skill name "docs:*": wildcard-suffix names are not allowed; list each skill by its exact name. ``` 空名称报告 `Skill names must be non-empty strings.`在TypeScript代理SDK 0.3.221之前,SDK并没有运行这一检查. Python SDK 升起时 `ValueError` 说明该条目已中断的规则。例如, `skills=["docs:*"]` 提出: ``` ValueError: Invalid skill name 'docs:*': wildcard-suffix names are not allowed; list each skill by its exact name. ``` 空名称报告 `Skill names must be non-empty strings`. 在Python代理SDK 0.2.129之前,SDK没有运行此检查. ### 其它故障清除 关于一般技能故障排除,如YAML语法错误和调试,参见: [Claude 代码技能故障排除部分](<https://code.claude.com/docs/en/skills#troubleshooting>). ## 今后的步骤 密码 [Claude代码技能指南](<https://code.claude.com/docs/en/skills>) 涵盖深度作者。 它的指南适用于 SDK 会话。 从这些章节开始 : - [前题参考](<https://code.claude.com/docs/en/skills#frontmatter-reference>): 每个支持的字段 - [将参数传递给技能](<https://code.claude.com/docs/en/skills#pass-arguments-to-skills>): `$ARGUMENTS`, `$0`,以及 `$1`。该数字 [完全替换表](<https://code.claude.com/docs/en/skills#available-string-substitutions>) 添加命名的参数和 `${CLAUDE_*}` 变量 - [注入动态上下文](<https://code.claude.com/docs/en/skills#inject-dynamic-context>): `` !`command` `` 在克劳德看到技能内容之前运行的行 - [选择技能负载位置](<https://code.claude.com/docs/en/skills#where-skills-live>): 每个技能位置, 插件命名间隔, 以及当两个共享一个名称时运行哪个技能 。 ## 相关资源 - [Claude 代码中的命令](<https://code.claude.com/docs/en/commands>): 完整命令表面,包括每个内置 - [代理技能概览](<https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview>):概念概述、惠益和架构 - [技能最佳做法](<https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices>):编写有效技能准则 - [代理技能烹饪本](<https://platform.claude.com/cookbook/skills-notebooks-01-skills-introduction>): 实例技能和模板 - [SDK中的子剂](<https://code.claude.com/docs/en/agent-sdk/subagents>): 具有程序选项的类似基于文件系统的代理 - [SDK概览](<https://code.claude.com/docs/en/agent-sdk/overview>):一般SDK概念 - [TypeScript SDK 参考文献](<https://code.claude.com/docs/en/agent-sdk/typescript>): 完整的 API 文档 - [Python SDK 参考文献](<https://code.claude.com/docs/en/agent-sdk/python>): 完整的 API 文档

查看原始来源