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
undefinedif [ -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
undefinedStep 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" | pendingAfter 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" | pendingTodoWrite执行完成后,继续阅读下方的阶段0部分。
Quick Reference
快速参考
Skills Invoked (Optimized Sequence)
调用的Skill(优化顺序)
| Order | Skill | Phase | Purpose | Invocation |
|---|---|---|---|---|
| 1 | plugin-structure | 1 | Directory & manifest | |
| 2 | implement-plan-preflight | 1 | ADR + Design Spec + Diagrams | |
| 3 | skill-architecture | 2 | Create skills (if has-skills) | |
| 4 | hook-development | 2 | Create hooks (if has-hooks) | |
| 5 | command-development | 2 | Create commands (if has-commands) | |
| 6 | agent-development | 2 | Create agents (if has-agents) | |
| 7 | code-hardcode-audit | 3 | Quality audit | |
| 8 | plugin-validator | 3 | Silent failure audit | |
| 9 | semantic-release | 4 | Version & publish | |
| 序号 | Skill | 阶段 | 用途 | 调用方式 |
|---|---|---|---|---|
| 1 | plugin-structure | 1 | 目录与清单文件 | |
| 2 | implement-plan-preflight | 1 | ADR + 设计规范 + 架构图 | |
| 3 | skill-architecture | 2 | 创建Skill(如果选择了skills模块) | |
| 4 | hook-development | 2 | 创建Hook(如果选择了hooks模块) | |
| 5 | command-development | 2 | 创建Command(如果选择了commands模块) | |
| 6 | agent-development | 2 | 创建Agent(如果选择了agents模块) | |
| 7 | code-hardcode-audit | 3 | 质量审计 | |
| 8 | plugin-validator | 3 | 静默错误审计 | |
| 9 | semantic-release | 4 | 版本管理与发布 | |
Skills EXCLUDED (Redundant)
排除的Skill(冗余)
| Skill | Reason Excluded |
|---|---|
| plugin-dev:skill-development | Use skill-architecture instead (3x more comprehensive) |
| plugin-dev:plugin-settings | Merged into hook-development |
| itp:adr-graph-easy-architect | Invoked 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
| Phase | Agent | Purpose | Invocation |
|---|---|---|---|
| 2 | skill-reviewer | Review skill quality | |
| 3 | plugin-validator | Validate final structure | |
| 阶段 | Agent | 用途 | 调用方式 |
|---|---|---|---|
| 2 | skill-reviewer | 评审Skill代码质量 | |
| 3 | plugin-validator | 验证最终结构 | |
File Locations
文件位置
| Artifact | Path | Notes |
|---|---|---|
| Plugin Directory | | Main plugin folder |
| Plugin Manifest | | Required manifest |
| Plugin README | | Documentation |
| Marketplace JSON | | Must add plugin entry |
| ADR | | Created by preflight skill |
| Design Spec | | Created by preflight skill |
| 制品 | 路径 | 备注 |
|---|---|---|
| 插件目录 | | 插件主文件夹 |
| 插件清单 | | 必需的配置文件 |
| 插件README | | 插件文档 |
| 市场配置JSON | | 必须添加插件条目 |
| ADR | | 由preflight skill自动创建 |
| 设计规范 | | 由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 (exists)
.claude-plugin/marketplace.json - 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:插件脚手架生成
- Invoke -- directory & manifest patterns
Skill(plugin-dev:plugin-structure) - Create plugin directory with component subdirs based on user selections
- Generate using marketplace version
plugin.json - Invoke -- creates ADR + Design Spec + diagrams
Skill(itp:implement-plan-preflight)
Detailed steps: Phase 1 Reference
- 调用-- 生成目录与清单模板
Skill(plugin-dev:plugin-structure) - 根据用户选择的模块创建插件目录与子目录
- 使用市场版本号生成
plugin.json - 调用-- 创建ADR + 设计规范 + 架构图
Skill(itp:implement-plan-preflight)
详细步骤: 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:
| Component | Skill Invocation | Then |
|---|---|---|
| Skills | | Spawn |
| Hooks | | -- |
| Commands | | -- |
| Agents | | -- |
Detailed steps: Phase 2 Reference
仅执行用户选择模块对应的Skill:
| 组件 | Skill调用方式 | 后续操作 |
|---|---|---|
| Skills | | 生成 |
| Hooks | | -- |
| Commands | | -- |
| Agents | | -- |
详细步骤: 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:注册与验证
- Add plugin to (include
marketplace.jsonfield if hooks exist)hooks - Run -- expect all-pass
node scripts/validate-plugins.mjs - Invoke -- quality audit
Skill(itp:code-hardcode-audit) - Run silent failure audit on all hook entry points
- Spawn -- structural validation
Task(plugin-dev:plugin-validator)
Detailed steps: Phase 3 Reference
- 将插件添加到(如果存在hooks模块请包含
marketplace.json字段)hooks - 执行-- 预期全部校验通过
node scripts/validate-plugins.mjs - 调用-- 质量审计
Skill(itp:code-hardcode-audit) - 对所有hook入口执行静默错误审计
- 生成-- 结构校验
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:提交与发布
- Stage changes: plugin dir, marketplace.json, ADR, design spec
- Conventional commit:
feat($PLUGIN_NAME): add plugin for [brief description] - Push to remote
- Invoke -- tag, changelog, GitHub release
Skill(itp:semantic-release)
Detailed steps: Phase 4 Reference
- 暂存变更:插件目录、marketplace.json、ADR、设计规范
- 约定式提交:
feat($PLUGIN_NAME): add plugin for [brief description] - 推送到远程仓库
- 调用-- 生成标签、更新日志、GitHub发布
Skill(itp:semantic-release)
详细步骤: 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。