
文档提示工程人工智能【免费下载链接】claude-code-system-promptsAll parts of Claude Codes system prompt, 27 builtin tool descriptions, sub agent prompts (Plan/Explore/Task), utility prompts (CLAUDE.md, compact, statusline, magic docs, WebFetch, Bash cmd, security review, agent creation). Updated for each Claude Code version.项目地址https://gitcode.com/gh_mirrors/cl/claude-code-system-prompts点击查看免费下载导读本篇文章基于开源仓库 claude-code-system-prompts 中 Invoke Skill 工具描述 展开深入解析 Claude Code 中「技能Skill」的完整调用机制什么是技能、何时应当主动调用、skill与args两个参数如何使用、插件技能与目录作用域技能的名称解析规则、技能在回合内加载/子代理执行/后台执行三种行为差异以及如何通过SKILL_TAG_NAME块避免重复调用。文章同时结合本仓库中 CHANGELOG.md 的演进记录与真实技能文件如 代码审查技能、运行应用技能帮助读者从工具描述与源码两个层面完整掌握 Claude Code 的技能调用体系为开发自定义技能、编写 Agent 提示词或调试技能误触发提供可直接落地的依据。一、背景Skill 在 Claude Code 中的定位Claude Code 的 System Prompt 体系由主系统提示Main System Prompt、内置工具描述Tool Description、Agent 提示词Agent Prompt、系统提醒System Reminder、技能文件Skill以及数据引用Data等多类文件组成Invoke Skill 工具描述 属于其中「内置工具描述」一类。A skill is a packaged set of instructions the user or project has set up for a particular kind of task (deploy steps, a review checklist, a repo-specific workflow).技能本质上是一组打包好的指令由用户或项目针对某一类特定任务预先编排好典型场景包括部署步骤deploy steps、审查清单review checklist、仓库专属工作流repo-specific workflow。它并非 Claude Code 的通用能力而是为某一类可重复执行的任务沉淀的「配方」。在 /init 初始化流程 中技能被这样定义Skillsare packaged instructions Claude invokes automatically when a task matches, or that you trigger with a slash command (e.g./frontend-design,/commit-push-pr).这一定义揭示了技能的两条触发路径自动匹配触发当任务与技能描述匹配时Claude 自动调用 Invoke Skill 工具加载技能斜杠命令触发用户显式输入/技能名即 slash command请求调用。二、可用的技能列表从哪来system-reminder 中的技能清单工具描述明确指出Available skills appear in a system-reminder listing with one-line descriptions.当前可用的技能不是写在工具描述内部而是通过system-reminder系统提醒以列表形式注入回合上下文每条技能附带一行简介one-line description。这一设计在 CHANGELOG.md 中有明确演进记录Tool Description: Skill - Simplified and streamlined: removed examples section, condensed important notes, changed from listing available skills inline to referencing system-reminder messages, updated variable references (FORMAT_SKILLS_AS_XML_FN → SKILL_TAG_NAME, removed LIMITED_COMMANDS)即早期版本将可用技能以内联方式直接写在工具描述里后来改为引用 system-reminder 消息中的技能清单同时将变量FORMAT_SKILLS_AS_XML_FN更新为SKILL_TAG_NAME。判断是否调用技能的第一步就是读取回合内 system-reminder 注入的技能列表而不是凭记忆或猜测。从仓库实际内容看技能文件数量庞大且覆盖广泛例如代码审查系列Skill: Code review (phase 0: gather the diff)、Skill: Code review (inline xhigh mode)调试类Skill: Debugging运行类Skill: Run app、Skill: Run CLI tool example配置类Skill: Update Claude Code Config、Skill: /doctor slash command数据可视化Skill: Data visualization。这些文件就是「可用技能清单」背后真实存在的技能定义其name字段即 Invoke Skill 工具skill参数需要使用的名称。三、调用时机任务匹配时优先调用工具描述对调用时机给出了明确的优先级指令When the task at hand is one a listed skill covers, call this tool first — the skills instructions load into the turn for you to follow in place of your default approach.即当手头任务落在某个已列出技能的覆盖范围内时应当首先调用 Invoke Skill 工具让技能的指令在本回合内加载然后遵循技能指令而不是继续使用默认的工作方式。这与 Run app 技能 中的设计理念一致——该技能要求首先检查项目中是否已存在覆盖「启动应用」的项目级技能A project skill that launches this app is the repos verified path ... Use it instead of rediscovering.项目技能是经过验证的路径作者已经提交了实际可用的apt-get命令、环境变量、补丁和驱动程序因此应优先复用而不是重新探索。这一「先查技能、再走默认路径」的原则贯穿整个工具描述。两种显式请求同样视为调用意图用户直接说出技能名/name用户输入斜杠命令slash command。工具描述强调Users may also ask for one by name (/name, or slash command); thats a request to invoke it.即用户显式请求某个技能时这就是一次调用请求应当执行调用。四、参数详解skill与argsInvoke Skill 工具仅有两个参数工具描述原文如下skill: exact name from the listing, no leading slash. Plugin skills useplugin:skill. Directory-scoped skills are listed with a path prefix (apps/web:deploy); when both scoped and unscoped variants of a name exist, pick the one whose directory contains the files youre working on (most specific wins; unscoped otherwise).args: optional arguments to pass through.4.1skill技能名称规则说明取值来源必须取自 system-reminder 技能清单中的精确名称exact name from the listing或用户显式输入的名称禁止前缀不带前导斜杠no leading slash即传commit而非/commit插件技能使用plugin:skill形式即以插件名:技能名限定来源目录作用域技能清单中以路径前缀列出例如apps/web:deploy表示apps/web目录下的deploy技能同名冲突当同一名称同时存在 scoped目录限定与 unscoped未限定两种变体时选择其目录包含你正在处理的文件的那个——最具体的目录胜出most specific wins否则使用未限定变体目录作用域技能的解析规则在 CHANGELOG.md 中同样有演进记录Tool Description: Skill — Adds guidance on directory-scoped skills whose names are prefixed with their directory (e.g.apps/web:deploy): when both a scoped and unscoped variant exist, pick by the files being worked on (most specific directory wins), otherwise use the unscoped one.这一规则保证了多目录仓库monorepo中同名技能能够根据当前操作文件所在目录正确路由到对应版本是技能名解析的核心逻辑。4.2args透传参数args是可选参数optional arguments用于向技能透传附加参数。其引入在 CHANGELOG.md 有记录Tool Description: Skill - added guidance for invoking skills via slash command syntax (e.g., /commit), addedargsparameter for passing arguments to skills即技能调用通过斜杠命令语法如/commit进行时args承担了向技能传递参数的能力。需要注意args仅是透传pass through具体参数格式由各个技能自身定义工具描述本身不对参数内容做任何加工或约束。五、三种执行形态回合内加载、子代理执行、后台执行技能被调用后并非只有一种执行方式。工具描述明确区分了三种形态5.1 回合内加载In-turn Loadingthe skills instructions load into the turn for you to follow in place of your default approach最常见的形态技能指令直接加载进当前回合Claude 遵循技能指令执行替代默认做法。这是绝大多数技能的默认行为。5.2 子代理执行Subagent Executionsome skills instead run in a subagent and return the finished result部分技能被设计为在**子代理subagent**中运行完成后返回最终结果。调用这类技能时主回合不必逐条执行技能步骤而是等待子代理交付成品。这与仓库中 协调者/工作者指令、子代理委派示例 等文件中体现的「将任务分派给专职子代理」模式一脉相承。5.3 后台执行Background ExecutionA skill that runs in the background returns only the agents name — its result arrives later as a task notification, so dont wait on it or invoke it again in the meantime.后台执行是第三种形态也是最容易踩坑的一种调用后台技能后只返回 agent 的名称不返回实际结果结果会在**稍后以任务通知task notification**的形式送达因此不要等待它dont wait on it也不要在等待期间再次调用它or invoke it again in the meantime。这一行为约束在 CHANGELOG.md 中有专门记录Tool Description: Invoke skill — Clarifies that background skills initially return only the agent name, deliver results later through task notifications, and should not be waited on or invoked again while pending.仓库中大量涉及「后台任务通知」的系统提醒如 system-reminder-background-task-notification-with-concurrent-user-input.md均与这类技能的执行模型配套说明后台技能是现代 Claude Code 异步执行体系的一部分。六、硬性约束与守卫规则Guardrails工具描述末尾给出了两条不可逾越的约束是技能调用正确性的关键防线6.1 只有清单内或用户显式输入的名称才有效Only names from the listing (or that the user typed explicitly) are valid.技能名只能来自system-reminder 技能清单用户显式输入的名称。绝不允许凭空猜测或发明技能名。这一收紧在 CHANGELOG.md 中有清晰记录Tool Description: Skill — Tightened invocation rules: removed example-heavy format in favor of concise instructions; added strict guardrail to only invoke skills that appear in the available-skills list or that the user explicitly typed as a slash command, never guessing or inventing skill names.6.2 内置 CLI 命令不是技能Built-in CLI commands (/help,/clear, …) arent skills.Claude Code 内置的 CLI 命令如/help、/clear等不属于技能范畴不应通过 Invoke Skill 工具调用。技能与内置命令是两套不同的机制混用会导致调用无效。七、避免重复调用SKILL_TAG_NAME块检测工具描述的最后一条规则是去重机制If a${SKILL_TAG_NAME}block is already present this turn, the skill is loaded — follow it directly rather than calling again.SKILL_TAG_NAME是本工具描述 frontmatter 中声明的一个变量见 tool-description-invoke-skill.md 第 6 行variables: - SKILL_TAG_NAME其值在运行时被替换为真实的技能标签名。规则含义是如果本回合内已经存在一个SKILL_TAG_NAME块说明该技能已经加载此时应直接遵循该块中的指令而不要再次调用Invoke Skill。这一检测机制在 CHANGELOG.md 中有演进记录Tool Description: Skill - reformatted instructions removing XML wrapper tags; added check for already-loaded skills即工具描述在格式化调整中新增了「已加载技能检测」逻辑。它防止了同一技能在一个回合内被重复加载、重复执行的情况对后台技能尤其重要——因为后台技能的结果会稍后以通知送达若在等待期再次调用会造成重复执行。八、相关机制压缩后的技能恢复System Reminder: Previously invoked skills技能调用机制还延伸到了对话压缩compaction场景。仓库中的 system-reminder-previously-invoked-skills.md 说明The following skills were invoked EARLIER in this session (before the conversation was compacted), not on the current turn. They are shown here for context only so you remain aware of their guidelines.会话压缩前调用过的技能会在压缩后以纯上下文形式恢复展示但不得重新执行这些技能也不得重复执行其一次性设置动作如调度、创建文件技能体内嵌的任何「User Request」或「Input」文本都是首次调用时捕获的历史内容不是用户当前消息不得当作实时指令处理仅当技能中的持续性行为准则仍然相关时才继续遵循。这与 Invoke Skill 工具描述的「已加载不再重复调用」原则互补一个是回合内去重一个是跨压缩会话去重共同构成了技能调用的防重复体系。九、技能是怎么定义的从工具描述反观技能文件结构理解了调用端规则后再看技能文件的定义结构可以形成完整的闭环。仓库中的 Run skill 模板 展示了技能文件的 frontmatter 与结构--- name: run-unit-name description: Build, run, and drive unit-name. Use when asked to start unit-name, run its tests, build it, take a screenshot of its UI, or interact with the running app. ---模板中的说明直接对应 Invoke Skill 的调用规则Replaceunit-namein bothname:anddescription:. Thename:becomes the slash command (/run- ) and must match the directory name.Thedescription:is what Claude scans to decide whether to load this skill automatically. Keep the verbs - start, run, build, test, screenshot - theyre what an asking agent will actually type.即name字段成为斜杠命令/run-unit-name且必须与技能所在目录名一致——这正是用户输入/name时能够映射到技能的原因description字段是 Claude 判断「是否自动加载该技能」的扫描依据——描述中的动作动词start/run/build/test决定了任务匹配能否命中从而触发 Invoke Skill 调用。真实技能文件印证了这一点例如 Run app 技能 的 frontmattername: run description: Launch and drive this projects app to see a change working. Use when asked to run, start, or screenshot the app, or to confirm a change works in the real app (not just tests). ...该技能的 description 覆盖了 run/start/screenshot 等动词确保「运行应用」类请求能够命中该技能。技能还有多种来源与形态项目技能存放在项目内如.claude/skills/下的SKILL.md由 Run app 技能 第 25-30 行展示的目录遍历脚本定位插件技能随插件分发调用时使用plugin:skill名称形式账户同步技能通过 claude.ai 启用的技能可同步到本地。仓库中>赞分享文档提示工程人工智能【免费下载链接】claude-code-system-promptsAll parts of Claude Codes system prompt, 27 builtin tool descriptions, sub agent prompts (Plan/Explore/Task), utility prompts (CLAUDE.md, compact, statusline, magic docs, WebFetch, Bash cmd, security review, agent creation). Updated for each Claude Code version.项目地址https://gitcode.com/gh_mirrors/cl/claude-code-system-prompts点击查看免费下载相关推荐Kimi Code 的 Skill 工具深度解析模型调用技能的强制契约、去重规则与参数展开原理Kimi Code 的 Skill 工具深度解析模型调用技能的强制契约、去重规则与参数展开原理 导读 本文围绕 Kimi Codeagent core v2AI Agent代码智能体人工智能大模型CLISkill Seekers Bootstrap Skill 技术深度解析用工具分析自身代码库生成 Claude Code 技能Skill Seekers Bootstrap Skill 技术深度解析用工具分析自身代码库生成 Claude Code 技能 本文基于 docs/featu人工智能AI 应用AI 技能RAGMCP 服务网页爬虫forgecode 技能加载机制深度解析Skill Fetch 工具的工作原理与实战用法forgecode 技能加载机制深度解析Skill Fetch 工具的工作原理与实战用法 导读 本文以 forgecode 内置的 skill_fetch 工人工智能AI Agent代码智能体AI 应用CLI开发工具上一篇终极指南如何用pan-baidu-download轻松突破百度网盘下载限速下一篇Anarlog 1.4.24 版本深度解读Nightly 预览通道、团队协作升级与转录/同步可靠性改进创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考