plugin-forge

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

CC Plugin Forge

CC 插件锻造工具

Purpose

用途

Build and manage Claude Code plugins with correct structure, manifests, and marketplace integration. Includes workflows, automation scripts, and reference docs.
构建并管理具有正确结构、清单文件和市场集成的Claude Code插件。包含工作流、自动化脚本和参考文档。

When to Use

适用场景

  • Creating new plugins for a marketplace
  • Adding/modifying plugin components (commands, skills, agents, hooks)
  • Updating plugin versions
  • Working with plugin or marketplace manifests
  • Setting up local plugin testing
  • Publishing plugins
  • 为插件市场创建新插件
  • 添加/修改插件组件(命令、Skill、Agent、钩子)
  • 更新插件版本
  • 处理插件或市场清单文件
  • 设置本地插件测试环境
  • 发布插件

Getting Started

快速开始

Create New Plugin

创建新插件

Use
create_plugin.py
to generate plugin structure:
bash
python scripts/create_plugin.py plugin-name \
  --marketplace-root /path/to/marketplace \
  --author-name "Your Name" \
  --author-email "your.email@example.com" \
  --description "Plugin description" \
  --keywords "keyword1,keyword2" \
  --category "productivity"
This automatically:
  • Creates plugin directory structure
  • Generates
    plugin.json
    manifest
  • Creates README template
  • Updates
    marketplace.json
使用
create_plugin.py
生成插件结构:
bash
python scripts/create_plugin.py plugin-name \
  --marketplace-root /path/to/marketplace \
  --author-name "Your Name" \
  --author-email "your.email@example.com" \
  --description "Plugin description" \
  --keywords "keyword1,keyword2" \
  --category "productivity"
该脚本会自动完成以下操作:
  • 创建插件目录结构
  • 生成
    plugin.json
    清单文件
  • 创建README模板
  • 更新
    marketplace.json

Bump Version

版本更新

Use
bump_version.py
to update versions in both manifests:
bash
python scripts/bump_version.py plugin-name major|minor|patch \
  --marketplace-root /path/to/marketplace
Semantic versioning:
  • major: Breaking changes (1.0.0 → 2.0.0)
  • minor: New features, refactoring (1.0.0 → 1.1.0)
  • patch: Bug fixes, docs (1.0.0 → 1.0.1)
使用
bump_version.py
更新两个清单文件中的版本:
bash
python scripts/bump_version.py plugin-name major|minor|patch \
  --marketplace-root /path/to/marketplace
语义化版本规则:
  • major:破坏性变更(1.0.0 → 2.0.0)
  • minor:新增功能、重构(1.0.0 → 1.1.0)
  • patch:Bug修复、文档更新(1.0.0 → 1.0.1)

Development Workflow

开发工作流

1. Create Structure

1. 创建目录结构

Manual approach (if not using script):
bash
mkdir -p plugins/plugin-name/.claude-plugin
mkdir -p plugins/plugin-name/commands
mkdir -p plugins/plugin-name/skills
手动创建方式(不使用脚本时):
bash
mkdir -p plugins/plugin-name/.claude-plugin
mkdir -p plugins/plugin-name/commands
mkdir -p plugins/plugin-name/skills

2. Plugin Manifest

2. 插件清单文件

File:
plugins/plugin-name/.claude-plugin/plugin.json
json
{
  "name": "plugin-name",
  "version": "0.1.0",
  "description": "Plugin description",
  "author": {
    "name": "Your Name",
    "email": "your.email@example.com"
  },
  "keywords": ["keyword1", "keyword2"]
}
文件路径:
plugins/plugin-name/.claude-plugin/plugin.json
json
{
  "name": "plugin-name",
  "version": "0.1.0",
  "description": "Plugin description",
  "author": {
    "name": "Your Name",
    "email": "your.email@example.com"
  },
  "keywords": ["keyword1", "keyword2"]
}

3. Register in Marketplace

3. 在市场中注册

Update
.claude-plugin/marketplace.json
:
json
{
  "name": "plugin-name",
  "source": "./plugins/plugin-name",
  "description": "Plugin description",
  "version": "0.1.0",
  "keywords": ["keyword1", "keyword2"],
  "category": "productivity"
}
更新
.claude-plugin/marketplace.json
json
{
  "name": "plugin-name",
  "source": "./plugins/plugin-name",
  "description": "Plugin description",
  "version": "0.1.0",
  "keywords": ["keyword1", "keyword2"],
  "category": "productivity"
}

4. Add Components

4. 添加组件

Create in respective directories:
ComponentLocationFormat
Commands
commands/
Markdown with frontmatter
Skills
skills/<name>/
Directory with
SKILL.md
Agents
agents/
Markdown definitions
Hooks
hooks/hooks.json
Event handlers
MCP Servers
.mcp.json
External integrations
在对应目录中创建组件:
组件位置格式
命令
commands/
带前置元数据的Markdown文件
Skill
skills/<name>/
包含
SKILL.md
的目录
Agent
agents/
Markdown定义文件
钩子
hooks/hooks.json
事件处理器
MCP服务器
.mcp.json
外部集成配置

5. Local Testing

5. 本地测试

bash
undefined
bash
undefined

Add marketplace

添加插件市场

/plugin marketplace add /path/to/marketplace-root
/plugin marketplace add /path/to/marketplace-root

Install plugin

安装插件

/plugin install plugin-name@marketplace-name
/plugin install plugin-name@marketplace-name

After changes: reinstall

修改后:重新安装

/plugin uninstall plugin-name@marketplace-name /plugin install plugin-name@marketplace-name
undefined
/plugin uninstall plugin-name@marketplace-name /plugin install plugin-name@marketplace-name
undefined

Plugin Patterns

插件模式

Framework Plugin

框架插件

For framework-specific guidance (React, Vue, etc.):
plugins/framework-name/
├── .claude-plugin/plugin.json
├── skills/
│   └── framework-name/
│       ├── SKILL.md
│       └── references/
├── commands/
│   └── prime/
│       ├── components.md
│       └── framework.md
└── README.md
针对特定框架(React、Vue等)的插件结构:
plugins/framework-name/
├── .claude-plugin/plugin.json
├── skills/
│   └── framework-name/
│       ├── SKILL.md
│       └── references/
├── commands/
│   └── prime/
│       ├── components.md
│       └── framework.md
└── README.md

Utility Plugin

实用工具插件

For tools and commands:
plugins/utility-name/
├── .claude-plugin/plugin.json
├── commands/
│   ├── action1.md
│   └── action2.md
└── README.md
针对工具和命令的插件结构:
plugins/utility-name/
├── .claude-plugin/plugin.json
├── commands/
│   ├── action1.md
│   └── action2.md
└── README.md

Domain Plugin

领域专属插件

For domain-specific knowledge:
plugins/domain-name/
├── .claude-plugin/plugin.json
├── skills/
│   └── domain-name/
│       ├── SKILL.md
│       ├── references/
│       └── scripts/
└── README.md
针对特定领域知识的插件结构:
plugins/domain-name/
├── .claude-plugin/plugin.json
├── skills/
│   └── domain-name/
│       ├── SKILL.md
│       ├── references/
│       └── scripts/
└── README.md

Command Naming

命令命名规则

Subdirectory-based namespacing with
:
separator:
  • commands/namespace/command.md
    /namespace:command
  • commands/simple.md
    /simple
Examples:
  • commands/prime/vue.md
    /prime:vue
  • commands/docs/generate.md
    /docs:generate
基于子目录的命名空间,使用
:
作为分隔符:
  • commands/namespace/command.md
    /namespace:command
  • commands/simple.md
    /simple
示例:
  • commands/prime/vue.md
    /prime:vue
  • commands/docs/generate.md
    /docs:generate

Version Management

版本管理

Important: Update version in BOTH locations:
  1. plugins/<name>/.claude-plugin/plugin.json
  2. .claude-plugin/marketplace.json
Use
bump_version.py
to automate.
重要提示: 需要在两个位置同时更新版本:
  1. plugins/<name>/.claude-plugin/plugin.json
  2. .claude-plugin/marketplace.json
使用
bump_version.py
脚本可自动完成该操作。

Git Commits

Git提交规范

Use conventional commits:
bash
git commit -m "feat: add new plugin"
git commit -m "fix: correct plugin manifest"
git commit -m "docs: update plugin README"
git commit -m "feat!: breaking change"
使用约定式提交格式:
bash
git commit -m "feat: add new plugin"
git commit -m "fix: correct plugin manifest"
git commit -m "docs: update plugin README"
git commit -m "feat!: breaking change"

Reference Docs

参考文档

Detailed documentation included:
ReferenceContent
references/plugin-structure.md
Directory structure, manifest schema, components
references/marketplace-schema.md
Marketplace format, plugin entries, distribution
references/workflows.md
Step-by-step workflows, patterns, publishing
包含以下详细文档:
参考文档内容
references/plugin-structure.md
目录结构、清单文件 Schema、组件说明
references/marketplace-schema.md
市场格式、插件条目、分发说明
references/workflows.md
分步工作流、插件模式、发布指南

Scripts

脚本说明

ScriptPurpose
scripts/create_plugin.py
Scaffold new plugin
scripts/bump_version.py
Update versions
脚本用途
scripts/create_plugin.py
快速搭建新插件脚手架
scripts/bump_version.py
更新插件版本
undefined