mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-28 09:23:08 +08:00
Refactor and enhance workflow commands and skills
- Removed obsolete ccw-test command file. - Updated ccw command to include new team workflows and collaborative planning features. - Enhanced review-cycle skill with unified auto mode detection for streamlined user experience. - Improved team-quality-assurance monitoring command to utilize consistent auto mode detection. - Standardized auto mode detection across workflow-execute and workflow-multi-cli-plan skills. - Introduced cycle workflows for integration testing and refactoring with self-iterating capabilities. - Added detailed usage examples for new team workflows and collaborative planning commands.
This commit is contained in:
@@ -23,8 +23,20 @@ Main process orchestrator: intent analysis → workflow selection → command ch
|
||||
| `workflow-multi-cli-plan` | ACE context → CLI discussion → plan → execute |
|
||||
| `review-cycle` | session/module review → fix orchestration |
|
||||
| `brainstorm` | auto/single-role → artifacts → analysis → synthesis |
|
||||
| `workflow:collaborative-plan-with-file` | understanding agent → parallel agents → plan-note.md |
|
||||
| `workflow:req-plan-with-file` | requirement decomposition → issue creation → execution-plan.json |
|
||||
| `workflow:integration-test-cycle` | explore → test dev → test-fix cycle → reflection |
|
||||
| `workflow:refactor-cycle` | tech debt discovery → prioritize → execute → validate |
|
||||
| `team-planex` | planner + executor wave pipeline(边规划边执行)|
|
||||
| `team-iterdev` | 迭代开发团队(planner → developer → reviewer 循环)|
|
||||
| `team-lifecycle` | 全生命周期团队(spec → impl → test)|
|
||||
| `team-issue` | issue 解决团队(discover → plan → execute)|
|
||||
| `team-testing` | 测试团队(strategy → generate → execute → analyze)|
|
||||
| `team-quality-assurance` | QA 团队(scout → strategist → generator → executor → analyst)|
|
||||
| `team-brainstorm` | 团队头脑风暴(facilitator → participants → synthesizer)|
|
||||
| `team-uidesign` | UI 设计团队(designer → implementer dual-track)|
|
||||
|
||||
独立命令(仍使用 colon 格式):workflow:brainstorm-with-file, workflow:debug-with-file, workflow:analyze-with-file, workflow:ui-design:*, issue:*, workflow:session:*
|
||||
独立命令(仍使用 colon 格式):workflow:brainstorm-with-file, workflow:debug-with-file, workflow:analyze-with-file, workflow:collaborative-plan-with-file, workflow:req-plan-with-file, workflow:integration-test-cycle, workflow:refactor-cycle, workflow:unified-execute-with-file, workflow:clean, workflow:init, workflow:init-guidelines, workflow:ui-design:*, issue:*, workflow:session:*
|
||||
|
||||
## Core Concept: Self-Contained Skills (自包含 Skill)
|
||||
|
||||
@@ -44,6 +56,19 @@ Main process orchestrator: intent analysis → workflow selection → command ch
|
||||
| TDD Planning | `workflow-tdd` → `workflow-execute` | tdd-plan 和 execute 是独立 Skill |
|
||||
| 测试流水线 | `workflow-test-fix` | 内部完成 gen→cycle |
|
||||
| 代码审查 | `review-cycle` | 内部完成 review→fix |
|
||||
| 多CLI协作 | `workflow-multi-cli-plan` | ACE context → CLI discussion → plan → execute |
|
||||
| 协作规划 | `workflow:collaborative-plan-with-file` | 多 agent 协作生成 plan-note.md |
|
||||
| 需求路线图 | `workflow:req-plan-with-file` | 需求拆解→issue 创建→执行计划 |
|
||||
| 集成测试循环 | `workflow:integration-test-cycle` | 自迭代集成测试闭环 |
|
||||
| 重构循环 | `workflow:refactor-cycle` | 技术债务发现→重构→验证 |
|
||||
| 团队 Plan+Execute | `team-planex` | 2 人团队 wave pipeline,边规划边执行 |
|
||||
| 团队迭代开发 | `team-iterdev` | 多角色迭代开发闭环 |
|
||||
| 团队全生命周期 | `team-lifecycle` | spec→impl→test 全流程 |
|
||||
| 团队 Issue | `team-issue` | 多角色协作 issue 解决 |
|
||||
| 团队测试 | `team-testing` | 多角色测试流水线 |
|
||||
| 团队 QA | `team-quality-assurance` | 多角色质量保障闭环 |
|
||||
| 团队头脑风暴 | `team-brainstorm` | 多角色协作头脑风暴 |
|
||||
| 团队 UI 设计 | `team-uidesign` | dual-track 设计+实现 |
|
||||
|
||||
## Execution Model
|
||||
|
||||
@@ -116,7 +141,22 @@ function detectTaskType(text) {
|
||||
'brainstorm-to-issue': /brainstorm.*issue|头脑风暴.*issue|idea.*issue|想法.*issue|从.*头脑风暴|convert.*brainstorm/,
|
||||
'debug-file': /debug.*document|hypothesis.*debug|troubleshoot.*track|investigate.*log|调试.*记录|假设.*验证|systematic debug|深度调试/,
|
||||
'analyze-file': /analyze.*document|explore.*concept|understand.*architecture|investigate.*discuss|collaborative analysis|分析.*讨论|深度.*理解|协作.*分析/,
|
||||
'collaborative-plan': /collaborative.*plan|协作.*规划|多人.*规划|multi.*agent.*plan|Plan Note|分工.*规划/,
|
||||
'req-plan': /roadmap|需求.*规划|需求.*拆解|requirement.*plan|req.*plan|progressive.*plan|路线.*图/,
|
||||
// Cycle workflows (self-iterating with reflection)
|
||||
'integration-test': /integration.*test|集成测试|端到端.*测试|e2e.*test|integration.*cycle/,
|
||||
'refactor': /refactor|重构|tech.*debt|技术债务/,
|
||||
// Team workflows (multi-role collaboration, explicit "team" keyword required)
|
||||
'team-planex': /team.*plan.*exec|team.*planex|团队.*规划.*执行|并行.*规划.*执行|wave.*pipeline/,
|
||||
'team-iterdev': /team.*iter|team.*iterdev|迭代.*开发.*团队|iterative.*dev.*team/,
|
||||
'team-lifecycle': /team.*lifecycle|全生命周期|full.*lifecycle|spec.*impl.*test.*team/,
|
||||
'team-issue': /team.*issue.*resolv|团队.*issue|team.*resolve.*issue/,
|
||||
'team-testing': /team.*test|测试团队|comprehensive.*test.*team|全面.*测试.*团队/,
|
||||
'team-qa': /team.*qa|quality.*assurance.*team|QA.*团队|质量.*保障.*团队|团队.*质量/,
|
||||
'team-brainstorm': /team.*brainstorm|团队.*头脑风暴|team.*ideation|多人.*头脑风暴/,
|
||||
'team-uidesign': /team.*ui.*design|UI.*设计.*团队|dual.*track.*design|团队.*UI/,
|
||||
// Standard workflows
|
||||
'multi-cli-plan': /multi.*cli|多.*CLI|多模型.*协作|multi.*model.*collab/,
|
||||
'bugfix': /fix|bug|error|crash|fail|debug/,
|
||||
'issue-batch': /issues?|batch/ && /fix|resolve/,
|
||||
'issue-transition': /issue workflow|structured workflow|queue|multi-stage/,
|
||||
@@ -167,7 +207,22 @@ function selectWorkflow(analysis) {
|
||||
'brainstorm-to-issue': { level: 4, flow: 'brainstorm-to-issue' }, // Brainstorm → Issue workflow
|
||||
'debug-file': { level: 3, flow: 'debug-with-file' }, // Hypothesis-driven debugging
|
||||
'analyze-file': { level: 3, flow: 'analyze-with-file' }, // Collaborative analysis
|
||||
'collaborative-plan': { level: 3, flow: 'collaborative-plan' }, // Multi-agent collaborative planning
|
||||
'req-plan': { level: 4, flow: 'req-plan' }, // Requirement-level roadmap planning
|
||||
// Cycle workflows (self-iterating with reflection)
|
||||
'integration-test': { level: 3, flow: 'integration-test-cycle' }, // Self-iterating integration test
|
||||
'refactor': { level: 3, flow: 'refactor-cycle' }, // Tech debt discovery and refactoring
|
||||
// Team workflows (multi-role collaboration)
|
||||
'team-planex': { level: 'Team', flow: 'team-planex' },
|
||||
'team-iterdev': { level: 'Team', flow: 'team-iterdev' },
|
||||
'team-lifecycle': { level: 'Team', flow: 'team-lifecycle' },
|
||||
'team-issue': { level: 'Team', flow: 'team-issue' },
|
||||
'team-testing': { level: 'Team', flow: 'team-testing' },
|
||||
'team-qa': { level: 'Team', flow: 'team-qa' },
|
||||
'team-brainstorm': { level: 'Team', flow: 'team-brainstorm' },
|
||||
'team-uidesign': { level: 'Team', flow: 'team-uidesign' },
|
||||
// Standard workflows
|
||||
'multi-cli-plan': { level: 3, flow: 'multi-cli-plan' }, // Multi-CLI collaborative planning
|
||||
'bugfix': { level: 2, flow: 'bugfix.standard' },
|
||||
'issue-batch': { level: 'Issue', flow: 'issue' },
|
||||
'issue-transition': { level: 2.5, flow: 'rapid-to-issue' }, // Bridge workflow
|
||||
@@ -250,6 +305,29 @@ function buildCommandChain(workflow, analysis) {
|
||||
// Note: Self-contained with multi-round discussion and CLI exploration
|
||||
],
|
||||
|
||||
'collaborative-plan': [
|
||||
{ cmd: 'workflow:collaborative-plan-with-file', args: `"${analysis.goal}"` },
|
||||
{ cmd: 'workflow:unified-execute-with-file', args: '' }
|
||||
// Note: Plan Note → unified execution engine
|
||||
],
|
||||
|
||||
'req-plan': [
|
||||
{ cmd: 'workflow:req-plan-with-file', args: `"${analysis.goal}"` },
|
||||
{ cmd: 'team-planex', args: '' }
|
||||
// Note: Requirement decomposition → issue creation → team-planex wave execution
|
||||
],
|
||||
|
||||
// Cycle workflows (self-iterating with reflection)
|
||||
'integration-test-cycle': [
|
||||
{ cmd: 'workflow:integration-test-cycle', args: `"${analysis.goal}"` }
|
||||
// Note: Self-contained explore → test → fix cycle with reflection
|
||||
],
|
||||
|
||||
'refactor-cycle': [
|
||||
{ cmd: 'workflow:refactor-cycle', args: `"${analysis.goal}"` }
|
||||
// Note: Self-contained tech debt discovery → refactor → validate
|
||||
],
|
||||
|
||||
// Level 3 - Standard
|
||||
'coupled': [
|
||||
{ cmd: 'workflow-plan', args: `"${analysis.goal}"` },
|
||||
@@ -298,6 +376,39 @@ function buildCommandChain(workflow, analysis) {
|
||||
{ cmd: 'issue:plan', args: '--all-pending' },
|
||||
{ cmd: 'issue:queue', args: '' },
|
||||
{ cmd: 'issue:execute', args: '' }
|
||||
],
|
||||
|
||||
// Team Workflows (multi-role collaboration, self-contained)
|
||||
'team-planex': [
|
||||
{ cmd: 'team-planex', args: `"${analysis.goal}"` }
|
||||
],
|
||||
|
||||
'team-iterdev': [
|
||||
{ cmd: 'team-iterdev', args: `"${analysis.goal}"` }
|
||||
],
|
||||
|
||||
'team-lifecycle': [
|
||||
{ cmd: 'team-lifecycle', args: `"${analysis.goal}"` }
|
||||
],
|
||||
|
||||
'team-issue': [
|
||||
{ cmd: 'team-issue', args: `"${analysis.goal}"` }
|
||||
],
|
||||
|
||||
'team-testing': [
|
||||
{ cmd: 'team-testing', args: `"${analysis.goal}"` }
|
||||
],
|
||||
|
||||
'team-qa': [
|
||||
{ cmd: 'team-quality-assurance', args: `"${analysis.goal}"` }
|
||||
],
|
||||
|
||||
'team-brainstorm': [
|
||||
{ cmd: 'team-brainstorm', args: `"${analysis.goal}"` }
|
||||
],
|
||||
|
||||
'team-uidesign': [
|
||||
{ cmd: 'team-uidesign', args: `"${analysis.goal}"` }
|
||||
]
|
||||
};
|
||||
|
||||
@@ -532,9 +643,22 @@ Phase 5: Execute Command Chain
|
||||
| "从头脑风暴创建 issue" | brainstorm-to-issue | 4 | issue:from-brainstorm → issue:queue → issue:execute |
|
||||
| "深度调试 WebSocket" | debug-file | 3 | workflow:debug-with-file |
|
||||
| "协作分析: 认证架构优化" | analyze-file | 3 | workflow:analyze-with-file |
|
||||
| "协作规划: 实时通知系统" | collaborative-plan | 3 | collaborative-plan-with-file → unified-execute-with-file |
|
||||
| "需求规划: OAuth + 2FA" | req-plan | 4 | req-plan-with-file → team-planex |
|
||||
| "集成测试: 支付流程" | integration-test | 3 | workflow:integration-test-cycle |
|
||||
| "重构 auth 模块" | refactor | 3 | workflow:refactor-cycle |
|
||||
| "multi-cli plan: API设计" | multi-cli-plan | 3 | workflow-multi-cli-plan → workflow-test-fix |
|
||||
| "OAuth2 system" | feature (high) | 3 | workflow-plan → workflow-execute → review-cycle → workflow-test-fix |
|
||||
| "Implement with TDD" | tdd | 3 | workflow-tdd → workflow-execute |
|
||||
| "Uncertain: real-time" | exploration | 4 | brainstorm → workflow-plan → workflow-execute → workflow-test-fix |
|
||||
| "team planex: 用户系统" | team-planex | Team | team-planex |
|
||||
| "迭代开发团队: 支付模块" | team-iterdev | Team | team-iterdev |
|
||||
| "全生命周期: 通知服务" | team-lifecycle | Team | team-lifecycle |
|
||||
| "team resolve issue #42" | team-issue | Team | team-issue |
|
||||
| "测试团队: 全面测试认证" | team-testing | Team | team-testing |
|
||||
| "QA 团队: 质量保障支付" | team-qa | Team | team-quality-assurance |
|
||||
| "团队头脑风暴: API 设计" | team-brainstorm | Team | team-brainstorm |
|
||||
| "团队 UI 设计: 仪表盘" | team-uidesign | Team | team-uidesign |
|
||||
|
||||
---
|
||||
|
||||
@@ -629,11 +753,15 @@ todos = [
|
||||
| **brainstorm-with-file** | Multi-perspective ideation | Gemini/Codex/Claude perspectives, diverge-converge cycles | `.workflow/.brainstorm/` |
|
||||
| **debug-with-file** | Hypothesis-driven debugging | Gemini validation, understanding evolution, NDJSON logging | `.workflow/.debug/` |
|
||||
| **analyze-with-file** | Collaborative analysis | Multi-round Q&A, CLI exploration, documented discussions | `.workflow/.analysis/` |
|
||||
| **collaborative-plan-with-file** | Multi-agent collaborative planning | Understanding agent + parallel agents, Plan Note shared doc | `.workflow/.planning/` |
|
||||
| **req-plan-with-file** | Requirement roadmap planning | Requirement decomposition, issue creation, execution-plan.json | `.workflow/.planning/` |
|
||||
|
||||
**Detection Keywords**:
|
||||
- **brainstorm**: 头脑风暴, 创意, 发散思维, multi-perspective, compare perspectives
|
||||
- **debug-file**: 深度调试, 假设验证, systematic debug, hypothesis debug
|
||||
- **analyze-file**: 协作分析, 深度理解, collaborative analysis, explore concept
|
||||
- **collaborative-plan**: 协作规划, 多人规划, collaborative plan, multi-agent plan, Plan Note
|
||||
- **req-plan**: roadmap, 需求规划, 需求拆解, requirement plan, progressive plan
|
||||
|
||||
**Characteristics**:
|
||||
1. **Self-Contained**: Each workflow handles its own iteration loop
|
||||
@@ -643,6 +771,73 @@ todos = [
|
||||
|
||||
---
|
||||
|
||||
## Team Workflows
|
||||
|
||||
**Team workflows** provide multi-role collaboration for complex tasks. Each team skill is self-contained with internal role routing via `--role=xxx`.
|
||||
|
||||
| Workflow | Roles | Pipeline | Use Case |
|
||||
|----------|-------|----------|----------|
|
||||
| **team-planex** | planner + executor | wave pipeline(边规划边执行)| 需要并行规划和执行的任务 |
|
||||
| **team-iterdev** | planner → developer → reviewer | 迭代开发循环 | 需要多轮迭代的开发任务 |
|
||||
| **team-lifecycle** | spec → impl → test | 全生命周期 | 从需求到测试的完整流程 |
|
||||
| **team-issue** | discover → plan → execute | issue 解决 | 多角色协作解决 issue |
|
||||
| **team-testing** | strategy → generate → execute → analyze | 测试流水线 | 全面测试覆盖 |
|
||||
| **team-quality-assurance** | scout → strategist → generator → executor → analyst | QA 闭环 | 质量保障全流程 |
|
||||
| **team-brainstorm** | facilitator → participants → synthesizer | 团队头脑风暴 | 多角色协作头脑风暴 |
|
||||
| **team-uidesign** | designer → implementer | dual-track 设计+实现 | UI 设计与实现并行 |
|
||||
|
||||
**Detection Keywords**:
|
||||
- **team-planex**: team planex, 团队规划执行, wave pipeline
|
||||
- **team-iterdev**: team iterdev, 迭代开发团队, iterative dev team
|
||||
- **team-lifecycle**: team lifecycle, 全生命周期, full lifecycle
|
||||
- **team-issue**: team issue, 团队 issue, team resolve issue
|
||||
- **team-testing**: team test, 测试团队, comprehensive test team
|
||||
- **team-qa**: team qa, QA 团队, 质量保障团队
|
||||
- **team-brainstorm**: team brainstorm, 团队头脑风暴, team ideation
|
||||
- **team-uidesign**: team ui design, UI 设计团队, dual track design
|
||||
|
||||
**Characteristics**:
|
||||
1. **Self-Contained**: Each team skill handles internal role coordination
|
||||
2. **Role-Based Routing**: All roles invoke the same skill with `--role=xxx`
|
||||
3. **Shared Memory**: Roles communicate via shared-memory.json and message bus
|
||||
4. **Auto Mode Support**: All team skills support `-y`/`--yes` for skip confirmations
|
||||
|
||||
---
|
||||
|
||||
## Cycle Workflows
|
||||
|
||||
**Cycle workflows** provide self-iterating development cycles with reflection-driven strategy adjustment. Each cycle is autonomous with built-in test-fix loops and quality gates.
|
||||
|
||||
| Workflow | Pipeline | Key Features | Output Folder |
|
||||
|----------|----------|--------------|---------------|
|
||||
| **integration-test-cycle** | explore → test dev → test-fix → reflection | Self-iterating with max-iterations, auto continue | `.workflow/.test-cycle/` |
|
||||
| **refactor-cycle** | discover → prioritize → execute → validate | Multi-dimensional analysis, regression validation | `.workflow/.refactor-cycle/` |
|
||||
|
||||
**Detection Keywords**:
|
||||
- **integration-test**: integration test, 集成测试, 端到端测试, e2e test
|
||||
- **refactor**: refactor, 重构, tech debt, 技术债务
|
||||
|
||||
**Characteristics**:
|
||||
1. **Self-Iterating**: Autonomous test-fix loops until quality gate passes
|
||||
2. **Reflection-Driven**: Strategy adjusts based on previous iteration results
|
||||
3. **Continue Support**: `--continue` flag to resume interrupted sessions
|
||||
4. **Auto Mode Support**: `-y`/`--yes` for fully autonomous execution
|
||||
|
||||
---
|
||||
|
||||
## Utility Commands
|
||||
|
||||
**Utility commands** are not auto-routed by CCW intent detection. Invoke directly when needed.
|
||||
|
||||
| Command | Purpose |
|
||||
|---------|---------|
|
||||
| `workflow:unified-execute-with-file` | Universal execution engine - consumes plan output from collaborative-plan, req-plan, brainstorm |
|
||||
| `workflow:clean` | Intelligent code cleanup - mainline detection, stale artifact removal |
|
||||
| `workflow:init` | Initialize `.workflow/project-tech.json` with project analysis |
|
||||
| `workflow:init-guidelines` | Interactive wizard to fill `project-guidelines.json` |
|
||||
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
@@ -665,9 +860,38 @@ todos = [
|
||||
# Exploratory task
|
||||
/ccw "Uncertain about architecture for real-time notifications"
|
||||
|
||||
# Multi-CLI collaborative planning
|
||||
/ccw "multi-cli plan: 支付网关API设计" # → workflow-multi-cli-plan → workflow-test-fix
|
||||
|
||||
# With-File workflows (documented exploration with multi-CLI collaboration)
|
||||
/ccw "头脑风暴: 用户通知系统重新设计" # → brainstorm-with-file
|
||||
/ccw "从头脑风暴 BS-通知系统-2025-01-28 创建 issue" # → brainstorm-to-issue (bridge)
|
||||
/ccw "深度调试: 系统随机崩溃问题" # → debug-with-file
|
||||
/ccw "协作分析: 理解现有认证架构的设计决策" # → analyze-with-file
|
||||
|
||||
# Team workflows (multi-role collaboration)
|
||||
/ccw "team planex: 用户认证系统" # → team-planex (planner + executor wave pipeline)
|
||||
/ccw "迭代开发团队: 支付模块重构" # → team-iterdev (planner → developer → reviewer)
|
||||
/ccw "全生命周期: 通知服务开发" # → team-lifecycle (spec → impl → test)
|
||||
/ccw "team resolve issue #42" # → team-issue (discover → plan → execute)
|
||||
/ccw "测试团队: 全面测试认证模块" # → team-testing (strategy → generate → execute → analyze)
|
||||
/ccw "QA 团队: 质量保障支付流程" # → team-quality-assurance (scout → strategist → generator → executor → analyst)
|
||||
/ccw "团队头脑风暴: API 网关设计" # → team-brainstorm (facilitator → participants → synthesizer)
|
||||
/ccw "团队 UI 设计: 管理后台仪表盘" # → team-uidesign (designer → implementer dual-track)
|
||||
|
||||
# Collaborative planning & requirement workflows
|
||||
/ccw "协作规划: 实时通知系统架构" # → collaborative-plan-with-file → unified-execute
|
||||
/ccw "需求规划: 用户认证 OAuth + 2FA" # → req-plan-with-file → team-planex
|
||||
/ccw "roadmap: 数据导出功能路线图" # → req-plan-with-file → team-planex
|
||||
|
||||
# Cycle workflows (self-iterating)
|
||||
/ccw "集成测试: 支付流程端到端" # → integration-test-cycle
|
||||
/ccw "重构 auth 模块的技术债务" # → refactor-cycle
|
||||
/ccw "tech debt: 清理支付服务" # → refactor-cycle
|
||||
|
||||
# Utility commands (invoked directly, not auto-routed)
|
||||
# /workflow:unified-execute-with-file # 通用执行引擎(消费 plan 输出)
|
||||
# /workflow:clean # 智能代码清理
|
||||
# /workflow:init # 初始化项目状态
|
||||
# /workflow:init-guidelines # 交互式填充项目规范
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user