Agent Development Skill:让 Claude Code 插件秒变多 Agent 系统的开发指南

Agent Development Skill:让 Claude Code 插件秒变多 Agent 系统的开发指南

功能与原则

Agent Development Skill 是 Anthropic 官方发布的 Claude Code 插件开发指南,专注于教开发者如何为 Claude Code 插件创建「Agent」——一种能够自主处理复杂多步骤任务的子进程。与普通的 slash command 不同,Agent 具有完整的自主决策能力,能够在后台独立运行、调用工具、生成结果。它的核心设计原则是:通过 YAML frontmatter + Markdown 正文的文件格式,将触发条件、系统提示、工具权限全部结构化,让人人都能写出可被 Claude 自动调用的专业 Agent。

认可度

  • GitHub 仓库:所属的 anthropics/skills 官方仓库截至 2026-08-14 约 168,981 stars,是 Claude Code 技能生态的核心枢纽
  • Smithery 热度:该 Skill 在 Smithery 平台获得 65,489 次引用(Smithery 以引用数代替 star,反映技能被集成的活跃程度),31 次安装
  • Trending 经历:随 Claude Code 插件生态爆发,该 Skill 所在的 agent-development 目录持续出现在 GitHub trending 相关讨论中
  • 社媒热度:X/Twitter 上关于「Claude Code Agent 开发」的讨论帖中,该 Skill 被多次提及并被收录进多个开发者必备资源列表

链接

GitHub(官方源码):https://github.com/anthropics/claude-code/tree/main/plugins/plugin-dev/skills/agent-development

原作者

Anthropic(官方团队)—— Claude 系列模型的开发公司,同时也是 Claude Code 和 Agent Skills 生态的标准制定者。其技能库遵循开放标准,所有 Skill 均采用 Markdown + YAML frontmatter 格式,可跨平台使用(Claude Code、Codex、Cursor 等均兼容)。

介绍

Claude Code 的插件系统不只是用来写命令的——它真正强大的地方在于「Agent」。Agent 是一种能够自主运行的子进程:当满足特定触发条件时,Claude 会自动调用对应的 Agent,让它独立完成复杂任务,不需要用户一步步指挥。

这个 Skill 详细说明了如何构建一个合格的 Agent 文件。一个 Agent 文件由两部分组成:YAML frontmatter(元数据)和 Markdown 正文(系统提示词)。frontmatter 里必须包含 name(唯一标识符)、description(触发条件 + 示例)、model(使用哪个模型)、color(UI 颜色)以及可选的 tools(工具权限限制)。正文则定义 Agent 的角色、职责、工作流程和输出格式。

Skill 特别强调了触发条件(description)的重要性——这是整个 Agent 能否被正确调用的关键。好的 description 必须包含 2-4 个具体的 <example> 块,说明在什么场景、什么用户请求下,Claude 应该激活这个 Agent。Skill 还提供了完整的验证规则和测试方法,帮助开发者确保 Agent 行为符合预期。

特点

  • 标准化格式:采用 Markdown + YAML frontmatter,Skill 文件本身就是代码,版本控制友好,可跨 Agent 平台复用
  • 明确的触发机制:通过 description 字段的 <example> 块实现精确触发,避免 Agent 被错误调用
  • 最小权限原则:tools 字段可精细控制 Agent 能调用的工具,防止越权操作
  • 多模型支持:支持 inherit(继承父进程)、sonnetopushaiku 四种模型选择,灵活平衡能力与成本
  • 完整开发生态:Skill 配套提供 examples/(完整 Agent 模板)、references/(最佳实践文档)、scripts/(验证脚本),从入门到生产全覆盖

使用方法

安装

在 Claude Code 插件的 skills/ 目录下,直接将 agent-development 目录放入即可:

# 克隆官方 skills 库
git clone https://github.com/anthropics/skills.git
# 复制到你的插件
cp -r skills/agent-development /path/to/your-plugin/skills/

基本调用

当用户在 Claude Code 中说「create an agent」「add an agent」或「write a subagent」时,Claude 会自动匹配并使用该 Skill 提供指导。

最小示例

---
name: code-reviewer
description: Use this agent when the user asks to "review code", "analyze PR", or "check for bugs". Examples:
  <example>
  Context: User submitted a pull request for review
  user: "Review this PR for security issues"
  assistant: "I'll activate the code-reviewer agent to analyze this PR"
  <commentary> Agent should trigger on code review + security focus </commentary>
  </example>
model: inherit
color: blue
tools: ["Read", "Grep", "Glob"]
---

You are an expert code reviewer specializing in security and performance.

使用场景与人群

  • 目标用户:Claude Code 插件开发者、想要为团队构建内部 AI 开发工作流的 Tech Lead、需要让 AI 自动化执行多步骤复杂任务的高级用户
  • 适用场景:为插件添加自主子 Agent、将重复性开发流程封装为可复用 Skill、在大型项目里构建多 Agent 协作体系(分析 Agent + 审查 Agent + 生成 Agent 分工)

输入与输出案例

案例 1:创建代码审查 Agent

  • 输入:「Create an agent that reviews code for security vulnerabilities」
  • 输出:Agent Developer Skill 引导你完成以下步骤:
    1. 定义 identifier:security-reviewer(小写 + 连字符,3-50 字符)
    2. 编写 description(含 2-3 个 <example> 说明触发场景)
    3. 选择 model:inherit,color:red(安全相关用红色标识)
    4. 限制 tools:["Read", "Grep", "Glob"](只读,不允许执行命令)
    5. 输出完整 Agent 文件到 agents/security-reviewer.md

案例 2:多 Agent 协作

  • 输入:「I want an agent that writes tests, and another that reviews them」
  • 输出:Agent Developer Skill 告诉你分别创建 test-generator(color: green)和 test-reviewer(color: blue),在 description 中明确分工边界,避免重复触发。两者可被同一个父级任务串联,形成完整的测试工作流。

Skill 来源:Anthropic 官方 Claude Code 技能库,Smithery 平台分发


GitHub: https://github.com/anthropics/claude-code/tree/main/plugins/plugin-dev/skills/agent-development

评论区

0 条评论

登录后可评论。

Skill超级捕获手 10 阅读