create

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- ⛔⛔⛔ MANDATORY: READ THIS ENTIRE FILE BEFORE ANY ACTION ⛔⛔⛔ -->
<!-- ⛔⛔⛔ 强制要求:执行任何操作前请完整阅读本文件 ⛔⛔⛔ -->

⛔ Create Plugin — STOP AND READ

⛔ 创建插件 — 请停下阅读

DO NOT ACT ON ASSUMPTIONS. Read this file first.
This is a structured workflow command for creating a new plugin in a Claude Code marketplace.
Your FIRST and ONLY action right now: Execute the TodoWrite below.
不要凭假设行事,请先阅读本文件。
这是用于在Claude Code市场中创建新插件的结构化工作流指令。
你当前的首要且唯一操作:执行下方的TodoWrite。

⛔ MANDATORY FIRST ACTION: TodoWrite Initialization

⛔ 强制首要操作:TodoWrite初始化

YOUR FIRST ACTION MUST BE the TodoWrite call below.
DO NOT:
  • ❌ Create any directories before TodoWrite
  • ❌ Read marketplace.json before TodoWrite
  • ❌ Ask questions before TodoWrite
  • ❌ Jump to any phase without completing Step 0
你的第一步操作必须是调用下方的TodoWrite。
禁止操作:
  • ❌ 在执行TodoWrite前创建任何目录
  • ❌ 在执行TodoWrite前读取marketplace.json
  • ❌ 在执行Todo前提问
  • ❌ 未完成步骤0就跳转至任何阶段

Step 0.1: Detect Marketplace Root

步骤0.1:检测市场根目录

Before executing TodoWrite, verify you're in a marketplace directory:
bash
/usr/bin/env bash << 'PREFLIGHT_EOF'
执行TodoWrite前,请确认你处于市场目录中:
bash
/usr/bin/env bash << 'PREFLIGHT_EOF'

Check for marketplace.json in cwd

Check for marketplace.json in cwd

if [ -f ".claude-plugin/marketplace.json" ]; then echo "✅ Marketplace detected: $(jq -r .name .claude-plugin/marketplace.json)" else echo "❌ Not a marketplace directory. Run from a marketplace root." exit 1 fi PREFLIGHT_EOF
undefined
if [ -f ".claude-plugin/marketplace.json" ]; then echo "✅ Marketplace detected: $(jq -r .name .claude-plugin/marketplace.json)" else echo "❌ Not a marketplace directory. Run from a marketplace root." exit 1 fi PREFLIGHT_EOF
undefined

Step 0.2: Execute MANDATORY TodoWrite

步骤0.2:执行强制TodoWrite

Execute TodoWrite NOW with this template:
TodoWrite with todos:

- "[Plugin] Phase 0: Detect marketplace root" | in_progress
- "[Plugin] Phase 0: Interactive prompts (name, category, components)" | pending
- "[Plugin] Phase 0: Confirm plugin doesn't exist" | pending
- "[Plugin] Phase 1: Skill → plugin-structure (scaffold)" | pending
- "[Plugin] Phase 1: Create plugin directory + plugin.json" | pending
- "[Plugin] Phase 1: Skill → implement-plan-preflight (ADR)" | pending
- "[Plugin] Phase 2: Skill → skill-architecture (if has-skills)" | pending
- "[Plugin] Phase 2: Skill → hook-development (if has-hooks)" | pending
- "[Plugin] Phase 2: Skill → command-development (if has-commands)" | pending
- "[Plugin] Phase 2: Skill → agent-development (if has-agents)" | pending
- "[Plugin] Phase 2: Agent → skill-reviewer (if skills created)" | pending
- "[Plugin] Phase 3: Add to marketplace.json" | pending
- "[Plugin] Phase 3: Run validate-plugins.mjs" | pending
- "[Plugin] Phase 3: Skill → code-hardcode-audit" | pending
- "[Plugin] Phase 3: Agent → plugin-validator" | pending
- "[Plugin] Phase 4: Git commit (conventional format)" | pending
- "[Plugin] Phase 4: Push to remote" | pending
- "[Plugin] Phase 4: Skill → semantic-release" | pending
After TodoWrite completes, proceed to Phase 0 section below.

立即使用此模板执行TodoWrite:
TodoWrite with todos:

- "[Plugin] Phase 0: Detect marketplace root" | in_progress
- "[Plugin] Phase 0: Interactive prompts (name, category, components)" | pending
- "[Plugin] Phase 0: Confirm plugin doesn't exist" | pending
- "[Plugin] Phase 1: Skill → plugin-structure (scaffold)" | pending
- "[Plugin] Phase 1: Create plugin directory + plugin.json" | pending
- "[Plugin] Phase 1: Skill → implement-plan-preflight (ADR)" | pending
- "[Plugin] Phase 2: Skill → skill-architecture (if has-skills)" | pending
- "[Plugin] Phase 2: Skill → hook-development (if has-hooks)" | pending
- "[Plugin] Phase 2: Skill → command-development (if has-commands)" | pending
- "[Plugin] Phase 2: Skill → agent-development (if has-agents)" | pending
- "[Plugin] Phase 2: Agent → skill-reviewer (if skills created)" | pending
- "[Plugin] Phase 3: Add to marketplace.json" | pending
- "[Plugin] Phase 3: Run validate-plugins.mjs" | pending
- "[Plugin] Phase 3: Skill → code-hardcode-audit" | pending
- "[Plugin] Phase 3: Agent → plugin-validator" | pending
- "[Plugin] Phase 4: Git commit (conventional format)" | pending
- "[Plugin] Phase 4: Push to remote" | pending
- "[Plugin] Phase 4: Skill → semantic-release" | pending
TodoWrite执行完成后,继续阅读下方的阶段0部分。

Quick Reference

快速参考

Skills Invoked (Optimized Sequence)

调用的Skill(优化顺序)

OrderSkillPhasePurposeInvocation
1plugin-structure1Directory & manifest
Skill(plugin-dev:plugin-structure)
2implement-plan-preflight1ADR + Design Spec + Diagrams
Skill(itp:implement-plan-preflight)
3skill-architecture2Create skills (if has-skills)
Skill(plugin-dev:skill-architecture)
4hook-development2Create hooks (if has-hooks)
Skill(plugin-dev:hook-development)
5command-development2Create commands (if has-commands)
Skill(plugin-dev:command-development)
6agent-development2Create agents (if has-agents)
Skill(plugin-dev:agent-development)
7code-hardcode-audit3Quality audit
Skill(itp:code-hardcode-audit)
8plugin-validator3Silent failure audit
Skill(plugin-dev:plugin-validator)
9semantic-release4Version & publish
Skill(itp:semantic-release)
序号Skill阶段用途调用方式
1plugin-structure1目录与清单文件
Skill(plugin-dev:plugin-structure)
2implement-plan-preflight1ADR + 设计规范 + 架构图
Skill(itp:implement-plan-preflight)
3skill-architecture2创建Skill(如果选择了skills模块)
Skill(plugin-dev:skill-architecture)
4hook-development2创建Hook(如果选择了hooks模块)
Skill(plugin-dev:hook-development)
5command-development2创建Command(如果选择了commands模块)
Skill(plugin-dev:command-development)
6agent-development2创建Agent(如果选择了agents模块)
Skill(plugin-dev:agent-development)
7code-hardcode-audit3质量审计
Skill(itp:code-hardcode-audit)
8plugin-validator3静默错误审计
Skill(plugin-dev:plugin-validator)
9semantic-release4版本管理与发布
Skill(itp:semantic-release)

Skills EXCLUDED (Redundant)

排除的Skill(冗余)

SkillReason Excluded
plugin-dev:skill-developmentUse skill-architecture instead (3x more comprehensive)
plugin-dev:plugin-settingsMerged into hook-development
itp:adr-graph-easy-architectInvoked BY implement-plan-preflight (not separately)
Skill排除原因
plugin-dev:skill-development请使用skill-architecture替代(功能完善度高出3倍)
plugin-dev:plugin-settings已合并到hook-development中
itp:adr-graph-easy-architect由implement-plan-preflight内部调用(无需单独调用)

Agents Spawned

生成的Agent

PhaseAgentPurposeInvocation
2skill-reviewerReview skill quality
Task(plugin-dev:skill-reviewer)
3plugin-validatorValidate final structure
Task(plugin-dev:plugin-validator)
阶段Agent用途调用方式
2skill-reviewer评审Skill代码质量
Task(plugin-dev:skill-reviewer)
3plugin-validator验证最终结构
Task(plugin-dev:plugin-validator)

File Locations

文件位置

ArtifactPathNotes
Plugin Directory
plugins/{name}/
Main plugin folder
Plugin Manifest
plugins/{name}/plugin.json
Required manifest
Plugin README
plugins/{name}/README.md
Documentation
Marketplace JSON
.claude-plugin/marketplace.json
Must add plugin entry
ADR
docs/adr/YYYY-MM-DD-{name}.md
Created by preflight skill
Design Spec
docs/design/YYYY-MM-DD-{name}/spec.md
Created by preflight skill

制品路径备注
插件目录
plugins/{name}/
插件主文件夹
插件清单
plugins/{name}/plugin.json
必需的配置文件
插件README
plugins/{name}/README.md
插件文档
市场配置JSON
.claude-plugin/marketplace.json
必须添加插件条目
ADR
docs/adr/YYYY-MM-DD-{name}.md
由preflight skill自动创建
设计规范
docs/design/YYYY-MM-DD-{name}/spec.md
由preflight skill自动创建

Phase 0: Discovery & Validation

阶段0:调研与验证

Detect marketplace root, gather plugin name/category/components via interactive prompts, confirm the plugin does not already exist.
Detailed steps: Phase 0 Reference
检测市场根目录,通过交互式提示收集插件名称/分类/模块信息,确认插件不存在重复。
详细步骤: Phase 0 Reference

Phase 0 Gate

阶段0准入条件

  • Marketplace root detected (
    .claude-plugin/marketplace.json
    exists)
  • Plugin name collected (kebab-case, no spaces)
  • Category selected
  • Components selected (skills/hooks/commands/agents)
  • Plugin directory does NOT exist
  • Plugin NOT in marketplace.json

  • 已检测到市场根目录(
    .claude-plugin/marketplace.json
    存在)
  • 已收集插件名称(kebab-case格式,无空格)
  • 已选择分类
  • 已选择模块(skills/hooks/commands/agents)
  • 插件目录不存在
  • 插件未录入marketplace.json

Phase 1: Scaffold Plugin

阶段1:插件脚手架生成

  1. Invoke
    Skill(plugin-dev:plugin-structure)
    -- directory & manifest patterns
  2. Create plugin directory with component subdirs based on user selections
  3. Generate
    plugin.json
    using marketplace version
  4. Invoke
    Skill(itp:implement-plan-preflight)
    -- creates ADR + Design Spec + diagrams
Detailed steps: Phase 1 Reference
  1. 调用
    Skill(plugin-dev:plugin-structure)
    -- 生成目录与清单模板
  2. 根据用户选择的模块创建插件目录与子目录
  3. 使用市场版本号生成
    plugin.json
  4. 调用
    Skill(itp:implement-plan-preflight)
    -- 创建ADR + 设计规范 + 架构图
详细步骤: Phase 1 Reference

Phase 1 Gate

阶段1准入条件

  • Plugin directory exists:
    plugins/$PLUGIN_NAME/
  • plugin.json created with marketplace version
  • ADR exists:
    docs/adr/$ADR_ID.md
  • Design spec exists:
    docs/design/$ADR_ID/spec.md
  • Both diagrams in ADR (Before/After + Architecture)

  • 插件目录已存在:
    plugins/$PLUGIN_NAME/
  • 已生成带市场版本号的plugin.json
  • ADR已存在:
    docs/adr/$ADR_ID.md
  • 设计规范已存在:
    docs/design/$ADR_ID/spec.md
  • ADR中包含两张架构图(现状/预期对比 + 整体架构)

Phase 2: Component Creation (Conditional)

阶段2:组件开发(条件执行)

Execute ONLY the skills for components the user selected:
ComponentSkill InvocationThen
Skills
Skill(plugin-dev:skill-architecture)
Spawn
Task(plugin-dev:skill-reviewer)
Hooks
Skill(plugin-dev:hook-development)
--
Commands
Skill(plugin-dev:command-development)
--
Agents
Skill(plugin-dev:agent-development)
--
Detailed steps: Phase 2 Reference
仅执行用户选择模块对应的Skill:
组件Skill调用方式后续操作
Skills
Skill(plugin-dev:skill-architecture)
生成
Task(plugin-dev:skill-reviewer)
Hooks
Skill(plugin-dev:hook-development)
--
Commands
Skill(plugin-dev:command-development)
--
Agents
Skill(plugin-dev:agent-development)
--
详细步骤: Phase 2 Reference

Phase 2 Gate

阶段2准入条件

  • All selected components created
  • If skills: skill-reviewer agent completed review
  • Files follow plugin-dev patterns

  • 所有选择的组件已创建完成
  • 如果包含skills:skill-reviewer agent已完成评审
  • 文件符合plugin-dev规范

Phase 3: Registration & Validation

阶段3:注册与验证

  1. Add plugin to
    marketplace.json
    (include
    hooks
    field if hooks exist)
  2. Run
    node scripts/validate-plugins.mjs
    -- expect all-pass
  3. Invoke
    Skill(itp:code-hardcode-audit)
    -- quality audit
  4. Run silent failure audit on all hook entry points
  5. Spawn
    Task(plugin-dev:plugin-validator)
    -- structural validation
Detailed steps: Phase 3 Reference
  1. 将插件添加到
    marketplace.json
    (如果存在hooks模块请包含
    hooks
    字段)
  2. 执行
    node scripts/validate-plugins.mjs
    -- 预期全部校验通过
  3. 调用
    Skill(itp:code-hardcode-audit)
    -- 质量审计
  4. 对所有hook入口执行静默错误审计
  5. 生成
    Task(plugin-dev:plugin-validator)
    -- 结构校验
详细步骤: Phase 3 Reference

Phase 3 Gate

阶段3准入条件

  • Plugin added to marketplace.json
  • validate-plugins.mjs passes
  • code-hardcode-audit passes
  • silent-failure-audit passes (no errors)
  • plugin-validator agent approves

  • 插件已添加到marketplace.json
  • validate-plugins.mjs校验通过
  • code-hardcode-audit校验通过
  • 静默错误审计通过(无报错)
  • plugin-validator agent审核通过

Phase 4: Commit & Release

阶段4:提交与发布

  1. Stage changes: plugin dir, marketplace.json, ADR, design spec
  2. Conventional commit:
    feat($PLUGIN_NAME): add plugin for [brief description]
  3. Push to remote
  4. Invoke
    Skill(itp:semantic-release)
    -- tag, changelog, GitHub release
Detailed steps: Phase 4 Reference
  1. 暂存变更:插件目录、marketplace.json、ADR、设计规范
  2. 约定式提交
    feat($PLUGIN_NAME): add plugin for [brief description]
  3. 推送到远程仓库
  4. 调用
    Skill(itp:semantic-release)
    -- 生成标签、更新日志、GitHub发布
详细步骤: Phase 4 Reference

Phase 4 Success Criteria

阶段4成功标准

  • All changes committed with conventional commit
  • Pushed to remote
  • semantic-release completed
  • New version tag created
  • GitHub release published

  • 所有变更已通过约定式提交上传
  • 已推送到远程仓库
  • semantic-release执行完成
  • 已创建新版本标签
  • GitHub发布已上线

Troubleshooting

问题排查

See Troubleshooting Reference for common issues and fixes.
常见问题与解决方案请查看Troubleshooting Reference