mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-14 02:42:04 +08:00
Refactor: Remove outdated security requirements and best practice templates
- Deleted security requirements specification file to streamline documentation. - Removed best practice finding template to enhance clarity and focus on critical issues. - Eliminated report template and security finding template to reduce redundancy and improve maintainability. - Updated skill generator templates to enforce mandatory prerequisites for better compliance with design standards. - Bumped package version from 6.3.18 to 6.3.23 for dependency updates.
This commit is contained in:
@@ -15,6 +15,9 @@ Meta-skill for creating new Claude Code skills with configurable execution modes
|
||||
│ Skill Generator Architecture │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ⚠️ Phase 0: Specification → 阅读并理解设计规范 (强制前置) │
|
||||
│ Study SKILL-DESIGN-SPEC.md + 模板 │
|
||||
│ ↓ │
|
||||
│ Phase 1: Requirements → skill-config.json │
|
||||
│ Discovery (name, type, mode, agents) │
|
||||
│ ↓ │
|
||||
@@ -82,10 +85,63 @@ Phase 01 → Phase 02 → Phase 03 → ... → Phase N
|
||||
3. **规范遵循**: 严格遵循 `_shared/SKILL-DESIGN-SPEC.md`
|
||||
4. **可扩展性**: 生成的 Skill 易于扩展和修改
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Mandatory Prerequisites (强制前置条件)
|
||||
|
||||
> **⛔ 禁止跳过**: 在执行任何生成操作之前,**必须**完整阅读以下文档。未阅读规范直接生成将导致输出不符合质量标准。
|
||||
|
||||
### 核心规范 (必读)
|
||||
|
||||
| Document | Purpose | Priority |
|
||||
|----------|---------|----------|
|
||||
| [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) | 通用设计规范 - 定义所有 Skill 的结构、命名、质量标准 | **P0 - 最高** |
|
||||
|
||||
### 模板文件 (生成前必读)
|
||||
|
||||
| Document | Purpose |
|
||||
|----------|---------|
|
||||
| [templates/skill-md.md](templates/skill-md.md) | SKILL.md 入口文件模板 |
|
||||
| [templates/sequential-phase.md](templates/sequential-phase.md) | Sequential Phase 模板 |
|
||||
| [templates/autonomous-orchestrator.md](templates/autonomous-orchestrator.md) | Autonomous 编排器模板 |
|
||||
| [templates/autonomous-action.md](templates/autonomous-action.md) | Autonomous Action 模板 |
|
||||
| [templates/code-analysis-action.md](templates/code-analysis-action.md) | 代码分析 Action 模板 |
|
||||
| [templates/llm-action.md](templates/llm-action.md) | LLM Action 模板 |
|
||||
| [templates/script-bash.md](templates/script-bash.md) | Bash 脚本模板 |
|
||||
| [templates/script-python.md](templates/script-python.md) | Python 脚本模板 |
|
||||
|
||||
### 规范文档 (按需阅读)
|
||||
|
||||
| Document | Purpose |
|
||||
|----------|---------|
|
||||
| [specs/execution-modes.md](specs/execution-modes.md) | 执行模式规范 |
|
||||
| [specs/skill-requirements.md](specs/skill-requirements.md) | Skill 需求规范 |
|
||||
| [specs/cli-integration.md](specs/cli-integration.md) | CLI 集成规范 |
|
||||
| [specs/scripting-integration.md](specs/scripting-integration.md) | 脚本集成规范 |
|
||||
|
||||
### Phase 执行指南 (执行时参考)
|
||||
|
||||
| Document | Purpose |
|
||||
|----------|---------|
|
||||
| [phases/01-requirements-discovery.md](phases/01-requirements-discovery.md) | 收集 Skill 需求 |
|
||||
| [phases/02-structure-generation.md](phases/02-structure-generation.md) | 生成目录结构 |
|
||||
| [phases/03-phase-generation.md](phases/03-phase-generation.md) | 生成 Phase 文件 |
|
||||
| [phases/04-specs-templates.md](phases/04-specs-templates.md) | 生成规范和模板 |
|
||||
| [phases/05-validation.md](phases/05-validation.md) | 验证和文档 |
|
||||
|
||||
---
|
||||
|
||||
## 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 │
|
||||
@@ -168,20 +224,3 @@ if (config.execution_mode === 'autonomous') {
|
||||
├── orchestrator-base.md # 编排器模板
|
||||
└── action-base.md # 动作模板
|
||||
```
|
||||
|
||||
## Reference Documents
|
||||
|
||||
| Document | Purpose |
|
||||
|----------|---------|
|
||||
| [phases/01-requirements-discovery.md](phases/01-requirements-discovery.md) | 收集 Skill 需求 |
|
||||
| [phases/02-structure-generation.md](phases/02-structure-generation.md) | 生成目录结构 |
|
||||
| [phases/03-phase-generation.md](phases/03-phase-generation.md) | 生成 Phase 文件 |
|
||||
| [phases/04-specs-templates.md](phases/04-specs-templates.md) | 生成规范和模板 |
|
||||
| [phases/05-validation.md](phases/05-validation.md) | 验证和文档 |
|
||||
| [specs/execution-modes.md](specs/execution-modes.md) | 执行模式规范 |
|
||||
| [specs/skill-requirements.md](specs/skill-requirements.md) | Skill 需求规范 |
|
||||
| [templates/skill-md.md](templates/skill-md.md) | SKILL.md 模板 |
|
||||
| [templates/sequential-phase.md](templates/sequential-phase.md) | Sequential Phase 模板 |
|
||||
| [templates/autonomous-orchestrator.md](templates/autonomous-orchestrator.md) | Autonomous 编排器模板 |
|
||||
| [templates/autonomous-action.md](templates/autonomous-action.md) | Autonomous Action 模板 |
|
||||
| [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) | 通用设计规范 |
|
||||
|
||||
@@ -2,6 +2,16 @@
|
||||
|
||||
自主模式编排器的模板。
|
||||
|
||||
## ⚠️ 重要提示
|
||||
|
||||
> **Phase 0 是强制前置阶段**:在 Orchestrator 启动执行循环之前,必须先完成 Phase 0 的规范研读。
|
||||
>
|
||||
> 生成 Orchestrator 时,需要确保:
|
||||
> 1. SKILL.md 中已包含 Phase 0 规范研读步骤
|
||||
> 2. Orchestrator 启动前验证规范已阅读
|
||||
> 3. 所有 Action 文件都引用相关的规范文档
|
||||
> 4. Architecture Overview 中 Phase 0 位于 Orchestrator 之前
|
||||
|
||||
## 模板结构
|
||||
|
||||
```markdown
|
||||
|
||||
@@ -2,6 +2,15 @@
|
||||
|
||||
顺序模式 Phase 文件的模板。
|
||||
|
||||
## ⚠️ 重要提示
|
||||
|
||||
> **Phase 0 是强制前置阶段**:在实现任何 Phase (1, 2, 3...) 之前,必须先完成 Phase 0 的规范研读。
|
||||
>
|
||||
> 生成 Sequential Phase 时,需要确保:
|
||||
> 1. SKILL.md 中已包含 Phase 0 规范研读步骤
|
||||
> 2. 每个 Phase 文件都引用相关的规范文档
|
||||
> 3. 执行流程明确标注 Phase 0 为禁止跳过的前置步骤
|
||||
|
||||
## 模板结构
|
||||
|
||||
```markdown
|
||||
|
||||
@@ -36,6 +36,16 @@ allowed-tools: {{allowed_tools}}
|
||||
|
||||
{{design_principles}}
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Mandatory Prerequisites (强制前置条件)
|
||||
|
||||
> **⛔ 禁止跳过**: 在执行任何操作之前,**必须**完整阅读以下文档。未阅读规范直接执行将导致输出不符合质量标准。
|
||||
|
||||
{{mandatory_prerequisites}}
|
||||
|
||||
---
|
||||
|
||||
## Execution Flow
|
||||
|
||||
{{execution_flow}}
|
||||
@@ -71,9 +81,10 @@ Bash(\`mkdir -p "\${workDir}"\`);
|
||||
| `{{description}}` | string | config.description |
|
||||
| `{{triggers}}` | string | config.triggers.join(", ") |
|
||||
| `{{allowed_tools}}` | string | config.allowed_tools.join(", ") |
|
||||
| `{{architecture_diagram}}` | string | 根据 execution_mode 生成 |
|
||||
| `{{architecture_diagram}}` | string | 根据 execution_mode 生成 (包含 Phase 0) |
|
||||
| `{{design_principles}}` | string | 根据 execution_mode 生成 |
|
||||
| `{{execution_flow}}` | string | 根据 phases/actions 生成 |
|
||||
| `{{mandatory_prerequisites}}` | string | 强制前置阅读文档列表 (specs + templates) |
|
||||
| `{{execution_flow}}` | string | 根据 phases/actions 生成 (Phase 0 在最前) |
|
||||
| `{{output_location}}` | string | config.output.location |
|
||||
| `{{additional_dirs}}` | string | 根据 execution_mode 生成 |
|
||||
| `{{output_structure}}` | string | 根据配置生成 |
|
||||
@@ -84,21 +95,48 @@ Bash(\`mkdir -p "\${workDir}"\`);
|
||||
```javascript
|
||||
function generateSkillMd(config) {
|
||||
const template = Read('templates/skill-md.md');
|
||||
|
||||
|
||||
return template
|
||||
.replace(/\{\{skill_name\}\}/g, config.skill_name)
|
||||
.replace(/\{\{display_name\}\}/g, config.display_name)
|
||||
.replace(/\{\{description\}\}/g, config.description)
|
||||
.replace(/\{\{triggers\}\}/g, config.triggers.map(t => `"${t}"`).join(", "))
|
||||
.replace(/\{\{allowed_tools\}\}/g, config.allowed_tools.join(", "))
|
||||
.replace(/\{\{architecture_diagram\}\}/g, generateArchitecture(config))
|
||||
.replace(/\{\{architecture_diagram\}\}/g, generateArchitecture(config)) // 包含 Phase 0
|
||||
.replace(/\{\{design_principles\}\}/g, generatePrinciples(config))
|
||||
.replace(/\{\{execution_flow\}\}/g, generateFlow(config))
|
||||
.replace(/\{\{mandatory_prerequisites\}\}/g, generatePrerequisites(config)) // 强制前置条件
|
||||
.replace(/\{\{execution_flow\}\}/g, generateFlow(config)) // Phase 0 在最前
|
||||
.replace(/\{\{output_location\}\}/g, config.output.location)
|
||||
.replace(/\{\{additional_dirs\}\}/g, generateAdditionalDirs(config))
|
||||
.replace(/\{\{output_structure\}\}/g, generateOutputStructure(config))
|
||||
.replace(/\{\{reference_table\}\}/g, generateReferenceTable(config));
|
||||
}
|
||||
|
||||
// 生成强制前置条件表格
|
||||
function generatePrerequisites(config) {
|
||||
const specs = config.specs || [];
|
||||
const templates = config.templates || [];
|
||||
|
||||
let result = '### 规范文档 (必读)\n\n';
|
||||
result += '| Document | Purpose | Priority |\n';
|
||||
result += '|----------|---------|----------|\n';
|
||||
|
||||
specs.forEach((spec, index) => {
|
||||
const priority = index === 0 ? '**P0 - 最高**' : 'P1';
|
||||
result += `| [${spec.path}](${spec.path}) | ${spec.purpose} | ${priority} |\n`;
|
||||
});
|
||||
|
||||
if (templates.length > 0) {
|
||||
result += '\n### 模板文件 (生成前必读)\n\n';
|
||||
result += '| Document | Purpose |\n';
|
||||
result += '|----------|---------|\n';
|
||||
templates.forEach(tmpl => {
|
||||
result += `| [${tmpl.path}](${tmpl.path}) | ${tmpl.purpose} |\n`;
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
```
|
||||
|
||||
## Sequential 模式示例
|
||||
@@ -118,6 +156,9 @@ Generate API documentation from source code.
|
||||
|
||||
\`\`\`
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ ⚠️ Phase 0: Specification → 阅读并理解设计规范 (强制前置) │
|
||||
│ Study │
|
||||
│ ↓ │
|
||||
│ Phase 1: Scanning → endpoints.json │
|
||||
│ ↓ │
|
||||
│ Phase 2: Parsing → schemas.json │
|
||||
@@ -125,6 +166,22 @@ Generate API documentation from source code.
|
||||
│ Phase 3: Generation → api-docs.md │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
\`\`\`
|
||||
|
||||
## ⚠️ Mandatory Prerequisites (强制前置条件)
|
||||
|
||||
> **⛔ 禁止跳过**: 在执行任何操作之前,**必须**完整阅读以下文档。
|
||||
|
||||
### 规范文档 (必读)
|
||||
|
||||
| Document | Purpose | Priority |
|
||||
|----------|---------|----------|
|
||||
| [specs/api-standards.md](specs/api-standards.md) | API 文档标准规范 | **P0 - 最高** |
|
||||
|
||||
### 模板文件 (生成前必读)
|
||||
|
||||
| Document | Purpose |
|
||||
|----------|---------|
|
||||
| [templates/endpoint-doc.md](templates/endpoint-doc.md) | 端点文档模板 |
|
||||
```
|
||||
|
||||
## Autonomous 模式示例
|
||||
@@ -144,6 +201,10 @@ Interactive task management with CRUD operations.
|
||||
|
||||
\`\`\`
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ ⚠️ Phase 0: Specification Study (强制前置) │
|
||||
└───────────────┬─────────────────────────────────────────────────┘
|
||||
↓
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ Orchestrator (状态驱动决策) │
|
||||
└───────────────┬─────────────────────────────────────────────────┘
|
||||
│
|
||||
@@ -153,4 +214,22 @@ Interactive task management with CRUD operations.
|
||||
│ List │ │Create │ │ Edit │ │Delete │
|
||||
└───────┘ └───────┘ └───────┘ └───────┘
|
||||
\`\`\`
|
||||
|
||||
## ⚠️ Mandatory Prerequisites (强制前置条件)
|
||||
|
||||
> **⛔ 禁止跳过**: 在执行任何操作之前,**必须**完整阅读以下文档。
|
||||
|
||||
### 规范文档 (必读)
|
||||
|
||||
| Document | Purpose | Priority |
|
||||
|----------|---------|----------|
|
||||
| [specs/task-schema.md](specs/task-schema.md) | 任务数据结构规范 | **P0 - 最高** |
|
||||
| [specs/action-catalog.md](specs/action-catalog.md) | 动作目录 | P1 |
|
||||
|
||||
### 模板文件 (生成前必读)
|
||||
|
||||
| Document | Purpose |
|
||||
|----------|---------|
|
||||
| [templates/orchestrator-base.md](templates/orchestrator-base.md) | 编排器模板 |
|
||||
| [templates/action-base.md](templates/action-base.md) | 动作模板 |
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user