claude-code-workflow 6.3.48 → 6.3.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/CLAUDE.md +6 -8
- package/.claude/agents/action-planning-agent.md +28 -45
- package/.claude/agents/cli-lite-planning-agent.md +93 -1
- package/.claude/agents/code-developer.md +144 -27
- package/.claude/commands/ccw-coordinator.md +175 -21
- package/.claude/commands/ccw-debug.md +832 -0
- package/.claude/commands/ccw.md +90 -9
- package/.claude/commands/cli/cli-init.md +1 -0
- package/.claude/commands/issue/convert-to-plan.md +718 -0
- package/.claude/commands/issue/from-brainstorm.md +382 -0
- package/.claude/commands/memory/tips.md +332 -0
- package/.claude/commands/workflow/analyze-with-file.md +804 -0
- package/.claude/commands/workflow/brainstorm/auto-parallel.md +18 -43
- package/.claude/commands/workflow/brainstorm/role-analysis.md +705 -0
- package/.claude/commands/workflow/brainstorm-with-file.md +1153 -0
- package/.claude/commands/workflow/debug-with-file.md +7 -5
- package/.claude/commands/workflow/execute.md +6 -4
- package/.claude/commands/workflow/lite-plan.md +2 -2
- package/.claude/commands/workflow/plan-verify.md +162 -327
- package/.claude/commands/workflow/plan.md +162 -26
- package/.claude/commands/workflow/replan.md +78 -2
- package/.claude/commands/workflow/{review-fix.md → review-cycle-fix.md} +6 -6
- package/.claude/commands/workflow/review-module-cycle.md +2 -2
- package/.claude/commands/workflow/review-session-cycle.md +2 -2
- package/.claude/commands/workflow/tools/conflict-resolution.md +16 -26
- package/.claude/commands/workflow/tools/context-gather.md +81 -118
- package/.claude/commands/workflow/tools/task-generate-agent.md +94 -10
- package/.claude/skills/ccw-help/command.json +4 -4
- package/.claude/skills/lite-skill-generator/SKILL.md +650 -0
- package/.claude/skills/lite-skill-generator/templates/simple-skill.md +68 -0
- package/.claude/skills/lite-skill-generator/templates/style-guide.md +64 -0
- package/.claude/skills/skill-generator/SKILL.md +277 -85
- package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +4 -15
- package/.claude/skills/skill-generator/phases/02-structure-generation.md +72 -17
- package/.claude/skills/skill-generator/phases/03-phase-generation.md +218 -51
- package/.claude/skills/skill-generator/phases/04-specs-templates.md +111 -41
- package/.claude/skills/skill-generator/phases/05-validation.md +139 -56
- package/.claude/skills/skill-generator/templates/autonomous-action.md +78 -268
- package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +14 -0
- package/.claude/skills/skill-generator/templates/code-analysis-action.md +12 -0
- package/.claude/skills/skill-generator/templates/llm-action.md +12 -0
- package/.claude/skills/skill-generator/templates/script-template.md +368 -0
- package/.claude/skills/skill-generator/templates/sequential-phase.md +14 -0
- package/.claude/skills/skill-generator/templates/skill-md.md +14 -0
- package/.claude/skills/skill-tuning/SKILL.md +130 -266
- package/.claude/skills/skill-tuning/phases/orchestrator.md +95 -283
- package/.claude/skills/skill-tuning/specs/problem-taxonomy.md +90 -198
- package/.claude/skills/skill-tuning/specs/tuning-strategies.md +193 -1345
- package/.claude/workflows/cli-templates/schemas/plan-verify-agent-schema.json +47 -0
- package/.claude/workflows/cli-templates/schemas/verify-json-schema.json +158 -0
- package/.claude/workflows/cli-tools-usage.md +1 -1
- package/.codex/AGENTS.md +1 -3
- package/.codex/prompts/analyze-with-file.md +607 -0
- package/.codex/prompts/brainstorm-to-cycle.md +455 -0
- package/.codex/prompts/brainstorm-with-file.md +933 -0
- package/.codex/prompts/debug-with-file.md +15 -20
- package/.codex/skills/ccw-cli-tools/SKILL.md +559 -0
- package/ccw/dist/commands/cli.d.ts.map +1 -1
- package/ccw/dist/commands/cli.js +29 -5
- package/ccw/dist/commands/cli.js.map +1 -1
- package/ccw/dist/commands/issue.d.ts +2 -0
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +62 -20
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.js +5 -3
- package/ccw/dist/config/litellm-api-config-manager.js.map +1 -1
- package/ccw/dist/config/litellm-provider-models.d.ts +73 -0
- package/ccw/dist/config/litellm-provider-models.d.ts.map +1 -0
- package/ccw/dist/config/litellm-provider-models.js +172 -0
- package/ccw/dist/config/litellm-provider-models.js.map +1 -0
- package/ccw/dist/config/provider-models.d.ts +25 -51
- package/ccw/dist/config/provider-models.d.ts.map +1 -1
- package/ccw/dist/config/provider-models.js +84 -149
- package/ccw/dist/config/provider-models.js.map +1 -1
- package/ccw/dist/config/storage-paths.d.ts.map +1 -1
- package/ccw/dist/config/storage-paths.js +23 -5
- package/ccw/dist/config/storage-paths.js.map +1 -1
- package/ccw/dist/core/auth/csrf-middleware.js +3 -3
- package/ccw/dist/core/auth/csrf-middleware.js.map +1 -1
- package/ccw/dist/core/dashboard-generator.d.ts.map +1 -1
- package/ccw/dist/core/dashboard-generator.js +3 -1
- package/ccw/dist/core/dashboard-generator.js.map +1 -1
- package/ccw/dist/core/routes/claude-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/claude-routes.js +206 -14
- package/ccw/dist/core/routes/claude-routes.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/dist/core/routes/commands-routes.d.ts +7 -0
- package/ccw/dist/core/routes/commands-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/commands-routes.js +480 -0
- package/ccw/dist/core/routes/commands-routes.js.map +1 -0
- package/ccw/dist/core/routes/model-routes.d.ts +11 -0
- package/ccw/dist/core/routes/model-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/model-routes.js +112 -0
- package/ccw/dist/core/routes/model-routes.js.map +1 -0
- package/ccw/dist/core/routes/nav-status-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/nav-status-routes.js +84 -1
- package/ccw/dist/core/routes/nav-status-routes.js.map +1 -1
- package/ccw/dist/core/routes/provider-routes.d.ts +11 -0
- package/ccw/dist/core/routes/provider-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/provider-routes.js +67 -0
- package/ccw/dist/core/routes/provider-routes.js.map +1 -0
- package/ccw/dist/core/routes/skills-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/skills-routes.js +219 -7
- package/ccw/dist/core/routes/skills-routes.js.map +1 -1
- package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/system-routes.js +58 -6
- package/ccw/dist/core/routes/system-routes.js.map +1 -1
- package/ccw/dist/core/server.d.ts.map +1 -1
- package/ccw/dist/core/server.js +13 -0
- package/ccw/dist/core/server.js.map +1 -1
- package/ccw/dist/mcp-server/index.js +2 -2
- package/ccw/dist/mcp-server/index.js.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.d.ts +48 -11
- package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.js +146 -50
- package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
- package/ccw/dist/tools/cli-config-manager.d.ts +1 -13
- package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
- package/ccw/dist/tools/cli-config-manager.js +3 -27
- package/ccw/dist/tools/cli-config-manager.js.map +1 -1
- package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor-core.js +7 -2
- package/ccw/dist/tools/cli-executor-core.js.map +1 -1
- package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -1
- package/ccw/dist/tools/cli-history-store.d.ts +11 -0
- package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
- package/ccw/dist/tools/cli-history-store.js +82 -2
- package/ccw/dist/tools/cli-history-store.js.map +1 -1
- package/ccw/dist/tools/command-registry.d.ts +7 -0
- package/ccw/dist/tools/command-registry.d.ts.map +1 -1
- package/ccw/dist/tools/command-registry.js +14 -1
- package/ccw/dist/tools/command-registry.js.map +1 -1
- package/ccw/dist/tools/generate-module-docs.d.ts.map +1 -1
- package/ccw/dist/tools/generate-module-docs.js +11 -7
- package/ccw/dist/tools/generate-module-docs.js.map +1 -1
- package/ccw/dist/tools/litellm-executor.d.ts +1 -0
- package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
- package/ccw/dist/tools/litellm-executor.js +11 -9
- package/ccw/dist/tools/litellm-executor.js.map +1 -1
- package/ccw/dist/types/skill-types.d.ts +97 -0
- package/ccw/dist/types/skill-types.d.ts.map +1 -0
- package/ccw/dist/types/skill-types.js +6 -0
- package/ccw/dist/types/skill-types.js.map +1 -0
- package/ccw/src/commands/cli.ts +36 -5
- package/ccw/src/commands/issue.ts +81 -26
- package/ccw/src/config/litellm-api-config-manager.ts +5 -3
- package/ccw/src/config/litellm-provider-models.ts +222 -0
- package/ccw/src/config/provider-models.ts +91 -190
- package/ccw/src/config/storage-paths.ts +20 -5
- package/ccw/src/core/auth/csrf-middleware.ts +3 -3
- package/ccw/src/core/dashboard-generator.ts +3 -1
- package/ccw/src/core/routes/claude-routes.ts +233 -15
- package/ccw/src/core/routes/cli-routes.ts +2 -3
- package/ccw/src/core/routes/commands-routes.ts +620 -0
- package/ccw/src/core/routes/nav-status-routes.ts +95 -1
- package/ccw/src/core/routes/provider-routes.ts +78 -0
- package/ccw/src/core/routes/skills-routes.ts +266 -45
- package/ccw/src/core/routes/system-routes.ts +102 -50
- package/ccw/src/core/server.ts +13 -0
- package/ccw/src/mcp-server/index.ts +2 -2
- package/ccw/src/templates/dashboard-css/18-cli-settings.css +35 -0
- package/ccw/src/templates/dashboard-css/37-commands.css +193 -0
- package/ccw/src/templates/dashboard-js/components/navigation.js +4 -0
- package/ccw/src/templates/dashboard-js/i18n.js +116 -0
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +249 -4
- package/ccw/src/templates/dashboard-js/views/commands-manager.js +503 -0
- package/ccw/src/templates/dashboard-js/views/issue-manager.js +7 -7
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js +2 -7
- package/ccw/src/templates/dashboard-js/views/skills-manager.js +164 -23
- package/ccw/src/templates/dashboard.html +7 -0
- package/ccw/src/tools/claude-cli-tools.ts +170 -56
- package/ccw/src/tools/cli-config-manager.ts +2 -33
- package/ccw/src/tools/cli-executor-core.ts +8 -2
- package/ccw/src/tools/cli-history-store.ts +92 -2
- package/ccw/src/tools/command-registry.ts +16 -1
- package/ccw/src/tools/generate-module-docs.ts +11 -7
- package/ccw/src/tools/litellm-executor.ts +13 -9
- package/ccw/src/types/skill-types.ts +99 -0
- package/package.json +1 -1
- package/.claude/commands/enhance-prompt.md +0 -93
- package/.claude/commands/memory/code-map-memory.md +0 -687
- package/.claude/commands/memory/docs.md +0 -615
- package/.claude/commands/memory/load-skill-memory.md +0 -182
- package/.claude/commands/memory/skill-memory.md +0 -525
- package/.claude/commands/memory/swagger-docs.md +0 -773
- package/.claude/commands/memory/tech-research-rules.md +0 -310
- package/.claude/commands/memory/workflow-skill-memory.md +0 -517
- package/.claude/commands/task/breakdown.md +0 -208
- package/.claude/commands/task/create.md +0 -152
- package/.claude/commands/task/execute.md +0 -270
- package/.claude/commands/task/replan.md +0 -441
- package/.claude/commands/version.md +0 -254
- package/.claude/commands/workflow/action-plan-verify.md +0 -485
- package/.claude/commands/workflow/brainstorm/api-designer.md +0 -587
- package/.claude/commands/workflow/brainstorm/data-architect.md +0 -220
- package/.claude/commands/workflow/brainstorm/product-manager.md +0 -200
- package/.claude/commands/workflow/brainstorm/product-owner.md +0 -200
- package/.claude/commands/workflow/brainstorm/scrum-master.md +0 -200
- package/.claude/commands/workflow/brainstorm/subject-matter-expert.md +0 -200
- package/.claude/commands/workflow/brainstorm/system-architect.md +0 -389
- package/.claude/commands/workflow/brainstorm/ui-designer.md +0 -221
- package/.claude/commands/workflow/brainstorm/ux-expert.md +0 -221
- package/.claude/commands/workflow/debug.md +0 -331
- package/.claude/commands/workflow/develop-with-file.md +0 -1044
- package/.claude/skills/ccw-loop/README.md +0 -303
- package/.claude/skills/skill-generator/templates/script-bash.md +0 -277
- package/.claude/skills/skill-generator/templates/script-python.md +0 -198
- package/.codex/prompts/debug.md +0 -318
- package/ccw/src/core/routes/mcp-routes.ts.backup +0 -549
|
@@ -0,0 +1,832 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ccw-debug
|
|
3
|
+
description: Aggregated debug command - combines debugging diagnostics and test verification in a synergistic workflow supporting cli-quick / debug-first / test-first / bidirectional-verification modes
|
|
4
|
+
argument-hint: "[--mode cli|debug|test|bidirectional] [--yes|-y] [--hotfix] \"bug description or error message\""
|
|
5
|
+
allowed-tools: SlashCommand(*), TodoWrite(*), AskUserQuestion(*), Read(*), Bash(*)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# CCW-Debug Aggregated Command
|
|
9
|
+
|
|
10
|
+
## Core Concept
|
|
11
|
+
|
|
12
|
+
**Aggregated Debug Command** - Combines debugging diagnostics and test verification in a synergistic workflow. Not a simple concatenation of two commands, but intelligent orchestration based on mode selection.
|
|
13
|
+
|
|
14
|
+
### Four Execution Modes
|
|
15
|
+
|
|
16
|
+
| Mode | Workflow | Use Case | Characteristics |
|
|
17
|
+
|------|----------|----------|-----------------|
|
|
18
|
+
| **CLI Quick** (cli) | Direct CLI Analysis → Fix Suggestions | Simple issues, quick diagnosis | Fastest, minimal workflow, recommendation-only |
|
|
19
|
+
| **Debug First** (debug) | Debug → Analyze Hypotheses → Apply Fix → Test Verification | Root cause unclear, requires exploration | Starts with exploration, Gemini-assisted |
|
|
20
|
+
| **Test First** (test) | Generate Tests → Execute → Analyze Failures → CLI Fixes | Code implemented, needs test validation | Driven by test coverage, auto-iterates |
|
|
21
|
+
| **Bidirectional Verification** (bidirectional) | Parallel: Debug + Test → Merge Findings → Unified Fix | Complex systems, ambiguous symptoms | Parallel execution, converged insights |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
### Basic Usage
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# CLI quick mode: fastest, recommendation-only (new!)
|
|
31
|
+
/ccw-debug --mode cli "Login failed: token validation error"
|
|
32
|
+
|
|
33
|
+
# Default mode: debug-first (recommended for most scenarios)
|
|
34
|
+
/ccw-debug "Login failed: token validation error"
|
|
35
|
+
|
|
36
|
+
# Test-first mode
|
|
37
|
+
/ccw-debug --mode test "User permission check failure"
|
|
38
|
+
|
|
39
|
+
# Bidirectional verification mode (complex issues)
|
|
40
|
+
/ccw-debug --mode bidirectional "Payment flow multiple failures"
|
|
41
|
+
|
|
42
|
+
# Auto mode (skip all confirmations)
|
|
43
|
+
/ccw-debug --yes "Quick fix: database connection timeout"
|
|
44
|
+
|
|
45
|
+
# Production hotfix (minimal diagnostics)
|
|
46
|
+
/ccw-debug --hotfix --yes "Production: API returns 500"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Mode Selection Guide
|
|
50
|
+
|
|
51
|
+
**Choose "CLI Quick"** when:
|
|
52
|
+
- Need immediate diagnosis, not execution
|
|
53
|
+
- Want quick recommendations without workflows
|
|
54
|
+
- Simple issues with clear symptoms
|
|
55
|
+
- Just need fix suggestions, no auto-application
|
|
56
|
+
- Time is critical, prefer fast output
|
|
57
|
+
- Want to review CLI analysis before action
|
|
58
|
+
|
|
59
|
+
**Choose "Debug First"** when:
|
|
60
|
+
- Root cause is unclear
|
|
61
|
+
- Error messages are incomplete or vague
|
|
62
|
+
- Need to understand code execution flow
|
|
63
|
+
- Issues involve multi-module interactions
|
|
64
|
+
|
|
65
|
+
**Choose "Test First"** when:
|
|
66
|
+
- Code is fully implemented
|
|
67
|
+
- Need test coverage verification
|
|
68
|
+
- Have clear failure cases
|
|
69
|
+
- Want automated iterative fixes
|
|
70
|
+
|
|
71
|
+
**Choose "Bidirectional Verification"** when:
|
|
72
|
+
- System is complex (multiple subsystems)
|
|
73
|
+
- Problem symptoms are ambiguous (multiple possible root causes)
|
|
74
|
+
- Need multi-angle validation
|
|
75
|
+
- Time allows parallel analysis
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Execution Flow
|
|
80
|
+
|
|
81
|
+
### Overall Process
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
Phase 1: Intent Analysis & Mode Selection
|
|
85
|
+
├─ Parse --mode flag or recommend mode
|
|
86
|
+
├─ Check --hotfix and --yes flags
|
|
87
|
+
└─ Determine workflow path
|
|
88
|
+
|
|
89
|
+
Phase 2: Initialization
|
|
90
|
+
├─ CLI Quick: Lightweight init (no session directory needed)
|
|
91
|
+
├─ Others: Create unified session directory (.workflow/.ccw-debug/)
|
|
92
|
+
├─ Setup TodoWrite tracking
|
|
93
|
+
└─ Prepare session context
|
|
94
|
+
|
|
95
|
+
Phase 3: Execute Corresponding Workflow
|
|
96
|
+
├─ CLI Quick: ccw cli → Diagnosis Report → Optional: Escalate to debug/test/apply fix
|
|
97
|
+
├─ Debug First: /workflow:debug-with-file → Fix → /workflow:test-fix-gen → /workflow:test-cycle-execute
|
|
98
|
+
├─ Test First: /workflow:test-fix-gen → /workflow:test-cycle-execute → CLI analyze failures
|
|
99
|
+
└─ Bidirectional: [/workflow:debug-with-file] ∥ [/workflow:test-fix-gen → test-cycle-execute]
|
|
100
|
+
|
|
101
|
+
Phase 4: Merge Findings (Bidirectional Mode) / Escalation Decision (CLI Mode)
|
|
102
|
+
├─ CLI Quick: Present results → Ask user: Apply fix? Escalate? Done?
|
|
103
|
+
├─ Bidirectional: Converge findings from both workflows
|
|
104
|
+
├─ Identify consistent and conflicting root cause analyses
|
|
105
|
+
└─ Generate unified fix plan
|
|
106
|
+
|
|
107
|
+
Phase 5: Completion & Follow-up
|
|
108
|
+
├─ Generate summary report
|
|
109
|
+
├─ Provide next step recommendations
|
|
110
|
+
└─ Optional: Expand to issues (testing/enhancement/refactoring/documentation)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Workflow Details
|
|
116
|
+
|
|
117
|
+
### Mode 0: CLI Quick (Minimal Debug Method)
|
|
118
|
+
|
|
119
|
+
**Best For**: Fast recommendations without full workflow overhead
|
|
120
|
+
|
|
121
|
+
**Workflow**:
|
|
122
|
+
```
|
|
123
|
+
User Input → Quick Context Gather → ccw cli (Gemini/Qwen/Codex)
|
|
124
|
+
↓
|
|
125
|
+
Analysis Report
|
|
126
|
+
↓
|
|
127
|
+
Fix Recommendations
|
|
128
|
+
↓
|
|
129
|
+
Optional: User Decision
|
|
130
|
+
┌──────────────┼──────────────┐
|
|
131
|
+
↓ ↓ ↓
|
|
132
|
+
Apply Fix Escalate Mode Done
|
|
133
|
+
(debug/test)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Execution Steps**:
|
|
137
|
+
|
|
138
|
+
1. **Lightweight Context Gather** (Phase 2)
|
|
139
|
+
```javascript
|
|
140
|
+
// No session directory needed for CLI mode
|
|
141
|
+
const tempContext = {
|
|
142
|
+
bug_description: bug_description,
|
|
143
|
+
timestamp: getUtc8ISOString(),
|
|
144
|
+
mode: "cli"
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Quick context discovery (30s max)
|
|
148
|
+
// - Read error file if path provided
|
|
149
|
+
// - Extract error patterns from description
|
|
150
|
+
// - Identify likely affected files (basic grep)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
2. **Execute CLI Analysis** (Phase 3)
|
|
154
|
+
```bash
|
|
155
|
+
# Use ccw cli with bug diagnosis template
|
|
156
|
+
ccw cli -p "
|
|
157
|
+
PURPOSE: Quick bug diagnosis for immediate recommendations
|
|
158
|
+
|
|
159
|
+
TASK:
|
|
160
|
+
• Analyze bug symptoms: ${bug_description}
|
|
161
|
+
• Identify likely root cause
|
|
162
|
+
• Provide actionable fix recommendations (code snippets if possible)
|
|
163
|
+
• Assess fix confidence level
|
|
164
|
+
|
|
165
|
+
MODE: analysis
|
|
166
|
+
|
|
167
|
+
CONTEXT: ${contextFiles.length > 0 ? '@' + contextFiles.join(' @') : 'Bug description only'}
|
|
168
|
+
|
|
169
|
+
EXPECTED:
|
|
170
|
+
- Root cause hypothesis (1-2 sentences)
|
|
171
|
+
- Fix strategy (immediate/comprehensive/refactor)
|
|
172
|
+
- Code snippets or file modification suggestions
|
|
173
|
+
- Confidence level: High/Medium/Low
|
|
174
|
+
- Risk assessment
|
|
175
|
+
|
|
176
|
+
CONSTRAINTS: Quick analysis, 2-5 minutes max
|
|
177
|
+
" --tool gemini --mode analysis --rule analysis-diagnose-bug-root-cause
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
3. **Present Results** (Phase 4)
|
|
181
|
+
```
|
|
182
|
+
## CLI Quick Analysis Complete
|
|
183
|
+
|
|
184
|
+
**Issue**: [bug_description]
|
|
185
|
+
**Analysis Time**: [duration]
|
|
186
|
+
**Confidence**: [High/Medium/Low]
|
|
187
|
+
|
|
188
|
+
### Root Cause
|
|
189
|
+
[1-2 sentence hypothesis]
|
|
190
|
+
|
|
191
|
+
### Fix Strategy
|
|
192
|
+
[immediate_patch | comprehensive_fix | refactor]
|
|
193
|
+
|
|
194
|
+
### Recommended Changes
|
|
195
|
+
|
|
196
|
+
**File**: src/module/file.ts
|
|
197
|
+
```typescript
|
|
198
|
+
// Change line 45-50
|
|
199
|
+
- old code
|
|
200
|
+
+ new code
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Rationale**: [why this fix]
|
|
204
|
+
**Risk**: [Low/Medium/High] - [risk description]
|
|
205
|
+
|
|
206
|
+
### Confidence Assessment
|
|
207
|
+
- Analysis confidence: [percentage]
|
|
208
|
+
- Recommendation: [apply immediately | review first | escalate to full debug]
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
4. **User Decision** (Phase 5)
|
|
212
|
+
```javascript
|
|
213
|
+
// Parse --yes flag
|
|
214
|
+
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
|
|
215
|
+
|
|
216
|
+
if (autoYes && confidence === 'High') {
|
|
217
|
+
// Auto-apply fix
|
|
218
|
+
console.log('[--yes + High confidence] Auto-applying fix...')
|
|
219
|
+
applyFixFromCLIRecommendation(cliOutput)
|
|
220
|
+
} else {
|
|
221
|
+
// Ask user
|
|
222
|
+
const decision = AskUserQuestion({
|
|
223
|
+
questions: [{
|
|
224
|
+
question: `CLI analysis complete (${confidence} confidence). What next?`,
|
|
225
|
+
header: "Decision",
|
|
226
|
+
multiSelect: false,
|
|
227
|
+
options: [
|
|
228
|
+
{ label: "Apply Fix", description: "Apply recommended changes immediately" },
|
|
229
|
+
{ label: "Escalate to Debug", description: "Switch to debug-first for deeper analysis" },
|
|
230
|
+
{ label: "Escalate to Test", description: "Switch to test-first for validation" },
|
|
231
|
+
{ label: "Review Only", description: "Just review, no action" }
|
|
232
|
+
]
|
|
233
|
+
}]
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
if (decision === "Apply Fix") {
|
|
237
|
+
applyFixFromCLIRecommendation(cliOutput)
|
|
238
|
+
} else if (decision === "Escalate to Debug") {
|
|
239
|
+
// Re-invoke ccw-debug with --mode debug
|
|
240
|
+
SlashCommand(command=`/ccw-debug --mode debug "${bug_description}"`)
|
|
241
|
+
} else if (decision === "Escalate to Test") {
|
|
242
|
+
// Re-invoke ccw-debug with --mode test
|
|
243
|
+
SlashCommand(command=`/ccw-debug --mode test "${bug_description}"`)
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Key Characteristics**:
|
|
249
|
+
- **Speed**: 2-5 minutes total (fastest mode)
|
|
250
|
+
- **Session**: No persistent session directory (lightweight)
|
|
251
|
+
- **Output**: Recommendation report only
|
|
252
|
+
- **Execution**: Optional, user-controlled
|
|
253
|
+
- **Escalation**: Can upgrade to full debug/test workflows
|
|
254
|
+
|
|
255
|
+
**Limitations**:
|
|
256
|
+
- No hypothesis iteration (single-shot analysis)
|
|
257
|
+
- No automatic test generation
|
|
258
|
+
- No instrumentation/logging
|
|
259
|
+
- Best for clear symptoms with localized fixes
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
### Mode 1: Debug First
|
|
264
|
+
|
|
265
|
+
**Best For**: Issues requiring root cause exploration
|
|
266
|
+
|
|
267
|
+
**Workflow**:
|
|
268
|
+
```
|
|
269
|
+
User Input → Session Init → /workflow:debug-with-file
|
|
270
|
+
↓
|
|
271
|
+
Generate understanding.md + hypotheses
|
|
272
|
+
↓
|
|
273
|
+
User reproduces issue, analyze logs
|
|
274
|
+
↓
|
|
275
|
+
Gemini validates hypotheses
|
|
276
|
+
↓
|
|
277
|
+
Apply fix code
|
|
278
|
+
↓
|
|
279
|
+
/workflow:test-fix-gen
|
|
280
|
+
↓
|
|
281
|
+
/workflow:test-cycle-execute
|
|
282
|
+
↓
|
|
283
|
+
Generate unified report
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**Execution Steps**:
|
|
287
|
+
|
|
288
|
+
1. **Session Initialization** (Phase 2)
|
|
289
|
+
```javascript
|
|
290
|
+
const sessionId = `CCWD-${bugSlug}-${dateStr}`
|
|
291
|
+
const sessionFolder = `.workflow/.ccw-debug/${sessionId}`
|
|
292
|
+
bash(`mkdir -p ${sessionFolder}`)
|
|
293
|
+
|
|
294
|
+
// Record mode selection
|
|
295
|
+
const modeConfig = {
|
|
296
|
+
mode: "debug",
|
|
297
|
+
original_input: bug_description,
|
|
298
|
+
timestamp: getUtc8ISOString(),
|
|
299
|
+
flags: { hotfix, autoYes }
|
|
300
|
+
}
|
|
301
|
+
Write(`${sessionFolder}/mode-config.json`, JSON.stringify(modeConfig, null, 2))
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
2. **Start Debug** (Phase 3)
|
|
305
|
+
```javascript
|
|
306
|
+
SlashCommand(command=`/workflow:debug-with-file "${bug_description}"`)
|
|
307
|
+
|
|
308
|
+
// Update TodoWrite
|
|
309
|
+
TodoWrite({
|
|
310
|
+
todos: [
|
|
311
|
+
{ content: "Phase 1: Debug & Analysis", status: "completed" },
|
|
312
|
+
{ content: "Phase 2: Apply Fix from Debug Findings", status: "in_progress" },
|
|
313
|
+
{ content: "Phase 3: Generate & Execute Tests", status: "pending" },
|
|
314
|
+
{ content: "Phase 4: Generate Report", status: "pending" }
|
|
315
|
+
]
|
|
316
|
+
})
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
3. **Apply Fix** (Handled by debug command)
|
|
320
|
+
|
|
321
|
+
4. **Test Generation & Execution**
|
|
322
|
+
```javascript
|
|
323
|
+
// Auto-continue after debug command completes
|
|
324
|
+
SlashCommand(command=`/workflow:test-fix-gen "Test validation for: ${bug_description}"`)
|
|
325
|
+
SlashCommand(command="/workflow:test-cycle-execute")
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
5. **Generate Report** (Phase 5)
|
|
329
|
+
```
|
|
330
|
+
## Debug-First Workflow Completed
|
|
331
|
+
|
|
332
|
+
**Issue**: [bug_description]
|
|
333
|
+
**Mode**: Debug First
|
|
334
|
+
**Session**: [sessionId]
|
|
335
|
+
|
|
336
|
+
### Debug Phase Results
|
|
337
|
+
- Root Cause: [extracted from understanding.md]
|
|
338
|
+
- Hypothesis Confirmation: [from hypotheses.json]
|
|
339
|
+
- Fixes Applied: [list of modified files]
|
|
340
|
+
|
|
341
|
+
### Test Phase Results
|
|
342
|
+
- Tests Created: [test files generated by IMPL-001]
|
|
343
|
+
- Pass Rate: [final test pass rate]
|
|
344
|
+
- Iteration Count: [fix iterations]
|
|
345
|
+
|
|
346
|
+
### Key Findings
|
|
347
|
+
- [learning points from debugging]
|
|
348
|
+
- [coverage insights from testing]
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
### Mode 2: Test First
|
|
354
|
+
|
|
355
|
+
**Best For**: Implemented code needing test validation
|
|
356
|
+
|
|
357
|
+
**Workflow**:
|
|
358
|
+
```
|
|
359
|
+
User Input → Session Init → /workflow:test-fix-gen
|
|
360
|
+
↓
|
|
361
|
+
Generate test tasks (IMPL-001, IMPL-002)
|
|
362
|
+
↓
|
|
363
|
+
/workflow:test-cycle-execute
|
|
364
|
+
↓
|
|
365
|
+
Auto-iterate: Test → Analyze Failures → CLI Fix
|
|
366
|
+
↓
|
|
367
|
+
Until pass rate ≥ 95%
|
|
368
|
+
↓
|
|
369
|
+
Generate report
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
**Execution Steps**:
|
|
373
|
+
|
|
374
|
+
1. **Session Initialization** (Phase 2)
|
|
375
|
+
```javascript
|
|
376
|
+
const modeConfig = {
|
|
377
|
+
mode: "test",
|
|
378
|
+
original_input: bug_description,
|
|
379
|
+
timestamp: getUtc8ISOString(),
|
|
380
|
+
flags: { hotfix, autoYes }
|
|
381
|
+
}
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
2. **Generate Tests** (Phase 3)
|
|
385
|
+
```javascript
|
|
386
|
+
SlashCommand(command=`/workflow:test-fix-gen "${bug_description}"`)
|
|
387
|
+
|
|
388
|
+
// Update TodoWrite
|
|
389
|
+
TodoWrite({
|
|
390
|
+
todos: [
|
|
391
|
+
{ content: "Phase 1: Generate Tests", status: "completed" },
|
|
392
|
+
{ content: "Phase 2: Execute & Fix Tests", status: "in_progress" },
|
|
393
|
+
{ content: "Phase 3: Final Validation", status: "pending" },
|
|
394
|
+
{ content: "Phase 4: Generate Report", status: "pending" }
|
|
395
|
+
]
|
|
396
|
+
})
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
3. **Execute & Iterate** (Phase 3 cont.)
|
|
400
|
+
```javascript
|
|
401
|
+
SlashCommand(command="/workflow:test-cycle-execute")
|
|
402
|
+
|
|
403
|
+
// test-cycle-execute handles:
|
|
404
|
+
// - Execute tests
|
|
405
|
+
// - Analyze failures
|
|
406
|
+
// - Generate fix tasks via CLI
|
|
407
|
+
// - Iterate fixes until pass
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
4. **Generate Report** (Phase 5)
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
### Mode 3: Bidirectional Verification
|
|
415
|
+
|
|
416
|
+
**Best For**: Complex systems, multi-dimensional analysis
|
|
417
|
+
|
|
418
|
+
**Workflow**:
|
|
419
|
+
```
|
|
420
|
+
User Input → Session Init → Parallel execution:
|
|
421
|
+
┌──────────────────────────────┐
|
|
422
|
+
│ │
|
|
423
|
+
↓ ↓
|
|
424
|
+
/workflow:debug-with-file /workflow:test-fix-gen
|
|
425
|
+
│ │
|
|
426
|
+
Generate hypotheses & understanding Generate test tasks
|
|
427
|
+
│ │
|
|
428
|
+
↓ ↓
|
|
429
|
+
Apply debug fixes /workflow:test-cycle-execute
|
|
430
|
+
│ │
|
|
431
|
+
└──────────────┬───────────────┘
|
|
432
|
+
↓
|
|
433
|
+
Phase 4: Merge Findings
|
|
434
|
+
├─ Converge root cause analyses
|
|
435
|
+
├─ Identify consistency (mutual validation)
|
|
436
|
+
├─ Identify conflicts (need coordination)
|
|
437
|
+
└─ Generate unified report
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
**Execution Steps**:
|
|
441
|
+
|
|
442
|
+
1. **Parallel Execution** (Phase 3)
|
|
443
|
+
```javascript
|
|
444
|
+
// Start debug
|
|
445
|
+
const debugTask = SlashCommand(
|
|
446
|
+
command=`/workflow:debug-with-file "${bug_description}"`,
|
|
447
|
+
run_in_background=false
|
|
448
|
+
)
|
|
449
|
+
|
|
450
|
+
// Start test generation (synchronous execution, SlashCommand blocks)
|
|
451
|
+
const testTask = SlashCommand(
|
|
452
|
+
command=`/workflow:test-fix-gen "${bug_description}"`,
|
|
453
|
+
run_in_background=false
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
// Execute test cycle
|
|
457
|
+
const testCycleTask = SlashCommand(
|
|
458
|
+
command="/workflow:test-cycle-execute",
|
|
459
|
+
run_in_background=false
|
|
460
|
+
)
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
2. **Merge Findings** (Phase 4)
|
|
464
|
+
```javascript
|
|
465
|
+
// Read debug results
|
|
466
|
+
const understandingMd = Read(`${debugSessionFolder}/understanding.md`)
|
|
467
|
+
const hypothesesJson = JSON.parse(Read(`${debugSessionFolder}/hypotheses.json`))
|
|
468
|
+
|
|
469
|
+
// Read test results
|
|
470
|
+
const testResultsJson = JSON.parse(Read(`${testSessionFolder}/.process/test-results.json`))
|
|
471
|
+
const fixPlanJson = JSON.parse(Read(`${testSessionFolder}/.task/IMPL-002.json`))
|
|
472
|
+
|
|
473
|
+
// Merge analysis
|
|
474
|
+
const convergence = {
|
|
475
|
+
debug_root_cause: hypothesesJson.confirmed_hypothesis,
|
|
476
|
+
test_failure_pattern: testResultsJson.failures,
|
|
477
|
+
consistency: analyzeConsistency(debugRootCause, testFailures),
|
|
478
|
+
conflicts: identifyConflicts(debugRootCause, testFailures),
|
|
479
|
+
unified_root_cause: mergeRootCauses(debugRootCause, testFailures),
|
|
480
|
+
recommended_fix: selectBestFix(debugRootCause, testRootCause)
|
|
481
|
+
}
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
3. **Generate Report** (Phase 5)
|
|
485
|
+
```
|
|
486
|
+
## Bidirectional Verification Workflow Completed
|
|
487
|
+
|
|
488
|
+
**Issue**: [bug_description]
|
|
489
|
+
**Mode**: Bidirectional Verification
|
|
490
|
+
|
|
491
|
+
### Debug Findings
|
|
492
|
+
- Root Cause (hypothesis): [from understanding.md]
|
|
493
|
+
- Confidence: [from hypotheses.json]
|
|
494
|
+
- Key code paths: [file:line]
|
|
495
|
+
|
|
496
|
+
### Test Findings
|
|
497
|
+
- Failure pattern: [list of failing tests]
|
|
498
|
+
- Error type: [error type]
|
|
499
|
+
- Impact scope: [affected modules]
|
|
500
|
+
|
|
501
|
+
### Merged Analysis
|
|
502
|
+
- ✓ Consistent: Both workflows identified same root cause
|
|
503
|
+
- ⚠ Conflicts: [list any conflicts]
|
|
504
|
+
- → Unified Root Cause: [final confirmed root cause]
|
|
505
|
+
|
|
506
|
+
### Recommended Fix
|
|
507
|
+
- Strategy: [selected fix strategy]
|
|
508
|
+
- Rationale: [why this strategy]
|
|
509
|
+
- Risks: [known risks]
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
---
|
|
513
|
+
|
|
514
|
+
## Command Line Interface
|
|
515
|
+
|
|
516
|
+
### Complete Syntax
|
|
517
|
+
|
|
518
|
+
```bash
|
|
519
|
+
/ccw-debug [OPTIONS] <BUG_DESCRIPTION>
|
|
520
|
+
|
|
521
|
+
Options:
|
|
522
|
+
--mode <cli|debug|test|bidirectional> Execution mode (default: debug)
|
|
523
|
+
--yes, -y Auto mode (skip all confirmations)
|
|
524
|
+
--hotfix, -h Production hotfix mode (only for debug mode)
|
|
525
|
+
--no-tests Skip test generation in debug-first mode
|
|
526
|
+
--skip-report Don't generate final report
|
|
527
|
+
--resume <session-id> Resume interrupted session
|
|
528
|
+
|
|
529
|
+
Arguments:
|
|
530
|
+
<BUG_DESCRIPTION> Issue description, error message, or .md file path
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
### Examples
|
|
534
|
+
|
|
535
|
+
```bash
|
|
536
|
+
# CLI quick mode: fastest, recommendation-only (NEW!)
|
|
537
|
+
/ccw-debug --mode cli "User login timeout"
|
|
538
|
+
/ccw-debug --mode cli --yes "Quick fix: API 500 error" # Auto-apply if high confidence
|
|
539
|
+
|
|
540
|
+
# Debug first (default)
|
|
541
|
+
/ccw-debug "User login timeout"
|
|
542
|
+
|
|
543
|
+
# Test first
|
|
544
|
+
/ccw-debug --mode test "Payment validation failure"
|
|
545
|
+
|
|
546
|
+
# Bidirectional verification
|
|
547
|
+
/ccw-debug --mode bidirectional "Multi-module data consistency issue"
|
|
548
|
+
|
|
549
|
+
# Hotfix auto mode
|
|
550
|
+
/ccw-debug --hotfix --yes "API 500 error"
|
|
551
|
+
|
|
552
|
+
# Debug first, skip tests
|
|
553
|
+
/ccw-debug --no-tests "Understand code flow"
|
|
554
|
+
|
|
555
|
+
# Resume interrupted session
|
|
556
|
+
/ccw-debug --resume CCWD-login-timeout-2025-01-27
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
---
|
|
560
|
+
|
|
561
|
+
## Session Structure
|
|
562
|
+
|
|
563
|
+
### File Organization
|
|
564
|
+
|
|
565
|
+
```
|
|
566
|
+
.workflow/.ccw-debug/CCWD-{slug}-{date}/
|
|
567
|
+
├── mode-config.json # Mode configuration and flags
|
|
568
|
+
├── session-manifest.json # Session index and status
|
|
569
|
+
├── final-report.md # Final report
|
|
570
|
+
│
|
|
571
|
+
├── debug/ # Debug workflow (if mode includes debug)
|
|
572
|
+
│ ├── debug-session-id.txt
|
|
573
|
+
│ ├── understanding.md
|
|
574
|
+
│ ├── hypotheses.json
|
|
575
|
+
│ └── debug.log
|
|
576
|
+
│
|
|
577
|
+
├── test/ # Test workflow (if mode includes test)
|
|
578
|
+
│ ├── test-session-id.txt
|
|
579
|
+
│ ├── IMPL_PLAN.md
|
|
580
|
+
│ ├── test-results.json
|
|
581
|
+
│ └── iteration-state.json
|
|
582
|
+
│
|
|
583
|
+
└── fusion/ # Fusion analysis (bidirectional mode)
|
|
584
|
+
├── convergence-analysis.json
|
|
585
|
+
├── consistency-report.md
|
|
586
|
+
└── unified-root-cause.json
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
### Session State Management
|
|
590
|
+
|
|
591
|
+
```json
|
|
592
|
+
{
|
|
593
|
+
"session_id": "CCWD-login-timeout-2025-01-27",
|
|
594
|
+
"mode": "debug|test|bidirectional",
|
|
595
|
+
"status": "running|completed|failed|paused",
|
|
596
|
+
"phases": {
|
|
597
|
+
"phase_1": { "status": "completed", "timestamp": "..." },
|
|
598
|
+
"phase_2": { "status": "in_progress", "timestamp": "..." },
|
|
599
|
+
"phase_3": { "status": "pending" },
|
|
600
|
+
"phase_4": { "status": "pending" },
|
|
601
|
+
"phase_5": { "status": "pending" }
|
|
602
|
+
},
|
|
603
|
+
"sub_sessions": {
|
|
604
|
+
"debug_session": "DBG-...",
|
|
605
|
+
"test_session": "WFS-test-..."
|
|
606
|
+
},
|
|
607
|
+
"artifacts": {
|
|
608
|
+
"debug_understanding": "...",
|
|
609
|
+
"test_results": "...",
|
|
610
|
+
"fusion_analysis": "..."
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
---
|
|
616
|
+
|
|
617
|
+
## Mode Selection Logic
|
|
618
|
+
|
|
619
|
+
### Auto Mode Recommendation
|
|
620
|
+
|
|
621
|
+
When user doesn't specify `--mode`, recommend based on input analysis:
|
|
622
|
+
|
|
623
|
+
```javascript
|
|
624
|
+
function recommendMode(bugDescription) {
|
|
625
|
+
const indicators = {
|
|
626
|
+
cli_signals: [
|
|
627
|
+
/quick|fast|simple|immediate/,
|
|
628
|
+
/recommendation|suggest|advice/,
|
|
629
|
+
/just need|only want|quick look/,
|
|
630
|
+
/straightforward|obvious|clear/
|
|
631
|
+
],
|
|
632
|
+
debug_signals: [
|
|
633
|
+
/unclear|don't know|maybe|uncertain|why/,
|
|
634
|
+
/error|crash|fail|exception|stack trace/,
|
|
635
|
+
/execution flow|code path|how does/
|
|
636
|
+
],
|
|
637
|
+
test_signals: [
|
|
638
|
+
/test|coverage|verify|pass|fail/,
|
|
639
|
+
/implementation|implemented|complete/,
|
|
640
|
+
/case|scenario|should/
|
|
641
|
+
],
|
|
642
|
+
complex_signals: [
|
|
643
|
+
/multiple|all|system|integration/,
|
|
644
|
+
/module|subsystem|network|distributed/,
|
|
645
|
+
/concurrent|async|race/
|
|
646
|
+
]
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
let score = { cli: 0, debug: 0, test: 0, bidirectional: 0 }
|
|
650
|
+
|
|
651
|
+
// CLI signals (lightweight preference)
|
|
652
|
+
for (const pattern of indicators.cli_signals) {
|
|
653
|
+
if (pattern.test(bugDescription)) score.cli += 3
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
// Debug signals
|
|
657
|
+
for (const pattern of indicators.debug_signals) {
|
|
658
|
+
if (pattern.test(bugDescription)) score.debug += 2
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
// Test signals
|
|
662
|
+
for (const pattern of indicators.test_signals) {
|
|
663
|
+
if (pattern.test(bugDescription)) score.test += 2
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// Complex signals (prefer bidirectional for complex issues)
|
|
667
|
+
for (const pattern of indicators.complex_signals) {
|
|
668
|
+
if (pattern.test(bugDescription)) {
|
|
669
|
+
score.bidirectional += 3
|
|
670
|
+
score.cli -= 2 // Complex issues not suitable for CLI quick
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
// If description is short and has clear error, prefer CLI
|
|
675
|
+
if (bugDescription.length < 100 && /error|fail|crash/.test(bugDescription)) {
|
|
676
|
+
score.cli += 2
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// Return highest scoring mode
|
|
680
|
+
return Object.entries(score).sort((a, b) => b[1] - a[1])[0][0]
|
|
681
|
+
}
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
---
|
|
685
|
+
|
|
686
|
+
## Best Practices
|
|
687
|
+
|
|
688
|
+
### When to Use Each Mode
|
|
689
|
+
|
|
690
|
+
| Issue Characteristic | Recommended Mode | Rationale |
|
|
691
|
+
|----------------------|-----------------|-----------|
|
|
692
|
+
| Simple error, clear symptoms | CLI Quick | Fastest recommendation |
|
|
693
|
+
| Incomplete error info, requires exploration | Debug First | Deep diagnostic capability |
|
|
694
|
+
| Code complete, needs test coverage | Test First | Automated iterative fixes |
|
|
695
|
+
| Cross-module issue, ambiguous symptoms | Bidirectional | Multi-angle insights |
|
|
696
|
+
| Production failure, needs immediate guidance | CLI Quick + --yes | Fastest guidance, optional escalation |
|
|
697
|
+
| Production failure, needs safe fix | Debug First + --hotfix | Minimal diagnosis time |
|
|
698
|
+
| Want to understand why it failed | Debug First | Records understanding evolution |
|
|
699
|
+
| Want to ensure all scenarios pass | Test First | Complete coverage-driven |
|
|
700
|
+
|
|
701
|
+
### Performance Tips
|
|
702
|
+
|
|
703
|
+
- **CLI Quick**: 2-5 minutes, no file I/O, recommendation-only
|
|
704
|
+
- **Debug First**: Usually requires manual issue reproduction (after logging added), then 15-30 min
|
|
705
|
+
- **Test First**: Fully automated, 20-45 min depending on test suite size
|
|
706
|
+
- **Bidirectional**: Most comprehensive but slowest (parallel workflows), 30-60 min
|
|
707
|
+
|
|
708
|
+
### Workflow Continuity
|
|
709
|
+
|
|
710
|
+
- **CLI Quick**: Can escalate to debug/test/apply fix based on user decision
|
|
711
|
+
- **Debug First**: Auto-launches test generation and execution after completion
|
|
712
|
+
- **Test First**: With high failure rates suggests switching to debug mode for root cause
|
|
713
|
+
- **Bidirectional**: Always executes complete flow
|
|
714
|
+
|
|
715
|
+
---
|
|
716
|
+
|
|
717
|
+
## Follow-up Expansion
|
|
718
|
+
|
|
719
|
+
After completion, offer to expand to issues:
|
|
720
|
+
|
|
721
|
+
```
|
|
722
|
+
## Done! What's next?
|
|
723
|
+
|
|
724
|
+
- [ ] Create Test issue (improve test coverage)
|
|
725
|
+
- [ ] Create Enhancement issue (optimize code quality)
|
|
726
|
+
- [ ] Create Refactor issue (improve architecture)
|
|
727
|
+
- [ ] Create Documentation issue (record learnings)
|
|
728
|
+
- [ ] Don't create any issue, end workflow
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
Selected items call: `/issue:new "{issue summary} - {dimension}"`
|
|
732
|
+
|
|
733
|
+
---
|
|
734
|
+
|
|
735
|
+
## Error Handling
|
|
736
|
+
|
|
737
|
+
| Error | CLI Quick | Debug First | Test First | Bidirectional |
|
|
738
|
+
|-------|-----------|-------------|-----------|---------------|
|
|
739
|
+
| Session creation failed | N/A (no session) | Retry → abort | Retry → abort | Retry → abort |
|
|
740
|
+
| CLI analysis failed | Retry with fallback tool → manual | N/A | N/A | N/A |
|
|
741
|
+
| Diagnosis/test failed | N/A | Continue with partial results | Direct failure | Use alternate workflow results |
|
|
742
|
+
| Low confidence result | Ask escalate or review | N/A | N/A | N/A |
|
|
743
|
+
| Merge conflicts | N/A | N/A | N/A | Select highest confidence plan |
|
|
744
|
+
| Fix application failed | Report error, no auto-retry | Request manual fix | Mark failed, request intervention | Try alternative plan |
|
|
745
|
+
|
|
746
|
+
---
|
|
747
|
+
|
|
748
|
+
## Relationship with ccw Command
|
|
749
|
+
|
|
750
|
+
| Feature | ccw | ccw-debug |
|
|
751
|
+
|---------|-----|----------|
|
|
752
|
+
| **Design** | General workflow orchestration | Debug + test aggregation |
|
|
753
|
+
| **Intent Detection** | ✅ Detects task type | ✅ Detects issue type |
|
|
754
|
+
| **Automation** | ✅ Auto-selects workflow | ✅ Auto-selects mode |
|
|
755
|
+
| **Quick Mode** | ❌ None | ✅ CLI Quick (2-5 min) |
|
|
756
|
+
| **Parallel Execution** | ❌ Sequential | ✅ Bidirectional mode parallel |
|
|
757
|
+
| **Fusion Analysis** | ❌ None | ✅ Bidirectional mode fusion |
|
|
758
|
+
| **Workflow Scope** | Broad (feature/bugfix/tdd/ui etc.) | Deep focus (debug + test) |
|
|
759
|
+
| **CLI Integration** | Yes | Yes (4 levels: quick/deep/iterative/fusion) |
|
|
760
|
+
|
|
761
|
+
---
|
|
762
|
+
|
|
763
|
+
## Usage Recommendations
|
|
764
|
+
|
|
765
|
+
1. **First Time**: Use default mode (debug-first), observe workflow
|
|
766
|
+
2. **Quick Decision**: Use CLI Quick (--mode cli) for immediate recommendations
|
|
767
|
+
3. **Quick Fix**: Use `--hotfix --yes` for minimal diagnostics (debug mode)
|
|
768
|
+
4. **Learning**: Use debug-first, read `understanding.md`
|
|
769
|
+
5. **Complete Validation**: Use bidirectional for multi-dimensional insights
|
|
770
|
+
6. **Auto Repair**: Use test-first for automatic iteration
|
|
771
|
+
7. **Escalation**: Start with CLI Quick, escalate to other modes as needed
|
|
772
|
+
|
|
773
|
+
---
|
|
774
|
+
|
|
775
|
+
## Reference
|
|
776
|
+
|
|
777
|
+
### Related Commands
|
|
778
|
+
|
|
779
|
+
- `ccw cli` - Direct CLI analysis (used by CLI Quick mode)
|
|
780
|
+
- `/workflow:debug-with-file` - Deep debug diagnostics
|
|
781
|
+
- `/workflow:test-fix-gen` - Test generation
|
|
782
|
+
- `/workflow:test-cycle-execute` - Test execution
|
|
783
|
+
- `/workflow:lite-fix` - Lightweight fix
|
|
784
|
+
- `/ccw` - General workflow orchestration
|
|
785
|
+
|
|
786
|
+
### Configuration Files
|
|
787
|
+
|
|
788
|
+
- `~/.claude/cli-tools.json` - CLI tool configuration (Gemini/Qwen/Codex)
|
|
789
|
+
- `.workflow/project-tech.json` - Project technology stack
|
|
790
|
+
- `.workflow/project-guidelines.json` - Project conventions
|
|
791
|
+
|
|
792
|
+
### CLI Tool Fallback Chain (for CLI Quick mode)
|
|
793
|
+
|
|
794
|
+
When CLI analysis fails, fallback order:
|
|
795
|
+
1. **Gemini** (primary): `gemini-2.5-pro`
|
|
796
|
+
2. **Qwen** (fallback): `coder-model`
|
|
797
|
+
3. **Codex** (fallback): `gpt-5.2`
|
|
798
|
+
|
|
799
|
+
---
|
|
800
|
+
|
|
801
|
+
## Summary: Mode Selection Decision Tree
|
|
802
|
+
|
|
803
|
+
```
|
|
804
|
+
User calls: /ccw-debug <bug_description>
|
|
805
|
+
|
|
806
|
+
┌─ Explicit --mode specified?
|
|
807
|
+
│ ├─ YES → Use specified mode
|
|
808
|
+
│ │ ├─ cli → 2-5 min analysis, optionally escalate
|
|
809
|
+
│ │ ├─ debug → Full debug-with-file workflow
|
|
810
|
+
│ │ ├─ test → Test-first workflow
|
|
811
|
+
│ │ └─ bidirectional → Parallel debug + test
|
|
812
|
+
│ │
|
|
813
|
+
│ └─ NO → Auto-recommend based on bug description
|
|
814
|
+
│ ├─ Keywords: "quick", "fast", "simple" → CLI Quick
|
|
815
|
+
│ ├─ Keywords: "error", "crash", "exception" → Debug First (or CLI if simple)
|
|
816
|
+
│ ├─ Keywords: "test", "verify", "coverage" → Test First
|
|
817
|
+
│ └─ Keywords: "multiple", "system", "distributed" → Bidirectional
|
|
818
|
+
│
|
|
819
|
+
├─ Check --yes flag
|
|
820
|
+
│ ├─ YES → Auto-confirm all decisions
|
|
821
|
+
│ │ ├─ CLI mode: Auto-apply if confidence High
|
|
822
|
+
│ │ └─ Others: Auto-select default options
|
|
823
|
+
│ │
|
|
824
|
+
│ └─ NO → Interactive mode, ask user for confirmations
|
|
825
|
+
│
|
|
826
|
+
├─ Check --hotfix flag (debug mode only)
|
|
827
|
+
│ ├─ YES → Minimal diagnostics, fast fix
|
|
828
|
+
│ └─ NO → Full analysis
|
|
829
|
+
│
|
|
830
|
+
└─ Execute selected mode workflow
|
|
831
|
+
└─ Return results or escalation options
|
|
832
|
+
```
|