跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 developing-claude-code-plugins

Developing Claude Code Plugins

在使用 Claude 代码插件( 创建、 修改、 测试、 释放、 或维护) 时使用 - 为完整的插件生命周期提供精简的工作流程、 模式和示例

172 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

在使用 Claude 代码插件( 创建、 修改、 测试、 释放、 或维护) 时使用 - 为完整的插件生命周期提供精简的工作流程、 模式和示例

何时用

当 :

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Developing Claude Code Plugins、Overview、When to Use、Quick Reference、Plugin Development Workflow、Phase 1: Plan。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/plugin-structure.md、references/common-patterns.md、references/polyglot-hooks.md、references/troubleshooting.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Use when working on Claude Code plugins (creating, modifying, testing, releasing, or maintaining) - provides streamlined workflows, patterns, and examples for the complete plugin lifecycle

Developing Claude Code PluginsOverviewWhen to UseQuick ReferencePlugin Development WorkflowPhase 1: PlanPhase 2: Create StructurePhase 3: Add ComponentsPhase 4: Test LocallyPhase 5: Debug and RefinePhase 6: Release and DistributeCritical Rules

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
developing-claude-code-plugins
description
Use when working on Claude Code plugins (creating, modifying, testing, releasing, or maintaining) - provides streamlined workflows, patterns, and examples for the complete plugin lifecycle
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 4
  • references/plugin-structure.md
  • references/common-patterns.md
  • references/polyglot-hooks.md
  • references/troubleshooting.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「developing-claude-code-plugins」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-3d41fccf38a1c583-%E5%BC%80%E5%8F%91-Claude-%E4%BB%A3%E7%A0%81%E6%8F%92%E4%BB%B6.html
请存为 .cursor/skills/developing-claude-code-plugins/SKILL.md 或 .claude/skills/developing-claude-code-plugins/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/obra/superpowers-developing-for-claude-code 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/obra/superpowers-developing-for-claude-code' --list

npx skills add 'https://github.com/obra/superpowers-developing-for-claude-code' --skill 'developing-claude-code-plugins'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版

name: developing-claude-code-plugins description: Use when working on Claude Code plugins (creating, modifying, testing, releasing, or maintaining) - provides streamlined workflows, patterns, and examples for the complete plugin lifecycle

Developing Claude Code Plugins

Overview

This skill provides efficient workflows for creating Claude Code plugins. Use it to make plugin development fast and correct - it synthesizes official docs into actionable steps and provides working examples.

When to Use

Use this skill when:

  • Creating a new Claude Code plugin from scratch
  • Adding components to an existing plugin (skills, commands, hooks, MCP servers)
  • Setting up a development marketplace for testing
  • Troubleshooting plugin structure issues
  • Understanding plugin architecture and patterns
  • Releasing a plugin (versioning, tagging, marketplace distribution)
  • Publishing updates or maintaining existing plugins

For comprehensive official documentation, use the working-with-claude-code skill to access full docs.

Quick Reference

| Need to... | Read This | Official Docs | |-----------|-----------|---------------| | Understand directory structure | references/plugin-structure.md | plugins.md | | Choose a plugin pattern | references/common-patterns.md | plugins.md | | Make hooks work cross-platform | references/polyglot-hooks.md | hooks.md | | Debug plugin issues | references/troubleshooting.md | Various | | See working examples | examples/ directory | N/A |

Plugin Development Workflow

Phase 1: Plan

Before writing code:

  1. Define your plugin's purpose

    • What problem does it solve?
    • Who will use it?
    • What components will it need?
  2. Choose your pattern (read references/common-patterns.md)

    • Simple plugin with one skill?
    • MCP integration with guidance?
    • Command collection?
    • Full-featured platform?
  3. Review examples

    • examples/simple-greeter-plugin/ - Minimal plugin
    • examples/full-featured-plugin/ - All components
    • Installed plugins in ~/.claude/plugins/

Phase 2: Create Structure

  1. Create directories (see references/plugin-structure.md for details):

    mkdir -p my-plugin/.claude-plugin
    mkdir -p my-plugin/skills
    # Add other component directories as needed
    
  2. Write plugin.json (required):

    {
      "name": "my-plugin",
      "version": "1.0.0",
      "description": "What your plugin does",
      "author": {"name": "Your Name"}
    }
    

    See references/plugin-structure.md for complete format.

  3. Create development marketplace (for local testing):

    Create .claude-plugin/marketplace.json:

    {
      "name": "my-dev",
      "plugins": [{
        "name": "my-plugin",
        "source": "./"
      }]
    }
    

    See references/plugin-structure.md for complete format.

Phase 3: Add Components

Use TodoWrite to track component creation:

Example:

- Create skill: main-workflow
- Add command: /hello
- Configure hooks
- Write README
- Test installation

For each component type, see:

  • Format/syntax: references/plugin-structure.md
  • When to use: references/common-patterns.md
  • Working code: examples/ directory

Phase 4: Test Locally

  1. Install for testing:

    /plugin marketplace add /path/to/my-plugin
    /plugin install my-plugin@my-dev
    

    Then restart Claude Code.

  2. Test each component:

    • Skills: Ask for tasks matching skill descriptions
    • Commands: Run /your-command
    • MCP servers: Check tools are available
    • Hooks: Trigger relevant events
  3. Iterate:

    /plugin uninstall my-plugin@my-dev
    # Make changes
    /plugin install my-plugin@my-dev
    # Restart Claude Code
    

Phase 5: Debug and Refine

If something doesn't work, read references/troubleshooting.md for:

  • Plugin not loading
  • Skill not triggering
  • Command not appearing
  • MCP server not starting
  • Hooks not firing

Common issues are usually:

  • Wrong directory structure
  • Hardcoded paths (use ${CLAUDE_PLUGIN_ROOT})
  • Forgot to restart Claude Code
  • Missing executable permissions on scripts

Phase 6: Release and Distribute

  1. Write README with:

    • What the plugin does
    • Installation instructions
    • Usage examples
    • Component descriptions
  2. Version your release using semantic versioning:

    • Update version in .claude-plugin/plugin.json
    • Document changes in CHANGELOG.md or RELEASE-NOTES.md
    • Example: "version": "1.2.1" (major.minor.patch)
  3. Commit and tag your release:

    git add .
    git commit -m "Release v1.2.1: [brief description]"
    git tag v1.2.1
    git push origin main
    git push origin v1.2.1
    
  4. Choose distribution method:

    Option A: Direct GitHub distribution

    • Users add: /plugin marketplace add your-org/your-plugin-repo
    • Your plugin.json serves as the manifest

    Option B: Marketplace distribution (recommended for multi-plugin collections)

    • Create separate marketplace repository
    • Add .claude-plugin/marketplace.json with plugin references:
      {
        "name": "my-marketplace",
        "owner": {"name": "Your Name"},
        "plugins": [{
          "name": "your-plugin",
          "source": {
            "source": "url",
            "url": "https://github.com/your-org/your-plugin.git"
          },
          "version": "1.2.1",
          "description": "Plugin description"
        }]
      }
      
    • Users add: /plugin marketplace add your-org/your-marketplace
    • Update marketplace manifest for each plugin release

    Option C: Private/team distribution

    • Configure in team's .claude/settings.json:
      {
        "extraKnownMarketplaces": {
          "team-tools": {
            "source": {"source": "github", "repo": "your-org/plugins"}
          }
        }
      }
      
  5. Test the release:

    # Test fresh installation
    /plugin marketplace add your-marketplace-source
    /plugin install your-plugin@marketplace-name
    # Verify functionality, then clean up
    /plugin uninstall your-plugin@marketplace-name
    
  6. Announce and maintain:

    • GitHub releases (optional)
    • Team notifications
    • Monitor for issues and user feedback
    • Plan maintenance updates

Critical Rules

Always follow these (from references/plugin-structure.md):

  1. .claude-plugin/ contains ONLY manifests (plugin.json and optionally marketplace.json)

    • ❌ Don't put skills, commands, or other components inside
    • ✅ Put them at plugin root
  2. Use ${CLAUDE_PLUGIN_ROOT} for all paths in config files

    • Makes plugin portable across systems
    • Required for hooks, MCP servers, scripts
  3. Use relative paths in plugin.json

    • Start with ./
    • Relative to plugin root
  4. Make scripts executable

    • chmod +x script.sh
    • Required for hooks and MCP servers

Resources in This Skill

  • references/plugin-structure.md - Directory layout, file formats, component syntax
  • references/common-patterns.md - When to use each plugin pattern, examples
  • references/polyglot-hooks.md - Cross-platform hook wrapper for Windows/macOS/Linux
  • references/troubleshooting.md - Debug guide for common issues
  • examples/simple-greeter-plugin/ - Minimal working plugin (one skill)
  • examples/full-featured-plugin/ - Complete plugin with all components (includes run-hook.cmd)

Cross-References

For deep dives into official documentation, use the working-with-claude-code skill to access:

  • plugins.md - Plugin development overview
  • plugins-reference.md - Complete API reference
  • skills.md - Skill authoring guide
  • slash-commands.md - Command format
  • hooks.md, hooks-guide.md - Hook system
  • mcp.md - MCP server integration
  • plugin-marketplaces.md - Distribution

Best Practices

  1. Start simple - Begin with minimal structure, add complexity when needed
  2. Test frequently - Install → test → uninstall → modify → repeat
  3. Use examples - Copy patterns from working plugins
  4. Follow conventions - Match style of existing plugins
  5. Document everything - Clear README helps users and future you
  6. Version properly - Use semantic versioning (major.minor.patch)

Workflow Summary

Plan → Choose pattern, review examples
Create → Make structure, write manifests
Add → Build components (skills, commands, etc.)
Test → Install via dev marketplace
Debug → Use troubleshooting guide
Release → Version, tag, distribute via marketplace
Maintain → Monitor, update, support users

The correct path is the fast path. Use references, follow patterns, test frequently.

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…