Meta-skill for creating new Claude Code skills with configurable execution modes.
Architecture Overview
┌─────────────────────────────────────────────────────────────────┐
│ Skill Generator Architecture │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ⚠️ Phase 0: Specification → 阅读并理解设计规范 (强制前置) │
│ Study SKILL-DESIGN-SPEC.md + 模板 │
│ ↓ │
│ Phase 1: Requirements → skill-config.json │
│ Discovery (name, type, mode, agents) │
│ ↓ │
│ Phase 2: Structure → 目录结构 + 核心文件骨架 │
│ Generation │
│ ↓ │
│ Phase 3: Phase → phases/*.md (根据 mode 生成) │
│ Generation Sequential | Autonomous │
│ ↓ │
│ Phase 4: Specs & → specs/*.md + templates/*.md │
│ Templates │
│ ↓ │
│ Phase 5: Validation → 验证完整性 + 生成使用说明 │
│ & Documentation │
│ │
└─────────────────────────────────────────────────────────────────┘
Execution Modes
Mode 1: Sequential (fixed order)
Traditional linear execution mode, where phases are executed in order of their numeric prefixes.
Phase 01 → Phase 02 → Phase 03 → ... → Phase N
Applicable scenarios:
- Pipeline-style tasks (collect → analyze → generate)
- Strong dependencies between phases
- Fixed output structure
Example: software-manual, copyright-docs
Mode 2: Autonomous (stateless autonomous selection)
Intelligent routing mode, dynamically selecting the execution path based on context.
┌─────────────────────────────────────────┐
│ Orchestrator Agent │
│ (读取状态 → 选择 Phase → 执行 → 更新) │
└───────────────┬─────────────────────────┘
│
┌───────────┼───────────┐
↓ ↓ ↓
┌───────┐ ┌───────┐ ┌───────┐
│Phase A│ │Phase B│ │Phase C│
│(独立) │ │(独立) │ │(独立) │
└───────┘ └───────┘ └───────┘
Applicable scenarios:
- Interactive tasks (dialogue, Q&A)
- No strong dependencies between phases
- Need to dynamically respond to user intent
Example: issue-manage, workflow-debug
Key Design Principles
- Mode awareness: automatically recommends the execution mode based on task characteristics
- Skeleton generation: generates the complete directory structure and file skeleton
- Specification compliance: strictly follows
_shared/SKILL-DESIGN-SPEC.md - Extensibility: the generated Skill is easy to extend and modify
⚠️ Mandatory Prerequisites (mandatory prerequisites)
⛔ Skipping prohibited: before performing any generation operation,mustfully read the following documents. Generating directly without reading the specifications will result in output that does not meet quality standards.
Core specifications (required reading)
| Document | Purpose | Priority |
|---|---|---|
| ../_shared/SKILL-DESIGN-SPEC.md | General design specification - defines the structure, naming, and quality standards of all Skills | P0 - Highest |
Template files (required reading before generation)
| Document | Purpose |
|---|---|
| templates/skill-md.md | SKILL.md entry file template |
| templates/sequential-phase.md | Sequential Phase template |
| templates/autonomous-orchestrator.md | Autonomous orchestrator template |
| templates/autonomous-action.md | Autonomous Action template |
| templates/code-analysis-action.md | Code analysis Action template |
| templates/llm-action.md | LLM Action template |
| templates/script-bash.md | Bash script template |
| templates/script-python.md | Python script template |
Specification documents (read as needed)
| Document | Purpose |
|---|---|
| specs/execution-modes.md | Execution mode specification |
| specs/skill-requirements.md | Skill requirements specification |
| specs/cli-integration.md | CLI integration specification |
| specs/scripting-integration.md | Script integration specification |
Phase execution guide (reference during execution)
| Document | Purpose |
|---|---|
| phases/01-requirements-discovery.md | Collect Skill requirements |
| phases/02-structure-generation.md | Generate directory structure |
| phases/03-phase-generation.md | Generate Phase files |
| phases/04-specs-templates.md | Generate specifications and templates |
| phases/05-validation.md | Validate and document |
Execution Flow
┌─────────────────────────────────────────────────────────────────┐
│ ⚠️ Phase 0: Specification Study (强制前置 - 禁止跳过) │
│ → Read: ../_shared/SKILL-DESIGN-SPEC.md (通用设计规范) │
│ → Read: templates/*.md (所有相关模板文件) │
│ → 理解: Skill 结构规范、命名约定、质量标准 │
│ → Output: 内化规范要求,确保后续生成符合标准 │
│ ⛔ 未完成 Phase 0 禁止进入 Phase 1 │
├─────────────────────────────────────────────────────────────────┤
│ Phase 1: Requirements Discovery │
│ → AskUserQuestion: Skill 名称、目标、执行模式 │
│ → Output: skill-config.json │
├─────────────────────────────────────────────────────────────────┤
│ Phase 2: Structure Generation │
│ → 创建目录结构: phases/, specs/, templates/, scripts/ │
│ → 生成 SKILL.md 入口文件 │
│ → Output: 完整目录结构 │
├─────────────────────────────────────────────────────────────────┤
│ Phase 3: Phase Generation │
│ → Sequential: 生成 01-xx.md, 02-xx.md, ... │
│ → Autonomous: 生成 orchestrator.md + actions/*.md │
│ → Output: phases/*.md │
├─────────────────────────────────────────────────────────────────┤
│ Phase 4: Specs & Templates │
│ → 生成领域规范: specs/{domain}-requirements.md │
│ → 生成质量标准: specs/quality-standards.md │
│ → 生成模板: templates/agent-base.md │
│ → Output: specs/*.md, templates/*.md │
├─────────────────────────────────────────────────────────────────┤
│ Phase 5: Validation & Documentation │
│ → 验证文件完整性 │
│ → 生成 README.md 使用说明 │
│ → Output: 验证报告 + README.md │
└─────────────────────────────────────────────────────────────────┘
Directory Setup
const skillName = config.skill_name;
const skillDir = `.claude/skills/${skillName}`;
// 创建目录结构
Bash(`mkdir -p "${skillDir}/phases"`);
Bash(`mkdir -p "${skillDir}/specs"`);
Bash(`mkdir -p "${skillDir}/templates"`);
// Autonomous 模式额外目录
if (config.execution_mode === 'autonomous') {
Bash(`mkdir -p "${skillDir}/phases/actions"`);
}
Output Structure
Sequential Mode
.claude/skills/{skill-name}/
├── SKILL.md
├── phases/
│ ├── 01-{step-one}.md
│ ├── 02-{step-two}.md
│ └── 03-{step-three}.md
├── specs/
│ ├── {domain}-requirements.md
│ └── quality-standards.md
└── templates/
└── agent-base.md
Autonomous Mode
.claude/skills/{skill-name}/
├── SKILL.md
├── phases/
│ ├── orchestrator.md # 编排器:读取状态 → 选择动作
│ ├── state-schema.md # 状态结构定义
│ └── actions/ # 独立动作(无顺序)
│ ├── action-{a}.md
│ ├── action-{b}.md
│ └── action-{c}.md
├── specs/
│ ├── {domain}-requirements.md
│ ├── action-catalog.md # 动作目录(描述、前置条件、效果)
│ └── quality-standards.md
└── templates/
├── orchestrator-base.md # 编排器模板
└── action-base.md # 动作模板