技能生成器
- 作者仓库星标 2,029
- 作者仓库 Claude-Code-Workflow
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @catlog22 · 未声明许可证
- 上下文用量评级
- 中等消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
在任何生成操作之前必须阅读的规范文档 文档 · 目的 · 何时使用 ../_shared/SKILL-DESIGN-SPEC.md · 通用技能设计规范 · 了解技能结构和命名约定 - 必需 specs/reference-docs-spec.md · 参考文档生成规范 · 确保参考文档具有正确的基于阶段的组织 - 必需
收集技能需求和配置文档·目的·何时使用phases/01-requirements-discovery.md·第1阶段执行指南·了解如何收集用户需求并生成配置specs/skill-requirements.md·技能需求规范·了解技能应包含哪些信息
生成目录结构和入口文件 文档 · 目的 · 何时使用 Phases/02-struct- Generation.md · 第 2 阶段执行指南 · 了解如何生成目录结构模板/skill-md.md · SKILL.md 模板 · 了解如何生成入口文件
根据执行模式生成特定阶段或操作文件 文档 · 目的 · 何时使用 Phases/03-phase- Generation.md · 第 3 阶段执行指南 · 了解顺序与自主生成逻辑 templates/sequential-phase.md · 顺序阶段模板 · 为顺序模式生成阶段文件 templates/autonomous-orchestrator.md · Orchestrator 模板 · 为自主模式生成 Orchestrator
生成特定领域的规范和模板文档·目的·何时使用phases/04-specs-templates.md·第4阶段执行指南·了解如何生成特定领域的文档specs/reference-docs-spec.md·参考文档规范·重要:生成规范时请遵循此规范
验证结果并生成最终文档 文档 · 目的 · 何时使用 Phases/05-validation.md · 第 5 阶段执行指南 · 了解如何验证生成的技能完整性
# Skill Generator
Meta-skill for creating new Claude Code skills with configurable execution modes.
## 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) │
│ │
└─────────────────────────────────────────────────────────────────┘
```
## Execution Modes
### Mode 1: Sequential (Fixed Order)
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`
### Mode 2: Autonomous (Stateless Auto-Select)
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`
## 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
---
## 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)
| Document | Purpose | Priority |
|----------|---------|----------|
| [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) | Universal design spec - defines structure, naming, quality standards for all Skills | **P0 - Critical** |
| [specs/reference-docs-spec.md](specs/reference-docs-spec.md) | Reference document generation spec - ensures generated Skills have proper phase-based Reference Documents with usage timing guidance | **P0 - Critical** |
### Template Files (Read Before Generation)
| Document | Purpose |
|----------|---------|
| [templates/skill-md.md](templates/skill-md.md) | SKILL.md entry file template |
| [templates/sequential-phase.md](templates/sequential-phase.md) | Sequential Phase template |
| [templates/autonomous-orchestrator.md](templates/autonomous-orchestrator.md) | Autonomous Orchestrator template |
| [templates/autonomous-action.md](templates/autonomous-action.md) | Autonomous Action template |
| [templates/code-analysis-action.md](templates/code-analysis-action.md) | Code Analysis Action template |
| [templates/llm-action.md](templates/llm-action.md) | LLM Action template |
| [templates/script-template.md](templates/script-template.md) | Unified Script Template (Bash + Python) |
### Specification Documents (Read as Needed)
| Document | Purpose |
|----------|---------|
| [specs/execution-modes.md](specs/execution-modes.md) | Execution Modes Specification |
| [specs/skill-requirements.md](specs/skill-requirements.md) | Skill Requirements Specification |
| [specs/cli-integration.md](specs/cli-integration.md) | CLI Integration Specification |
| [specs/scripting-integration.md](specs/scripting-integration.md) | Script Integration Specification |
### Phase Execution Guides (Reference During Execution)
| Document | Purpose |
|----------|---------|
| [phases/01-requirements-discovery.md](phases/01-requirements-discovery.md) | Collect Skill Requirements |
| [phases/02-structure-generation.md](phases/02-structure-generation.md) | Generate Directory Structure |
| [phases/03-phase-generation.md](phases/03-phase-generation.md) | Generate Phase Files |
| [phases/04-specs-templates.md](phases/04-specs-templates.md) | Generate Specs and Templates |
| [phases/05-validation.md](phases/05-validation.md) | Validation and Documentation |
---
## 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));
```
---
## 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](specs/reference-docs-spec.md) for details.
### Phase 0: Specification Study (Mandatory Prerequisites)
Specification documents that must be read before any generation operation
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) | Universal Skill design specification | Understand Skill structure and naming conventions - **REQUIRED** |
| [specs/reference-docs-spec.md](specs/reference-docs-spec.md) | Reference document generation specification | Ensure Reference Documents have proper phase-based organization - **REQUIRED** |
### Phase 1: Requirements Discovery
Collect Skill requirements and configuration
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [phases/01-requirements-discovery.md](phases/01-requirements-discovery.md) | Phase 1 execution guide | Understand how to collect user requirements and generate configuration |
| [specs/skill-requirements.md](specs/skill-requirements.md) | Skill requirements specification | Understand what information a Skill should contain |
### Phase 2: Structure Generation
Generate directory structure and entry file
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [phases/02-structure-generation.md](phases/02-structure-generation.md) | Phase 2 execution guide | Understand how to generate directory structure |
| [templates/skill-md.md](templates/skill-md.md) | SKILL.md template | Learn how to generate the entry file |
### Phase 3: Phase/Action Generation
Generate specific phase or action files based on execution mode
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [phases/03-phase-generation.md](phases/03-phase-generation.md) | Phase 3 execution guide | Understand Sequential vs Autonomous generation logic |
| [templates/sequential-phase.md](templates/sequential-phase.md) | Sequential Phase template | Generate phase files for Sequential mode |
| [templates/autonomous-orchestrator.md](templates/autonomous-orchestrator.md) | Orchestrator template | Generate orchestrator for Autonomous mode |
| [templates/autonomous-action.md](templates/autonomous-action.md) | Action template | Generate action files for Autonomous mode |
### Phase 4: Specs & Templates
Generate domain-specific specifications and templates
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [phases/04-specs-templates.md](phases/04-specs-templates.md) | Phase 4 execution guide | Understand how to generate domain-specific documentation |
| [specs/reference-docs-spec.md](specs/reference-docs-spec.md) | Reference document specification | IMPORTANT: Follow this spec when generating Specs |
### Phase 5: Validation & Documentation
Verify results and generate final documentation
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [phases/05-validation.md](phases/05-validation.md) | Phase 5 execution guide | Understand how to verify generated Skill completeness |
### Debugging & Troubleshooting
Reference documents when encountering issues
| Issue | Solution Document |
|-------|------------------|
| Generated Skill missing Reference Documents | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) - verify phase-based organization is followed |
| Reference document organization unclear | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) - Core Principles section |
| Generated documentation does not meet quality standards | [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) |
### Reference & Background
Documents for deep learning and design decisions
| Document | Purpose | Notes |
|----------|---------|-------|
| [specs/execution-modes.md](specs/execution-modes.md) | Detailed execution modes specification | Comparison and use cases for Sequential vs Autonomous |
| [specs/cli-integration.md](specs/cli-integration.md) | CLI integration specification | How generated Skills integrate with CLI |
| [specs/scripting-integration.md](specs/scripting-integration.md) | Script integration specification | How to use scripts in Phases |
| [templates/script-template.md](templates/script-template.md) | Script template | Unified Bash + Python template |
---
## Output Structure
### Sequential Mode
```
.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
```
### Autonomous Mode
```
.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
```
---
## 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](specs/reference-docs-spec.md) for details.
### Phase 0: Specification Study (Mandatory Prerequisites)
Specification documents that must be read before any generation operation
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) | Universal Skill design specification | Understand Skill structure and naming conventions - **REQUIRED** |
| [specs/reference-docs-spec.md](specs/reference-docs-spec.md) | Reference document generation specification | Ensure Reference Documents have proper phase-based organization - **REQUIRED** |
### Phase 1: Requirements Discovery
Collect Skill requirements and configuration
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [phases/01-requirements-discovery.md](phases/01-requirements-discovery.md) | Phase 1 execution guide | Understand how to collect user requirements and generate configuration |
| [specs/skill-requirements.md](specs/skill-requirements.md) | Skill requirements specification | Understand what information a Skill should contain |
### Phase 2: Structure Generation
Generate directory structure and entry file
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [phases/02-structure-generation.md](phases/02-structure-generation.md) | Phase 2 execution guide | Understand how to generate directory structure |
| [templates/skill-md.md](templates/skill-md.md) | SKILL.md template | Learn how to generate the entry file |
### Phase 3: Phase/Action Generation
Generate specific phase or action files based on execution mode
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [phases/03-phase-generation.md](phases/03-phase-generation.md) | Phase 3 execution guide | Understand Sequential vs Autonomous generation logic |
| [templates/sequential-phase.md](templates/sequential-phase.md) | Sequential Phase template | Generate phase files for Sequential mode |
| [templates/autonomous-orchestrator.md](templates/autonomous-orchestrator.md) | Orchestrator template | Generate orchestrator for Autonomous mode |
| [templates/autonomous-action.md](templates/autonomous-action.md) | Action template | Generate action files for Autonomous mode |
### Phase 4: Specs & Templates
Generate domain-specific specifications and templates
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [phases/04-specs-templates.md](phases/04-specs-templates.md) | Phase 4 execution guide | Understand how to generate domain-specific documentation |
| [specs/reference-docs-spec.md](specs/reference-docs-spec.md) | Reference document specification | IMPORTANT: Follow this spec when generating Specs |
### Phase 5: Validation & Documentation
Verify results and generate final documentation
| Document | Purpose | When to Use |
|----------|---------|-------------|
| [phases/05-validation.md](phases/05-validation.md) | Phase 5 execution guide | Understand how to verify generated Skill completeness |
### Debugging & Troubleshooting
Reference documents when encountering issues
| Issue | Solution Document |
|-------|------------------|
| Generated Skill missing Reference Documents | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) - verify phase-based organization is followed |
| Reference document organization unclear | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) - Core Principles section |
| Generated documentation does not meet quality standards | [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) |
### Reference & Background
Documents for deep learning and design decisions
| Document | Purpose | Notes |
|----------|---------|-------|
| [specs/execution-modes.md](specs/execution-modes.md) | Detailed execution modes specification | Comparison and use cases for Sequential vs Autonomous |
| [specs/cli-integration.md](specs/cli-integration.md) | CLI integration specification | How generated Skills integrate with CLI |
| [specs/scripting-integration.md](specs/scripting-integration.md) | Script integration specification | How to use scripts in Phases |
| [templates/script-template.md](templates/script-template.md) | Script template | Unified Bash + Python template | 按说明文件中的顺序排列。
模式1:顺序(固定顺序)
模式 2:自主(无状态自动选择)
主要设计原则
所需先决条件
核心规格(必读)
文件/命令 -> software-manual · copyright-docs · issue-manage · workflow-debug · _shared/SKILL-DESIGN-SPEC.md · .workflow/.scratchpad/skill-gen-${timestamp} · ${workDir}/skill-config.json · .claude/skills/${config.skill_name}
内容校验值 -> cc606db6a802
当前原文的自动摘译,尚未人工审校。
模式1:顺序(固定顺序)
传统的线性执行模型,阶段按数字前缀顺序执行。使用案例: 管道任务(收集 -> 分析 -> 生成) 阶段之间的强依赖性 固定输出结构
模式 2:自主(无状态自动选择)
智能路由模型,根据上下文动态选择执行路径。使用案例: 交互式任务(聊天、问答) 阶段之间没有强依赖性 需要动态用户意图响应
主要设计原则
模式感知:根据任务特征自动推荐执行模式 骨架生成:生成完整的目录结构和文件骨架 标准符合性:严格遵循
_shared/SKILL-DESIGN-SPEC.md可扩展性:生成的技能易于扩展和修改所需先决条件
重要提示:在进行任何生成操作之前,请阅读以下规范文档。在不理解这些标准的情况下进行生成将导致不合格的输出。
核心规格(必读)
文档 · 目的 · 优先级 ../_shared/SKILL-DESIGN-SPEC.md · 通用设计规范 - 定义所有技能的结构、命名和质量标准 · P0 - 关键规范/reference-docs-spec.md · 参考文档生成规范 - 确保生成的技能具有适当的基于阶段的参考文档以及使用时间指导 · P0 - 关键