feat: add multi-mode workflow planning skill with session management and task generation

This commit is contained in:
catlog22
2026-03-02 15:25:56 +08:00
parent 2c2b9d6e29
commit 121e834459
28 changed files with 6478 additions and 533 deletions

View File

@@ -1,18 +1,18 @@
--- ---
name: ccw-help name: ccw-help
description: CCW command help system. Search, browse, recommend commands. Triggers "ccw-help", "ccw-issue". description: CCW command help system. Search, browse, recommend commands, skills, teams. Triggers "ccw-help", "ccw-issue".
allowed-tools: Read, Grep, Glob, AskUserQuestion allowed-tools: Read, Grep, Glob, AskUserQuestion
version: 7.0.0 version: 8.0.0
--- ---
# CCW-Help Skill # CCW-Help Skill
CCW 命令帮助系统,提供命令搜索、推荐、文档查看功能。 CCW 命令帮助系统,提供命令搜索、推荐、文档查看、Skill/Team 浏览功能。
## Trigger Conditions ## Trigger Conditions
- 关键词: "ccw-help", "ccw-issue", "帮助", "命令", "怎么用", "ccw 怎么用", "工作流" - 关键词: "ccw-help", "ccw-issue", "帮助", "命令", "怎么用", "ccw 怎么用", "工作流", "skill", "team"
- 场景: 询问命令用法、搜索命令、请求下一步建议、询问任务应该用哪个工作流 - 场景: 询问命令用法、搜索命令、请求下一步建议、询问任务应该用哪个工作流、浏览 Skill/Team 目录
## Operation Modes ## Operation Modes
@@ -61,7 +61,7 @@ CCW 命令帮助系统,提供命令搜索、推荐、文档查看功能。
4. Get user confirmation 4. Get user confirmation
5. Execute chain with TODO tracking 5. Execute chain with TODO tracking
**Supported Workflows**: **Supported Workflows** (参考 [ccw.md](../../commands/ccw.md)):
- **Level 1** (Lite-Lite-Lite): Ultra-simple quick tasks - **Level 1** (Lite-Lite-Lite): Ultra-simple quick tasks
- **Level 2** (Rapid/Hotfix): Bug fixes, simple features, documentation - **Level 2** (Rapid/Hotfix): Bug fixes, simple features, documentation
- **Level 2.5** (Rapid-to-Issue): Bridge from quick planning to issue workflow - **Level 2.5** (Rapid-to-Issue): Bridge from quick planning to issue workflow
@@ -71,12 +71,17 @@ CCW 命令帮助系统,提供命令搜索、推荐、文档查看功能。
- Test-fix workflows (debug failing tests) - Test-fix workflows (debug failing tests)
- Review workflows (code review and fixes) - Review workflows (code review and fixes)
- UI design workflows - UI design workflows
- Multi-CLI collaborative workflows
- Cycle workflows (integration-test, refactor)
- **Level 4** (Full): Exploratory tasks with brainstorming - **Level 4** (Full): Exploratory tasks with brainstorming
- **With-File Workflows**: Documented exploration with multi-CLI collaboration - **With-File Workflows**: Documented exploration with multi-CLI collaboration
- `brainstorm-with-file`: Multi-perspective ideation - `brainstorm-with-file`: Multi-perspective ideation → workflow-plan → workflow-execute
- `debug-with-file`: Hypothesis-driven debugging - `debug-with-file`: Hypothesis-driven debugging (standalone)
- `analyze-with-file`: Collaborative analysis - `analyze-with-file`: Collaborative analysis → workflow-lite-planex
- `collaborative-plan-with-file`: Multi-agent planning → unified-execute
- `roadmap-with-file`: Strategic requirement roadmap → team-planex
- **Issue Workflow**: Batch issue discovery, planning, queueing, execution - **Issue Workflow**: Batch issue discovery, planning, queueing, execution
- **Team Workflow**: team-planex wave pipeline for parallel execution
### Mode 6: Issue Reporting ### Mode 6: Issue Reporting
@@ -86,6 +91,16 @@ CCW 命令帮助系统,提供命令搜索、推荐、文档查看功能。
1. Use AskUserQuestion to gather context 1. Use AskUserQuestion to gather context
2. Generate structured issue template 2. Generate structured issue template
### Mode 7: Skill & Team Browsing
**Triggers**: "skill", "team", "技能", "团队", "有哪些 skill", "team 怎么用"
**Process**:
1. Query `command.json` skills array
2. Filter by category: workflow / team / review / meta / utility / standalone
3. Present categorized skill list with descriptions
4. For team skills, explain team architecture and usage patterns
## Data Source ## Data Source
Single source of truth: **[command.json](command.json)** Single source of truth: **[command.json](command.json)**
@@ -94,8 +109,9 @@ Single source of truth: **[command.json](command.json)**
|-------|---------| |-------|---------|
| `commands[]` | Flat command list with metadata | | `commands[]` | Flat command list with metadata |
| `commands[].flow` | Relationships (next_steps, prerequisites) | | `commands[].flow` | Relationships (next_steps, prerequisites) |
| `commands[].essential` | Essential flag for onboarding |
| `agents[]` | Agent directory | | `agents[]` | Agent directory |
| `skills[]` | Skill directory with categories |
| `skills[].is_team` | Whether skill uses team architecture |
| `essential_commands[]` | Core commands list | | `essential_commands[]` | Core commands list |
### Source Path Format ### Source Path Format
@@ -109,6 +125,77 @@ Single source of truth: **[command.json](command.json)**
} }
``` ```
## Skill Catalog
### Workflow Skills (核心工作流)
| Skill | 内部流水线 | 触发词 |
|-------|-----------|--------|
| `workflow-lite-planex` | explore → plan → confirm → execute | "lite-plan", 快速任务 |
| `workflow-plan` | session → context → convention → gen → verify | "workflow-plan", 正式规划 |
| `workflow-execute` | session discovery → task processing → commit | "workflow-execute", 执行 |
| `workflow-tdd-plan` | 6-phase TDD plan → verify | "tdd-plan", TDD 开发 |
| `workflow-test-fix` | session → context → analysis → gen → cycle | "test-fix", 测试修复 |
| `workflow-multi-cli-plan` | ACE context → CLI discussion → plan → execute | "multi-cli", 多CLI协作 |
| `workflow-skill-designer` | Meta-skill for designing workflow skills | "skill-designer" |
### Team Skills (团队协作)
Team Skills 使用 `team-worker` agent 架构Coordinator 编排流水线Workers 是加载了 role-spec 的 `team-worker` agents。
| Skill | 用途 | 架构 |
|-------|------|------|
| `team-planex` | 规划+执行 wave pipeline | planner + executor, 适合清晰 issue/roadmap |
| `team-lifecycle-v5` | 完整生命周期 (spec/impl/test) | team-worker agents with role-specs |
| `team-lifecycle-v4` | 优化版生命周期 | Optimized pipeline |
| `team-lifecycle-v3` | 基础版生命周期 | All roles invoke unified skill |
| `team-coordinate-v2` | 通用动态团队协调 | 运行时动态生成 role-specs |
| `team-coordinate` | 通用团队协调 v1 | Dynamic role generation |
| `team-brainstorm` | 团队头脑风暴 | Multi-perspective analysis |
| `team-frontend` | 前端开发团队 | Frontend specialists |
| `team-issue` | Issue 解决团队 | Issue resolution pipeline |
| `team-iterdev` | 迭代开发团队 | Iterative development |
| `team-review` | 代码扫描/漏洞审查 | Scanning + vulnerability review |
| `team-roadmap-dev` | Roadmap 驱动开发 | Requirement → implementation |
| `team-tech-debt` | 技术债务清理 | Debt identification + cleanup |
| `team-testing` | 测试团队 | Test planning + execution |
| `team-quality-assurance` | QA 团队 | Quality assurance pipeline |
| `team-uidesign` | UI 设计团队 | Design system + prototyping |
| `team-ultra-analyze` | 深度协作分析 | Deep collaborative analysis |
| `team-executor` | 轻量执行 (恢复会话) | Resume existing sessions |
| `team-executor-v2` | 轻量执行 v2 | Improved session resumption |
### Standalone Skills (独立技能)
| Skill | 用途 |
|-------|------|
| `brainstorm` | 双模头脑风暴 (auto pipeline / single role) |
| `review-code` | 多维度代码审查 |
| `review-cycle` | 审查+自动修复编排 |
| `spec-generator` | 6阶段规格文档链 (product-brief → PRD → architecture → epics) |
| `issue-manage` | 交互式 Issue 管理 (CRUD) |
| `memory-capture` | 统一记忆捕获 (session compact / quick tip) |
| `memory-manage` | 统一记忆管理 (CLAUDE.md + documentation) |
| `command-generator` | 命令文件生成器 |
| `skill-generator` | Meta-skill: 创建新 Skill |
| `skill-tuning` | Skill 诊断与优化 |
## Workflow Mapping (CCW Auto-Route)
CCW 根据任务意图自动选择工作流级别(参考 [ccw.md](../../commands/ccw.md)
| 输入示例 | 类型 | 级别 | 流水线 |
|---------|------|------|--------|
| "Add API endpoint" | feature (low) | 2 | workflow-lite-planex → workflow-test-fix |
| "Fix login timeout" | bugfix | 2 | workflow-lite-planex → workflow-test-fix |
| "协作分析: 认证架构" | analyze-file | 3 | analyze-with-file → workflow-lite-planex |
| "重构 auth 模块" | refactor | 3 | workflow:refactor-cycle |
| "multi-cli: API设计" | multi-cli | 3 | workflow-multi-cli-plan → workflow-test-fix |
| "头脑风暴: 通知系统" | brainstorm | 4 | brainstorm-with-file → workflow-plan → workflow-execute |
| "roadmap: OAuth + 2FA" | roadmap | 4 | roadmap-with-file → team-planex |
| "specification: 用户系统" | spec-driven | 4 | spec-generator → workflow-plan → workflow-execute |
| "team planex: 用户系统" | team-planex | Team | team-planex |
## Slash Commands ## Slash Commands
```bash ```bash
@@ -116,6 +203,8 @@ Single source of truth: **[command.json](command.json)**
/ccw-help # General help entry /ccw-help # General help entry
/ccw-help search <keyword> # Search commands /ccw-help search <keyword> # Search commands
/ccw-help next <command> # Get next step suggestions /ccw-help next <command> # Get next step suggestions
/ccw-help skills # Browse skill catalog
/ccw-help teams # Browse team skills
/ccw-issue # Issue reporting /ccw-issue # Issue reporting
``` ```
@@ -128,6 +217,9 @@ Single source of truth: **[command.json](command.json)**
/ccw "头脑风暴: 用户通知系统" # → detect brainstorm, use brainstorm-with-file /ccw "头脑风暴: 用户通知系统" # → detect brainstorm, use brainstorm-with-file
/ccw "深度调试: 系统随机崩溃" # → detect debug-file, use debug-with-file /ccw "深度调试: 系统随机崩溃" # → detect debug-file, use debug-with-file
/ccw "协作分析: 认证架构设计" # → detect analyze-file, use analyze-with-file /ccw "协作分析: 认证架构设计" # → detect analyze-file, use analyze-with-file
/ccw "roadmap: OAuth + 2FA 路线图" # → roadmap-with-file → team-planex
/ccw "集成测试: 支付流程" # → integration-test-cycle
/ccw "重构 auth 模块" # → refactor-cycle
``` ```
## Maintenance ## Maintenance
@@ -135,6 +227,7 @@ Single source of truth: **[command.json](command.json)**
### Update Mechanism ### Update Mechanism
CCW-Help skill supports manual updates through user confirmation dialog. CCW-Help skill supports manual updates through user confirmation dialog.
Script scans `commands/`, `agents/`, and `skills/` directories to regenerate all indexes.
#### How to Update #### How to Update
@@ -153,18 +246,33 @@ cd D:/Claude_dms3/.claude/skills/ccw-help
python scripts/auto-update.py python scripts/auto-update.py
``` ```
This runs `analyze_commands.py` to scan commands/ and agents/ directories and regenerate `command.json`. This runs `analyze_commands.py` to scan commands/, agents/, and skills/ directories and regenerate `command.json` + all index files.
#### Update Scripts #### Update Scripts
- **`auto-update.py`**: Simple wrapper that runs analyze_commands.py - **`auto-update.py`**: Simple wrapper that runs analyze_commands.py
- **`analyze_commands.py`**: Scans directories and generates command index - **`analyze_commands.py`**: Scans directories and generates command/agent/skill indexes
#### Generated Index Files
| File | Content |
|------|---------|
| `command.json` | Master index: commands + agents + skills |
| `index/all-commands.json` | Flat command list |
| `index/all-agents.json` | Agent directory |
| `index/all-skills.json` | Skill directory with metadata |
| `index/skills-by-category.json` | Skills grouped by category |
| `index/by-category.json` | Commands by category |
| `index/by-use-case.json` | Commands by usage scenario |
| `index/essential-commands.json` | Core commands for onboarding |
| `index/command-relationships.json` | Command flow relationships |
## Statistics ## Statistics
- **Commands**: 50+ - **Commands**: 50+
- **Agents**: 16 - **Agents**: 22
- **Workflows**: 6 main levels + 3 with-file variants - **Skills**: 36+ (7 workflow, 19 team, 10+ standalone/utility)
- **Workflows**: 6 main levels + 5 with-file variants + 2 cycle variants
- **Essential**: 10 core commands - **Essential**: 10 core commands
## Core Principle ## Core Principle

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,11 @@
"description": "|", "description": "|",
"source": "../../../agents/cli-planning-agent.md" "source": "../../../agents/cli-planning-agent.md"
}, },
{
"name": "cli-roadmap-plan-agent",
"description": "|",
"source": "../../../agents/cli-roadmap-plan-agent.md"
},
{ {
"name": "code-developer", "name": "code-developer",
"description": "|", "description": "|",
@@ -74,6 +79,16 @@
"description": "|", "description": "|",
"source": "../../../agents/tdd-developer.md" "source": "../../../agents/tdd-developer.md"
}, },
{
"name": "team-worker",
"description": "|",
"source": "../../../agents/team-worker.md"
},
{
"name": "test-action-planning-agent",
"description": "|",
"source": "../../../agents/test-action-planning-agent.md"
},
{ {
"name": "test-context-search-agent", "name": "test-context-search-agent",
"description": "|", "description": "|",

View File

@@ -43,6 +43,72 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/cli/codex-review.md" "source": "../../../commands/cli/codex-review.md"
}, },
{
"name": "flow-create",
"command": "/flow-create",
"description": "",
"arguments": "",
"category": "general",
"subcategory": null,
"usage_scenario": "implementation",
"difficulty": "Intermediate",
"source": "../../../commands/flow-create.md"
},
{
"name": "add",
"command": "/idaw:add",
"description": "Add IDAW tasks - manual creation or import from ccw issue",
"arguments": "[-y|--yes] [--from-issue <id>[,<id>,...]] \\\"description\\\" [--type <task_type>] [--priority <1-5>]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/add.md"
},
{
"name": "resume",
"command": "/idaw:resume",
"description": "Resume interrupted IDAW session from last checkpoint",
"arguments": "[-y|--yes] [session-id]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "session-management",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/resume.md"
},
{
"name": "run-coordinate",
"command": "/idaw:run-coordinate",
"description": "IDAW coordinator - execute task skill chains via external CLI with hook callbacks and git checkpoints",
"arguments": "[-y|--yes] [--task <id>[,<id>,...]] [--dry-run] [--tool <tool>]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/run-coordinate.md"
},
{
"name": "run",
"command": "/idaw:run",
"description": "IDAW orchestrator - execute task skill chains serially with git checkpoints",
"arguments": "[-y|--yes] [--task <id>[,<id>,...]] [--dry-run]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/run.md"
},
{
"name": "status",
"command": "/idaw:status",
"description": "View IDAW task and session progress",
"arguments": "[session-id]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "session-management",
"difficulty": "Beginner",
"source": "../../../commands/idaw/status.md"
},
{ {
"name": "convert-to-plan", "name": "convert-to-plan",
"command": "/issue:convert-to-plan", "command": "/issue:convert-to-plan",
@@ -131,6 +197,17 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/issue/queue.md" "source": "../../../commands/issue/queue.md"
}, },
{
"name": "prepare",
"command": "/memory:prepare",
"description": "Delegate to universal-executor agent to analyze project via Gemini/Qwen CLI and return JSON core content package for task context",
"arguments": "[--tool gemini|qwen] \\\"task context description\\",
"category": "memory",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/memory/prepare.md"
},
{ {
"name": "style-skill-memory", "name": "style-skill-memory",
"command": "/memory:style-skill-memory", "command": "/memory:style-skill-memory",
@@ -175,6 +252,17 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/clean.md" "source": "../../../commands/workflow/clean.md"
}, },
{
"name": "workflow:collaborative-plan-with-file",
"command": "/workflow:collaborative-plan-with-file",
"description": "Collaborative planning with Plan Note - Understanding agent creates shared plan-note.md template, parallel agents fill pre-allocated sections, conflict detection without merge. Outputs executable plan-note.md.",
"arguments": "[-y|--yes] <task description> [--max-agents=5]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "planning",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/collaborative-plan-with-file.md"
},
{ {
"name": "debug-with-file", "name": "debug-with-file",
"command": "/workflow:debug-with-file", "command": "/workflow:debug-with-file",
@@ -186,17 +274,72 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/debug-with-file.md" "source": "../../../commands/workflow/debug-with-file.md"
}, },
{
"name": "init-guidelines",
"command": "/workflow:init-guidelines",
"description": "Interactive wizard to fill specs/*.md based on project analysis",
"arguments": "[--reset]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/init-guidelines.md"
},
{
"name": "init-specs",
"command": "/workflow:init-specs",
"description": "Interactive wizard to create individual specs or personal constraints with scope selection",
"arguments": "[--scope <global|project>] [--dimension <specs|personal>] [--category <general|exploration|planning|execution>]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/init-specs.md"
},
{ {
"name": "init", "name": "init",
"command": "/workflow:init", "command": "/workflow:init",
"description": "Initialize project-level state with intelligent project analysis using cli-explore-agent", "description": "Initialize project-level state with intelligent project analysis using cli-explore-agent",
"arguments": "[--regenerate]", "arguments": "[--regenerate] [--skip-specs]",
"category": "workflow", "category": "workflow",
"subcategory": null, "subcategory": null,
"usage_scenario": "general", "usage_scenario": "general",
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/init.md" "source": "../../../commands/workflow/init.md"
}, },
{
"name": "integration-test-cycle",
"command": "/workflow:integration-test-cycle",
"description": "Self-iterating integration test workflow with codebase exploration, test development, autonomous test-fix cycles, and reflection-driven strategy adjustment",
"arguments": "[-y|--yes] [-c|--continue] [--max-iterations=N] \\\"module or feature description\\",
"category": "workflow",
"subcategory": null,
"usage_scenario": "testing",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/integration-test-cycle.md"
},
{
"name": "refactor-cycle",
"command": "/workflow:refactor-cycle",
"description": "Tech debt discovery and self-iterating refactoring with multi-dimensional analysis, prioritized execution, regression validation, and reflection-driven adjustment",
"arguments": "[-y|--yes] [-c|--continue] [--scope=module|project] \\\"module or refactoring goal\\",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/refactor-cycle.md"
},
{
"name": "roadmap-with-file",
"command": "/workflow:roadmap-with-file",
"description": "Strategic requirement roadmap with iterative decomposition and issue creation. Outputs roadmap.md (human-readable, single source) + issues.jsonl (machine-executable). Handoff to team-planex.",
"arguments": "[-y|--yes] [-c|--continue] [-m progressive|direct|auto] \\\"requirement description\\",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/roadmap-with-file.md"
},
{ {
"name": "complete", "name": "complete",
"command": "/workflow:session:complete", "command": "/workflow:session:complete",
@@ -233,8 +376,8 @@
{ {
"name": "solidify", "name": "solidify",
"command": "/workflow:session:solidify", "command": "/workflow:session:solidify",
"description": "Crystallize session learnings and user-defined constraints into permanent project guidelines", "description": "Crystallize session learnings and user-defined constraints into permanent project guidelines, or compress recent memories",
"arguments": "[-y|--yes] [--type <convention|constraint|learning>] [--category <category>] \\\"rule or insight\\", "arguments": "[-y|--yes] [--type <convention|constraint|learning|compress>] [--category <category>] [--limit <N>] \\\"rule or insight\\",
"category": "workflow", "category": "workflow",
"subcategory": "session", "subcategory": "session",
"usage_scenario": "general", "usage_scenario": "general",
@@ -252,6 +395,17 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/session/start.md" "source": "../../../commands/workflow/session/start.md"
}, },
{
"name": "sync",
"command": "/workflow:session:sync",
"description": "Quick-sync session work to specs/*.md and project-tech",
"arguments": "[-y|--yes] [\\\"what was done\\\"]",
"category": "workflow",
"subcategory": "session",
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/session/sync.md"
},
{ {
"name": "animation-extract", "name": "animation-extract",
"command": "/workflow:ui-design:animation-extract", "command": "/workflow:ui-design:animation-extract",
@@ -366,7 +520,7 @@
"name": "unified-execute-with-file", "name": "unified-execute-with-file",
"command": "/workflow:unified-execute-with-file", "command": "/workflow:unified-execute-with-file",
"description": "Universal execution engine for consuming any planning/brainstorm/analysis output with minimal progress tracking, multi-agent coordination, and incremental execution", "description": "Universal execution engine for consuming any planning/brainstorm/analysis output with minimal progress tracking, multi-agent coordination, and incremental execution",
"arguments": "[-y|--yes] [-p|--plan <path>] [-m|--mode sequential|parallel] [\\\"execution context or task name\\\"]", "arguments": "[-y|--yes] [<path>[,<path2>] | -p|--plan <path>[,<path2>]] [--auto-commit] [--commit-prefix \\\"prefix\\\"] [\\\"execution context or task name\\\"]",
"category": "workflow", "category": "workflow",
"subcategory": null, "subcategory": null,
"usage_scenario": "implementation", "usage_scenario": "implementation",

View File

@@ -0,0 +1,362 @@
[
{
"name": "brainstorm",
"description": "Unified brainstorming skill with dual-mode operation - auto pipeline and single role analysis. Triggers on \"brainstorm\", \"头脑风暴\".",
"category": "standalone",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/brainstorm/SKILL.md"
},
{
"name": "command-generator",
"description": "Command file generator - 5 phase workflow for creating Claude Code command files with YAML frontmatter. Generates .md command files for project or user scope. Triggers on \"create command\", \"new command\", \"command generator\".",
"category": "meta",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/command-generator/SKILL.md"
},
{
"name": "issue-manage",
"description": "Interactive issue management with menu-driven CRUD operations. Use when managing issues, viewing issue status, editing issue fields, performing bulk operations, or viewing issue history. Triggers on \"manage issue\", \"list issues\", \"edit issue\", \"delete issue\", \"bulk update\", \"issue dashboard\", \"issue history\", \"completed issues\".",
"category": "utility",
"is_team": false,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/issue-manage/SKILL.md"
},
{
"name": "memory-capture",
"description": "Unified memory capture with routing - session compact or quick tips. Triggers on \"memory capture\", \"compact session\", \"save session\", \"quick tip\", \"memory tips\", \"记录\", \"压缩会话\".",
"category": "utility",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/memory-capture/SKILL.md"
},
{
"name": "memory-manage",
"description": "Unified memory management - CLAUDE.md updates and documentation generation with interactive routing. Triggers on \"memory manage\", \"update claude\", \"update memory\", \"generate docs\", \"更新记忆\", \"生成文档\".",
"category": "utility",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/memory-manage/SKILL.md"
},
{
"name": "review-code",
"description": "Multi-dimensional code review with structured reports. Analyzes correctness, readability, performance, security, testing, and architecture. Triggers on \"review code\", \"code review\", \"审查代码\", \"代码审查\".",
"category": "review",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/review-code/SKILL.md"
},
{
"name": "review-cycle",
"description": "Unified multi-dimensional code review with automated fix orchestration. Routes to session-based (git changes), module-based (path patterns), or fix mode. Triggers on \"workflow:review-cycle\", \"workflow:review-session-cycle\", \"workflow:review-module-cycle\", \"workflow:review-cycle-fix\".",
"category": "review",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/review-cycle/SKILL.md"
},
{
"name": "skill-generator",
"description": "Meta-skill for creating new Claude Code skills with configurable execution modes. Supports sequential (fixed order) and autonomous (stateless) phase patterns. Use for skill scaffolding, skill creation, or building new workflows. Triggers on \"create skill\", \"new skill\", \"skill generator\".",
"category": "meta",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/skill-generator/SKILL.md"
},
{
"name": "skill-tuning",
"description": "Universal skill diagnosis and optimization tool. Detect and fix skill execution issues including context explosion, long-tail forgetting, data flow disruption, and agent coordination failures. Supports Gemini CLI for deep analysis. Triggers on \"skill tuning\", \"tune skill\", \"skill diagnosis\", \"optimize skill\", \"skill debug\".",
"category": "meta",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/skill-tuning/SKILL.md"
},
{
"name": "spec-generator",
"description": "Specification generator - 6 phase document chain producing product brief, PRD, architecture, and epics. Triggers on \"generate spec\", \"create specification\", \"spec generator\", \"workflow:spec\".",
"category": "meta",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/spec-generator/SKILL.md"
},
{
"name": "team-brainstorm",
"description": "Unified team skill for brainstorming team. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team brainstorm\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-brainstorm/SKILL.md"
},
{
"name": "team-coordinate",
"description": "Universal team coordination skill with dynamic role generation. Only coordinator is built-in -- all worker roles are generated at runtime based on task analysis. Beat/cadence model for orchestration. Triggers on \"team coordinate\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-coordinate/SKILL.md"
},
{
"name": "team-coordinate-v2",
"description": "Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for orchestration. Triggers on \"team coordinate v2\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-coordinate-v2/SKILL.md"
},
{
"name": "team-executor",
"description": "Lightweight session execution skill. Resumes existing team-coordinate sessions for pure execution. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"team executor\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-executor/SKILL.md"
},
{
"name": "team-executor-v2",
"description": "Lightweight session execution skill. Resumes existing team-coordinate-v2 sessions for pure execution via team-worker agents. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"team executor v2\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-executor-v2/SKILL.md"
},
{
"name": "team-frontend",
"description": "Unified team skill for frontend development team. All roles invoke this skill with --role arg. Built-in ui-ux-pro-max design intelligence. Triggers on \"team frontend\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-frontend/SKILL.md"
},
{
"name": "team-issue",
"description": "Unified team skill for issue resolution. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team issue\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-issue/SKILL.md"
},
{
"name": "team-iterdev",
"description": "Unified team skill for iterative development team. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team iterdev\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-iterdev/SKILL.md"
},
{
"name": "team-lifecycle-v3",
"description": "Unified team skill for full lifecycle - spec/impl/test. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team lifecycle\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-lifecycle-v3/SKILL.md"
},
{
"name": "team-lifecycle-v4",
"description": "Unified team skill for full lifecycle - spec/impl/test. Optimized cadence with inline discuss subagent and shared explore. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team lifecycle\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-lifecycle-v4/SKILL.md"
},
{
"name": "team-lifecycle-v5",
"description": "Unified team skill for full lifecycle - spec/impl/test. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents loaded with role-specific Phase 2-4 specs. Triggers on \"team lifecycle\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": true,
"version": "",
"source": "../../../skills/team-lifecycle-v5/SKILL.md"
},
{
"name": "team-planex",
"description": "Unified team skill for plan-and-execute pipeline. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on \"team planex\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": true,
"version": "",
"source": "../../../skills/team-planex/SKILL.md"
},
{
"name": "team-quality-assurance",
"description": "Unified team skill for quality assurance team. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team quality-assurance\", \"team qa\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-quality-assurance/SKILL.md"
},
{
"name": "team-review",
"description": "Unified team skill for code scanning, vulnerability review, optimization suggestions, and automated fix. 4-role team: coordinator, scanner, reviewer, fixer. Triggers on team-review.",
"category": "team",
"is_team": false,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-review/SKILL.md"
},
{
"name": "team-roadmap-dev",
"description": "Unified team skill for roadmap-driven development workflow. Coordinator discusses roadmap with user, then dispatches phased execution pipeline (plan -> execute -> verify). All roles invoke this skill with --role arg. Triggers on \"team roadmap-dev\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-roadmap-dev/SKILL.md"
},
{
"name": "team-tech-debt",
"description": "Unified team skill for tech debt identification and cleanup. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team tech-debt\", \"tech debt cleanup\", \"技术债务\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-tech-debt/SKILL.md"
},
{
"name": "team-testing",
"description": "Unified team skill for testing team. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team testing\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-testing/SKILL.md"
},
{
"name": "team-uidesign",
"description": "Unified team skill for UI design team. All roles invoke this skill with --role arg for role-specific execution. CP-9 Dual-Track design+implementation.",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-uidesign/SKILL.md"
},
{
"name": "team-ultra-analyze",
"description": "Unified team skill for deep collaborative analysis. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team ultra-analyze\", \"team analyze\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-ultra-analyze/SKILL.md"
},
{
"name": "workflow-execute",
"description": "Coordinate agent execution for workflow tasks with automatic session discovery, parallel task processing, and status tracking. Triggers on \"workflow-execute\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-execute/SKILL.md"
},
{
"name": "workflow-lite-planex",
"description": "Lightweight planning and execution skill (Phase 1: plan, Phase 2: execute). Triggers on \"workflow-lite-planex\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-lite-planex/SKILL.md"
},
{
"name": "workflow-multi-cli-plan",
"description": "Multi-CLI collaborative planning and execution skill with integrated execution phase. Triggers on \"workflow-multi-cli-plan\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-multi-cli-plan/SKILL.md"
},
{
"name": "workflow-plan",
"description": "Unified planning skill - 4-phase planning workflow, plan verification, and interactive replanning. Triggers on \"workflow-plan\", \"workflow-plan-verify\", \"workflow:replan\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-plan/SKILL.md"
},
{
"name": "workflow-skill-designer",
"description": "Meta-skill for designing orchestrator+phases structured workflow skills. Creates SKILL.md coordinator with progressive phase loading, TodoWrite patterns, and data flow. Triggers on \"design workflow skill\", \"create workflow skill\", \"workflow skill designer\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-skill-designer/SKILL.md"
},
{
"name": "workflow-tdd-plan-plan",
"description": "Unified TDD workflow skill combining 6-phase TDD planning with Red-Green-Refactor task chain generation, and 4-phase TDD verification with compliance reporting. Triggers on \"workflow-tdd-plan\", \"workflow-tdd-verify\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-tdd-plan/SKILL.md"
},
{
"name": "workflow-test-fix",
"description": "Unified test-fix pipeline combining test generation (session, context, analysis, task gen) with iterative test-cycle execution (adaptive strategy, progressive testing, CLI fallback). Triggers on \"workflow-test-fix\", \"workflow-test-fix\", \"test fix workflow\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-test-fix/SKILL.md"
}
]

View File

@@ -22,6 +22,17 @@
"usage_scenario": "general", "usage_scenario": "general",
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/ccw.md" "source": "../../../commands/ccw.md"
},
{
"name": "flow-create",
"command": "/flow-create",
"description": "",
"arguments": "",
"category": "general",
"subcategory": null,
"usage_scenario": "implementation",
"difficulty": "Intermediate",
"source": "../../../commands/flow-create.md"
} }
] ]
}, },
@@ -51,6 +62,65 @@
} }
] ]
}, },
"idaw": {
"_root": [
{
"name": "add",
"command": "/idaw:add",
"description": "Add IDAW tasks - manual creation or import from ccw issue",
"arguments": "[-y|--yes] [--from-issue <id>[,<id>,...]] \\\"description\\\" [--type <task_type>] [--priority <1-5>]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/add.md"
},
{
"name": "resume",
"command": "/idaw:resume",
"description": "Resume interrupted IDAW session from last checkpoint",
"arguments": "[-y|--yes] [session-id]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "session-management",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/resume.md"
},
{
"name": "run-coordinate",
"command": "/idaw:run-coordinate",
"description": "IDAW coordinator - execute task skill chains via external CLI with hook callbacks and git checkpoints",
"arguments": "[-y|--yes] [--task <id>[,<id>,...]] [--dry-run] [--tool <tool>]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/run-coordinate.md"
},
{
"name": "run",
"command": "/idaw:run",
"description": "IDAW orchestrator - execute task skill chains serially with git checkpoints",
"arguments": "[-y|--yes] [--task <id>[,<id>,...]] [--dry-run]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/run.md"
},
{
"name": "status",
"command": "/idaw:status",
"description": "View IDAW task and session progress",
"arguments": "[session-id]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "session-management",
"difficulty": "Beginner",
"source": "../../../commands/idaw/status.md"
}
]
},
"issue": { "issue": {
"_root": [ "_root": [
{ {
@@ -145,6 +215,17 @@
}, },
"memory": { "memory": {
"_root": [ "_root": [
{
"name": "prepare",
"command": "/memory:prepare",
"description": "Delegate to universal-executor agent to analyze project via Gemini/Qwen CLI and return JSON core content package for task context",
"arguments": "[--tool gemini|qwen] \\\"task context description\\",
"category": "memory",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/memory/prepare.md"
},
{ {
"name": "style-skill-memory", "name": "style-skill-memory",
"command": "/memory:style-skill-memory", "command": "/memory:style-skill-memory",
@@ -193,6 +274,17 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/clean.md" "source": "../../../commands/workflow/clean.md"
}, },
{
"name": "workflow:collaborative-plan-with-file",
"command": "/workflow:collaborative-plan-with-file",
"description": "Collaborative planning with Plan Note - Understanding agent creates shared plan-note.md template, parallel agents fill pre-allocated sections, conflict detection without merge. Outputs executable plan-note.md.",
"arguments": "[-y|--yes] <task description> [--max-agents=5]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "planning",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/collaborative-plan-with-file.md"
},
{ {
"name": "debug-with-file", "name": "debug-with-file",
"command": "/workflow:debug-with-file", "command": "/workflow:debug-with-file",
@@ -204,22 +296,77 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/debug-with-file.md" "source": "../../../commands/workflow/debug-with-file.md"
}, },
{
"name": "init-guidelines",
"command": "/workflow:init-guidelines",
"description": "Interactive wizard to fill specs/*.md based on project analysis",
"arguments": "[--reset]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/init-guidelines.md"
},
{
"name": "init-specs",
"command": "/workflow:init-specs",
"description": "Interactive wizard to create individual specs or personal constraints with scope selection",
"arguments": "[--scope <global|project>] [--dimension <specs|personal>] [--category <general|exploration|planning|execution>]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/init-specs.md"
},
{ {
"name": "init", "name": "init",
"command": "/workflow:init", "command": "/workflow:init",
"description": "Initialize project-level state with intelligent project analysis using cli-explore-agent", "description": "Initialize project-level state with intelligent project analysis using cli-explore-agent",
"arguments": "[--regenerate]", "arguments": "[--regenerate] [--skip-specs]",
"category": "workflow", "category": "workflow",
"subcategory": null, "subcategory": null,
"usage_scenario": "general", "usage_scenario": "general",
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/init.md" "source": "../../../commands/workflow/init.md"
}, },
{
"name": "integration-test-cycle",
"command": "/workflow:integration-test-cycle",
"description": "Self-iterating integration test workflow with codebase exploration, test development, autonomous test-fix cycles, and reflection-driven strategy adjustment",
"arguments": "[-y|--yes] [-c|--continue] [--max-iterations=N] \\\"module or feature description\\",
"category": "workflow",
"subcategory": null,
"usage_scenario": "testing",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/integration-test-cycle.md"
},
{
"name": "refactor-cycle",
"command": "/workflow:refactor-cycle",
"description": "Tech debt discovery and self-iterating refactoring with multi-dimensional analysis, prioritized execution, regression validation, and reflection-driven adjustment",
"arguments": "[-y|--yes] [-c|--continue] [--scope=module|project] \\\"module or refactoring goal\\",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/refactor-cycle.md"
},
{
"name": "roadmap-with-file",
"command": "/workflow:roadmap-with-file",
"description": "Strategic requirement roadmap with iterative decomposition and issue creation. Outputs roadmap.md (human-readable, single source) + issues.jsonl (machine-executable). Handoff to team-planex.",
"arguments": "[-y|--yes] [-c|--continue] [-m progressive|direct|auto] \\\"requirement description\\",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/roadmap-with-file.md"
},
{ {
"name": "unified-execute-with-file", "name": "unified-execute-with-file",
"command": "/workflow:unified-execute-with-file", "command": "/workflow:unified-execute-with-file",
"description": "Universal execution engine for consuming any planning/brainstorm/analysis output with minimal progress tracking, multi-agent coordination, and incremental execution", "description": "Universal execution engine for consuming any planning/brainstorm/analysis output with minimal progress tracking, multi-agent coordination, and incremental execution",
"arguments": "[-y|--yes] [-p|--plan <path>] [-m|--mode sequential|parallel] [\\\"execution context or task name\\\"]", "arguments": "[-y|--yes] [<path>[,<path2>] | -p|--plan <path>[,<path2>]] [--auto-commit] [--commit-prefix \\\"prefix\\\"] [\\\"execution context or task name\\\"]",
"category": "workflow", "category": "workflow",
"subcategory": null, "subcategory": null,
"usage_scenario": "implementation", "usage_scenario": "implementation",
@@ -264,8 +411,8 @@
{ {
"name": "solidify", "name": "solidify",
"command": "/workflow:session:solidify", "command": "/workflow:session:solidify",
"description": "Crystallize session learnings and user-defined constraints into permanent project guidelines", "description": "Crystallize session learnings and user-defined constraints into permanent project guidelines, or compress recent memories",
"arguments": "[-y|--yes] [--type <convention|constraint|learning>] [--category <category>] \\\"rule or insight\\", "arguments": "[-y|--yes] [--type <convention|constraint|learning|compress>] [--category <category>] [--limit <N>] \\\"rule or insight\\",
"category": "workflow", "category": "workflow",
"subcategory": "session", "subcategory": "session",
"usage_scenario": "general", "usage_scenario": "general",
@@ -282,6 +429,17 @@
"usage_scenario": "general", "usage_scenario": "general",
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/session/start.md" "source": "../../../commands/workflow/session/start.md"
},
{
"name": "sync",
"command": "/workflow:session:sync",
"description": "Quick-sync session work to specs/*.md and project-tech",
"arguments": "[-y|--yes] [\\\"what was done\\\"]",
"category": "workflow",
"subcategory": "session",
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/session/sync.md"
} }
], ],
"ui-design": [ "ui-design": [

View File

@@ -33,6 +33,39 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/cli/cli-init.md" "source": "../../../commands/cli/cli-init.md"
}, },
{
"name": "add",
"command": "/idaw:add",
"description": "Add IDAW tasks - manual creation or import from ccw issue",
"arguments": "[-y|--yes] [--from-issue <id>[,<id>,...]] \\\"description\\\" [--type <task_type>] [--priority <1-5>]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/add.md"
},
{
"name": "run-coordinate",
"command": "/idaw:run-coordinate",
"description": "IDAW coordinator - execute task skill chains via external CLI with hook callbacks and git checkpoints",
"arguments": "[-y|--yes] [--task <id>[,<id>,...]] [--dry-run] [--tool <tool>]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/run-coordinate.md"
},
{
"name": "run",
"command": "/idaw:run",
"description": "IDAW orchestrator - execute task skill chains serially with git checkpoints",
"arguments": "[-y|--yes] [--task <id>[,<id>,...]] [--dry-run]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/run.md"
},
{ {
"name": "issue:discover-by-prompt", "name": "issue:discover-by-prompt",
"command": "/issue:discover-by-prompt", "command": "/issue:discover-by-prompt",
@@ -77,6 +110,17 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/issue/queue.md" "source": "../../../commands/issue/queue.md"
}, },
{
"name": "prepare",
"command": "/memory:prepare",
"description": "Delegate to universal-executor agent to analyze project via Gemini/Qwen CLI and return JSON core content package for task context",
"arguments": "[--tool gemini|qwen] \\\"task context description\\",
"category": "memory",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/memory/prepare.md"
},
{ {
"name": "clean", "name": "clean",
"command": "/workflow:clean", "command": "/workflow:clean",
@@ -99,17 +143,61 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/debug-with-file.md" "source": "../../../commands/workflow/debug-with-file.md"
}, },
{
"name": "init-guidelines",
"command": "/workflow:init-guidelines",
"description": "Interactive wizard to fill specs/*.md based on project analysis",
"arguments": "[--reset]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/init-guidelines.md"
},
{
"name": "init-specs",
"command": "/workflow:init-specs",
"description": "Interactive wizard to create individual specs or personal constraints with scope selection",
"arguments": "[--scope <global|project>] [--dimension <specs|personal>] [--category <general|exploration|planning|execution>]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/init-specs.md"
},
{ {
"name": "init", "name": "init",
"command": "/workflow:init", "command": "/workflow:init",
"description": "Initialize project-level state with intelligent project analysis using cli-explore-agent", "description": "Initialize project-level state with intelligent project analysis using cli-explore-agent",
"arguments": "[--regenerate]", "arguments": "[--regenerate] [--skip-specs]",
"category": "workflow", "category": "workflow",
"subcategory": null, "subcategory": null,
"usage_scenario": "general", "usage_scenario": "general",
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/init.md" "source": "../../../commands/workflow/init.md"
}, },
{
"name": "refactor-cycle",
"command": "/workflow:refactor-cycle",
"description": "Tech debt discovery and self-iterating refactoring with multi-dimensional analysis, prioritized execution, regression validation, and reflection-driven adjustment",
"arguments": "[-y|--yes] [-c|--continue] [--scope=module|project] \\\"module or refactoring goal\\",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/refactor-cycle.md"
},
{
"name": "roadmap-with-file",
"command": "/workflow:roadmap-with-file",
"description": "Strategic requirement roadmap with iterative decomposition and issue creation. Outputs roadmap.md (human-readable, single source) + issues.jsonl (machine-executable). Handoff to team-planex.",
"arguments": "[-y|--yes] [-c|--continue] [-m progressive|direct|auto] \\\"requirement description\\",
"category": "workflow",
"subcategory": null,
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/roadmap-with-file.md"
},
{ {
"name": "list", "name": "list",
"command": "/workflow:session:list", "command": "/workflow:session:list",
@@ -124,8 +212,8 @@
{ {
"name": "solidify", "name": "solidify",
"command": "/workflow:session:solidify", "command": "/workflow:session:solidify",
"description": "Crystallize session learnings and user-defined constraints into permanent project guidelines", "description": "Crystallize session learnings and user-defined constraints into permanent project guidelines, or compress recent memories",
"arguments": "[-y|--yes] [--type <convention|constraint|learning>] [--category <category>] \\\"rule or insight\\", "arguments": "[-y|--yes] [--type <convention|constraint|learning|compress>] [--category <category>] [--limit <N>] \\\"rule or insight\\",
"category": "workflow", "category": "workflow",
"subcategory": "session", "subcategory": "session",
"usage_scenario": "general", "usage_scenario": "general",
@@ -143,6 +231,17 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/session/start.md" "source": "../../../commands/workflow/session/start.md"
}, },
{
"name": "sync",
"command": "/workflow:session:sync",
"description": "Quick-sync session work to specs/*.md and project-tech",
"arguments": "[-y|--yes] [\\\"what was done\\\"]",
"category": "workflow",
"subcategory": "session",
"usage_scenario": "general",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/session/sync.md"
},
{ {
"name": "animation-extract", "name": "animation-extract",
"command": "/workflow:ui-design:animation-extract", "command": "/workflow:ui-design:animation-extract",
@@ -223,6 +322,98 @@
"source": "../../../commands/workflow/analyze-with-file.md" "source": "../../../commands/workflow/analyze-with-file.md"
} }
], ],
"implementation": [
{
"name": "flow-create",
"command": "/flow-create",
"description": "",
"arguments": "",
"category": "general",
"subcategory": null,
"usage_scenario": "implementation",
"difficulty": "Intermediate",
"source": "../../../commands/flow-create.md"
},
{
"name": "execute",
"command": "/issue:execute",
"description": "Execute queue with DAG-based parallel orchestration (one commit per solution)",
"arguments": "[-y|--yes] --queue <queue-id> [--worktree [<existing-path>]]",
"category": "issue",
"subcategory": null,
"usage_scenario": "implementation",
"difficulty": "Intermediate",
"source": "../../../commands/issue/execute.md"
},
{
"name": "generate",
"command": "/workflow:ui-design:generate",
"description": "Assemble UI prototypes by combining layout templates with design tokens (default animation support), pure assembler without new content generation",
"arguments": "[--design-id <id>] [--session <id>]",
"category": "workflow",
"subcategory": "ui-design",
"usage_scenario": "implementation",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/ui-design/generate.md"
},
{
"name": "unified-execute-with-file",
"command": "/workflow:unified-execute-with-file",
"description": "Universal execution engine for consuming any planning/brainstorm/analysis output with minimal progress tracking, multi-agent coordination, and incremental execution",
"arguments": "[-y|--yes] [<path>[,<path2>] | -p|--plan <path>[,<path2>]] [--auto-commit] [--commit-prefix \\\"prefix\\\"] [\\\"execution context or task name\\\"]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "implementation",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/unified-execute-with-file.md"
}
],
"session-management": [
{
"name": "resume",
"command": "/idaw:resume",
"description": "Resume interrupted IDAW session from last checkpoint",
"arguments": "[-y|--yes] [session-id]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "session-management",
"difficulty": "Intermediate",
"source": "../../../commands/idaw/resume.md"
},
{
"name": "status",
"command": "/idaw:status",
"description": "View IDAW task and session progress",
"arguments": "[session-id]",
"category": "idaw",
"subcategory": null,
"usage_scenario": "session-management",
"difficulty": "Beginner",
"source": "../../../commands/idaw/status.md"
},
{
"name": "complete",
"command": "/workflow:session:complete",
"description": "Mark active workflow session as complete, archive with lessons learned, update manifest, remove active flag",
"arguments": "[-y|--yes] [--detailed]",
"category": "workflow",
"subcategory": "session",
"usage_scenario": "session-management",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/session/complete.md"
},
{
"name": "resume",
"command": "/workflow:session:resume",
"description": "Resume the most recently paused workflow session with automatic session discovery and status update",
"arguments": "",
"category": "workflow",
"subcategory": "session",
"usage_scenario": "session-management",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/session/resume.md"
}
],
"planning": [ "planning": [
{ {
"name": "convert-to-plan", "name": "convert-to-plan",
@@ -268,6 +459,17 @@
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/brainstorm-with-file.md" "source": "../../../commands/workflow/brainstorm-with-file.md"
}, },
{
"name": "workflow:collaborative-plan-with-file",
"command": "/workflow:collaborative-plan-with-file",
"description": "Collaborative planning with Plan Note - Understanding agent creates shared plan-note.md template, parallel agents fill pre-allocated sections, conflict detection without merge. Outputs executable plan-note.md.",
"arguments": "[-y|--yes] <task description> [--max-agents=5]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "planning",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/collaborative-plan-with-file.md"
},
{ {
"name": "workflow:ui-design:codify-style", "name": "workflow:ui-design:codify-style",
"command": "/workflow:ui-design:codify-style", "command": "/workflow:ui-design:codify-style",
@@ -313,41 +515,6 @@
"source": "../../../commands/workflow/ui-design/reference-page-generator.md" "source": "../../../commands/workflow/ui-design/reference-page-generator.md"
} }
], ],
"implementation": [
{
"name": "execute",
"command": "/issue:execute",
"description": "Execute queue with DAG-based parallel orchestration (one commit per solution)",
"arguments": "[-y|--yes] --queue <queue-id> [--worktree [<existing-path>]]",
"category": "issue",
"subcategory": null,
"usage_scenario": "implementation",
"difficulty": "Intermediate",
"source": "../../../commands/issue/execute.md"
},
{
"name": "generate",
"command": "/workflow:ui-design:generate",
"description": "Assemble UI prototypes by combining layout templates with design tokens (default animation support), pure assembler without new content generation",
"arguments": "[--design-id <id>] [--session <id>]",
"category": "workflow",
"subcategory": "ui-design",
"usage_scenario": "implementation",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/ui-design/generate.md"
},
{
"name": "unified-execute-with-file",
"command": "/workflow:unified-execute-with-file",
"description": "Universal execution engine for consuming any planning/brainstorm/analysis output with minimal progress tracking, multi-agent coordination, and incremental execution",
"arguments": "[-y|--yes] [-p|--plan <path>] [-m|--mode sequential|parallel] [\\\"execution context or task name\\\"]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "implementation",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/unified-execute-with-file.md"
}
],
"documentation": [ "documentation": [
{ {
"name": "style-skill-memory", "name": "style-skill-memory",
@@ -361,28 +528,17 @@
"source": "../../../commands/memory/style-skill-memory.md" "source": "../../../commands/memory/style-skill-memory.md"
} }
], ],
"session-management": [ "testing": [
{ {
"name": "complete", "name": "integration-test-cycle",
"command": "/workflow:session:complete", "command": "/workflow:integration-test-cycle",
"description": "Mark active workflow session as complete, archive with lessons learned, update manifest, remove active flag", "description": "Self-iterating integration test workflow with codebase exploration, test development, autonomous test-fix cycles, and reflection-driven strategy adjustment",
"arguments": "[-y|--yes] [--detailed]", "arguments": "[-y|--yes] [-c|--continue] [--max-iterations=N] \\\"module or feature description\\",
"category": "workflow", "category": "workflow",
"subcategory": "session", "subcategory": null,
"usage_scenario": "session-management", "usage_scenario": "testing",
"difficulty": "Intermediate", "difficulty": "Intermediate",
"source": "../../../commands/workflow/session/complete.md" "source": "../../../commands/workflow/integration-test-cycle.md"
},
{
"name": "resume",
"command": "/workflow:session:resume",
"description": "Resume the most recently paused workflow session with automatic session discovery and status update",
"arguments": "",
"category": "workflow",
"subcategory": "session",
"usage_scenario": "session-management",
"difficulty": "Intermediate",
"source": "../../../commands/workflow/session/resume.md"
} }
] ]
} }

View File

@@ -1,15 +1,146 @@
{ {
"workflow-plan": {
"calls_internally": [
"workflow:session:start",
"workflow:tools:context-gather",
"workflow:tools:conflict-resolution",
"workflow:tools:task-generate-agent"
],
"next_steps": [
"workflow-plan-verify",
"workflow:status",
"workflow-execute"
],
"alternatives": [
"workflow-tdd-plan"
],
"prerequisites": []
},
"workflow-tdd-plan": {
"calls_internally": [
"workflow:session:start",
"workflow:tools:context-gather",
"workflow:tools:task-generate-tdd"
],
"next_steps": [
"workflow-tdd-verify",
"workflow:status",
"workflow-execute"
],
"alternatives": [
"workflow-plan"
],
"prerequisites": []
},
"workflow-execute": {
"prerequisites": [
"workflow-plan",
"workflow-tdd-plan"
],
"related": [
"workflow:status",
"workflow:resume"
],
"next_steps": [
"workflow:review",
"workflow-tdd-verify"
]
},
"workflow-plan-verify": {
"prerequisites": [
"workflow-plan"
],
"next_steps": [
"workflow-execute"
],
"related": [
"workflow:status"
]
},
"workflow-tdd-verify": {
"prerequisites": [
"workflow-execute"
],
"related": [
"workflow:tools:tdd-coverage-analysis"
]
},
"workflow:session:start": { "workflow:session:start": {
"next_steps": [], "next_steps": [
"workflow-plan",
"workflow-execute"
],
"related": [ "related": [
"workflow:session:list", "workflow:session:list",
"workflow:session:resume" "workflow:session:resume"
] ]
}, },
"workflow:session:resume": { "workflow:session:resume": {
"alternatives": [], "alternatives": [
"workflow:resume"
],
"related": [ "related": [
"workflow:session:list" "workflow:session:list",
"workflow:status"
]
},
"workflow-lite-planex": {
"calls_internally": [],
"next_steps": [
"workflow:status"
],
"alternatives": [
"workflow-plan"
],
"prerequisites": []
},
"workflow:lite-fix": {
"next_steps": [
"workflow:status"
],
"alternatives": [
"workflow-lite-planex"
],
"related": [
"workflow-test-fix"
]
},
"workflow:review-session-cycle": {
"prerequisites": [
"workflow-execute"
],
"next_steps": [
"workflow:review-fix"
],
"related": [
"workflow:review-module-cycle"
]
},
"workflow:review-fix": {
"prerequisites": [
"workflow:review-module-cycle",
"workflow:review-session-cycle"
],
"related": [
"workflow-test-fix"
]
},
"memory:docs": {
"calls_internally": [
"workflow:session:start",
"workflow:tools:context-gather"
],
"next_steps": [
"workflow-execute"
]
},
"memory:skill-memory": {
"next_steps": [
"workflow-plan",
"cli:analyze"
],
"related": [
"memory:load-skill-memory"
] ]
} }
} }

View File

@@ -0,0 +1,374 @@
{
"standalone": [
{
"name": "brainstorm",
"description": "Unified brainstorming skill with dual-mode operation - auto pipeline and single role analysis. Triggers on \"brainstorm\", \"头脑风暴\".",
"category": "standalone",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/brainstorm/SKILL.md"
}
],
"meta": [
{
"name": "command-generator",
"description": "Command file generator - 5 phase workflow for creating Claude Code command files with YAML frontmatter. Generates .md command files for project or user scope. Triggers on \"create command\", \"new command\", \"command generator\".",
"category": "meta",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/command-generator/SKILL.md"
},
{
"name": "skill-generator",
"description": "Meta-skill for creating new Claude Code skills with configurable execution modes. Supports sequential (fixed order) and autonomous (stateless) phase patterns. Use for skill scaffolding, skill creation, or building new workflows. Triggers on \"create skill\", \"new skill\", \"skill generator\".",
"category": "meta",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/skill-generator/SKILL.md"
},
{
"name": "skill-tuning",
"description": "Universal skill diagnosis and optimization tool. Detect and fix skill execution issues including context explosion, long-tail forgetting, data flow disruption, and agent coordination failures. Supports Gemini CLI for deep analysis. Triggers on \"skill tuning\", \"tune skill\", \"skill diagnosis\", \"optimize skill\", \"skill debug\".",
"category": "meta",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/skill-tuning/SKILL.md"
},
{
"name": "spec-generator",
"description": "Specification generator - 6 phase document chain producing product brief, PRD, architecture, and epics. Triggers on \"generate spec\", \"create specification\", \"spec generator\", \"workflow:spec\".",
"category": "meta",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/spec-generator/SKILL.md"
}
],
"utility": [
{
"name": "issue-manage",
"description": "Interactive issue management with menu-driven CRUD operations. Use when managing issues, viewing issue status, editing issue fields, performing bulk operations, or viewing issue history. Triggers on \"manage issue\", \"list issues\", \"edit issue\", \"delete issue\", \"bulk update\", \"issue dashboard\", \"issue history\", \"completed issues\".",
"category": "utility",
"is_team": false,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/issue-manage/SKILL.md"
},
{
"name": "memory-capture",
"description": "Unified memory capture with routing - session compact or quick tips. Triggers on \"memory capture\", \"compact session\", \"save session\", \"quick tip\", \"memory tips\", \"记录\", \"压缩会话\".",
"category": "utility",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/memory-capture/SKILL.md"
},
{
"name": "memory-manage",
"description": "Unified memory management - CLAUDE.md updates and documentation generation with interactive routing. Triggers on \"memory manage\", \"update claude\", \"update memory\", \"generate docs\", \"更新记忆\", \"生成文档\".",
"category": "utility",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/memory-manage/SKILL.md"
}
],
"review": [
{
"name": "review-code",
"description": "Multi-dimensional code review with structured reports. Analyzes correctness, readability, performance, security, testing, and architecture. Triggers on \"review code\", \"code review\", \"审查代码\", \"代码审查\".",
"category": "review",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/review-code/SKILL.md"
},
{
"name": "review-cycle",
"description": "Unified multi-dimensional code review with automated fix orchestration. Routes to session-based (git changes), module-based (path patterns), or fix mode. Triggers on \"workflow:review-cycle\", \"workflow:review-session-cycle\", \"workflow:review-module-cycle\", \"workflow:review-cycle-fix\".",
"category": "review",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/review-cycle/SKILL.md"
}
],
"team": [
{
"name": "team-brainstorm",
"description": "Unified team skill for brainstorming team. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team brainstorm\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-brainstorm/SKILL.md"
},
{
"name": "team-coordinate",
"description": "Universal team coordination skill with dynamic role generation. Only coordinator is built-in -- all worker roles are generated at runtime based on task analysis. Beat/cadence model for orchestration. Triggers on \"team coordinate\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-coordinate/SKILL.md"
},
{
"name": "team-coordinate-v2",
"description": "Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for orchestration. Triggers on \"team coordinate v2\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-coordinate-v2/SKILL.md"
},
{
"name": "team-executor",
"description": "Lightweight session execution skill. Resumes existing team-coordinate sessions for pure execution. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"team executor\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-executor/SKILL.md"
},
{
"name": "team-executor-v2",
"description": "Lightweight session execution skill. Resumes existing team-coordinate-v2 sessions for pure execution via team-worker agents. No analysis, no role generation -- only loads and executes. Session path required. Triggers on \"team executor v2\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-executor-v2/SKILL.md"
},
{
"name": "team-frontend",
"description": "Unified team skill for frontend development team. All roles invoke this skill with --role arg. Built-in ui-ux-pro-max design intelligence. Triggers on \"team frontend\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-frontend/SKILL.md"
},
{
"name": "team-issue",
"description": "Unified team skill for issue resolution. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team issue\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-issue/SKILL.md"
},
{
"name": "team-iterdev",
"description": "Unified team skill for iterative development team. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team iterdev\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-iterdev/SKILL.md"
},
{
"name": "team-lifecycle-v3",
"description": "Unified team skill for full lifecycle - spec/impl/test. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team lifecycle\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-lifecycle-v3/SKILL.md"
},
{
"name": "team-lifecycle-v4",
"description": "Unified team skill for full lifecycle - spec/impl/test. Optimized cadence with inline discuss subagent and shared explore. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team lifecycle\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-lifecycle-v4/SKILL.md"
},
{
"name": "team-lifecycle-v5",
"description": "Unified team skill for full lifecycle - spec/impl/test. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents loaded with role-specific Phase 2-4 specs. Triggers on \"team lifecycle\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": true,
"version": "",
"source": "../../../skills/team-lifecycle-v5/SKILL.md"
},
{
"name": "team-planex",
"description": "Unified team skill for plan-and-execute pipeline. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on \"team planex\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": true,
"version": "",
"source": "../../../skills/team-planex/SKILL.md"
},
{
"name": "team-quality-assurance",
"description": "Unified team skill for quality assurance team. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team quality-assurance\", \"team qa\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-quality-assurance/SKILL.md"
},
{
"name": "team-review",
"description": "Unified team skill for code scanning, vulnerability review, optimization suggestions, and automated fix. 4-role team: coordinator, scanner, reviewer, fixer. Triggers on team-review.",
"category": "team",
"is_team": false,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-review/SKILL.md"
},
{
"name": "team-roadmap-dev",
"description": "Unified team skill for roadmap-driven development workflow. Coordinator discusses roadmap with user, then dispatches phased execution pipeline (plan -> execute -> verify). All roles invoke this skill with --role arg. Triggers on \"team roadmap-dev\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-roadmap-dev/SKILL.md"
},
{
"name": "team-tech-debt",
"description": "Unified team skill for tech debt identification and cleanup. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team tech-debt\", \"tech debt cleanup\", \"技术债务\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-tech-debt/SKILL.md"
},
{
"name": "team-testing",
"description": "Unified team skill for testing team. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team testing\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-testing/SKILL.md"
},
{
"name": "team-uidesign",
"description": "Unified team skill for UI design team. All roles invoke this skill with --role arg for role-specific execution. CP-9 Dual-Track design+implementation.",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-uidesign/SKILL.md"
},
{
"name": "team-ultra-analyze",
"description": "Unified team skill for deep collaborative analysis. All roles invoke this skill with --role arg for role-specific execution. Triggers on \"team ultra-analyze\", \"team analyze\".",
"category": "team",
"is_team": true,
"has_phases": false,
"has_role_specs": false,
"version": "",
"source": "../../../skills/team-ultra-analyze/SKILL.md"
}
],
"workflow": [
{
"name": "workflow-execute",
"description": "Coordinate agent execution for workflow tasks with automatic session discovery, parallel task processing, and status tracking. Triggers on \"workflow-execute\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-execute/SKILL.md"
},
{
"name": "workflow-lite-planex",
"description": "Lightweight planning and execution skill (Phase 1: plan, Phase 2: execute). Triggers on \"workflow-lite-planex\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-lite-planex/SKILL.md"
},
{
"name": "workflow-multi-cli-plan",
"description": "Multi-CLI collaborative planning and execution skill with integrated execution phase. Triggers on \"workflow-multi-cli-plan\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-multi-cli-plan/SKILL.md"
},
{
"name": "workflow-plan",
"description": "Unified planning skill - 4-phase planning workflow, plan verification, and interactive replanning. Triggers on \"workflow-plan\", \"workflow-plan-verify\", \"workflow:replan\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-plan/SKILL.md"
},
{
"name": "workflow-skill-designer",
"description": "Meta-skill for designing orchestrator+phases structured workflow skills. Creates SKILL.md coordinator with progressive phase loading, TodoWrite patterns, and data flow. Triggers on \"design workflow skill\", \"create workflow skill\", \"workflow skill designer\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-skill-designer/SKILL.md"
},
{
"name": "workflow-tdd-plan-plan",
"description": "Unified TDD workflow skill combining 6-phase TDD planning with Red-Green-Refactor task chain generation, and 4-phase TDD verification with compliance reporting. Triggers on \"workflow-tdd-plan\", \"workflow-tdd-verify\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-tdd-plan/SKILL.md"
},
{
"name": "workflow-test-fix",
"description": "Unified test-fix pipeline combining test generation (session, context, analysis, task gen) with iterative test-cycle execution (adaptive strategy, progressive testing, CLI fallback). Triggers on \"workflow-test-fix\", \"workflow-test-fix\", \"test fix workflow\".",
"category": "workflow",
"is_team": false,
"has_phases": true,
"has_role_specs": false,
"version": "",
"source": "../../../skills/workflow-test-fix/SKILL.md"
}
]
}

View File

@@ -1,11 +1,10 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
""" """
Analyze all command/agent files and generate index files for ccw-help skill. Analyze all command/agent/skill files and generate index files for ccw-help skill.
Outputs relative paths pointing to source files (no reference folder duplication). Outputs relative paths pointing to source files (no reference folder duplication).
""" """
import os import os
import re
import json import json
from pathlib import Path from pathlib import Path
from collections import defaultdict from collections import defaultdict
@@ -15,9 +14,13 @@ from typing import Dict, List, Any
BASE_DIR = Path("D:/Claude_dms3/.claude") BASE_DIR = Path("D:/Claude_dms3/.claude")
COMMANDS_DIR = BASE_DIR / "commands" COMMANDS_DIR = BASE_DIR / "commands"
AGENTS_DIR = BASE_DIR / "agents" AGENTS_DIR = BASE_DIR / "agents"
SKILLS_DIR = BASE_DIR / "skills"
SKILL_DIR = BASE_DIR / "skills" / "ccw-help" SKILL_DIR = BASE_DIR / "skills" / "ccw-help"
INDEX_DIR = SKILL_DIR / "index" INDEX_DIR = SKILL_DIR / "index"
# Skills to skip (internal/shared, not user-facing)
SKIP_SKILLS = {"_shared", "ccw-help"}
def parse_frontmatter(content: str) -> Dict[str, Any]: def parse_frontmatter(content: str) -> Dict[str, Any]:
"""Extract YAML frontmatter from markdown content.""" """Extract YAML frontmatter from markdown content."""
frontmatter = {} frontmatter = {}
@@ -139,6 +142,66 @@ def analyze_agent_file(file_path: Path) -> Dict[str, Any]:
"source": rel_path # Relative from index/ dir (e.g., "../../../agents/...") "source": rel_path # Relative from index/ dir (e.g., "../../../agents/...")
} }
def categorize_skill(name: str, description: str) -> str:
"""Determine skill category from name and description."""
if name.startswith('team-'):
return "team"
if name.startswith('workflow-'):
return "workflow"
if name.startswith('review-'):
return "review"
if name.startswith('spec-') or name.startswith('command-') or name.startswith('skill-'):
return "meta"
if name.startswith('memory-') or name.startswith('issue-'):
return "utility"
return "standalone"
def analyze_skill_dir(skill_path: Path) -> Dict[str, Any] | None:
"""Analyze a skill directory and extract metadata from SKILL.md."""
skill_md = skill_path / "SKILL.md"
if not skill_md.exists():
return None
with open(skill_md, 'r', encoding='utf-8') as f:
content = f.read()
frontmatter = parse_frontmatter(content)
name = frontmatter.get('name', skill_path.name)
description = frontmatter.get('description', '')
allowed_tools = frontmatter.get('allowed-tools', '')
version = frontmatter.get('version', '')
category = categorize_skill(name, description)
# Detect if it's a team skill (uses TeamCreate + SendMessage together)
is_team = 'TeamCreate' in allowed_tools and 'SendMessage' in allowed_tools
# Detect if it has phases
phases_dir = skill_path / "phases"
has_phases = phases_dir.exists() and any(phases_dir.iterdir()) if phases_dir.exists() else False
# Detect if it has role-specs
role_specs_dir = skill_path / "role-specs"
has_role_specs = role_specs_dir.exists() and any(role_specs_dir.iterdir()) if role_specs_dir.exists() else False
# Build relative path from INDEX_DIR
rel_from_base = skill_path.relative_to(BASE_DIR)
rel_path = "../../../" + str(rel_from_base).replace('\\', '/') + "/SKILL.md"
return {
"name": name,
"description": description,
"category": category,
"is_team": is_team,
"has_phases": has_phases,
"has_role_specs": has_role_specs,
"version": version,
"source": rel_path
}
def build_command_relationships() -> Dict[str, Any]: def build_command_relationships() -> Dict[str, Any]:
"""Build command relationship mappings.""" """Build command relationship mappings."""
return { return {
@@ -263,7 +326,24 @@ def main():
except Exception as e: except Exception as e:
print(f" ERROR analyzing {agent_file}: {e}") print(f" ERROR analyzing {agent_file}: {e}")
print(f"\nAnalyzed {len(all_commands)} commands, {len(all_agents)} agents") # Analyze skill directories
print("\n=== Analyzing Skill Files ===")
skill_dirs = [d for d in SKILLS_DIR.iterdir() if d.is_dir() and d.name not in SKIP_SKILLS]
print(f"Found {len(skill_dirs)} skill directories")
all_skills = []
for skill_dir in sorted(skill_dirs):
try:
metadata = analyze_skill_dir(skill_dir)
if metadata:
all_skills.append(metadata)
print(f" OK {metadata['name']} [{metadata['category']}]")
else:
print(f" SKIP {skill_dir.name} (no SKILL.md)")
except Exception as e:
print(f" ERROR analyzing {skill_dir}: {e}")
print(f"\nAnalyzed {len(all_commands)} commands, {len(all_agents)} agents, {len(all_skills)} skills")
# Generate index files # Generate index files
INDEX_DIR.mkdir(parents=True, exist_ok=True) INDEX_DIR.mkdir(parents=True, exist_ok=True)
@@ -316,15 +396,62 @@ def main():
json.dump(relationships, f, indent=2, ensure_ascii=False) json.dump(relationships, f, indent=2, ensure_ascii=False)
print(f"OK Generated {relationships_path.name} ({os.path.getsize(relationships_path)} bytes)") print(f"OK Generated {relationships_path.name} ({os.path.getsize(relationships_path)} bytes)")
# 7. all-skills.json
all_skills_path = INDEX_DIR / "all-skills.json"
with open(all_skills_path, 'w', encoding='utf-8') as f:
json.dump(all_skills, f, indent=2, ensure_ascii=False)
print(f"OK Generated {all_skills_path.name} ({os.path.getsize(all_skills_path)} bytes)")
# 8. skills-by-category.json
skills_by_cat = defaultdict(list)
for skill in all_skills:
skills_by_cat[skill['category']].append(skill)
skills_by_cat_path = INDEX_DIR / "skills-by-category.json"
with open(skills_by_cat_path, 'w', encoding='utf-8') as f:
json.dump(dict(skills_by_cat), f, indent=2, ensure_ascii=False)
print(f"OK Generated {skills_by_cat_path.name} ({os.path.getsize(skills_by_cat_path)} bytes)")
# Generate master command.json (includes commands, agents, skills)
master = {
"_metadata": {
"version": "4.0.0",
"total_commands": len(all_commands),
"total_agents": len(all_agents),
"total_skills": len(all_skills),
"description": "Auto-generated CCW-Help command index from analyze_commands.py",
"generated": "Auto-updated - all commands, agents, skills synced from file system",
"last_sync": "command.json now stays in sync with CLI definitions"
},
"essential_commands": [cmd['name'] for cmd in essential],
"commands": all_commands,
"agents": all_agents,
"skills": all_skills,
"categories": sorted(set(cmd['category'] for cmd in all_commands)),
"skill_categories": sorted(skills_by_cat.keys())
}
master_path = SKILL_DIR / "command.json"
with open(master_path, 'w', encoding='utf-8') as f:
json.dump(master, f, indent=2, ensure_ascii=False)
print(f"\nOK Generated command.json ({os.path.getsize(master_path)} bytes)")
# Print summary # Print summary
print("\n=== Summary ===") print("\n=== Summary ===")
print(f"Commands: {len(all_commands)}") print(f"Commands: {len(all_commands)}")
print(f"Agents: {len(all_agents)}") print(f"Agents: {len(all_agents)}")
print(f"Skills: {len(all_skills)}")
print(f"Essential: {len(essential)}") print(f"Essential: {len(essential)}")
print(f"\nBy category:") print(f"\nCommands by category:")
for cat in sorted(by_category.keys()): for cat in sorted(by_category.keys()):
total = sum(len(cmds) for cmds in by_category[cat].values()) total = sum(len(cmds) for cmds in by_category[cat].values())
print(f" {cat}: {total}") print(f" {cat}: {total}")
print(f"\nSkills by category:")
for cat in sorted(skills_by_cat.keys()):
print(f" {cat}: {len(skills_by_cat[cat])}")
for skill in skills_by_cat[cat]:
team_tag = " [team]" if skill['is_team'] else ""
print(f" - {skill['name']}{team_tag}")
print(f"\nIndex: {INDEX_DIR}") print(f"\nIndex: {INDEX_DIR}")
print("=== Complete ===") print("=== Complete ===")

View File

@@ -0,0 +1,349 @@
---
name: team-perf-opt
description: Unified team skill for performance optimization. Uses team-worker agent architecture with role-spec files for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on "team perf-opt".
allowed-tools: Task, TaskCreate, TaskList, TaskGet, TaskUpdate, TeamCreate, TeamDelete, SendMessage, AskUserQuestion, Read, Write, Edit, Bash, Glob, Grep, mcp__ace-tool__search_context
---
# Team Performance Optimization
Unified team skill: Profile application performance, identify bottlenecks, design optimization strategies, implement changes, benchmark improvements, and review code quality. Built on **team-worker agent architecture** -- all worker roles share a single agent definition with role-specific Phase 2-4 loaded from markdown specs.
## Architecture
```
+---------------------------------------------------+
| Skill(skill="team-perf-opt") |
| args="<task-description>" |
+-------------------+-------------------------------+
|
Orchestration Mode (auto -> coordinator)
|
Coordinator (inline)
Phase 0-5 orchestration
|
+-------+-------+-------+-------+
v v v v v
[tw] [tw] [tw] [tw] [tw]
profiler strate- optim- bench- review-
gist izer marker er
Subagents (callable by workers, not team members):
[explore] [discuss]
(tw) = team-worker agent
```
## Role Router
This skill is **coordinator-only**. Workers do NOT invoke this skill -- they are spawned as `team-worker` agents directly.
### Input Parsing
Parse `$ARGUMENTS`. No `--role` needed -- always routes to coordinator.
### Role Registry
| Role | Spec | Task Prefix | Type | Inner Loop |
|------|------|-------------|------|------------|
| coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | (none) | orchestrator | - |
| profiler | [role-specs/profiler.md](role-specs/profiler.md) | PROFILE-* | orchestration | false |
| strategist | [role-specs/strategist.md](role-specs/strategist.md) | STRATEGY-* | orchestration | false |
| optimizer | [role-specs/optimizer.md](role-specs/optimizer.md) | IMPL-* / FIX-* | code_generation | true |
| benchmarker | [role-specs/benchmarker.md](role-specs/benchmarker.md) | BENCH-* | validation | false |
| reviewer | [role-specs/reviewer.md](role-specs/reviewer.md) | REVIEW-* / QUALITY-* | read_only_analysis | false |
### Subagent Registry
| Subagent | Spec | Callable By | Purpose |
|----------|------|-------------|---------|
| explore | [subagents/explore-subagent.md](subagents/explore-subagent.md) | profiler, optimizer | Shared codebase exploration for performance-critical code paths |
| discuss | [subagents/discuss-subagent.md](subagents/discuss-subagent.md) | strategist, reviewer | Multi-perspective discussion for optimization approaches and review findings |
### Dispatch
Always route to coordinator. Coordinator reads `roles/coordinator/role.md` and executes its phases.
### Orchestration Mode
User just provides task description.
**Invocation**: `Skill(skill="team-perf-opt", args="<task-description>")`
**Lifecycle**:
```
User provides task description
-> coordinator Phase 1-3: Requirement clarification -> TeamCreate -> Create task chain
-> coordinator Phase 4: spawn first batch workers (background) -> STOP
-> Worker (team-worker agent) executes -> SendMessage callback -> coordinator advances
-> Loop until pipeline complete -> Phase 5 report + completion action
```
**User Commands** (wake paused coordinator):
| Command | Action |
|---------|--------|
| `check` / `status` | Output execution status graph, no advancement |
| `resume` / `continue` | Check worker states, advance next step |
| `revise <TASK-ID> [feedback]` | Create revision task + cascade downstream |
| `feedback <text>` | Analyze feedback impact, create targeted revision chain |
| `recheck` | Re-run quality check |
| `improve [dimension]` | Auto-improve weakest dimension |
---
## Command Execution Protocol
When coordinator needs to execute a command (dispatch, monitor):
1. **Read the command file**: `roles/coordinator/commands/<command-name>.md`
2. **Follow the workflow** defined in the command file (Phase 2-4 structure)
3. **Commands are inline execution guides** -- NOT separate agents or subprocesses
4. **Execute synchronously** -- complete the command workflow before proceeding
Example:
```
Phase 3 needs task dispatch
-> Read roles/coordinator/commands/dispatch.md
-> Execute Phase 2 (Context Loading)
-> Execute Phase 3 (Task Chain Creation)
-> Execute Phase 4 (Validation)
-> Continue to Phase 4
```
---
## Coordinator Spawn Template
### v5 Worker Spawn (all roles)
When coordinator spawns workers, use `team-worker` agent with role-spec path:
```
Task({
subagent_type: "team-worker",
description: "Spawn <role> worker",
team_name: <team-name>,
name: "<role>",
run_in_background: true,
prompt: `## Role Assignment
role: <role>
role_spec: .claude/skills/team-perf-opt/role-specs/<role>.md
session: <session-folder>
session_id: <session-id>
team_name: <team-name>
requirement: <task-description>
inner_loop: <true|false>
Read role_spec file to load Phase 2-4 domain instructions.
Execute built-in Phase 1 (task discovery) -> role-spec Phase 2-4 -> built-in Phase 5 (report).`
})
```
**Inner Loop roles** (optimizer): Set `inner_loop: true`. The team-worker agent handles the loop internally.
**Single-task roles** (profiler, strategist, benchmarker, reviewer): Set `inner_loop: false`.
---
## Pipeline Definitions
### Pipeline Diagram
```
Pipeline: Linear with Review-Fix Cycle
=====================================================================
Stage 1 Stage 2 Stage 3 Stage 4
(W:1) (W:2) (W:3) (W:4)
+-----------+
PROFILE-001 --> STRATEGY-001 --> IMPL-001 --> | BENCH-001 |
[profiler] [strategist] [optimizer] | [bench] |
^ +-----------+
| |
| +-----------+
+<--FIX--->| REVIEW-001|
| | [reviewer]|
| +-----------+
| |
(max 3 iterations) v
COMPLETE
=====================================================================
```
### Cadence Control
**Beat model**: Event-driven, each beat = coordinator wake -> process -> spawn -> STOP.
```
Beat Cycle (single beat)
======================================================================
Event Coordinator Workers
----------------------------------------------------------------------
callback/resume --> +- handleCallback -+
| mark completed |
| check pipeline |
+- handleSpawnNext -+
| find ready tasks |
| spawn workers ---+--> [team-worker A] Phase 1-5
| (parallel OK) --+--> [team-worker B] Phase 1-5
+- STOP (idle) -----+ |
|
callback <-----------------------------------------+
(next beat) SendMessage + TaskUpdate(completed)
======================================================================
Fast-Advance (skips coordinator for simple linear successors)
======================================================================
[Worker A] Phase 5 complete
+- 1 ready task? simple successor?
| --> spawn team-worker B directly
| --> log fast_advance to message bus (coordinator syncs on next wake)
+- complex case? --> SendMessage to coordinator
======================================================================
```
```
Beat View: Performance Optimization Pipeline
======================================================================
Event Coordinator Workers
----------------------------------------------------------------------
new task --> +- Phase 1-3: clarify -+
| TeamCreate |
| create PROFILE-001 |
+- Phase 4: spawn ------+--> [profiler] Phase 1-5
+- STOP (idle) ---------+ |
|
callback <----------------------------------------------+
(profiler done) --> +- handleCallback ------+ profile_complete
| mark PROFILE done |
| spawn strategist ----+--> [strategist] Phase 1-5
+- STOP ----------------+ |
|
callback <----------------------------------------------+
(strategist done)--> +- handleCallback ------+ strategy_complete
| mark STRATEGY done |
| spawn optimizer -----+--> [optimizer] Phase 1-5
+- STOP ----------------+ |
|
callback <----------------------------------------------+
(optimizer done) --> +- handleCallback ------+ impl_complete
| mark IMPL done |
| spawn bench+reviewer-+--> [benchmarker] Phase 1-5
| (parallel) -------+--> [reviewer] Phase 1-5
+- STOP ----------------+ | |
| |
callback x2 <--------------------------------------+-----------+
--> +- handleCallback ------+
| both done? |
| YES + pass -> Phase 5|
| NO / fail -> FIX task|
| spawn optimizer -----+--> [optimizer] FIX-001
+- STOP or Phase 5 -----+
======================================================================
```
**Checkpoints**:
| Checkpoint | Trigger | Location | Behavior |
|------------|---------|----------|----------|
| CP-1 | PROFILE-001 complete | After Stage 1 | User reviews bottleneck report, can refine scope |
| CP-2 | STRATEGY-001 complete | After Stage 2 | User reviews optimization plan, can adjust priorities |
| CP-3 | REVIEW/BENCH fail | Stage 4 | Auto-create FIX task, re-enter Stage 3 (max 3x) |
| CP-4 | All tasks complete | Phase 5 | Interactive completion action |
### Task Metadata Registry
| Task ID | Role | Phase | Dependencies | Description |
|---------|------|-------|-------------|-------------|
| PROFILE-001 | profiler | Stage 1 | (none) | Profile application, identify bottlenecks |
| STRATEGY-001 | strategist | Stage 2 | PROFILE-001 | Design optimization plan from bottleneck report |
| IMPL-001 | optimizer | Stage 3 | STRATEGY-001 | Implement highest-priority optimizations |
| BENCH-001 | benchmarker | Stage 4 | IMPL-001 | Run benchmarks, compare vs baseline |
| REVIEW-001 | reviewer | Stage 4 | IMPL-001 | Review optimization code for correctness |
| FIX-001 | optimizer | Stage 3 (cycle) | REVIEW-001 or BENCH-001 | Fix issues found in review/benchmark |
---
## Completion Action
When the pipeline completes (all tasks done, coordinator Phase 5):
```
AskUserQuestion({
questions: [{
question: "Team pipeline complete. What would you like to do?",
header: "Completion",
multiSelect: false,
options: [
{ label: "Archive & Clean (Recommended)", description: "Archive session, clean up tasks and team resources" },
{ label: "Keep Active", description: "Keep session active for follow-up work or inspection" },
{ label: "Export Results", description: "Export deliverables to a specified location, then clean" }
]
}]
})
```
| Choice | Action |
|--------|--------|
| Archive & Clean | Update session status="completed" -> TeamDelete(perf-opt) -> output final summary |
| Keep Active | Update session status="paused" -> output resume instructions: `Skill(skill="team-perf-opt", args="resume")` |
| Export Results | AskUserQuestion for target path -> copy deliverables -> Archive & Clean |
---
## Session Directory
```
.workflow/<session-id>/
+-- session.json # Session metadata + status
+-- artifacts/
| +-- baseline-metrics.json # Profiler: before-optimization metrics
| +-- bottleneck-report.md # Profiler: ranked bottleneck findings
| +-- optimization-plan.md # Strategist: prioritized optimization plan
| +-- benchmark-results.json # Benchmarker: after-optimization metrics
| +-- review-report.md # Reviewer: code review findings
+-- explorations/
| +-- cache-index.json # Shared explore cache
| +-- <hash>.md # Cached exploration results
+-- wisdom/
| +-- patterns.md # Discovered patterns and conventions
| +-- shared-memory.json # Cross-role structured data
+-- discussions/
| +-- DISCUSS-OPT.md # Strategy discussion record
| +-- DISCUSS-REVIEW.md # Review discussion record
```
## Session Resume
Coordinator supports `--resume` / `--continue` for interrupted sessions:
1. Scan session directory for sessions with status "active" or "paused"
2. Multiple matches -> AskUserQuestion for selection
3. Audit TaskList -> reconcile session state <-> task status
4. Reset in_progress -> pending (interrupted tasks)
5. Rebuild team and spawn needed workers only
6. Create missing tasks with correct blockedBy
7. Kick first executable task -> Phase 4 coordination loop
## Shared Resources
| Resource | Path | Usage |
|----------|------|-------|
| Performance Baseline | [<session>/artifacts/baseline-metrics.json](<session>/artifacts/baseline-metrics.json) | Before-optimization metrics for comparison |
| Bottleneck Report | [<session>/artifacts/bottleneck-report.md](<session>/artifacts/bottleneck-report.md) | Profiler output consumed by strategist |
| Optimization Plan | [<session>/artifacts/optimization-plan.md](<session>/artifacts/optimization-plan.md) | Strategist output consumed by optimizer |
| Benchmark Results | [<session>/artifacts/benchmark-results.json](<session>/artifacts/benchmark-results.json) | Benchmarker output consumed by reviewer |
## Error Handling
| Scenario | Resolution |
|----------|------------|
| Role spec file not found | Error with expected path (role-specs/<name>.md) |
| Command file not found | Fallback to inline execution in coordinator role.md |
| Subagent spec not found | Error with expected path (subagents/<name>-subagent.md) |
| Fast-advance orphan detected | Coordinator resets task to pending on next check |
| consensus_blocked HIGH | Coordinator creates revision task or pauses pipeline |
| team-worker agent unavailable | Error: requires .claude/agents/team-worker.md |
| Completion action timeout | Default to Keep Active |
| Profiling tool not available | Fallback to static analysis methods |
| Benchmark regression detected | Auto-create FIX task with regression details |
| Review-fix cycle exceeds 3 iterations | Escalate to user with summary of remaining issues |

View File

@@ -0,0 +1,85 @@
---
prefix: BENCH
inner_loop: false
message_types:
success: bench_complete
error: error
fix: fix_required
---
# Performance Benchmarker
Run benchmarks comparing before/after optimization metrics. Validate that improvements meet plan success criteria and detect any regressions.
## Phase 2: Environment & Baseline Loading
| Input | Source | Required |
|-------|--------|----------|
| Baseline metrics | <session>/artifacts/baseline-metrics.json | Yes |
| Optimization plan | <session>/artifacts/optimization-plan.md | Yes |
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
1. Extract session path from task description
2. Read baseline metrics -- extract pre-optimization performance numbers
3. Read optimization plan -- extract success criteria and target thresholds
4. Load shared-memory.json for project type and optimization scope
5. Detect available benchmark tools from project:
| Signal | Benchmark Tool | Method |
|--------|---------------|--------|
| package.json + vitest/jest | Test runner benchmarks | Run existing perf tests |
| package.json + webpack/vite | Bundle analysis | Compare build output sizes |
| Cargo.toml + criterion | Rust benchmarks | cargo bench |
| go.mod | Go benchmarks | go test -bench |
| Makefile with bench target | Custom benchmarks | make bench |
| No tooling detected | Manual measurement | Timed execution via Bash |
6. Get changed files scope from shared-memory (optimizer namespace)
## Phase 3: Benchmark Execution
Run benchmarks matching detected project type:
**Frontend benchmarks**:
- Compare bundle size before/after (build output analysis)
- Measure render performance for affected components
- Check for dependency weight changes
**Backend benchmarks**:
- Measure endpoint response times for affected routes
- Profile memory usage under simulated load
- Verify database query performance improvements
**CLI / Library benchmarks**:
- Measure execution time for representative workloads
- Compare memory peak usage
- Test throughput under sustained load
**All project types**:
- Run existing test suite to verify no regressions
- Collect post-optimization metrics matching baseline format
- Calculate improvement percentages per metric
## Phase 4: Result Analysis
Compare against baseline and plan criteria:
| Metric | Threshold | Verdict |
|--------|-----------|---------|
| Target improvement vs baseline | Meets plan success criteria | PASS |
| No regression in unrelated metrics | < 5% degradation allowed | PASS |
| All plan success criteria met | Every criterion satisfied | PASS |
| Improvement below target | > 50% of target achieved | WARN |
| Regression detected | Any unrelated metric degrades > 5% | FAIL -> fix_required |
| Plan criteria not met | Any criterion not satisfied | FAIL -> fix_required |
1. Write benchmark results to `<session>/artifacts/benchmark-results.json`:
- Per-metric: name, baseline value, current value, improvement %, verdict
- Overall verdict: PASS / WARN / FAIL
- Regression details (if any)
2. Update `<session>/wisdom/shared-memory.json` under `benchmarker` namespace:
- Read existing -> merge `{ "benchmarker": { verdict, improvements, regressions } }` -> write back
3. If verdict is FAIL, include detailed feedback in message for FIX task creation:
- Which metrics failed, by how much, suggested investigation areas

View File

@@ -0,0 +1,76 @@
---
prefix: IMPL
inner_loop: true
additional_prefixes: [FIX]
subagents: [explore]
message_types:
success: impl_complete
error: error
fix: fix_required
---
# Code Optimizer
Implement optimization changes following the strategy plan. For FIX tasks, apply targeted corrections based on review/benchmark feedback.
## Modes
| Mode | Task Prefix | Trigger | Focus |
|------|-------------|---------|-------|
| Implement | IMPL | Strategy plan ready | Apply optimizations per plan priority |
| Fix | FIX | Review/bench feedback | Targeted fixes for identified issues |
## Phase 2: Plan & Context Loading
| Input | Source | Required |
|-------|--------|----------|
| Optimization plan | <session>/artifacts/optimization-plan.md | Yes (IMPL) |
| Review/bench feedback | From task description | Yes (FIX) |
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
| Wisdom files | <session>/wisdom/patterns.md | No |
| Context accumulator | From prior IMPL/FIX tasks | Yes (inner loop) |
1. Extract session path and task mode (IMPL or FIX) from task description
2. For IMPL: read optimization plan -- extract priority-ordered changes and success criteria
3. For FIX: parse review/benchmark feedback for specific issues to address
4. Use `explore` subagent to load implementation context for target files
5. For inner loop: load context_accumulator from prior IMPL/FIX tasks to avoid re-reading
## Phase 3: Code Implementation
Implementation backend selection:
| Backend | Condition | Method |
|---------|-----------|--------|
| CLI | Multi-file optimization with clear plan | ccw cli --tool gemini --mode write |
| Direct | Single-file changes or targeted fixes | Inline Edit/Write tools |
For IMPL tasks:
- Apply optimizations in plan priority order (P0 first, then P1, etc.)
- Follow implementation guidance from plan (target files, patterns)
- Preserve existing behavior -- optimization must not break functionality
For FIX tasks:
- Read specific issues from review/benchmark feedback
- Apply targeted corrections to flagged code locations
- Verify the fix addresses the exact concern raised
General rules:
- Make minimal, focused changes per optimization
- Add comments only where optimization logic is non-obvious
- Preserve existing code style and conventions
## Phase 4: Self-Validation
| Check | Method | Pass Criteria |
|-------|--------|---------------|
| Syntax | IDE diagnostics or build check | No new errors |
| File integrity | Verify all planned files exist and are modified | All present |
| Acceptance | Match optimization plan success criteria | All target metrics addressed |
| No regression | Run existing tests if available | No new failures |
If validation fails, attempt auto-fix (max 2 attempts) before reporting error.
Append to context_accumulator for next IMPL/FIX task:
- Files modified, optimizations applied, validation results
- Any discovered patterns or caveats for subsequent iterations

View File

@@ -0,0 +1,73 @@
---
prefix: PROFILE
inner_loop: false
subagents: [explore]
message_types:
success: profile_complete
error: error
---
# Performance Profiler
Profile application performance to identify CPU, memory, I/O, network, and rendering bottlenecks. Produce quantified baseline metrics and a ranked bottleneck report.
## Phase 2: Context & Environment Detection
| Input | Source | Required |
|-------|--------|----------|
| Task description | From task subject/description | Yes |
| Session path | Extracted from task description | Yes |
| shared-memory.json | <session>/wisdom/shared-memory.json | No |
1. Extract session path and target scope from task description
2. Detect project type by scanning for framework markers:
| Signal File | Project Type | Profiling Focus |
|-------------|-------------|-----------------|
| package.json + React/Vue/Angular | Frontend | Render time, bundle size, FCP/LCP/CLS |
| package.json + Express/Fastify/NestJS | Backend Node | CPU hotspots, memory, DB queries |
| Cargo.toml / go.mod / pom.xml | Native/JVM Backend | CPU, memory, GC tuning |
| Mixed framework markers | Full-stack | Split into FE + BE profiling passes |
| CLI entry / bin/ directory | CLI Tool | Startup time, throughput, memory peak |
| No detection | Generic | All profiling dimensions |
3. Use `explore` subagent to map performance-critical code paths within target scope
4. Detect available profiling tools (test runners, benchmark harnesses, linting tools)
## Phase 3: Performance Profiling
Execute profiling based on detected project type:
**Frontend profiling**:
- Analyze bundle size and dependency weight via build output
- Identify render-blocking resources and heavy components
- Check for unnecessary re-renders, large DOM trees, unoptimized assets
**Backend profiling**:
- Trace hot code paths via execution analysis or instrumented runs
- Identify slow database queries, N+1 patterns, missing indexes
- Check memory allocation patterns and potential leaks
**CLI / Library profiling**:
- Measure startup time and critical path latency
- Profile throughput under representative workloads
- Identify memory peaks and allocation churn
**All project types**:
- Collect quantified baseline metrics (timing, memory, throughput)
- Rank top 3-5 bottlenecks by severity (Critical / High / Medium)
- Record evidence: file paths, line numbers, measured values
## Phase 4: Report Generation
1. Write baseline metrics to `<session>/artifacts/baseline-metrics.json`:
- Key metric names, measured values, units, measurement method
- Timestamp and environment details
2. Write bottleneck report to `<session>/artifacts/bottleneck-report.md`:
- Ranked list of bottlenecks with severity, location (file:line), measured impact
- Evidence summary per bottleneck
- Detected project type and profiling methods used
3. Update `<session>/wisdom/shared-memory.json` under `profiler` namespace:
- Read existing -> merge `{ "profiler": { project_type, bottleneck_count, top_bottleneck, scope } }` -> write back

View File

@@ -0,0 +1,69 @@
---
prefix: REVIEW
inner_loop: false
additional_prefixes: [QUALITY]
discuss_rounds: [DISCUSS-REVIEW]
subagents: [discuss]
message_types:
success: review_complete
error: error
fix: fix_required
---
# Optimization Reviewer
Review optimization code changes for correctness, side effects, regression risks, and adherence to best practices. Provide structured verdicts with actionable feedback.
## Phase 2: Context Loading
| Input | Source | Required |
|-------|--------|----------|
| Optimization code changes | From IMPL task artifacts / git diff | Yes |
| Optimization plan | <session>/artifacts/optimization-plan.md | Yes |
| Benchmark results | <session>/artifacts/benchmark-results.json | No |
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
1. Extract session path from task description
2. Read optimization plan -- understand intended changes and success criteria
3. Load shared-memory.json for optimizer namespace (files modified, patterns applied)
4. Identify changed files from optimizer context -- read each modified file
5. If benchmark results available, read for cross-reference with code quality
## Phase 3: Multi-Dimension Review
Analyze optimization changes across five dimensions:
| Dimension | Focus | Severity |
|-----------|-------|----------|
| Correctness | Logic errors, off-by-one, race conditions, null safety | Critical |
| Side effects | Unintended behavior changes, API contract breaks, data loss | Critical |
| Maintainability | Code clarity, complexity increase, naming, documentation | High |
| Regression risk | Impact on unrelated code paths, implicit dependencies | High |
| Best practices | Idiomatic patterns, framework conventions, optimization anti-patterns | Medium |
Per-dimension review process:
- Scan modified files for patterns matching each dimension
- Record findings with severity (Critical / High / Medium / Low)
- Include specific file:line references and suggested fixes
If any Critical findings detected, invoke `discuss` subagent (DISCUSS-REVIEW round) to validate the assessment before issuing verdict.
## Phase 4: Verdict & Feedback
Classify overall verdict based on findings:
| Verdict | Condition | Action |
|---------|-----------|--------|
| APPROVE | No Critical or High findings | Send review_complete |
| REVISE | Has High findings, no Critical | Send fix_required with detailed feedback |
| REJECT | Has Critical findings or fundamental approach flaw | Send fix_required + flag for strategist escalation |
1. Write review report to `<session>/artifacts/review-report.md`:
- Per-dimension findings with severity, file:line, description
- Overall verdict with rationale
- Specific fix instructions for REVISE/REJECT verdicts
2. Update `<session>/wisdom/shared-memory.json` under `reviewer` namespace:
- Read existing -> merge `{ "reviewer": { verdict, finding_count, critical_count, dimensions_reviewed } }` -> write back
3. If DISCUSS-REVIEW was triggered, record discussion summary in `<session>/discussions/DISCUSS-REVIEW.md`

View File

@@ -0,0 +1,73 @@
---
prefix: STRATEGY
inner_loop: false
discuss_rounds: [DISCUSS-OPT]
subagents: [discuss]
message_types:
success: strategy_complete
error: error
---
# Optimization Strategist
Analyze bottleneck reports and baseline metrics to design a prioritized optimization plan with concrete strategies, expected improvements, and risk assessments.
## Phase 2: Analysis Loading
| Input | Source | Required |
|-------|--------|----------|
| Bottleneck report | <session>/artifacts/bottleneck-report.md | Yes |
| Baseline metrics | <session>/artifacts/baseline-metrics.json | Yes |
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
| Wisdom files | <session>/wisdom/patterns.md | No |
1. Extract session path from task description
2. Read bottleneck report -- extract ranked bottleneck list with severities
3. Read baseline metrics -- extract current performance numbers
4. Load shared-memory.json for profiler findings (project_type, scope)
5. Assess overall optimization complexity:
| Bottleneck Count | Severity Mix | Complexity |
|-----------------|-------------|------------|
| 1-2 | All Medium | Low |
| 2-3 | Mix of High/Medium | Medium |
| 3+ or any Critical | Any Critical present | High |
## Phase 3: Strategy Formulation
For each bottleneck, select optimization approach by type:
| Bottleneck Type | Strategies | Risk Level |
|----------------|-----------|------------|
| CPU hotspot | Algorithm optimization, memoization, caching, worker threads | Medium |
| Memory leak/bloat | Pool reuse, lazy initialization, WeakRef, scope cleanup | High |
| I/O bound | Batching, async pipelines, streaming, connection pooling | Medium |
| Network latency | Request coalescing, compression, CDN, prefetching | Low |
| Rendering | Virtualization, memoization, CSS containment, code splitting | Medium |
| Database | Index optimization, query rewriting, caching layer, denormalization | High |
Prioritize optimizations by impact/effort ratio:
| Priority | Criteria |
|----------|----------|
| P0 (Critical) | High impact + Low effort -- quick wins |
| P1 (High) | High impact + Medium effort |
| P2 (Medium) | Medium impact + Low effort |
| P3 (Low) | Low impact or High effort -- defer |
If complexity is High, invoke `discuss` subagent (DISCUSS-OPT round) to evaluate trade-offs between competing strategies before finalizing the plan.
Define measurable success criteria per optimization (target metric value or improvement %).
## Phase 4: Plan Output
1. Write optimization plan to `<session>/artifacts/optimization-plan.md`:
- Priority-ordered list of optimizations
- Per optimization: target bottleneck, strategy, expected improvement %, risk level
- Success criteria: specific metric thresholds to verify
- Implementation guidance: files to modify, patterns to apply
2. Update `<session>/wisdom/shared-memory.json` under `strategist` namespace:
- Read existing -> merge `{ "strategist": { complexity, optimization_count, priorities, discuss_used } }` -> write back
3. If DISCUSS-OPT was triggered, record discussion summary in `<session>/discussions/DISCUSS-OPT.md`

View File

@@ -0,0 +1,175 @@
# Command: Dispatch
Create the performance optimization task chain with correct dependencies and structured task descriptions.
## Phase 2: Context Loading
| Input | Source | Required |
|-------|--------|----------|
| User requirement | From coordinator Phase 1 | Yes |
| Session folder | From coordinator Phase 2 | Yes |
| Pipeline definition | From SKILL.md Pipeline Definitions | Yes |
1. Load user requirement and optimization scope from session.json
2. Load pipeline stage definitions from SKILL.md Task Metadata Registry
3. Determine if single-pass or multi-pass optimization is needed
## Phase 3: Task Chain Creation
### Task Description Template
Every task description uses structured format for clarity:
```
TaskCreate({
subject: "<TASK-ID>",
owner: "<role>",
description: "PURPOSE: <what this task achieves> | Success: <measurable completion criteria>
TASK:
- <step 1: specific action>
- <step 2: specific action>
- <step 3: specific action>
CONTEXT:
- Session: <session-folder>
- Scope: <optimization-scope>
- Upstream artifacts: <artifact-1>, <artifact-2>
- Shared memory: <session>/wisdom/shared-memory.json
EXPECTED: <deliverable path> + <quality criteria>
CONSTRAINTS: <scope limits, focus areas>
---
InnerLoop: <true|false>",
blockedBy: [<dependency-list>],
status: "pending"
})
```
### Task Chain
Create tasks in dependency order:
**PROFILE-001** (profiler, Stage 1):
```
TaskCreate({
subject: "PROFILE-001",
description: "PURPOSE: Profile application performance to identify bottlenecks | Success: Baseline metrics captured, top 3-5 bottlenecks ranked by severity
TASK:
- Detect project type and available profiling tools
- Execute profiling across relevant dimensions (CPU, memory, I/O, network, rendering)
- Collect baseline metrics and rank bottlenecks by severity
CONTEXT:
- Session: <session-folder>
- Scope: <optimization-scope>
- Shared memory: <session>/wisdom/shared-memory.json
EXPECTED: <session>/artifacts/baseline-metrics.json + <session>/artifacts/bottleneck-report.md | Quantified metrics with evidence
CONSTRAINTS: Focus on <optimization-scope> | Profile before any changes
---
InnerLoop: false",
status: "pending"
})
```
**STRATEGY-001** (strategist, Stage 2):
```
TaskCreate({
subject: "STRATEGY-001",
description: "PURPOSE: Design prioritized optimization plan from bottleneck analysis | Success: Actionable plan with measurable success criteria per optimization
TASK:
- Analyze bottleneck report and baseline metrics
- Select optimization strategies per bottleneck type
- Prioritize by impact/effort ratio, define success criteria
CONTEXT:
- Session: <session-folder>
- Scope: <optimization-scope>
- Upstream artifacts: baseline-metrics.json, bottleneck-report.md
- Shared memory: <session>/wisdom/shared-memory.json
EXPECTED: <session>/artifacts/optimization-plan.md | Priority-ordered with improvement targets
CONSTRAINTS: Focus on highest-impact optimizations | Risk assessment required
---
InnerLoop: false",
blockedBy: ["PROFILE-001"],
status: "pending"
})
```
**IMPL-001** (optimizer, Stage 3):
```
TaskCreate({
subject: "IMPL-001",
description: "PURPOSE: Implement optimization changes per strategy plan | Success: All planned optimizations applied, code compiles, existing tests pass
TASK:
- Load optimization plan and identify target files
- Apply optimizations in priority order (P0 first)
- Validate changes compile and pass existing tests
CONTEXT:
- Session: <session-folder>
- Scope: <optimization-scope>
- Upstream artifacts: optimization-plan.md
- Shared memory: <session>/wisdom/shared-memory.json
EXPECTED: Modified source files + validation passing | Optimizations applied without regressions
CONSTRAINTS: Preserve existing behavior | Minimal changes per optimization | Follow code conventions
---
InnerLoop: true",
blockedBy: ["STRATEGY-001"],
status: "pending"
})
```
**BENCH-001** (benchmarker, Stage 4 - parallel):
```
TaskCreate({
subject: "BENCH-001",
description: "PURPOSE: Benchmark optimization results against baseline | Success: All plan success criteria met, no regressions detected
TASK:
- Load baseline metrics and plan success criteria
- Run benchmarks matching project type
- Compare before/after metrics, calculate improvements
CONTEXT:
- Session: <session-folder>
- Scope: <optimization-scope>
- Upstream artifacts: baseline-metrics.json, optimization-plan.md
- Shared memory: <session>/wisdom/shared-memory.json
EXPECTED: <session>/artifacts/benchmark-results.json | Per-metric comparison with verdicts
CONSTRAINTS: Must compare against baseline | Flag any regressions
---
InnerLoop: false",
blockedBy: ["IMPL-001"],
status: "pending"
})
```
**REVIEW-001** (reviewer, Stage 4 - parallel):
```
TaskCreate({
subject: "REVIEW-001",
description: "PURPOSE: Review optimization code for correctness, side effects, and regression risks | Success: All dimensions reviewed, verdict issued
TASK:
- Load modified files and optimization plan
- Review across 5 dimensions: correctness, side effects, maintainability, regression risk, best practices
- Issue verdict: APPROVE, REVISE, or REJECT with actionable feedback
CONTEXT:
- Session: <session-folder>
- Scope: <optimization-scope>
- Upstream artifacts: optimization-plan.md, benchmark-results.json (if available)
- Shared memory: <session>/wisdom/shared-memory.json
EXPECTED: <session>/artifacts/review-report.md | Per-dimension findings with severity
CONSTRAINTS: Focus on optimization changes only | Provide specific file:line references
---
InnerLoop: false",
blockedBy: ["IMPL-001"],
status: "pending"
})
```
## Phase 4: Validation
Verify task chain integrity:
| Check | Method | Expected |
|-------|--------|----------|
| All 5 tasks created | TaskList count | 5 tasks |
| Dependencies correct | STRATEGY blocks on PROFILE, IMPL blocks on STRATEGY, BENCH+REVIEW block on IMPL | All valid |
| No circular dependencies | Trace dependency graph | Acyclic |
| All task IDs use correct prefixes | PROFILE-*, STRATEGY-*, IMPL-*, BENCH-*, REVIEW-* | Match role registry |
| Structured descriptions complete | Each has PURPOSE/TASK/CONTEXT/EXPECTED/CONSTRAINTS | All present |
If validation fails, fix the specific task and re-validate.

View File

@@ -0,0 +1,201 @@
# Command: Monitor
Handle all coordinator monitoring events: worker callbacks, status checks, pipeline advancement, and completion.
## Phase 2: Context Loading
| Input | Source | Required |
|-------|--------|----------|
| Session state | <session>/session.json | Yes |
| Task list | TaskList() | Yes |
| Trigger event | From Entry Router detection | Yes |
| Pipeline definition | From SKILL.md | Yes |
1. Load session.json for current state and fix cycle count
2. Run TaskList() to get current task statuses
3. Identify trigger event type from Entry Router
## Phase 3: Event Handlers
### handleCallback
Triggered when a worker sends completion message.
1. Parse message to identify role and task ID
2. Mark task as completed:
```
TaskUpdate({ taskId: "<task-id>", status: "completed" })
```
3. Record completion in session state
4. Check if checkpoint feedback is configured for this stage:
| Completed Task | Checkpoint | Action |
|---------------|------------|--------|
| PROFILE-001 | CP-1 | Notify user: bottleneck report ready for review |
| STRATEGY-001 | CP-2 | Notify user: optimization plan ready for review |
| BENCH-001 or REVIEW-001 | CP-3 | Check verdicts (see Review-Fix Cycle below) |
5. Proceed to handleSpawnNext
### handleSpawnNext
Find and spawn the next ready tasks.
1. Scan task list for tasks where:
- Status is "pending"
- All blockedBy tasks have status "completed"
2. For each ready task, spawn team-worker:
```
Task({
subagent_type: "team-worker",
description: "Spawn <role> worker for <task-id>",
team_name: "perf-opt",
name: "<role>",
run_in_background: true,
prompt: `## Role Assignment
role: <role>
role_spec: .claude/skills/team-perf-opt/role-specs/<role>.md
session: <session-folder>
session_id: <session-id>
team_name: perf-opt
requirement: <task-description>
inner_loop: <true|false>
Read role_spec file to load Phase 2-4 domain instructions.
Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.`
})
```
3. For Stage 4 (BENCH-001 + REVIEW-001): spawn both in parallel since both block on IMPL-001
4. STOP after spawning -- wait for next callback
### Review-Fix Cycle (CP-3)
When both BENCH-001 and REVIEW-001 are completed:
1. Read benchmark verdict from shared-memory (benchmarker namespace)
2. Read review verdict from shared-memory (reviewer namespace)
| Bench Verdict | Review Verdict | Action |
|--------------|----------------|--------|
| PASS | APPROVE | -> handleComplete |
| PASS | REVISE | Create FIX task with review feedback |
| FAIL | APPROVE | Create FIX task with benchmark feedback |
| FAIL | REVISE/REJECT | Create FIX task with combined feedback |
| Any | REJECT | Create FIX task + flag for strategist re-evaluation |
3. Check fix cycle count:
| Cycle Count | Action |
|-------------|--------|
| < 3 | Create FIX task, increment cycle count |
| >= 3 | Escalate to user with summary of remaining issues |
4. Create FIX task if needed:
```
TaskCreate({
subject: "FIX-<N>",
description: "PURPOSE: Fix issues identified by review/benchmark | Success: All flagged issues resolved
TASK:
- Address review findings: <specific-findings>
- Fix benchmark regressions: <specific-regressions>
- Re-validate after fixes
CONTEXT:
- Session: <session-folder>
- Upstream artifacts: review-report.md, benchmark-results.json
- Shared memory: <session>/wisdom/shared-memory.json
EXPECTED: Fixed source files | All flagged issues addressed
CONSTRAINTS: Targeted fixes only | Do not introduce new changes
---
InnerLoop: true",
blockedBy: [],
status: "pending"
})
```
5. Create new BENCH and REVIEW tasks blocked on FIX task
6. Proceed to handleSpawnNext (spawns optimizer for FIX task)
### handleCheck
Output current pipeline status without advancing.
1. Build status graph from task list:
```
Pipeline Status:
[DONE] PROFILE-001 (profiler) -> bottleneck-report.md
[DONE] STRATEGY-001 (strategist) -> optimization-plan.md
[RUN] IMPL-001 (optimizer) -> implementing...
[WAIT] BENCH-001 (benchmarker) -> blocked by IMPL-001
[WAIT] REVIEW-001 (reviewer) -> blocked by IMPL-001
Fix Cycles: 0/3
Session: <session-id>
```
2. Output status -- do NOT advance pipeline
### handleResume
Resume pipeline after user pause or interruption.
1. Audit task list for inconsistencies:
- Tasks stuck in "in_progress" -> reset to "pending"
- Tasks with completed blockers but still "pending" -> include in spawn list
2. Proceed to handleSpawnNext
### handleConsensus
Handle consensus_blocked signals from discuss rounds.
| Severity | Action |
|----------|--------|
| HIGH | Pause pipeline, notify user with findings summary |
| MEDIUM | Create revision task for the blocked role |
| LOW | Log finding, continue pipeline |
### handleComplete
Triggered when all pipeline tasks are completed and no fix cycles remain.
1. Verify all tasks have status "completed":
```
TaskList()
```
2. If any tasks not completed, return to handleSpawnNext
3. If all completed, transition to coordinator Phase 5 (Report + Completion Action)
### handleRevise
Triggered by user "revise <TASK-ID> [feedback]" command.
1. Parse target task ID and optional feedback
2. Create revision task with same role but updated requirements
3. Set blockedBy to empty (immediate execution)
4. Cascade: create new downstream tasks that depend on the revised task
5. Proceed to handleSpawnNext
### handleFeedback
Triggered by user "feedback <text>" command.
1. Analyze feedback text to determine impact scope
2. Identify which pipeline stage and role should handle the feedback
3. Create targeted revision task
4. Proceed to handleSpawnNext
## Phase 4: State Persistence
After every handler execution:
1. Update session.json with current state (active tasks, fix cycle count, last event)
2. Verify task list consistency
3. STOP and wait for next event

View File

@@ -0,0 +1,252 @@
# Coordinator - Performance Optimization Team
**Role**: coordinator
**Type**: Orchestrator
**Team**: perf-opt
Orchestrates the performance optimization pipeline: manages task chains, spawns team-worker agents, handles review-fix cycles, and drives the pipeline to completion.
## Boundaries
### MUST
- Use `team-worker` agent type for all worker spawns (NOT `general-purpose`)
- Follow Command Execution Protocol for dispatch and monitor commands
- Respect pipeline stage dependencies (blockedBy)
- Stop after spawning workers -- wait for callbacks
- Handle review-fix cycles with max 3 iterations
- Execute completion action in Phase 5
### MUST NOT
- Implement domain logic (profiling, optimizing, reviewing) -- workers handle this
- Spawn workers without creating tasks first
- Skip checkpoints when configured
- Force-advance pipeline past failed review/benchmark
- Modify source code directly -- delegate to optimizer worker
---
## Command Execution Protocol
When coordinator needs to execute a command (dispatch, monitor):
1. **Read the command file**: `roles/coordinator/commands/<command-name>.md`
2. **Follow the workflow** defined in the command file (Phase 2-4 structure)
3. **Commands are inline execution guides** -- NOT separate agents or subprocesses
4. **Execute synchronously** -- complete the command workflow before proceeding
Example:
```
Phase 3 needs task dispatch
-> Read roles/coordinator/commands/dispatch.md
-> Execute Phase 2 (Context Loading)
-> Execute Phase 3 (Task Chain Creation)
-> Execute Phase 4 (Validation)
-> Continue to Phase 4
```
---
## Entry Router
When coordinator is invoked, detect invocation type:
| Detection | Condition | Handler |
|-----------|-----------|---------|
| Worker callback | Message contains role tag [profiler], [strategist], [optimizer], [benchmarker], [reviewer] | -> handleCallback |
| Consensus blocked | Message contains "consensus_blocked" | -> handleConsensus |
| Status check | Arguments contain "check" or "status" | -> handleCheck |
| Manual resume | Arguments contain "resume" or "continue" | -> handleResume |
| Pipeline complete | All tasks have status "completed" | -> handleComplete |
| Interrupted session | Active/paused session exists | -> Phase 0 (Resume Check) |
| New session | None of above | -> Phase 1 (Requirement Clarification) |
For callback/check/resume/complete: load `commands/monitor.md` and execute matched handler, then STOP.
### Router Implementation
1. **Load session context** (if exists):
- Scan `.workflow/.team/PERF-OPT-*/team-session.json` for active/paused sessions
- If found, extract session folder path and status
2. **Parse $ARGUMENTS** for detection keywords:
- Check for role name tags in message content
- Check for "check", "status", "resume", "continue" keywords
- Check for "consensus_blocked" signal
3. **Route to handler**:
- For monitor handlers: Read `commands/monitor.md`, execute matched handler, STOP
- For Phase 0: Execute Session Resume Check below
- For Phase 1: Execute Requirement Clarification below
---
## Phase 0: Session Resume Check
Triggered when an active/paused session is detected on coordinator entry.
1. Load session.json from detected session folder
2. Audit task list:
```
TaskList()
```
3. Reconcile session state vs task status:
| Task Status | Session Expects | Action |
|-------------|----------------|--------|
| in_progress | Should be running | Reset to pending (worker was interrupted) |
| completed | Already tracked | Skip |
| pending + unblocked | Ready to run | Include in spawn list |
4. Rebuild team if not active:
```
TeamCreate({ team_name: "perf-opt" })
```
5. Spawn workers for ready tasks -> Phase 4 coordination loop
---
## Phase 1: Requirement Clarification
1. Parse user task description from $ARGUMENTS
2. Identify optimization target:
| Signal | Target |
|--------|--------|
| Specific file/module mentioned | Scoped optimization |
| "slow", "performance", generic | Full application profiling |
| Specific metric mentioned (FCP, memory, startup) | Targeted metric optimization |
3. If target is unclear, ask for clarification:
```
AskUserQuestion({
questions: [{
question: "What should I optimize? Provide a target scope or describe the performance issue.",
header: "Scope"
}]
})
```
4. Record optimization requirement with scope and target metrics
---
## Phase 2: Session & Team Setup
1. Create session directory:
```
Bash("mkdir -p .workflow/<session-id>/artifacts .workflow/<session-id>/explorations .workflow/<session-id>/wisdom .workflow/<session-id>/discussions")
```
2. Write session.json with status="active", team_name, requirement, timestamp
3. Initialize shared-memory.json:
```
Write("<session>/wisdom/shared-memory.json", { "session_id": "<session-id>", "requirement": "<requirement>" })
```
4. Create team:
```
TeamCreate({ team_name: "perf-opt" })
```
---
## Phase 3: Task Chain Creation
Execute `commands/dispatch.md` inline (Command Execution Protocol):
1. Read `roles/coordinator/commands/dispatch.md`
2. Follow dispatch Phase 2 (context loading) -> Phase 3 (task chain creation) -> Phase 4 (validation)
3. Result: all pipeline tasks created with correct blockedBy dependencies
---
## Phase 4: Spawn & Coordination Loop
### Initial Spawn
Find first unblocked task and spawn its worker:
```
Task({
subagent_type: "team-worker",
description: "Spawn profiler worker",
team_name: "perf-opt",
name: "profiler",
run_in_background: true,
prompt: `## Role Assignment
role: profiler
role_spec: .claude/skills/team-perf-opt/role-specs/profiler.md
session: <session-folder>
session_id: <session-id>
team_name: perf-opt
requirement: <requirement>
inner_loop: false
Read role_spec file to load Phase 2-4 domain instructions.
Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.`
})
```
**STOP** after spawning. Wait for worker callback.
### Coordination (via monitor.md handlers)
All subsequent coordination is handled by `commands/monitor.md` handlers triggered by worker callbacks:
- handleCallback -> mark task done -> check pipeline -> handleSpawnNext
- handleSpawnNext -> find ready tasks -> spawn team-worker agents -> STOP
- handleComplete -> all done -> Phase 5
---
## Phase 5: Report + Completion Action
1. Load session state -> count completed tasks, calculate duration
2. List deliverables:
| Deliverable | Path |
|-------------|------|
| Baseline Metrics | <session>/artifacts/baseline-metrics.json |
| Bottleneck Report | <session>/artifacts/bottleneck-report.md |
| Optimization Plan | <session>/artifacts/optimization-plan.md |
| Benchmark Results | <session>/artifacts/benchmark-results.json |
| Review Report | <session>/artifacts/review-report.md |
3. Include discussion summaries if discuss rounds were used
4. Output pipeline summary: task count, duration, improvement metrics from benchmark results
5. **Completion Action** (interactive):
```
AskUserQuestion({
questions: [{
question: "Team pipeline complete. What would you like to do?",
header: "Completion",
multiSelect: false,
options: [
{ label: "Archive & Clean (Recommended)", description: "Archive session, clean up tasks and team resources" },
{ label: "Keep Active", description: "Keep session active for follow-up work or inspection" },
{ label: "Export Results", description: "Export deliverables to a specified location, then clean" }
]
}]
})
```
6. Handle user choice:
| Choice | Steps |
|--------|-------|
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete("perf-opt") -> output final summary with artifact paths |
| Keep Active | Update session status="paused" -> output: "Session paused. Resume with: Skill(skill='team-perf-opt', args='resume')" |
| Export Results | AskUserQuestion for target directory -> copy all artifacts -> Archive & Clean flow |

View File

@@ -0,0 +1,208 @@
{
"version": "5.0.0",
"team_name": "perf-opt",
"team_display_name": "Performance Optimization",
"skill_name": "team-perf-opt",
"skill_path": ".claude/skills/team-perf-opt/",
"worker_agent": "team-worker",
"pipeline_type": "Linear with Review-Fix Cycle",
"completion_action": "interactive",
"has_inline_discuss": true,
"has_shared_explore": true,
"has_checkpoint_feedback": true,
"has_session_resume": true,
"roles": [
{
"name": "coordinator",
"type": "orchestrator",
"description": "Orchestrates performance optimization pipeline, manages task chains, handles review-fix cycles",
"spec_path": "roles/coordinator/role.md",
"tools": ["Task", "TaskCreate", "TaskList", "TaskGet", "TaskUpdate", "TeamCreate", "TeamDelete", "SendMessage", "AskUserQuestion", "Read", "Write", "Bash", "Glob", "Grep"]
},
{
"name": "profiler",
"type": "orchestration",
"description": "Profiles application performance, identifies CPU/memory/IO/network/rendering bottlenecks",
"role_spec": "role-specs/profiler.md",
"inner_loop": false,
"frontmatter": {
"prefix": "PROFILE",
"inner_loop": false,
"additional_prefixes": [],
"discuss_rounds": [],
"subagents": ["explore"],
"message_types": {
"success": "profile_complete",
"error": "error"
}
},
"weight": 1,
"tools": ["Read", "Bash", "Glob", "Grep", "Task", "mcp__ace-tool__search_context"]
},
{
"name": "strategist",
"type": "orchestration",
"description": "Analyzes bottleneck reports, designs prioritized optimization plans with concrete strategies",
"role_spec": "role-specs/strategist.md",
"inner_loop": false,
"frontmatter": {
"prefix": "STRATEGY",
"inner_loop": false,
"additional_prefixes": [],
"discuss_rounds": ["DISCUSS-OPT"],
"subagents": ["discuss"],
"message_types": {
"success": "strategy_complete",
"error": "error"
}
},
"weight": 2,
"tools": ["Read", "Bash", "Glob", "Grep", "Task", "mcp__ace-tool__search_context"]
},
{
"name": "optimizer",
"type": "code_generation",
"description": "Implements optimization changes following the strategy plan",
"role_spec": "role-specs/optimizer.md",
"inner_loop": true,
"frontmatter": {
"prefix": "IMPL",
"inner_loop": true,
"additional_prefixes": ["FIX"],
"discuss_rounds": [],
"subagents": ["explore"],
"message_types": {
"success": "impl_complete",
"error": "error",
"fix": "fix_required"
}
},
"weight": 3,
"tools": ["Read", "Write", "Edit", "Bash", "Glob", "Grep", "Task", "mcp__ace-tool__search_context"]
},
{
"name": "benchmarker",
"type": "validation",
"description": "Runs benchmarks, compares before/after metrics, validates performance improvements",
"role_spec": "role-specs/benchmarker.md",
"inner_loop": false,
"frontmatter": {
"prefix": "BENCH",
"inner_loop": false,
"additional_prefixes": [],
"discuss_rounds": [],
"subagents": [],
"message_types": {
"success": "bench_complete",
"error": "error",
"fix": "fix_required"
}
},
"weight": 4,
"tools": ["Read", "Bash", "Glob", "Grep", "Task"]
},
{
"name": "reviewer",
"type": "read_only_analysis",
"description": "Reviews optimization code for correctness, side effects, and regression risks",
"role_spec": "role-specs/reviewer.md",
"inner_loop": false,
"frontmatter": {
"prefix": "REVIEW",
"inner_loop": false,
"additional_prefixes": ["QUALITY"],
"discuss_rounds": ["DISCUSS-REVIEW"],
"subagents": ["discuss"],
"message_types": {
"success": "review_complete",
"error": "error",
"fix": "fix_required"
}
},
"weight": 4,
"tools": ["Read", "Bash", "Glob", "Grep", "Task", "mcp__ace-tool__search_context"]
}
],
"pipeline": {
"stages": [
{
"stage": 1,
"name": "Performance Profiling",
"roles": ["profiler"],
"blockedBy": [],
"fast_advance": true
},
{
"stage": 2,
"name": "Optimization Strategy",
"roles": ["strategist"],
"blockedBy": ["PROFILE"],
"fast_advance": true
},
{
"stage": 3,
"name": "Code Optimization",
"roles": ["optimizer"],
"blockedBy": ["STRATEGY"],
"fast_advance": false
},
{
"stage": 4,
"name": "Benchmark & Review",
"roles": ["benchmarker", "reviewer"],
"blockedBy": ["IMPL"],
"fast_advance": false,
"parallel": true,
"review_fix_cycle": {
"trigger": "REVIEW or BENCH finds issues",
"target_stage": 3,
"max_iterations": 3
}
}
],
"diagram": "See pipeline-diagram section"
},
"subagents": [
{
"name": "explore",
"agent_type": "cli-explore-agent",
"callable_by": ["profiler", "optimizer"],
"purpose": "Shared codebase exploration for performance-critical code paths",
"has_cache": true,
"cache_domain": "explorations"
},
{
"name": "discuss",
"agent_type": "cli-discuss-agent",
"callable_by": ["strategist", "reviewer"],
"purpose": "Multi-perspective discussion for optimization approaches and review findings",
"has_cache": false
}
],
"shared_resources": [
{
"name": "Performance Baseline",
"path": "<session>/artifacts/baseline-metrics.json",
"usage": "Before-optimization metrics for comparison"
},
{
"name": "Bottleneck Report",
"path": "<session>/artifacts/bottleneck-report.md",
"usage": "Profiler output consumed by strategist"
},
{
"name": "Optimization Plan",
"path": "<session>/artifacts/optimization-plan.md",
"usage": "Strategist output consumed by optimizer"
},
{
"name": "Benchmark Results",
"path": "<session>/artifacts/benchmark-results.json",
"usage": "Benchmarker output consumed by reviewer"
}
]
}

View File

@@ -0,0 +1,89 @@
# Discuss Subagent
Multi-perspective discussion for evaluating optimization strategies and reviewing code change quality. Used by strategist (DISCUSS-OPT) and reviewer (DISCUSS-REVIEW) when complex trade-offs require multi-angle analysis.
## Design Rationale
Complex optimization decisions (e.g., choosing between algorithmic change vs caching layer) and nuanced code review findings (e.g., evaluating whether a side effect is acceptable) benefit from structured multi-perspective analysis. This subagent provides that analysis inline without spawning additional team members.
## Invocation
Called by strategist, reviewer after their primary analysis when complexity warrants multi-perspective evaluation:
```
Task({
subagent_type: "cli-discuss-agent",
run_in_background: false,
description: "Discuss <round-id>: <topic> for performance optimization",
prompt: `Conduct a multi-perspective discussion on the following topic.
Round: <round-id>
Topic: <discussion-topic>
Session: <session-folder>
Context:
<relevant-context-from-calling-role>
Perspectives to consider:
- Performance impact: Will this actually improve the target metric?
- Risk assessment: What could go wrong? Side effects? Regressions?
- Maintainability: Is the optimized code still understandable and maintainable?
- Alternative approaches: Are there simpler or safer ways to achieve the same goal?
Evaluate trade-offs and provide a structured recommendation with:
- Consensus verdict: proceed / revise / escalate
- Confidence level: high / medium / low
- Key trade-offs identified
- Recommended approach with rationale
- Dissenting perspectives (if any)`
})
```
## Round Configuration
| Round | Artifact | Parameters | Calling Role |
|-------|----------|------------|-------------|
| DISCUSS-OPT | <session>/discussions/DISCUSS-OPT.md | Optimization strategy trade-offs | strategist |
| DISCUSS-REVIEW | <session>/discussions/DISCUSS-REVIEW.md | Code review finding validation | reviewer |
## Integration with Calling Role
The calling role is responsible for:
1. **Before calling**: Complete primary analysis, identify the specific trade-off or finding needing discussion
2. **Calling**: Invoke subagent with round ID, topic, and relevant context
3. **After calling**:
| Result | Action |
|--------|--------|
| consensus_reached (proceed) | Incorporate recommendation into output, continue |
| consensus_reached (revise) | Adjust findings/strategy based on discussion insights |
| consensus_blocked (HIGH) | Report to coordinator via message with severity |
| consensus_blocked (MEDIUM) | Include in output with recommendation for revision |
| consensus_blocked (LOW) | Note in output, proceed with original assessment |
## Output Schema
```json
{
"round_id": "<DISCUSS-OPT|DISCUSS-REVIEW>",
"topic": "<discussion-topic>",
"verdict": "<proceed|revise|escalate>",
"confidence": "<high|medium|low>",
"trade_offs": [
{ "dimension": "<performance|risk|maintainability>", "pro": "<benefit>", "con": "<cost>" }
],
"recommendation": "<recommended-approach>",
"rationale": "<reasoning>",
"dissenting_views": ["<alternative-perspective>"]
}
```
## Error Handling
| Scenario | Resolution |
|----------|------------|
| Single perspective analysis fails | Continue with partial perspectives |
| All analyses fail | Return basic recommendation from calling role's primary analysis |
| Artifact not found | Return error immediately |
| Discussion inconclusive | Return "revise" verdict with low confidence |

View File

@@ -0,0 +1,108 @@
# Explore Subagent
Shared codebase exploration for discovering performance-critical code paths, module structures, and optimization opportunities. Results are cached to avoid redundant exploration across profiler and optimizer roles.
## Design Rationale
Codebase exploration is a read-only operation shared between profiler (mapping bottlenecks) and optimizer (understanding implementation context). Caching explorations avoids redundant work when optimizer re-explores paths the profiler already mapped.
## Invocation
Called by profiler, optimizer after needing codebase context for performance analysis or implementation:
```
Task({
subagent_type: "cli-explore-agent",
run_in_background: false,
description: "Explore codebase for performance-critical paths in <target-scope>",
prompt: `Explore the codebase to identify performance-critical code paths.
Target scope: <target-scope>
Session: <session-folder>
Focus: <exploration-focus>
Tasks:
1. Map the module structure and entry points within scope
2. Identify hot code paths (frequently called functions, critical loops)
3. Find performance-relevant patterns (caching, lazy loading, async, pooling)
4. Note any existing performance optimizations or benchmark harnesses
5. List key files with their roles in the performance-critical path
Output a structured exploration report with:
- Module map (key files and their relationships)
- Hot path analysis (call chains, loop nests, recursive patterns)
- Existing optimization patterns found
- Performance-relevant configuration (caching, pooling, batching settings)
- Recommended investigation targets for profiling`
})
```
## Cache Mechanism
### Cache Index Schema
`<session-folder>/explorations/cache-index.json`:
```json
{
"entries": [
{
"key": "<scope-hash>",
"scope": "<target-scope>",
"focus": "<exploration-focus>",
"timestamp": "<ISO-8601>",
"result_file": "<hash>.md"
}
]
}
```
### Cache Lookup Rules
| Condition | Action |
|-----------|--------|
| Exact scope+focus match exists | Return cached result from <hash>.md |
| No match | Execute subagent, cache result to <hash>.md, update index |
| Cache file missing but index has entry | Remove stale entry, re-execute |
| Cache older than current session | Use cached (explorations are stable within session) |
## Integration with Calling Role
The calling role is responsible for:
1. **Before calling**: Determine target scope and exploration focus
2. **Calling**: Check cache first, invoke subagent only on cache miss
3. **After calling**:
| Result | Action |
|--------|--------|
| Exploration successful | Use findings to inform profiling/implementation |
| Exploration partial | Use available findings, note gaps |
| Exploration failed | Proceed without exploration context, use direct file reading |
## Output Schema
```json
{
"scope": "<target-scope>",
"module_map": [
{ "file": "<path>", "role": "<description>", "hot_path": true }
],
"hot_paths": [
{ "chain": "<call-chain>", "frequency": "<high|medium|low>", "files": ["<path>"] }
],
"existing_optimizations": [
{ "type": "<pattern>", "location": "<file:line>", "description": "<what>" }
],
"investigation_targets": ["<file-or-pattern>"]
}
```
## Error Handling
| Scenario | Resolution |
|----------|------------|
| Single exploration angle fails | Continue with partial results |
| All exploration fails | Return basic result from direct file listing |
| Target scope not found | Return error immediately |
| Cache corrupt | Clear cache-index.json, re-execute |

View File

@@ -0,0 +1,725 @@
---
name: brainstorm
description: |
Dual-mode brainstorming pipeline. Auto mode: framework generation → parallel role analysis
(spawn_agents_on_csv) → cross-role synthesis. Single role mode: individual role analysis.
CSV-driven parallel coordination with NDJSON discovery board.
argument-hint: "[-y|--yes] [--count N] [--session ID] [--skip-questions] [--style-skill PKG] \"topic\" | <role-name> [--session ID]"
allowed-tools: spawn_agents_on_csv, spawn_agent, wait, send_input, close_agent, AskUserQuestion, Read, Write, Edit, Bash, Glob, Grep
---
## Auto Mode
When `--yes` or `-y`: Auto-select auto mode, auto-select recommended roles, skip all clarification questions, use defaults.
# Brainstorm
## Usage
```bash
$brainstorm "Build real-time collaboration platform" --count 3
$brainstorm -y "Design payment system" --count 5
$brainstorm "Build notification system" --style-skill material-design
$brainstorm system-architect --session WFS-xxx
$brainstorm ux-expert --include-questions
```
**Flags**:
- `-y, --yes`: Skip all confirmations (auto mode)
- `--count N`: Number of roles to select (default: 3, max: 9)
- `--session ID`: Use existing session
- `--skip-questions / --include-questions`: Control interactive Q&A per role
- `--style-skill PKG`: Style skill package for ui-designer
- `--update`: Update existing role analysis
---
## Overview
Dual-mode brainstorming with CSV-driven parallel role analysis. Auto mode runs a full pipeline; single role mode runs one role analysis independently.
```
┌──────────────────────────────────────────────────────────────────┐
│ BRAINSTORM PIPELINE │
├──────────────────────────────────────────────────────────────────┤
│ │
│ Phase 1: Mode Detection & Routing │
│ ├─ Parse flags and arguments │
│ └─ Route to Auto Mode or Single Role Mode │
│ │
│ ═══ Auto Mode ═══ │
│ │
│ Phase 2: Interactive Framework Generation │
│ ├─ Context collection → Topic analysis → Role selection │
│ ├─ Generate guidance-specification.md │
│ ├─ Generate roles.csv (1 row per selected role) │
│ └─ User validates (skip if -y) │
│ │
│ Phase 3: Wave Role Analysis (spawn_agents_on_csv) │
│ ├─ spawn_agents_on_csv(role instruction template) │
│ ├─ Each role agent produces analysis.md + sub-documents │
│ └─ discoveries.ndjson shared across role agents │
│ │
│ Phase 4: Synthesis Integration │
│ ├─ Read all role analyses (read-only) │
│ ├─ Cross-role analysis → conflict detection │
│ ├─ Feature spec generation │
│ └─ Output: feature-specs/ + feature-index.json │
│ │
│ ═══ Single Role Mode ═══ │
│ │
│ Phase 3S: Single Role Analysis (spawn_agent) │
│ ├─ spawn_agent(conceptual-planning-agent) │
│ └─ Output: {role}/analysis*.md │
│ │
└──────────────────────────────────────────────────────────────────┘
```
---
## Context Flow
```
roles.csv feature-specs/
┌──────────────┐ ┌──────────────────┐
│ R1: sys-arch │──findings───→│ F-001-auth.md │
│ analysis.md │ │ (cross-role spec) │
├──────────────┤ ├──────────────────┤
│ R2: ui-design│──findings───→│ F-002-ui.md │
│ analysis.md │ │ (cross-role spec) │
├──────────────┤ ├──────────────────┤
│ R3: test-str │──findings───→│ F-003-test.md │
│ analysis.md │ │ (cross-role spec) │
└──────────────┘ └──────────────────┘
Two context channels:
1. Directed: role findings → synthesis → feature specs
2. Broadcast: discoveries.ndjson (append-only shared board)
```
---
## CSV Schema
### roles.csv
```csv
id,role,title,focus,deps,wave,status,findings,output_files,error
"R1","system-architect","系统架构师","Technical architecture, scalability","","1","pending","","",""
"R2","ui-designer","UI设计师","Visual design, mockups","","1","pending","","",""
"R3","test-strategist","测试策略师","Test strategy, quality","","1","pending","","",""
```
**Columns**:
| Column | Phase | Description |
|--------|-------|-------------|
| `id` | Input | Role ID: R1, R2, ... |
| `role` | Input | Role identifier (e.g., system-architect) |
| `title` | Input | Role display title |
| `focus` | Input | Role focus areas and keywords |
| `deps` | Input | Dependency IDs (usually empty — all wave 1) |
| `wave` | Computed | Wave number (usually 1 for all roles) |
| `status` | Output | `pending``completed` / `failed` |
| `findings` | Output | Key discoveries (max 800 chars) |
| `output_files` | Output | Generated analysis files (semicolon-separated) |
| `error` | Output | Error message if failed |
---
## Available Roles
| Role ID | Title | Focus Area |
|---------|-------|------------|
| `data-architect` | 数据架构师 | Data models, storage strategies, data flow |
| `product-manager` | 产品经理 | Product strategy, roadmap, prioritization |
| `product-owner` | 产品负责人 | Backlog management, user stories, acceptance criteria |
| `scrum-master` | 敏捷教练 | Process facilitation, impediment removal |
| `subject-matter-expert` | 领域专家 | Domain knowledge, business rules, compliance |
| `system-architect` | 系统架构师 | Technical architecture, scalability, integration |
| `test-strategist` | 测试策略师 | Test strategy, quality assurance |
| `ui-designer` | UI设计师 | Visual design, mockups, design systems |
| `ux-expert` | UX专家 | User research, information architecture, journey |
---
## Session Structure
```
.workflow/active/WFS-{topic}/
├── workflow-session.json # Session metadata
├── .process/
│ └── context-package.json # Phase 0 context
├── roles.csv # Role analysis state (Phase 2-3)
├── discoveries.ndjson # Shared discovery board
└── .brainstorming/
├── guidance-specification.md # Framework (Phase 2)
├── feature-index.json # Feature index (Phase 4)
├── synthesis-changelog.md # Synthesis audit trail (Phase 4)
├── feature-specs/ # Feature specs (Phase 4)
│ ├── F-001-{slug}.md
│ └── F-00N-{slug}.md
└── {role}/ # Role analyses (Phase 3, immutable)
├── {role}-context.md # Interactive Q&A
├── analysis.md # Main/index document
├── analysis-cross-cutting.md # Cross-feature
└── analysis-F-{id}-{slug}.md # Per-feature
```
---
## Implementation
### Session Initialization
```javascript
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
// Parse flags
const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
const countMatch = $ARGUMENTS.match(/--count\s+(\d+)/)
const roleCount = countMatch ? Math.min(parseInt(countMatch[1]), 9) : 3
const sessionMatch = $ARGUMENTS.match(/--session\s+(\S+)/)
const existingSessionId = sessionMatch ? sessionMatch[1] : null
const skipQuestions = $ARGUMENTS.includes('--skip-questions')
const includeQuestions = $ARGUMENTS.includes('--include-questions')
const styleSkillMatch = $ARGUMENTS.match(/--style-skill\s+(\S+)/)
const styleSkill = styleSkillMatch ? styleSkillMatch[1] : null
const updateMode = $ARGUMENTS.includes('--update')
// Role detection
const VALID_ROLES = [
'data-architect', 'product-manager', 'product-owner', 'scrum-master',
'subject-matter-expert', 'system-architect', 'test-strategist',
'ui-designer', 'ux-expert'
]
const cleanArgs = $ARGUMENTS
.replace(/--yes|-y|--count\s+\d+|--session\s+\S+|--skip-questions|--include-questions|--style-skill\s+\S+|--update/g, '')
.trim()
const firstArg = cleanArgs.split(/\s+/)[0]
const isRole = VALID_ROLES.includes(firstArg)
// Mode detection
let executionMode
if (AUTO_YES) {
executionMode = 'auto'
} else if (isRole) {
executionMode = 'single-role'
} else if (cleanArgs) {
executionMode = 'auto'
} else {
executionMode = null // Ask user
}
const topic = isRole
? cleanArgs.replace(firstArg, '').trim()
: cleanArgs.replace(/^["']|["']$/g, '')
```
---
### Phase 1: Mode Detection & Routing
**Objective**: Parse arguments, determine execution mode, prepare session.
**Steps**:
1. **Detect Mode**
```javascript
if (executionMode === null) {
const modeAnswer = AskUserQuestion({
questions: [{
question: "Choose brainstorming mode:",
header: "Mode",
multiSelect: false,
options: [
{ label: "Auto Mode (Recommended)", description: "Full pipeline: framework → parallel roles → synthesis" },
{ label: "Single Role", description: "Run one role analysis independently" }
]
}]
})
executionMode = modeAnswer.Mode.startsWith('Auto') ? 'auto' : 'single-role'
}
```
2. **Session Setup**
```javascript
let sessionId, sessionFolder
if (existingSessionId) {
sessionId = existingSessionId
sessionFolder = `.workflow/active/${sessionId}`
} else if (executionMode === 'auto') {
const slug = topic.toLowerCase().replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-').substring(0, 40)
sessionId = `WFS-${slug}`
sessionFolder = `.workflow/active/${sessionId}`
Bash(`mkdir -p "${sessionFolder}/.brainstorming" "${sessionFolder}/.process"`)
// Initialize workflow-session.json
Write(`${sessionFolder}/workflow-session.json`, JSON.stringify({
session_id: sessionId,
topic: topic,
status: 'brainstorming',
execution_mode: executionMode,
created_at: getUtc8ISOString()
}, null, 2))
} else {
// Single role mode requires existing session
const existing = Bash(`ls -d .workflow/active/WFS-* 2>/dev/null | head -1`).trim()
if (!existing) {
console.log('ERROR: No active session found. Run auto mode first to create a session.')
return
}
sessionId = existing.split('/').pop()
sessionFolder = existing
}
```
**Route**:
- `executionMode === 'auto'` → Phase 2
- `executionMode === 'single-role'` → Phase 3S
---
### Phase 2: Interactive Framework Generation (Auto Mode)
**Objective**: Analyze topic, select roles, generate guidance-specification.md and roles.csv.
**Steps**:
1. **Analyze Topic & Select Roles**
```javascript
Bash({
command: `ccw cli -p "PURPOSE: Analyze brainstorming topic and recommend ${roleCount} expert roles for multi-perspective analysis. Success = well-matched roles with clear focus areas.
TASK:
• Analyze topic domain, complexity, and key dimensions
• Select ${roleCount} roles from: data-architect, product-manager, product-owner, scrum-master, subject-matter-expert, system-architect, test-strategist, ui-designer, ux-expert
• For each role: define focus area, key questions, and analysis scope
• Identify potential cross-role conflicts or synergies
• Generate feature decomposition if topic has distinct components
MODE: analysis
CONTEXT: @**/*
EXPECTED: JSON: {analysis: {domain, complexity, dimensions[]}, roles: [{id, role, title, focus, key_questions[]}], features: [{id, title, description}]}
CONSTRAINTS: Select exactly ${roleCount} roles | Each role must have distinct perspective | Roles must cover topic comprehensively
TOPIC: ${topic}" --tool gemini --mode analysis --rule planning-breakdown-task-steps`,
run_in_background: true
})
// Wait for CLI completion → { analysis, roles[], features[] }
```
2. **User Validation** (skip if AUTO_YES)
```javascript
if (!AUTO_YES) {
console.log(`\n## Brainstorm Framework\n`)
console.log(`Topic: ${topic}`)
console.log(`Domain: ${analysis.domain} | Complexity: ${analysis.complexity}`)
console.log(`\nSelected Roles (${roles.length}):`)
roles.forEach(r => console.log(` - [${r.id}] ${r.title}: ${r.focus}`))
if (features.length > 0) {
console.log(`\nFeatures (${features.length}):`)
features.forEach(f => console.log(` - [${f.id}] ${f.title}`))
}
const answer = AskUserQuestion({
questions: [{
question: "Approve brainstorm framework?",
header: "Validate",
multiSelect: false,
options: [
{ label: "Approve", description: "Proceed with role analysis" },
{ label: "Modify Roles", description: "Change role selection" },
{ label: "Cancel", description: "Abort" }
]
}]
})
if (answer.Validate === "Cancel") return
if (answer.Validate === "Modify Roles") {
// Allow user to adjust via AskUserQuestion
const roleAnswer = AskUserQuestion({
questions: [{
question: "Select roles for analysis:",
header: "Roles",
multiSelect: true,
options: VALID_ROLES.map(r => ({
label: r,
description: roles.find(sel => sel.role === r)?.focus || ''
}))
}]
})
// Rebuild roles[] from selection
}
}
```
3. **Generate Guidance Specification**
```javascript
const guidanceContent = `# Guidance Specification
## Topic
${topic}
## Analysis
- **Domain**: ${analysis.domain}
- **Complexity**: ${analysis.complexity}
- **Dimensions**: ${analysis.dimensions.join(', ')}
## Selected Roles
${roles.map(r => `### ${r.title} (${r.role})
- **Focus**: ${r.focus}
- **Key Questions**: ${r.key_questions.join('; ')}`).join('\n\n')}
## Features
${features.map(f => `- **[${f.id}] ${f.title}**: ${f.description}`).join('\n')}
`
Write(`${sessionFolder}/.brainstorming/guidance-specification.md`, guidanceContent)
```
4. **Generate roles.csv**
```javascript
const header = 'id,role,title,focus,deps,wave,status,findings,output_files,error'
const rows = roles.map(r =>
[r.id, r.role, r.title, r.focus, '', '1', 'pending', '', '', '']
.map(v => `"${String(v).replace(/"/g, '""')}"`)
.join(',')
)
Write(`${sessionFolder}/roles.csv`, [header, ...rows].join('\n'))
```
Update workflow-session.json with selected_roles.
---
### Phase 3: Wave Role Analysis (spawn_agents_on_csv) — Auto Mode
**Objective**: Execute parallel role analysis via `spawn_agents_on_csv`. Each role agent produces analysis documents.
**Steps**:
1. **Role Analysis Wave**
```javascript
const rolesCSV = parseCsv(Read(`${sessionFolder}/roles.csv`))
console.log(`\n## Phase 3: Parallel Role Analysis (${rolesCSV.length} roles)\n`)
spawn_agents_on_csv({
csv_path: `${sessionFolder}/roles.csv`,
id_column: "id",
instruction: buildRoleInstruction(sessionFolder, topic, features),
max_concurrency: Math.min(rolesCSV.length, 4),
max_runtime_seconds: 600,
output_csv_path: `${sessionFolder}/roles-results.csv`,
output_schema: {
type: "object",
properties: {
id: { type: "string" },
status: { type: "string", enum: ["completed", "failed"] },
findings: { type: "string" },
output_files: { type: "array", items: { type: "string" } },
error: { type: "string" }
},
required: ["id", "status", "findings"]
}
})
// Merge results into roles.csv
const roleResults = parseCsv(Read(`${sessionFolder}/roles-results.csv`))
for (const result of roleResults) {
updateMasterCsvRow(`${sessionFolder}/roles.csv`, result.id, {
status: result.status,
findings: result.findings || '',
output_files: Array.isArray(result.output_files) ? result.output_files.join(';') : (result.output_files || ''),
error: result.error || ''
})
console.log(` [${result.id}] ${result.status === 'completed' ? '✓' : '✗'} ${rolesCSV.find(r => r.id === result.id)?.role}`)
}
Bash(`rm -f "${sessionFolder}/roles-results.csv"`)
```
2. **Role Instruction Template**
```javascript
function buildRoleInstruction(sessionFolder, topic, features) {
const featureList = features.length > 0
? features.map(f => `- [${f.id}] ${f.title}: ${f.description}`).join('\n')
: 'No feature decomposition — analyze topic holistically.'
return `
## ROLE ANALYSIS ASSIGNMENT
### MANDATORY FIRST STEPS
1. Read guidance specification: ${sessionFolder}/.brainstorming/guidance-specification.md
2. Read shared discoveries: ${sessionFolder}/discoveries.ndjson (if exists)
3. Read project context: .workflow/project-tech.json (if exists)
---
## Your Role
**Role ID**: {id}
**Role**: {role}
**Title**: {title}
**Focus**: {focus}
---
## Topic
${topic}
## Features to Analyze
${featureList}
---
## Analysis Protocol
1. **Read guidance**: Load guidance-specification.md for full context
2. **Read discoveries**: Load discoveries.ndjson for shared findings from other roles
3. **Analyze from your perspective**: Apply your role expertise to the topic
4. **Per-feature analysis** (if features exist):
- Create \`${sessionFolder}/.brainstorming/{role}/analysis-{feature-id}-{slug}.md\` per feature
- Create \`${sessionFolder}/.brainstorming/{role}/analysis-cross-cutting.md\` for cross-feature concerns
5. **Create index document**: \`${sessionFolder}/.brainstorming/{role}/analysis.md\`
- Summary of all findings
- Links to sub-documents
- Key recommendations
6. **Share discoveries**: Append findings to shared board:
\`\`\`bash
echo '{"ts":"<ISO8601>","worker":"{id}","type":"<type>","data":{...}}' >> ${sessionFolder}/discoveries.ndjson
\`\`\`
7. **Report result**: Return JSON via report_agent_job_result
### Document Constraints
- Main analysis.md: < 3000 words
- Sub-documents: < 2000 words each, max 5
- Total per role: < 15000 words
### Discovery Types to Share
- \`design_pattern\`: {name, rationale, applicability} — recommended patterns
- \`risk\`: {area, severity, mitigation} — identified risks
- \`requirement\`: {title, priority, source} — derived requirements
- \`constraint\`: {type, description, impact} — discovered constraints
- \`synergy\`: {roles[], area, description} — cross-role opportunities
---
## Output (report_agent_job_result)
Return JSON:
{
"id": "{id}",
"status": "completed" | "failed",
"findings": "Key insights from {role} perspective (max 800 chars)",
"output_files": ["path/to/analysis.md", "path/to/analysis-F-001.md"],
"error": ""
}
`
}
```
---
### Phase 3S: Single Role Analysis (spawn_agent) — Single Role Mode
**Objective**: Run one role analysis via spawn_agent with optional interactive Q&A.
```javascript
if (executionMode === 'single-role') {
const roleName = firstArg
const roleDir = `${sessionFolder}/.brainstorming/${roleName}`
Bash(`mkdir -p "${roleDir}"`)
const agentId = spawn_agent({
agent: `~/.codex/agents/conceptual-planning-agent.md`,
instruction: `
Perform a ${roleName} analysis for the brainstorming session.
**Session**: ${sessionFolder}
**Role**: ${roleName}
**Topic**: Read from ${sessionFolder}/.brainstorming/guidance-specification.md
${includeQuestions ? '**Mode**: Interactive — ask clarification questions before analysis' : ''}
${skipQuestions ? '**Mode**: Skip questions — proceed directly to analysis' : ''}
${styleSkill ? `**Style Skill**: ${styleSkill} — load .claude/skills/style-${styleSkill}/ for design reference` : ''}
${updateMode ? '**Update Mode**: Read existing analysis and enhance/update it' : ''}
**Output**: Create analysis documents in ${roleDir}/
- ${roleDir}/analysis.md (main index)
- ${roleDir}/analysis-*.md (sub-documents as needed)
Follow the same analysis protocol as wave role analysis but with interactive refinement.
`
})
wait({ id: agentId })
close_agent({ id: agentId })
console.log(`\n✓ ${roleName} analysis complete: ${roleDir}/analysis.md`)
}
```
---
### Phase 4: Synthesis Integration (Auto Mode)
**Objective**: Read all role analyses, cross-reference, generate feature specs.
**Steps**:
1. **Collect Role Findings**
```javascript
const rolesCSV = parseCsv(Read(`${sessionFolder}/roles.csv`))
const completedRoles = rolesCSV.filter(r => r.status === 'completed')
// Read all analysis.md index files (optimized: skip sub-docs for token efficiency)
const roleAnalyses = {}
for (const role of completedRoles) {
const indexPath = `${sessionFolder}/.brainstorming/${role.role}/analysis.md`
const content = Read(indexPath)
if (content) roleAnalyses[role.role] = content
}
// Read discoveries
const discoveriesPath = `${sessionFolder}/discoveries.ndjson`
const discoveries = Read(discoveriesPath) || ''
```
2. **Synthesis via Agent**
```javascript
const synthesisAgent = spawn_agent({
agent: `~/.codex/agents/conceptual-planning-agent.md`,
instruction: `
## SYNTHESIS ASSIGNMENT
Synthesize ${completedRoles.length} role analyses into unified feature specifications.
**Session**: ${sessionFolder}
**Role Analyses**: ${completedRoles.map(r => `${sessionFolder}/.brainstorming/${r.role}/analysis.md`).join(', ')}
**Discoveries**: ${discoveriesPath}
### Synthesis Protocol
1. **Read all role analyses** (analysis.md files only — these are index documents)
2. **Cross-reference findings**: Identify agreements, conflicts, and unique insights
3. **Generate feature specs**: For each feature in guidance-specification.md:
- Create ${sessionFolder}/.brainstorming/feature-specs/F-{id}-{slug}.md
- Consolidate perspectives from all relevant roles
- Note conflicts and recommended resolutions
4. **Generate feature index**: ${sessionFolder}/.brainstorming/feature-index.json
- Array of {id, title, slug, roles_contributing[], conflict_count, priority}
5. **Generate changelog**: ${sessionFolder}/.brainstorming/synthesis-changelog.md
- Decisions made, conflicts resolved, trade-offs accepted
### Complexity Assessment
Evaluate complexity score (0-8):
- Feature count (≤2: 0, 3-4: 1, ≥5: 2)
- Unresolved conflicts (0: 0, 1-2: 1, ≥3: 2)
- Participating roles (≤2: 0, 3-4: 1, ≥5: 2)
- Cross-feature dependencies (0: 0, 1-2: 1, ≥3: 2)
### Output Files
- feature-specs/F-{id}-{slug}.md (one per feature)
- feature-index.json
- synthesis-changelog.md
`
})
wait({ id: synthesisAgent })
close_agent({ id: synthesisAgent })
```
3. **Completion Summary**
```javascript
const featureIndex = JSON.parse(Read(`${sessionFolder}/.brainstorming/feature-index.json`) || '[]')
console.log(`
## Brainstorm Complete
Session: ${sessionId}
Roles analyzed: ${completedRoles.length}
Features synthesized: ${featureIndex.length}
### Feature Specs
${featureIndex.map(f => ` - [${f.id}] ${f.title} (${f.roles_contributing?.length || 0} roles, ${f.conflict_count || 0} conflicts)`).join('\n')}
### Next Steps
- /workflow-plan --session ${sessionId} → Generate implementation plan
- Review: ${sessionFolder}/.brainstorming/feature-specs/
`)
```
---
## Utility Functions
### CSV Parser
```javascript
function parseCsv(content) {
const lines = content.trim().split('\n')
if (lines.length < 2) return []
const headers = parseCSVLine(lines[0])
return lines.slice(1).map(line => {
const values = parseCSVLine(line)
const row = {}
headers.forEach((h, i) => row[h] = values[i] || '')
return row
})
}
```
### CSV Row Updater
```javascript
function updateMasterCsvRow(csvPath, id, updates) {
const content = Read(csvPath)
const lines = content.trim().split('\n')
const headers = parseCSVLine(lines[0])
const idIdx = headers.indexOf('id')
for (let i = 1; i < lines.length; i++) {
const values = parseCSVLine(lines[i])
if (values[idIdx]?.replace(/"/g, '') === id) {
Object.entries(updates).forEach(([key, val]) => {
const idx = headers.indexOf(key)
if (idx >= 0) values[idx] = `"${String(val).replace(/"/g, '""')}"`
})
lines[i] = values.join(',')
break
}
}
Write(csvPath, lines.join('\n'))
}
```
---
## Error Handling
| Error | Recovery |
|-------|----------|
| Invalid role name | Show valid roles list, prompt again |
| No active session (single role) | Guide user to run auto mode first |
| Role agent failure | Mark failed in roles.csv, continue with remaining |
| Synthesis overflow (>100KB) | Read only analysis.md index files |
| Context compression | Re-read guidance-specification.md and roles.csv |
---
## Compact Protection
> **COMPACT DIRECTIVE**: If context compression occurs mid-execution, re-read the current phase's state:
> - Phase 2: Re-read `guidance-specification.md`
> - Phase 3: Re-read `roles.csv` for progress state
> - Phase 4: Re-read `feature-index.json` and `roles.csv`

View File

@@ -831,14 +831,14 @@ ${selectedMode === 'progressive' ? `**Progressive Mode**:
case 'done': case 'done':
// Output paths and end // Output paths and end
console.log(` console.log([
Roadmap saved: ${sessionFolder}/roadmap.md `Roadmap saved: ${sessionFolder}/roadmap.md`,
Issues created: ${issueIds.length} `Issues created: ${issueIds.length}`,
'',
To execute later: 'To execute later:',
$team-planex ${issueIds.slice(0, 3).join(' ')}... ` $team-planex ${issueIds.slice(0, 3).join(' ')}...`,
ccw issue list --session ${sessionId} ` ccw issue list --session ${sessionId}`
`) ].join('\n'))
break break
} }
``` ```
@@ -897,3 +897,7 @@ To execute later:
| Collaborative multi-agent planning | `$collaborative-plan-with-file` | | Collaborative multi-agent planning | `$collaborative-plan-with-file` |
| Full specification documents | `$spec-generator` | | Full specification documents | `$spec-generator` |
| Code implementation from existing plan | `$workflow-lite-planex` | | Code implementation from existing plan | `$workflow-lite-planex` |
---
**Now execute roadmap-with-file for**: $ARGUMENTS

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,636 @@
---
name: workflow-plan
description: |
Planning pipeline with multi-mode routing (plan/verify/replan). Session discovery →
context gathering (spawn_agent) → conditional conflict resolution → task generation
(spawn_agent or N+1 parallel agents) → plan verification → interactive replan.
Produces IMPL_PLAN.md, task JSONs, TODO_LIST.md.
argument-hint: "[-y|--yes] [--session ID] \"task description\" | verify [--session ID] | replan [--session ID] [IMPL-N] \"changes\""
allowed-tools: spawn_agent, wait, send_input, close_agent, AskUserQuestion, Read, Write, Edit, Bash, Glob, Grep
---
## Auto Mode
When `--yes` or `-y`: Skip all confirmations, use defaults, auto-verify, auto-continue to execute if PROCEED.
# Workflow Plan
## Usage
```bash
# Plan mode (default)
$workflow-plan "Build authentication system with JWT and OAuth"
$workflow-plan -y "Add rate limiting to API endpoints"
$workflow-plan --session WFS-auth "Extend with 2FA support"
# Verify mode
$workflow-plan verify --session WFS-auth
$workflow-plan verify
# Replan mode
$workflow-plan replan --session WFS-auth "Change from JWT to session-based auth"
$workflow-plan replan --session WFS-auth IMPL-3 "Split into two smaller tasks"
```
**Flags**:
- `-y, --yes`: Skip all confirmations (auto mode)
- `--session ID`: Use specific session
---
## Overview
Multi-mode planning pipeline using subagent coordination. Plan mode runs 4 sequential phases with conditional branching; verify and replan modes operate on existing plans.
```
┌──────────────────────────────────────────────────────────────────┐
│ WORKFLOW PLAN PIPELINE │
├──────────────────────────────────────────────────────────────────┤
│ │
│ Mode Detection: plan | verify | replan │
│ │
│ ═══ Plan Mode (default) ═══ │
│ │
│ Phase 1: Session Discovery │
│ ├─ Create or find workflow session │
│ └─ Initialize planning-notes.md │
│ │
│ Phase 2: Context Gathering (spawn_agent: context-search-agent) │
│ ├─ Codebase analysis → context-package.json │
│ └─ Conflict risk assessment │
│ │
│ Phase 3: Conflict Resolution (conditional: risk ≥ medium) │
│ ├─ CLI-driven conflict analysis │
│ └─ User-selected resolution strategies │
│ │
│ Phase 4: Task Generation (spawn_agent: action-planning-agent) │
│ ├─ Single module → 1 agent │
│ ├─ Multi-module → N+1 parallel agents │
│ └─ Output: IMPL_PLAN.md + task JSONs + TODO_LIST.md │
│ │
│ Plan Confirmation Gate │
│ ├─ "Verify Plan" → Phase 5 │
│ ├─ "Start Execution" → workflow-execute │
│ └─ "Review Status" → Display inline │
│ │
│ ═══ Verify Mode ═══ │
│ Phase 5: Plan Verification (spawn_agent: cli-explore-agent) │
│ └─ 10-dimension analysis → PLAN_VERIFICATION.md │
│ │
│ ═══ Replan Mode ═══ │
│ Phase 6: Interactive Replan │
│ └─ Clarification → Impact → Backup → Apply → Verify │
│ │
└──────────────────────────────────────────────────────────────────┘
```
---
## Data Flow
```
User Input (task description)
↓ [Convert to GOAL/SCOPE/CONTEXT]
Phase 1 ──→ sessionId, planning-notes.md
Phase 2 ──→ context-package.json, conflictRisk
├── conflictRisk ≥ medium ──→ Phase 3 ──→ modified artifacts
└── conflictRisk < medium ──→ skip Phase 3
Phase 4 ──→ IMPL_PLAN.md, plan.json, task JSONs, TODO_LIST.md
├── Verify → Phase 5 → PLAN_VERIFICATION.md
├── Execute → workflow-execute skill
└── Review → inline display
```
---
## Session Structure
```
.workflow/active/WFS-{session}/
├── workflow-session.json # Session metadata
├── planning-notes.md # Accumulated context across phases
├── IMPL_PLAN.md # Implementation plan (human-readable)
├── plan.json # Structured plan overview (machine-readable)
├── TODO_LIST.md # Task checklist
├── .task/ # Task definitions
│ ├── IMPL-1.json
│ └── IMPL-N.json
└── .process/
├── context-package.json # Phase 2 output
├── conflict-resolution.json # Phase 3 output (conditional)
├── PLAN_VERIFICATION.md # Phase 5 output
└── backup/ # Phase 6 backups
```
---
## Implementation
### Session Initialization
```javascript
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
// Parse flags
const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
const sessionMatch = $ARGUMENTS.match(/--session\s+(\S+)/)
const existingSessionId = sessionMatch ? sessionMatch[1] : null
// Mode detection
const cleanArgs = $ARGUMENTS
.replace(/--yes|-y|--session\s+\S+/g, '').trim()
let mode = 'plan'
if (cleanArgs.startsWith('verify')) mode = 'verify'
else if (cleanArgs.startsWith('replan')) mode = 'replan'
const taskDescription = cleanArgs
.replace(/^(verify|replan)\s*/, '')
.replace(/^["']|["']$/g, '')
.trim()
// Extract replan task ID if present
const replanTaskMatch = taskDescription.match(/^(IMPL-\d+(?:\.\d+)?)\s+(.+)/)
const replanTaskId = replanTaskMatch ? replanTaskMatch[1] : null
const replanDescription = replanTaskMatch ? replanTaskMatch[2] : taskDescription
```
---
### Phase 1: Session Discovery (Plan Mode)
**Objective**: Create or find workflow session, initialize planning notes.
```javascript
if (mode !== 'plan') {
// verify/replan: locate existing session
// → Jump to Phase 5 or Phase 6
}
let sessionId, sessionFolder
if (existingSessionId) {
sessionId = existingSessionId
sessionFolder = `.workflow/active/${sessionId}`
if (!Bash(`test -d "${sessionFolder}" && echo yes`).trim()) {
console.log(`ERROR: Session ${sessionId} not found`)
return
}
} else {
// Auto-detect from .workflow/active/ or create new
const sessions = Bash(`ls -d .workflow/active/WFS-* 2>/dev/null`).trim().split('\n').filter(Boolean)
if (sessions.length === 0 || taskDescription) {
// Create new session
const slug = taskDescription.toLowerCase()
.replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-').substring(0, 40)
sessionId = `WFS-${slug}`
sessionFolder = `.workflow/active/${sessionId}`
Bash(`mkdir -p "${sessionFolder}/.task" "${sessionFolder}/.process" "${sessionFolder}/.summaries"`)
Write(`${sessionFolder}/workflow-session.json`, JSON.stringify({
session_id: sessionId,
status: 'planning',
created_at: getUtc8ISOString(),
task_description: taskDescription
}, null, 2))
} else if (sessions.length === 1) {
sessionId = sessions[0].split('/').pop()
sessionFolder = sessions[0]
} else {
// Multiple sessions — ask user
if (AUTO_YES) {
sessionFolder = sessions[0]
sessionId = sessions[0].split('/').pop()
} else {
const answer = AskUserQuestion({
questions: [{
question: "Multiple sessions found. Select one:",
header: "Session",
multiSelect: false,
options: sessions.slice(0, 4).map(s => ({
label: s.split('/').pop(),
description: s
}))
}]
})
sessionId = answer.Session
sessionFolder = `.workflow/active/${sessionId}`
}
}
}
// Initialize planning-notes.md
const structuredDesc = `GOAL: ${taskDescription}\nSCOPE: Core implementation\nCONTEXT: New development`
Write(`${sessionFolder}/planning-notes.md`, `# Planning Notes\n\n## User Intent\n${structuredDesc}\n`)
console.log(`Session: ${sessionId}`)
```
---
### Phase 2: Context Gathering (spawn_agent)
**Objective**: Gather project context, assess conflict risk.
```javascript
console.log(`\n## Phase 2: Context Gathering\n`)
const ctxAgent = spawn_agent({
agent: `~/.codex/agents/context-search-agent.md`,
instruction: `
Gather implementation context for planning.
**Session**: ${sessionFolder}
**Task**: ${taskDescription}
**Mode**: PLAN
### Steps
1. Analyze project structure (package.json, tsconfig, etc.)
2. Search for existing similar implementations
3. Identify integration points and dependencies
4. Assess conflict risk with existing code
5. Generate context package
### Output
Write context package to: ${sessionFolder}/.process/context-package.json
Format: {
"critical_files": [...],
"patterns": [...],
"dependencies": [...],
"integration_points": [...],
"conflict_risk": "none" | "low" | "medium" | "high",
"conflict_areas": [...],
"constraints": [...]
}
`
})
wait({ id: ctxAgent })
close_agent({ id: ctxAgent })
// Parse outputs
const contextPkg = JSON.parse(Read(`${sessionFolder}/.process/context-package.json`) || '{}')
const conflictRisk = contextPkg.conflict_risk || 'none'
const contextPath = `${sessionFolder}/.process/context-package.json`
// Update planning-notes.md
Edit(`${sessionFolder}/planning-notes.md`, {
oldText: '## User Intent',
newText: `## Context Findings
- Critical files: ${(contextPkg.critical_files || []).join(', ')}
- Conflict risk: ${conflictRisk}
- Constraints: ${(contextPkg.constraints || []).join('; ')}
## User Intent`
})
console.log(` Context gathered. Conflict risk: ${conflictRisk}`)
```
---
### Phase 3: Conflict Resolution (Conditional)
**Objective**: Detect and resolve conflicts when risk ≥ medium.
```javascript
if (['medium', 'high'].includes(conflictRisk)) {
console.log(`\n## Phase 3: Conflict Resolution (risk: ${conflictRisk})\n`)
Bash({
command: `ccw cli -p "PURPOSE: Analyze and resolve conflicts between planned changes and existing codebase.
TASK:
• Read context package for conflict areas
• Analyze each conflict area in detail
• Propose resolution strategies (refactor, adapt, isolate, defer)
• For each conflict: assess impact and recommend approach
MODE: analysis
CONTEXT: @**/*
EXPECTED: JSON: {conflicts: [{area, severity, description, strategy, impact}], summary: string}
CONSTRAINTS: Focus on ${(contextPkg.conflict_areas || []).join(', ')}
TASK DESCRIPTION: ${taskDescription}" --tool gemini --mode analysis --rule analysis-diagnose-bug-root-cause`,
run_in_background: true
})
// Wait for CLI → conflicts[]
if (!AUTO_YES && conflicts.length > 0) {
// Present conflicts and let user select strategies
console.log(`\n### Conflicts Found: ${conflicts.length}\n`)
conflicts.forEach((c, i) => {
console.log(`${i + 1}. [${c.severity}] ${c.area}: ${c.description}`)
console.log(` Strategy: ${c.strategy} | Impact: ${c.impact}`)
})
const answer = AskUserQuestion({
questions: [{
question: "Accept conflict resolution strategies?",
header: "Conflicts",
multiSelect: false,
options: [
{ label: "Accept All", description: "Apply all recommended strategies" },
{ label: "Review Each", description: "Approve strategies individually" },
{ label: "Skip", description: "Proceed without resolving" }
]
}]
})
}
// Write resolution
Write(`${sessionFolder}/.process/conflict-resolution.json`,
JSON.stringify({ conflicts, resolved_at: getUtc8ISOString() }, null, 2))
// Update planning-notes
// Append conflict decisions to planning-notes.md
} else {
console.log(` Conflict risk: ${conflictRisk} — skipping Phase 3`)
}
```
---
### Phase 4: Task Generation (spawn_agent)
**Objective**: Generate IMPL_PLAN.md, task JSONs, TODO_LIST.md.
**Steps**:
1. **Determine Planning Strategy**
```javascript
console.log(`\n## Phase 4: Task Generation\n`)
// Detect module count from context
const modules = contextPkg.integration_points?.map(p => p.module).filter(Boolean) || []
const uniqueModules = [...new Set(modules)]
const isMultiModule = uniqueModules.length >= 2
```
2. **Single Module → One Agent**
```javascript
if (!isMultiModule) {
const planAgent = spawn_agent({
agent: `~/.codex/agents/action-planning-agent.md`,
instruction: `
Generate implementation plan and task JSONs.
**Session**: ${sessionFolder}
**Task**: ${taskDescription}
**Context**: ${contextPath}
**Planning Notes**: ${sessionFolder}/planning-notes.md
${contextPkg.conflict_risk === 'medium' || contextPkg.conflict_risk === 'high'
? `**Conflict Resolution**: ${sessionFolder}/.process/conflict-resolution.json` : ''}
### Output Requirements
1. **IMPL_PLAN.md** at ${sessionFolder}/IMPL_PLAN.md
- Section 1: Requirements Summary
- Section 2: Architecture Decisions
- Section 3: Task Breakdown (with dependencies)
- Section 4: Implementation Strategy (Sequential/Parallel/Phased)
- Section 5: Risk Assessment
2. **plan.json** at ${sessionFolder}/plan.json
- {task_ids[], recommended_execution, complexity, shared_context}
3. **Task JSONs** at ${sessionFolder}/.task/IMPL-{N}.json
- {id, title, description, depends_on[], convergence, meta: {type, agent}}
4. **TODO_LIST.md** at ${sessionFolder}/TODO_LIST.md
- Checkbox format: - [ ] IMPL-{N}: {title}
`
})
wait({ id: planAgent })
close_agent({ id: planAgent })
}
```
3. **Multi-Module → N+1 Parallel Agents**
```javascript
if (isMultiModule) {
const prefixes = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
const moduleAgents = []
// Spawn N module planners in parallel
for (let i = 0; i < uniqueModules.length; i++) {
const prefix = prefixes[i]
const mod = uniqueModules[i]
const agentId = spawn_agent({
agent: `~/.codex/agents/action-planning-agent.md`,
instruction: `
Plan module: ${mod} (prefix: ${prefix})
**Session**: ${sessionFolder}
**Module**: ${mod}
**Context**: ${contextPath}
**Task ID prefix**: ${prefix} (e.g., ${prefix}1, ${prefix}2, ...)
Generate task JSONs for this module only.
Output to: ${sessionFolder}/.task/${prefix}{N}.json
Mark cross-module dependencies as CROSS::${'{module}'}::${'{task}'}
`
})
moduleAgents.push({ id: agentId, module: mod, prefix })
}
// Wait for all module planners
wait({ ids: moduleAgents.map(a => a.id) })
moduleAgents.forEach(a => close_agent({ id: a.id }))
// +1 Coordinator: integrate all modules
const coordAgent = spawn_agent({
agent: `~/.codex/agents/action-planning-agent.md`,
instruction: `
Integrate ${uniqueModules.length} module plans into unified IMPL_PLAN.md.
**Session**: ${sessionFolder}
**Modules**: ${uniqueModules.join(', ')}
**Task Directory**: ${sessionFolder}/.task/
### Steps
1. Read all module task JSONs from .task/
2. Resolve CROSS:: dependencies (replace with actual task IDs)
3. Generate unified IMPL_PLAN.md, plan.json, TODO_LIST.md
4. Renumber task IDs to sequential IMPL-1, IMPL-2, ...
`
})
wait({ id: coordAgent })
close_agent({ id: coordAgent })
}
```
4. **Plan Confirmation Gate**
```javascript
// Validate outputs exist
const planExists = Bash(`test -f "${sessionFolder}/IMPL_PLAN.md" && echo yes`).trim() === 'yes'
const taskCount = parseInt(Bash(`ls ${sessionFolder}/.task/IMPL-*.json 2>/dev/null | wc -l`).trim()) || 0
console.log(`\n## Plan Generated\n`)
console.log(` Tasks: ${taskCount}`)
console.log(` Plan: ${sessionFolder}/IMPL_PLAN.md`)
if (AUTO_YES) {
// Auto-verify then auto-execute if PROCEED
console.log(` [--yes] Auto-verifying plan...`)
// → Fall through to Phase 5, then Phase 5 result determines next step
} else {
const nextStep = AskUserQuestion({
questions: [{
question: "Plan generated. What's next?",
header: "Next Step",
multiSelect: false,
options: [
{ label: "Verify Plan (Recommended)", description: "Run quality verification before execution" },
{ label: "Start Execution", description: "Proceed to workflow-execute" },
{ label: "Review Status", description: "Display plan summary inline" }
]
}]
})
if (nextStep['Next Step'] === 'Start Execution') {
console.log(`\nReady to execute. Run: $workflow-execute --session ${sessionId}`)
return
}
if (nextStep['Next Step'] === 'Review Status') {
const plan = Read(`${sessionFolder}/IMPL_PLAN.md`)
console.log(plan)
return
}
// Verify → continue to Phase 5
}
```
---
### Phase 5: Plan Verification (Verify Mode)
**Objective**: Read-only multi-dimensional plan analysis.
```javascript
if (mode === 'verify' || /* auto-verify from Phase 4 */) {
console.log(`\n## Phase 5: Plan Verification\n`)
// Find session if in verify mode entry
if (mode === 'verify' && !sessionFolder) {
// Session discovery (same logic as Phase 1)
}
Bash({
command: `ccw cli -p "PURPOSE: Verify implementation plan quality across 10 dimensions. Read-only analysis. Success = actionable quality gate recommendation.
TASK:
• A: User Intent Alignment — does plan match original goal?
• B: Requirements Coverage — are all requirements addressed?
• C: Consistency Validation — internal consistency of plan
• D: Dependency Integrity — valid dependency chain
• E: Synthesis Alignment — matches brainstorm artifacts (if exist)
• F: Task Specification Quality — clear, actionable, testable
• G: Duplication Detection — no overlapping tasks
• H: Feasibility Assessment — realistic scope and effort
• I: Constraints Compliance — respects stated constraints
• J: Context Validation — planning-notes consistent with plan
MODE: analysis
CONTEXT: @${sessionFolder}/IMPL_PLAN.md @${sessionFolder}/.task/**/*.json @${sessionFolder}/planning-notes.md @${sessionFolder}/TODO_LIST.md
EXPECTED: Structured report with: per-dimension score (PASS/WARN/FAIL), issues list, quality gate (BLOCK_EXECUTION/PROCEED_WITH_FIXES/PROCEED_WITH_CAUTION/PROCEED)
CONSTRAINTS: Read-only | No file modifications | Be specific about issues" --tool gemini --mode analysis --rule analysis-review-architecture --cd "${sessionFolder}"`,
run_in_background: true
})
// Wait for CLI → verification report
Write(`${sessionFolder}/.process/PLAN_VERIFICATION.md`, verificationReport)
console.log(` Quality gate: ${qualityGate}`)
console.log(` Report: ${sessionFolder}/.process/PLAN_VERIFICATION.md`)
if (AUTO_YES && qualityGate === 'PROCEED') {
console.log(` [--yes] Plan verified. Ready for execution.`)
console.log(` Run: $workflow-execute --session ${sessionId}`)
}
}
```
---
### Phase 6: Interactive Replan (Replan Mode)
**Objective**: Modify existing plan based on new requirements.
```javascript
if (mode === 'replan') {
console.log(`\n## Phase 6: Interactive Replan\n`)
// Find session
if (!sessionFolder) {
// Session discovery logic
}
const scope = replanTaskId ? 'task' : 'session'
console.log(` Scope: ${scope}${replanTaskId ? ` (${replanTaskId})` : ''}`)
console.log(` Changes: ${replanDescription}`)
// 1. Backup current plan
Bash(`mkdir -p "${sessionFolder}/.process/backup" && cp "${sessionFolder}/IMPL_PLAN.md" "${sessionFolder}/.process/backup/IMPL_PLAN-$(date +%Y%m%d%H%M%S).md"`)
// 2. Replan via agent
const replanAgent = spawn_agent({
agent: `~/.codex/agents/action-planning-agent.md`,
instruction: `
Replan ${scope === 'task' ? `task ${replanTaskId}` : 'entire session'}.
**Session**: ${sessionFolder}
**Current Plan**: ${sessionFolder}/IMPL_PLAN.md
**Current Tasks**: ${sessionFolder}/.task/
**Changes Requested**: ${replanDescription}
${replanTaskId ? `**Target Task**: ${sessionFolder}/.task/${replanTaskId}.json` : ''}
### Steps
1. Read current plan and task JSONs
2. Analyze impact of requested changes
3. Modify affected tasks (update/add/remove)
4. Update IMPL_PLAN.md with change annotations
5. Update TODO_LIST.md
6. Generate change summary
### Constraints
- Preserve completed tasks
- Minimize changes to unaffected tasks
- Maintain dependency integrity
`
})
wait({ id: replanAgent })
close_agent({ id: replanAgent })
console.log(` Replan complete. Review: ${sessionFolder}/IMPL_PLAN.md`)
}
```
---
## Error Handling
| Error | Recovery |
|-------|----------|
| No active session | Guide: run `$workflow-plan "description"` first |
| Context gathering timeout | Retry with reduced scope |
| Conflict analysis failure | Skip Phase 3, proceed with warning |
| Task generation failure | Retry agent with simplified context |
| Plan verification failure | Display partial results |
| Session not found (verify/replan) | List available sessions |
---
## Compact Protection
> **COMPACT DIRECTIVE**: If context compression occurs:
> - Re-read `planning-notes.md` for accumulated context
> - Re-read `workflow-session.json` for session state
> - Phase 4 is the most token-intensive — if compressed, re-read task JSONs on demand