skill-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Generator

Skill Generator

Meta-skill for creating new Claude Code skills with configurable execution modes.
一款用于创建新Claude Code技能的元技能,支持可配置的执行模式。

Architecture Overview

架构概述

┌─────────────────────────────────────────────────────────────────┐
│                    Skill Generator                               │
│                                                                  │
│  Input: User Request (skill name, purpose, mode)                │
│                         ↓                                        │
│  ┌─────────────────────────────────────────────────────────┐    │
│  │  Phase 0-5: Sequential Pipeline                          │    │
│  │  ┌────┐ ┌────┐ ┌────┐ ┌────┐ ┌────┐ ┌────┐             │    │
│  │  │ P0 │→│ P1 │→│ P2 │→│ P3 │→│ P4 │→│ P5 │             │    │
│  │  │Spec│ │Req │ │Dir │ │Gen │ │Spec│ │Val │             │    │
│  │  └────┘ └────┘ └────┘ └─┬──┘ └────┘ └────┘             │    │
│  │                         │                                │    │
│  │                    ┌────┴────┐                           │    │
│  │                    ↓         ↓                           │    │
│  │              Sequential  Autonomous                      │    │
│  │              (phases/)   (actions/)                      │    │
│  └─────────────────────────────────────────────────────────┘    │
│                         ↓                                        │
│  Output: .claude/skills/{skill-name}/ (complete package)        │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│                    Skill Generator                               │
│                                                                  │
│  输入: 用户请求(技能名称、用途、模式)                │
│                         ↓                                        │
│  ┌─────────────────────────────────────────────────────────┐    │
│  │  阶段0-5: 顺序执行流水线                          │    │
│  │  ┌────┐ ┌────┐ ┌────┐ ┌────┐ ┌────┐ ┌────┐             │    │
│  │  │ P0 │→│ P1 │→│ P2 │→│ P3 │→│ P4 │→│ P5 │             │    │
│  │  │Spec│ │Req │ │Dir │ │Gen │ │Spec│ │Val │             │    │
│  │  └────┘ └────┘ └────┘ └─┬──┘ └────┘ └────┘             │    │
│  │                         │                                │    │
│  │                    ┌────┴────┐                           │    │
│  │                    ↓         ↓                           │    │
│  │              Sequential  Autonomous                      │    │
│  │              (phases/)   (actions/)                      │    │
│  └─────────────────────────────────────────────────────────┘    │
│                         ↓                                        │
│  输出: .claude/skills/{skill-name}/ (完整技能包)        │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Execution Modes

执行模式

Mode 1: Sequential (Fixed Order)

模式1: Sequential(固定顺序)

Traditional linear execution model, phases execute in numeric prefix order.
Phase 01 -> Phase 02 -> Phase 03 -> ... -> Phase N
Use Cases:
  • Pipeline tasks (collect -> analyze -> generate)
  • Strong dependencies between phases
  • Fixed output structure
Examples:
software-manual
,
copyright-docs
传统线性执行模型,阶段按数字前缀顺序执行。
Phase 01 -> Phase 02 -> Phase 03 -> ... -> Phase N
适用场景:
  • 流水线任务(收集→分析→生成)
  • 阶段间存在强依赖关系
  • 需要固定输出结构
示例:
software-manual
,
copyright-docs

Mode 2: Autonomous (Stateless Auto-Select)

模式2: Autonomous(无状态自动选择)

Intelligent routing model, dynamically selects execution path based on context.
---------------------------------------------------
                Orchestrator Agent
   (Read state -> Select Phase -> Execute -> Update)
---------------------------------------------------
                |
    ---------+----------+----------
    |        |          |
  Phase A   Phase B    Phase C
  (standalone)  (standalone)  (standalone)
Use Cases:
  • Interactive tasks (chat, Q&A)
  • No strong dependencies between phases
  • Dynamic user intent response required
Examples:
issue-manage
,
workflow-debug
智能路由模型,根据上下文动态选择执行路径。
---------------------------------------------------
                Orchestrator Agent
   (读取状态 → 选择阶段 → 执行 → 更新状态)
---------------------------------------------------
                |
    ---------+----------+----------
    |        |          |
  Phase A   Phase B    Phase C
  (独立执行)  (独立执行)  (独立执行)
适用场景:
  • 交互式任务(聊天、问答)
  • 阶段间无强依赖关系
  • 需要响应用户动态意图
示例:
issue-manage
,
workflow-debug

Key Design Principles

核心设计原则

  1. Mode Awareness: Automatically recommend execution mode based on task characteristics
  2. Skeleton Generation: Generate complete directory structure and file skeletons
  3. Standards Compliance: Strictly follow
    _shared/SKILL-DESIGN-SPEC.md
  4. Extensibility: Generated Skills are easy to extend and modify

  1. 模式感知: 根据任务特性自动推荐执行模式
  2. 骨架生成: 生成完整的目录结构和文件骨架
  3. 标准合规: 严格遵循
    _shared/SKILL-DESIGN-SPEC.md
    规范
  4. 可扩展性: 生成的技能易于扩展和修改

Required Prerequisites

必要前置条件

IMPORTANT: Before any generation operation, read the following specification documents. Generating without understanding these standards will result in non-conforming output.
重要提示:在执行任何生成操作前,请阅读以下规范文档。若不了解这些标准,生成的内容将不符合要求。

Core Specifications (Mandatory Read)

核心规范(必读)

DocumentPurposePriority
../_shared/SKILL-DESIGN-SPEC.mdUniversal design spec - defines structure, naming, quality standards for all SkillsP0 - Critical
specs/reference-docs-spec.mdReference document generation spec - ensures generated Skills have proper phase-based Reference Documents with usage timing guidanceP0 - Critical
文档用途优先级
../_shared/SKILL-DESIGN-SPEC.md通用设计规范 - 定义所有技能的结构、命名和质量标准P0 - 关键
specs/reference-docs-spec.md参考文档生成规范 - 确保生成的技能具备基于阶段的参考文档及使用时机指引P0 - 关键

Template Files (Read Before Generation)

模板文件(生成前阅读)

DocumentPurpose
templates/skill-md.mdSKILL.md entry file template
templates/sequential-phase.mdSequential Phase template
templates/autonomous-orchestrator.mdAutonomous Orchestrator template
templates/autonomous-action.mdAutonomous Action template
templates/code-analysis-action.mdCode Analysis Action template
templates/llm-action.mdLLM Action template
templates/script-template.mdUnified Script Template (Bash + Python)
文档用途
templates/skill-md.mdSKILL.md入口文件模板
templates/sequential-phase.mdSequential阶段模板
templates/autonomous-orchestrator.mdAutonomous编排器模板
templates/autonomous-action.mdAutonomous动作模板
templates/code-analysis-action.md代码分析动作模板
templates/llm-action.mdLLM动作模板
templates/script-template.md统一脚本模板(Bash + Python)

Specification Documents (Read as Needed)

规范文档(按需阅读)

DocumentPurpose
specs/execution-modes.mdExecution Modes Specification
specs/skill-requirements.mdSkill Requirements Specification
specs/cli-integration.mdCLI Integration Specification
specs/scripting-integration.mdScript Integration Specification
文档用途
specs/execution-modes.md执行模式规范
specs/skill-requirements.md技能需求规范
specs/cli-integration.mdCLI集成规范
specs/scripting-integration.md脚本集成规范

Phase Execution Guides (Reference During Execution)

阶段执行指南(执行时参考)

DocumentPurpose
phases/01-requirements-discovery.mdCollect Skill Requirements
phases/02-structure-generation.mdGenerate Directory Structure
phases/03-phase-generation.mdGenerate Phase Files
phases/04-specs-templates.mdGenerate Specs and Templates
phases/05-validation.mdValidation and Documentation

文档用途
phases/01-requirements-discovery.md收集技能需求
phases/02-structure-generation.md生成目录结构
phases/03-phase-generation.md生成阶段文件
phases/04-specs-templates.md生成规范和模板
phases/05-validation.md验证和文档编制

Execution Flow

执行流程

Input Parsing:
   └─ Convert user request to structured format (skill-name/purpose/mode)

Phase 0: Specification Study (MANDATORY - Must complete before proceeding)
   - Read specification documents
   - Load: ../_shared/SKILL-DESIGN-SPEC.md
   - Load: All templates/*.md files
   - Understand: Structure rules, naming conventions, quality standards
   - Output: Internalized requirements (in-memory, no file output)
   - Validation: MUST complete before Phase 1

Phase 1: Requirements Discovery
   - Gather skill requirements via user interaction
   - Tool: AskUserQuestion
   - Collect: Skill name, purpose, execution mode
   - Collect: Phase/Action definition
   - Collect: Tool dependencies, output format
   - Process: Generate configuration object
   - Output: skill-config.json
   - Contains: skill_name, execution_mode, phases/actions, allowed_tools

Phase 2: Structure Generation
   - Create directory structure and entry file
   - Input: skill-config.json (from Phase 1)
   - Tool: Bash
   - Execute: mkdir -p .claude/skills/{skill-name}/{phases,specs,templates,scripts}
   - Tool: Write
   - Generate: SKILL.md (entry point with architecture diagram)
   - Output: Complete directory structure

Phase 3: Phase/Action Generation
   - Decision (execution_mode check):
   - IF execution_mode === "sequential": Generate Sequential Phases
   - Read template: templates/sequential-phase.md
   - Loop: For each phase in config.sequential_config.phases
   - Generate: phases/{phase-id}.md
   - Link: Previous phase output -> Current phase input
   - Write: phases/_orchestrator.md
   - Write: workflow.json
   - Output: phases/01-{name}.md, phases/02-{name}.md, ...

   - ELSE IF execution_mode === "autonomous": Generate Orchestrator + Actions
   - Read template: templates/autonomous-orchestrator.md
   - Write: phases/state-schema.md
   - Write: phases/orchestrator.md
   - Write: specs/action-catalog.md
   - Loop: For each action in config.autonomous_config.actions
   - Read template: templates/autonomous-action.md
   - Generate: phases/actions/{action-id}.md
   - Output: phases/orchestrator.md, phases/actions/*.md

Phase 4: Specs & Templates
   - Generate domain specifications and templates
   - Input: skill-config.json (domain context)
   - Reference: [specs/reference-docs-spec.md](specs/reference-docs-spec.md) for document organization
   - Tool: Write
   - Generate: specs/{domain}-requirements.md
   - Generate: specs/quality-standards.md
   - Generate: templates/agent-base.md (if needed)
   - Output: Domain-specific documentation

Phase 5: Validation & Documentation
   - Verify completeness and generate usage guide
   - Input: All generated files from previous phases
   - Tool: Glob + Read
   - Check: Required files exist and contain proper structure
   - Tool: Write
   - Generate: README.md (usage instructions)
   - Generate: validation-report.json (completeness check)
   - Output: Final documentation
Execution Protocol:
javascript
// Phase 0: Read specifications (in-memory)
Read('.claude/skills/_shared/SKILL-DESIGN-SPEC.md');
Read('.claude/skills/skill-generator/templates/*.md'); // All templates

// Phase 1: Gather requirements
const answers = AskUserQuestion({
  questions: [
    { question: "Skill name?", header: "Name", options: [...] },
    { question: "Execution mode?", header: "Mode", options: ["Sequential", "Autonomous"] }
  ]
});

const config = generateConfig(answers);
const workDir = `.workflow/.scratchpad/skill-gen-${timestamp}`;
Write(`${workDir}/skill-config.json`, JSON.stringify(config));

// Phase 2: Create structure
const skillDir = `.claude/skills/${config.skill_name}`;
Bash(`mkdir -p "${skillDir}/phases" "${skillDir}/specs" "${skillDir}/templates"`);
Write(`${skillDir}/SKILL.md`, generateSkillEntry(config));

// Phase 3: Generate phases (mode-dependent)
if (config.execution_mode === 'sequential') {
  Write(`${skillDir}/phases/_orchestrator.md`, generateOrchestrator(config));
  Write(`${skillDir}/workflow.json`, generateWorkflowDef(config));
  config.sequential_config.phases.forEach(phase => {
    Write(`${skillDir}/phases/${phase.id}.md`, generatePhase(phase, config));
  });
} else {
  Write(`${skillDir}/phases/orchestrator.md`, generateAutonomousOrchestrator(config));
  Write(`${skillDir}/phases/state-schema.md`, generateStateSchema(config));
  config.autonomous_config.actions.forEach(action => {
    Write(`${skillDir}/phases/actions/${action.id}.md`, generateAction(action, config));
  });
}

// Phase 4: Generate specs
Write(`${skillDir}/specs/${config.skill_name}-requirements.md`, generateRequirements(config));
Write(`${skillDir}/specs/quality-standards.md`, generateQualityStandards(config));


// Phase 5: Validate & Document
const validation = validateStructure(skillDir);
Write(`${skillDir}/validation-report.json`, JSON.stringify(validation));
Write(`${skillDir}/README.md`, generateReadme(config, validation));

输入解析:
   └─ 将用户请求转换为结构化格式(技能名称/用途/模式)

阶段0: 规范学习(必填 - 必须完成后才能进入下一阶段)
   - 阅读规范文档
   - 加载: ../_shared/SKILL-DESIGN-SPEC.md
   - 加载: 所有templates/*.md文件
   - 理解: 结构规则、命名约定、质量标准
   - 输出: 内化的需求(仅在内存中,无文件输出)
   - 验证: 必须在阶段1前完成

阶段1: 需求探索
   - 通过用户交互收集技能需求
   - 工具: AskUserQuestion
   - 收集: 技能名称、用途、执行模式
   - 收集: 阶段/动作定义
   - 收集: 工具依赖、输出格式
   - 处理: 生成配置对象
   - 输出: skill-config.json
   - 包含: skill_name, execution_mode, phases/actions, allowed_tools

阶段2: 结构生成
   - 创建目录结构和入口文件
   - 输入: skill-config.json(来自阶段1)
   - 工具: Bash
   - 执行: mkdir -p .claude/skills/{skill-name}/{phases,specs,templates,scripts}
   - 工具: Write
   - 生成: SKILL.md(含架构图的入口文件)
   - 输出: 完整目录结构

阶段3: 阶段/动作生成
   - 决策(检查execution_mode):
   - 若execution_mode === "sequential": 生成Sequential阶段
   - 读取模板: templates/sequential-phase.md
   - 循环: 遍历config.sequential_config.phases中的每个阶段
   - 生成: phases/{phase-id}.md
   - 关联: 前一阶段输出 → 当前阶段输入
   - 写入: phases/_orchestrator.md
   - 写入: workflow.json
   - 输出: phases/01-{name}.md, phases/02-{name}.md, ...

   - 若execution_mode === "autonomous": 生成编排器+动作
   - 读取模板: templates/autonomous-orchestrator.md
   - 写入: phases/state-schema.md
   - 写入: phases/orchestrator.md
   - 写入: specs/action-catalog.md
   - 循环: 遍历config.autonomous_config.actions中的每个动作
   - 读取模板: templates/autonomous-action.md
   - 生成: phases/actions/{action-id}.md
   - 输出: phases/orchestrator.md, phases/actions/*.md

阶段4: 规范与模板生成
   - 生成领域特定规范和模板
   - 输入: skill-config.json(领域上下文)
   - 参考: [specs/reference-docs-spec.md](specs/reference-docs-spec.md)的文档组织规范
   - 工具: Write
   - 生成: specs/{domain}-requirements.md
   - 生成: specs/quality-standards.md
   - 生成: templates/agent-base.md(按需)
   - 输出: 领域特定文档

阶段5: 验证与文档编制
   - 验证完整性并生成使用指南
   - 输入: 前序阶段生成的所有文件
   - 工具: Glob + Read
   - 检查: 必要文件是否存在且结构正确
   - 工具: Write
   - 生成: README.md(使用说明)
   - 生成: validation-report.json(完整性检查报告)
   - 输出: 最终文档
执行协议:
javascript
// Phase 0: 读取规范(内存中处理)
Read('.claude/skills/_shared/SKILL-DESIGN-SPEC.md');
Read('.claude/skills/skill-generator/templates/*.md'); // 所有模板

// Phase 1: 收集需求
const answers = AskUserQuestion({
  questions: [
    { question: "Skill name?", header: "Name", options: [...] },
    { question: "Execution mode?", header: "Mode", options: ["Sequential", "Autonomous"] }
  ]
});

const config = generateConfig(answers);
const workDir = `.workflow/.scratchpad/skill-gen-${timestamp}`;
Write(`${workDir}/skill-config.json`, JSON.stringify(config));

// Phase 2: 创建结构
const skillDir = `.claude/skills/${config.skill_name}`;
Bash(`mkdir -p "${skillDir}/phases" "${skillDir}/specs" "${skillDir}/templates"`);
Write(`${skillDir}/SKILL.md`, generateSkillEntry(config));

// Phase 3: 生成阶段(依赖执行模式)
if (config.execution_mode === 'sequential') {
  Write(`${skillDir}/phases/_orchestrator.md`, generateOrchestrator(config));
  Write(`${skillDir}/workflow.json`, generateWorkflowDef(config));
  config.sequential_config.phases.forEach(phase => {
    Write(`${skillDir}/phases/${phase.id}.md`, generatePhase(phase, config));
  });
} else {
  Write(`${skillDir}/phases/orchestrator.md`, generateAutonomousOrchestrator(config));
  Write(`${skillDir}/phases/state-schema.md`, generateStateSchema(config));
  config.autonomous_config.actions.forEach(action => {
    Write(`${skillDir}/phases/actions/${action.id}.md`, generateAction(action, config));
  });
}

// Phase 4: 生成规范文档
Write(`${skillDir}/specs/${config.skill_name}-requirements.md`, generateRequirements(config));
Write(`${skillDir}/specs/quality-standards.md`, generateQualityStandards(config));


// Phase 5: 验证与文档编制
const validation = validateStructure(skillDir);
Write(`${skillDir}/validation-report.json`, JSON.stringify(validation));
Write(`${skillDir}/README.md`, generateReadme(config, validation));

Reference Documents by Phase

各阶段参考文档

IMPORTANT: This section demonstrates how skill-generator organizes its own reference documentation. This is the pattern that all generated Skills should emulate. See specs/reference-docs-spec.md for details.
重要提示:本部分展示了skill-generator自身的参考文档组织方式,所有生成的技能都应遵循此模式。详情请见specs/reference-docs-spec.md

Phase 0: Specification Study (Mandatory Prerequisites)

阶段0: 规范学习(必填前置条件)

Specification documents that must be read before any generation operation
DocumentPurposeWhen to Use
../_shared/SKILL-DESIGN-SPEC.mdUniversal Skill design specificationUnderstand Skill structure and naming conventions - REQUIRED
specs/reference-docs-spec.mdReference document generation specificationEnsure Reference Documents have proper phase-based organization - REQUIRED
执行任何生成操作前必须阅读的规范文档
文档用途使用时机
../_shared/SKILL-DESIGN-SPEC.md通用技能设计规范理解技能结构和命名约定 - 必填
specs/reference-docs-spec.md参考文档生成规范确保参考文档具备正确的阶段化组织 - 必填

Phase 1: Requirements Discovery

阶段1: 需求探索

Collect Skill requirements and configuration
DocumentPurposeWhen to Use
phases/01-requirements-discovery.mdPhase 1 execution guideUnderstand how to collect user requirements and generate configuration
specs/skill-requirements.mdSkill requirements specificationUnderstand what information a Skill should contain
收集技能需求和配置
文档用途使用时机
phases/01-requirements-discovery.md阶段1执行指南理解如何收集用户需求并生成配置
specs/skill-requirements.md技能需求规范理解技能应包含的信息

Phase 2: Structure Generation

阶段2: 结构生成

Generate directory structure and entry file
DocumentPurposeWhen to Use
phases/02-structure-generation.mdPhase 2 execution guideUnderstand how to generate directory structure
templates/skill-md.mdSKILL.md templateLearn how to generate the entry file
生成目录结构和入口文件
文档用途使用时机
phases/02-structure-generation.md阶段2执行指南理解如何生成目录结构
templates/skill-md.mdSKILL.md模板学习如何生成入口文件

Phase 3: Phase/Action Generation

阶段3: 阶段/动作生成

Generate specific phase or action files based on execution mode
DocumentPurposeWhen to Use
phases/03-phase-generation.mdPhase 3 execution guideUnderstand Sequential vs Autonomous generation logic
templates/sequential-phase.mdSequential Phase templateGenerate phase files for Sequential mode
templates/autonomous-orchestrator.mdOrchestrator templateGenerate orchestrator for Autonomous mode
templates/autonomous-action.mdAction templateGenerate action files for Autonomous mode
根据执行模式生成特定阶段或动作文件
文档用途使用时机
phases/03-phase-generation.md阶段3执行指南理解Sequential与Autonomous模式的生成逻辑
templates/sequential-phase.mdSequential阶段模板为Sequential模式生成阶段文件
templates/autonomous-orchestrator.md编排器模板为Autonomous模式生成编排器
templates/autonomous-action.md动作模板为Autonomous模式生成动作文件

Phase 4: Specs & Templates

阶段4: 规范与模板生成

Generate domain-specific specifications and templates
DocumentPurposeWhen to Use
phases/04-specs-templates.mdPhase 4 execution guideUnderstand how to generate domain-specific documentation
specs/reference-docs-spec.mdReference document specificationIMPORTANT: Follow this spec when generating Specs
生成领域特定规范和模板
文档用途使用时机
phases/04-specs-templates.md阶段4执行指南理解如何生成领域特定文档
specs/reference-docs-spec.md参考文档规范重要提示:生成规范文档时请遵循此规范

Phase 5: Validation & Documentation

阶段5: 验证与文档编制

Verify results and generate final documentation
DocumentPurposeWhen to Use
phases/05-validation.mdPhase 5 execution guideUnderstand how to verify generated Skill completeness
验证结果并生成最终文档
文档用途使用时机
phases/05-validation.md阶段5执行指南理解如何验证生成技能的完整性

Debugging & Troubleshooting

调试与故障排除

Reference documents when encountering issues
IssueSolution Document
Generated Skill missing Reference Documentsspecs/reference-docs-spec.md - verify phase-based organization is followed
Reference document organization unclearspecs/reference-docs-spec.md - Core Principles section
Generated documentation does not meet quality standards../_shared/SKILL-DESIGN-SPEC.md
遇到问题时参考的文档
问题解决方案文档
生成的技能缺少参考文档specs/reference-docs-spec.md - 验证是否遵循阶段化组织方式
参考文档组织不清晰specs/reference-docs-spec.md - 核心原则章节
生成的文档不符合质量标准../_shared/SKILL-DESIGN-SPEC.md

Reference & Background

参考与背景

Documents for deep learning and design decisions
DocumentPurposeNotes
specs/execution-modes.mdDetailed execution modes specificationComparison and use cases for Sequential vs Autonomous
specs/cli-integration.mdCLI integration specificationHow generated Skills integrate with CLI
specs/scripting-integration.mdScript integration specificationHow to use scripts in Phases
templates/script-template.mdScript templateUnified Bash + Python template

用于深度学习和了解设计决策的文档
文档用途说明
specs/execution-modes.md详细执行模式规范Sequential与Autonomous模式的对比和适用场景
specs/cli-integration.mdCLI集成规范生成的技能如何与CLI集成
specs/scripting-integration.md脚本集成规范如何在阶段中使用脚本
templates/script-template.md脚本模板统一的Bash + Python模板

Output Structure

输出结构

Sequential Mode

Sequential模式

.claude/skills/{skill-name}/
├── SKILL.md                        # Entry file
├── phases/
│   ├── _orchestrator.md            # Declarative orchestrator
│   ├── workflow.json               # Workflow definition
│   ├── 01-{step-one}.md           # Phase 1
│   ├── 02-{step-two}.md           # Phase 2
│   └── 03-{step-three}.md         # Phase 3
├── specs/
│   ├── {skill-name}-requirements.md
│   └── quality-standards.md
├── templates/
│   └── agent-base.md
├── scripts/
└── README.md
.claude/skills/{skill-name}/
├── SKILL.md                        # 入口文件
├── phases/
│   ├── _orchestrator.md            # 声明式编排器
│   ├── workflow.json               # 工作流定义
│   ├── 01-{step-one}.md           # 阶段1
│   ├── 02-{step-two}.md           # 阶段2
│   └── 03-{step-three}.md         # 阶段3
├── specs/
│   ├── {skill-name}-requirements.md
│   └── quality-standards.md
├── templates/
│   └── agent-base.md
├── scripts/
└── README.md

Autonomous Mode

Autonomous模式

.claude/skills/{skill-name}/
├── SKILL.md                        # Entry file
├── phases/
│   ├── orchestrator.md             # Orchestrator (state-driven)
│   ├── state-schema.md             # State schema definition
│   └── actions/
│       ├── action-init.md
│       ├── action-create.md
│       └── action-list.md
├── specs/
│   ├── {skill-name}-requirements.md
│   ├── action-catalog.md
│   └── quality-standards.md
├── templates/
│   ├── orchestrator-base.md
│   └── action-base.md
├── scripts/
└── README.md

.claude/skills/{skill-name}/
├── SKILL.md                        # 入口文件
├── phases/
│   ├── orchestrator.md             # 状态驱动的编排器
│   ├── state-schema.md             # 状态 schema 定义
│   └── actions/
│       ├── action-init.md
│       ├── action-create.md
│       └── action-list.md
├── specs/
│   ├── {skill-name}-requirements.md
│   ├── action-catalog.md
│   └── quality-standards.md
├── templates/
│   ├── orchestrator-base.md
│   └── action-base.md
├── scripts/
└── README.md

Reference Documents by Phase

各阶段参考文档

IMPORTANT: This section demonstrates how skill-generator organizes its own reference documentation. This is the pattern that all generated Skills should emulate. See specs/reference-docs-spec.md for details.
重要提示:本部分展示了skill-generator自身的参考文档组织方式,所有生成的技能都应遵循此模式。详情请见specs/reference-docs-spec.md

Phase 0: Specification Study (Mandatory Prerequisites)

阶段0: 规范学习(必填前置条件)

Specification documents that must be read before any generation operation
DocumentPurposeWhen to Use
../_shared/SKILL-DESIGN-SPEC.mdUniversal Skill design specificationUnderstand Skill structure and naming conventions - REQUIRED
specs/reference-docs-spec.mdReference document generation specificationEnsure Reference Documents have proper phase-based organization - REQUIRED
执行任何生成操作前必须阅读的规范文档
文档用途使用时机
../_shared/SKILL-DESIGN-SPEC.md通用技能设计规范理解技能结构和命名约定 - 必填
specs/reference-docs-spec.md参考文档生成规范确保参考文档具备正确的阶段化组织 - 必填

Phase 1: Requirements Discovery

阶段1: 需求探索

Collect Skill requirements and configuration
DocumentPurposeWhen to Use
phases/01-requirements-discovery.mdPhase 1 execution guideUnderstand how to collect user requirements and generate configuration
specs/skill-requirements.mdSkill requirements specificationUnderstand what information a Skill should contain
收集技能需求和配置
文档用途使用时机
phases/01-requirements-discovery.md阶段1执行指南理解如何收集用户需求并生成配置
specs/skill-requirements.md技能需求规范理解技能应包含的信息

Phase 2: Structure Generation

阶段2: 结构生成

Generate directory structure and entry file
DocumentPurposeWhen to Use
phases/02-structure-generation.mdPhase 2 execution guideUnderstand how to generate directory structure
templates/skill-md.mdSKILL.md templateLearn how to generate the entry file
生成目录结构和入口文件
文档用途使用时机
phases/02-structure-generation.md阶段2执行指南理解如何生成目录结构
templates/skill-md.mdSKILL.md模板学习如何生成入口文件

Phase 3: Phase/Action Generation

阶段3: 阶段/动作生成

Generate specific phase or action files based on execution mode
DocumentPurposeWhen to Use
phases/03-phase-generation.mdPhase 3 execution guideUnderstand Sequential vs Autonomous generation logic
templates/sequential-phase.mdSequential Phase templateGenerate phase files for Sequential mode
templates/autonomous-orchestrator.mdOrchestrator templateGenerate orchestrator for Autonomous mode
templates/autonomous-action.mdAction templateGenerate action files for Autonomous mode
根据执行模式生成特定阶段或动作文件
文档用途使用时机
phases/03-phase-generation.md阶段3执行指南理解Sequential与Autonomous模式的生成逻辑
templates/sequential-phase.mdSequential阶段模板为Sequential模式生成阶段文件
templates/autonomous-orchestrator.md编排器模板为Autonomous模式生成编排器
templates/autonomous-action.md动作模板为Autonomous模式生成动作文件

Phase 4: Specs & Templates

阶段4: 规范与模板生成

Generate domain-specific specifications and templates
DocumentPurposeWhen to Use
phases/04-specs-templates.mdPhase 4 execution guideUnderstand how to generate domain-specific documentation
specs/reference-docs-spec.mdReference document specificationIMPORTANT: Follow this spec when generating Specs
生成领域特定规范和模板
文档用途使用时机
phases/04-specs-templates.md阶段4执行指南理解如何生成领域特定文档
specs/reference-docs-spec.md参考文档规范重要提示:生成规范文档时请遵循此规范

Phase 5: Validation & Documentation

阶段5: 验证与文档编制

Verify results and generate final documentation
DocumentPurposeWhen to Use
phases/05-validation.mdPhase 5 execution guideUnderstand how to verify generated Skill completeness
验证结果并生成最终文档
文档用途使用时机
phases/05-validation.md阶段5执行指南理解如何验证生成技能的完整性

Debugging & Troubleshooting

调试与故障排除

Reference documents when encountering issues
IssueSolution Document
Generated Skill missing Reference Documentsspecs/reference-docs-spec.md - verify phase-based organization is followed
Reference document organization unclearspecs/reference-docs-spec.md - Core Principles section
Generated documentation does not meet quality standards../_shared/SKILL-DESIGN-SPEC.md
遇到问题时参考的文档
问题解决方案文档
生成的技能缺少参考文档specs/reference-docs-spec.md - 验证是否遵循阶段化组织方式
参考文档组织不清晰specs/reference-docs-spec.md - 核心原则章节
生成的文档不符合质量标准../_shared/SKILL-DESIGN-SPEC.md

Reference & Background

参考与背景

Documents for deep learning and design decisions
DocumentPurposeNotes
specs/execution-modes.mdDetailed execution modes specificationComparison and use cases for Sequential vs Autonomous
specs/cli-integration.mdCLI integration specificationHow generated Skills integrate with CLI
specs/scripting-integration.mdScript integration specificationHow to use scripts in Phases
templates/script-template.mdScript templateUnified Bash + Python template
用于深度学习和了解设计决策的文档
文档用途说明
specs/execution-modes.md详细执行模式规范Sequential与Autonomous模式的对比和适用场景
specs/cli-integration.mdCLI集成规范生成的技能如何与CLI集成
specs/scripting-integration.md脚本集成规范如何在阶段中使用脚本
templates/script-template.md脚本模板统一的Bash + Python模板