plugin-dev-guide
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePlugin Development Guide
插件开发指南
This meta-skill provides an overview of Claude Code plugin development and routes to specialized skills based on the task at hand.
本元技能提供Claude Code插件开发的概览,并根据手头任务引导至专业技能。
Plugin Development Skills Overview
插件开发技能概览
The plugin-dev toolkit provides 9 specialized skills for building Claude Code plugins, plus this guide. Each skill handles a specific domain of plugin development.
插件开发工具包提供9个用于构建Claude Code插件的专业技能,加上本指南。每个技能负责插件开发的特定领域。
Skill Quick Reference
技能速查
| Skill | Purpose |
|---|---|
| plugin-structure | Directory layout, manifest, component organization |
| command-development | Simple prompts (single .md files in commands/) |
| agent-development | Autonomous subagents |
| skill-development | Complex prompts with bundled resources (skills/) |
| hook-development | Event-driven automation |
| mcp-integration | Model Context Protocol servers |
| lsp-integration | Language Server Protocol for code intelligence |
| plugin-settings | User configuration via .local.md |
| marketplace-structure | Plugin marketplace creation |
| 技能名称 | 用途 |
|---|---|
| plugin-structure | 目录布局、清单文件、组件组织 |
| command-development | 简单提示(commands/目录下的单个.md文件) |
| agent-development | 自主子Agent |
| skill-development | 包含捆绑资源的复杂提示(skills/目录下) |
| hook-development | 事件驱动的自动化 |
| mcp-integration | Model Context Protocol 服务器 |
| lsp-integration | 用于代码智能的Language Server Protocol |
| plugin-settings | 通过.local.md实现用户配置 |
| marketplace-structure | 插件市场创建 |
When to Use Each Skill
何时使用各技能
Starting a New Plugin
启动新插件
Skill:
plugin-structureUse when the user needs to:
- Create a new plugin from scratch
- Understand plugin directory layout
- Configure plugin.json manifest
- Learn about component auto-discovery
- Use ${CLAUDE_PLUGIN_ROOT} for portable paths
技能:
plugin-structure当用户需要以下操作时使用:
- 从零开始创建新插件
- 了解插件目录布局
- 配置plugin.json清单文件
- 学习组件自动发现机制
- 使用${CLAUDE_PLUGIN_ROOT}实现可移植路径
Adding User-Facing Commands
添加面向用户的命令
Skill:
command-developmentUse when the user needs to:
- Create slash commands (/command-name)
- Configure command frontmatter (description, allowed-tools, model)
- Use dynamic arguments ($ARGUMENTS, $1, $2)
- Reference files with @ syntax
- Execute bash inline with backticks
[BANG]
技能:
command-development当用户需要以下操作时使用:
- 创建斜杠命令(/command-name)
- 配置命令前置元数据(描述、允许使用的工具、模型)
- 使用动态参数($ARGUMENTS, $1, $2)
- 使用@语法引用文件
- 使用反引号内联执行bash命令
[BANG]
Creating Autonomous Agents
创建自主Agent
Skill:
agent-developmentUse when the user needs to:
- Create subagents for complex tasks
- Write agent system prompts
- Configure agent triggering (description with examples)
- Choose agent models and colors
- Restrict agent tool access
技能:
agent-development当用户需要以下操作时使用:
- 创建用于复杂任务的子Agent
- 编写Agent系统提示词
- 配置Agent触发条件(带示例的描述)
- 选择Agent模型和颜色
- 限制Agent的工具访问权限
Building Skills
构建技能
Skill:
skill-developmentUse when the user needs to:
- Create skills that extend Claude's capabilities
- Write SKILL.md with proper frontmatter
- Organize skill content with progressive disclosure
- Create references/, examples/, scripts/ directories
- Write effective trigger phrases
技能:
skill-development当用户需要以下操作时使用:
- 创建扩展Claude能力的技能
- 编写带有正确前置元数据的SKILL.md
- 使用渐进式披露组织技能内容
- 创建references/、examples/、scripts/目录
- 编写有效的触发短语
Implementing Event Hooks
实现事件钩子
Skill:
hook-developmentUse when the user needs to:
- React to Claude Code events (PreToolUse, Stop, SessionStart, etc.)
- Create prompt-based or command-based hooks
- Validate tool inputs before execution
- Enforce completion standards
- Block dangerous operations
技能:
hook-development当用户需要以下操作时使用:
- 响应Claude Code事件(PreToolUse、Stop、SessionStart等)
- 创建基于提示词或命令的钩子
- 在执行前验证工具输入
- 强制执行完成标准
- 阻止危险操作
Integrating External Services via MCP
通过MCP集成外部服务
Skill:
mcp-integrationUse when the user needs to:
- Add MCP servers to plugins
- Configure stdio, SSE, HTTP, or WebSocket servers
- Set up authentication (OAuth, tokens)
- Use MCP tools in commands and agents
- Discover existing MCP servers on PulseMCP
技能:
mcp-integration当用户需要以下操作时使用:
- 向插件添加MCP服务器
- 配置stdio、SSE、HTTP或WebSocket服务器
- 设置身份验证(OAuth、令牌)
- 在命令和Agent中使用MCP工具
- 在PulseMCP上发现现有MCP服务器
Adding Code Intelligence via LSP
通过LSP添加代码智能
Skill:
lsp-integrationUse when the user needs to:
- Add Language Server Protocol servers to plugins
- Enable go-to-definition and find-references
- Configure language-specific servers (pyright, gopls, rust-analyzer)
- Set up extensionToLanguage mappings
- Enhance Claude's code understanding
技能:
lsp-integration当用户需要以下操作时使用:
- 向插件添加Language Server Protocol服务器
- 启用跳转到定义和查找引用功能
- 配置特定语言的服务器(pyright、gopls、rust-analyzer)
- 设置extensionToLanguage映射
- 增强Claude的代码理解能力
Managing Plugin Configuration
管理插件配置
Skill:
plugin-settingsUse when the user needs to:
- Store user-configurable settings
- Use .claude/plugin-name.local.md pattern
- Parse YAML frontmatter in hooks
- Create temporarily active hooks
- Manage agent state
技能:
plugin-settings当用户需要以下操作时使用:
- 存储用户可配置的设置
- 使用.claude/plugin-name.local.md模式
- 在钩子中解析YAML前置元数据
- 创建临时激活的钩子
- 管理Agent状态
Creating Plugin Marketplaces
创建插件市场
Skill:
marketplace-structureUse when the user needs to:
- Create a marketplace for multiple plugins
- Configure marketplace.json
- Set up plugin sources (relative, GitHub, git URL)
- Distribute plugins to teams
- Organize plugin collections
技能:
marketplace-structure当用户需要以下操作时使用:
- 为多个插件创建市场
- 配置marketplace.json
- 设置插件源(相对路径、GitHub、Git URL)
- 向团队分发插件
- 组织插件集合
Decision Tree for Skill Selection
技能选择决策树
User wants to...
├── Create/organize a plugin structure? → plugin-structure
├── Add a simple slash command (no bundled resources)? → command-development
├── Create an autonomous agent? → agent-development
├── Add a complex skill with scripts/references? → skill-development
├── React to Claude Code events? → hook-development
├── Integrate external service/API? → mcp-integration
├── Add code intelligence/LSP? → lsp-integration
├── Make plugin configurable? → plugin-settings
└── Distribute multiple plugins? → marketplace-structure用户想要...
├── 创建/组织插件结构? → plugin-structure
├── 添加简单斜杠命令(无捆绑资源)? → command-development
├── 创建自主Agent? → agent-development
├── 添加包含脚本/参考资料的复杂技能? → skill-development
├── 响应Claude Code事件? → hook-development
├── 集成外部服务/API? → mcp-integration
├── 添加代码智能/LSP? → lsp-integration
├── 使插件可配置? → plugin-settings
└── 分发多个插件? → marketplace-structureCommon Multi-Skill Workflows
常见多技能工作流
Building a Complete Plugin
构建完整插件
- Start: Load skill to create directory layout
plugin-structure - Add features: Load for user-facing commands
command-development - Automation: Load for event-driven behavior
hook-development - Configuration: Load if user configuration needed
plugin-settings - Validation: Use plugin-validator agent to validate structure
- 开始:加载技能创建目录布局
plugin-structure - 添加功能:加载实现面向用户的命令
command-development - 自动化:加载实现事件驱动行为
hook-development - 配置:如果需要用户配置,加载
plugin-settings - 验证:使用plugin-validator Agent验证结构
Creating an MCP-Powered Plugin
创建基于MCP的插件
- Start: Load for basic structure
plugin-structure - Integration: Load to configure MCP servers
mcp-integration - Commands: Load to create commands that use MCP tools
command-development - Agents: Load for autonomous MCP workflows
agent-development
- 开始:加载搭建基础结构
plugin-structure - 集成:加载配置MCP服务器
mcp-integration - 命令:加载创建使用MCP工具的命令
command-development - Agent:加载实现自主MCP工作流
agent-development
Building a Code Intelligence Plugin
构建代码智能插件
- Start: Load for basic structure
plugin-structure - LSP: Load to configure language servers
lsp-integration - Commands: Load for commands using LSP features
command-development
- 开始:加载搭建基础结构
plugin-structure - LSP:加载配置语言服务器
lsp-integration - 命令:加载创建使用LSP功能的命令
command-development
Building a Skill-Focused Plugin
构建聚焦技能的插件
- Start: Load for basic structure
plugin-structure - Skills: Load to create specialized skills
skill-development - Validation: Use skill-reviewer agent to validate skill quality
- 开始:加载搭建基础结构
plugin-structure - 技能:加载创建专业技能
skill-development - 验证:使用skill-reviewer Agent验证技能质量
Available Agents
可用Agent
The plugin-dev plugin also provides 3 agents:
| Agent | Purpose |
|---|---|
| plugin-validator | Validates plugin structure and manifests |
| skill-reviewer | Reviews skill quality and triggering |
| agent-creator | Generates new agents from descriptions |
Use agents proactively after creating components to ensure quality.
插件开发插件还提供3个Agent:
| Agent名称 | 用途 |
|---|---|
| plugin-validator | 验证插件结构和清单文件 |
| skill-reviewer | 审核技能质量和触发机制 |
| agent-creator | 根据描述生成新的Agent |
创建组件后主动使用这些Agent以确保质量。
Available Commands
可用命令
| Command | Purpose |
|---|---|
| Overview and skill routing |
| Entry point - choose plugin or marketplace creation |
| 8-phase guided plugin creation workflow |
| 8-phase guided marketplace creation workflow |
| 命令名称 | 用途 |
|---|---|
| 概览和技能指引 |
| 入口点 - 选择创建插件或市场 |
| 8阶段引导式插件创建工作流 |
| 8阶段引导式市场创建工作流 |
User Request
用户请求
$ARGUMENTS
If the user provided a request above, analyze it and either:
- Route to a specific skill if the request clearly matches one domain
- Answer directly using this guide's overview information
- Ask for clarification if the request is ambiguous
If no request was provided, summarize the available plugin development capabilities and ask what the user wants to build or learn about.
$ARGUMENTS
如果用户在上方提供了请求,请进行分析并选择以下操作之一:
- 引导至特定技能:如果请求明确匹配某个领域
- 直接回答:使用本指南的概览信息
- 请求澄清:如果请求不明确
如果未提供请求,请总结可用的插件开发能力,并询问用户想要构建或了解什么。