@thierrynakoa/fire-flow 10.0.0
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-plugin/plugin.json +64 -0
- package/ARCHITECTURE-DIAGRAM.md +440 -0
- package/COMMAND-REFERENCE.md +172 -0
- package/DOMINION-FLOW-OVERVIEW.md +421 -0
- package/LICENSE +21 -0
- package/QUICK-START.md +351 -0
- package/README.md +398 -0
- package/TROUBLESHOOTING.md +264 -0
- package/agents/fire-codebase-mapper.md +484 -0
- package/agents/fire-debugger.md +535 -0
- package/agents/fire-executor.md +949 -0
- package/agents/fire-fact-checker.md +276 -0
- package/agents/fire-learncoding-explainer.md +237 -0
- package/agents/fire-learncoding-walker.md +147 -0
- package/agents/fire-planner.md +675 -0
- package/agents/fire-project-researcher.md +155 -0
- package/agents/fire-research-synthesizer.md +166 -0
- package/agents/fire-researcher.md +723 -0
- package/agents/fire-reviewer.md +499 -0
- package/agents/fire-roadmapper.md +203 -0
- package/agents/fire-verifier.md +880 -0
- package/bin/cli.js +208 -0
- package/commands/fire-0-orient.md +476 -0
- package/commands/fire-1-new.md +281 -0
- package/commands/fire-1a-discuss.md +455 -0
- package/commands/fire-2-plan.md +527 -0
- package/commands/fire-3-execute.md +1303 -0
- package/commands/fire-4-verify.md +845 -0
- package/commands/fire-5-handoff.md +515 -0
- package/commands/fire-6-resume.md +501 -0
- package/commands/fire-7-review.md +409 -0
- package/commands/fire-add-new-skill.md +598 -0
- package/commands/fire-analytics.md +499 -0
- package/commands/fire-assumptions.md +78 -0
- package/commands/fire-autonomous.md +528 -0
- package/commands/fire-brainstorm.md +413 -0
- package/commands/fire-complete-milestone.md +270 -0
- package/commands/fire-dashboard.md +375 -0
- package/commands/fire-debug.md +663 -0
- package/commands/fire-discover.md +616 -0
- package/commands/fire-double-check.md +460 -0
- package/commands/fire-execute-plan.md +182 -0
- package/commands/fire-learncoding.md +242 -0
- package/commands/fire-loop-resume.md +272 -0
- package/commands/fire-loop-stop.md +198 -0
- package/commands/fire-loop.md +1168 -0
- package/commands/fire-map-codebase.md +313 -0
- package/commands/fire-new-milestone.md +356 -0
- package/commands/fire-reflect.md +235 -0
- package/commands/fire-research.md +246 -0
- package/commands/fire-search.md +330 -0
- package/commands/fire-security-audit-repo.md +293 -0
- package/commands/fire-security-scan.md +484 -0
- package/commands/fire-session-summary.md +252 -0
- package/commands/fire-skills-diff.md +506 -0
- package/commands/fire-skills-history.md +388 -0
- package/commands/fire-skills-rollback.md +408 -0
- package/commands/fire-skills-sync.md +470 -0
- package/commands/fire-test.md +520 -0
- package/commands/fire-todos.md +335 -0
- package/commands/fire-transition.md +186 -0
- package/commands/fire-update.md +312 -0
- package/commands/fire-verify-uat.md +146 -0
- package/commands/fire-vuln-scan.md +493 -0
- package/hooks/hooks.json +16 -0
- package/hooks/run-hook.cmd +69 -0
- package/hooks/run-hook.sh +8 -0
- package/hooks/run-session-end.cmd +49 -0
- package/hooks/run-session-end.sh +7 -0
- package/hooks/session-end.sh +90 -0
- package/hooks/session-start.sh +111 -0
- package/package.json +52 -0
- package/plugin.json +7 -0
- package/references/auto-skill-extraction.md +136 -0
- package/references/behavioral-directives.md +365 -0
- package/references/blocker-tracking.md +155 -0
- package/references/checkpoints.md +165 -0
- package/references/circuit-breaker.md +410 -0
- package/references/context-engineering.md +587 -0
- package/references/decision-time-guidance.md +289 -0
- package/references/error-classification.md +326 -0
- package/references/execution-mode-intelligence.md +242 -0
- package/references/git-integration.md +217 -0
- package/references/honesty-protocols.md +304 -0
- package/references/integration-architecture.md +470 -0
- package/references/issue-to-pr-pipeline.md +150 -0
- package/references/metrics-and-trends.md +234 -0
- package/references/playwright-e2e-testing.md +326 -0
- package/references/questioning.md +125 -0
- package/references/research-improvements.md +110 -0
- package/references/skills-usage-guide.md +429 -0
- package/references/tdd.md +131 -0
- package/references/testing-enforcement.md +192 -0
- package/references/ui-brand.md +383 -0
- package/references/validation-checklist.md +456 -0
- package/references/verification-patterns.md +187 -0
- package/references/warrior-principles.md +173 -0
- package/skills-library/SKILLS-INDEX.md +588 -0
- package/skills-library/_general/frontend/html-visual-reports.md +292 -0
- package/skills-library/_general/methodology/debug-swarm-researcher-escape-hatch.md +240 -0
- package/skills-library/_general/methodology/learncoding-agentic-pattern.md +114 -0
- package/skills-library/_general/methodology/shell-autonomous-loop-fixplan.md +238 -0
- package/skills-library/basics/api-rest-basics.md +162 -0
- package/skills-library/basics/env-variables.md +96 -0
- package/skills-library/basics/error-handling-basics.md +125 -0
- package/skills-library/basics/git-commit-conventions.md +106 -0
- package/skills-library/basics/readme-template.md +108 -0
- package/skills-library/common-tasks/async-await-patterns.md +157 -0
- package/skills-library/common-tasks/auth-jwt-basics.md +164 -0
- package/skills-library/common-tasks/database-schema-design.md +166 -0
- package/skills-library/common-tasks/file-upload-basics.md +166 -0
- package/skills-library/common-tasks/form-validation.md +159 -0
- package/skills-library/debugging/FAILURE_TAXONOMY_CLASSIFICATION.md +117 -0
- package/skills-library/debugging/THREE_AGENT_HYPOTHESIS_DEBUGGING.md +86 -0
- package/skills-library/methodology/BREATH_BASED_PARALLEL_EXECUTION.md +678 -0
- package/skills-library/methodology/CONFIDENCE_GATED_EXECUTION.md +243 -0
- package/skills-library/methodology/EVIDENCE_BASED_VALIDATION.md +308 -0
- package/skills-library/methodology/MULTI_PERSPECTIVE_CODE_REVIEW.md +330 -0
- package/skills-library/methodology/PATH_VERIFICATION_GATE.md +211 -0
- package/skills-library/methodology/REFLEXION_MEMORY_PATTERN.md +183 -0
- package/skills-library/methodology/RESEARCH_BACKED_WORKFLOW_UPGRADE.md +263 -0
- package/skills-library/methodology/SABBATH_REST_PATTERN.md +267 -0
- package/skills-library/methodology/STONE_AND_SCAFFOLD.md +220 -0
- package/skills-library/performance/cache-augmented-generation.md +172 -0
- package/skills-library/quality-safety/debugging-steps.md +147 -0
- package/skills-library/quality-safety/deployment-checklist.md +155 -0
- package/skills-library/quality-safety/security-checklist.md +204 -0
- package/skills-library/quality-safety/testing-basics.md +180 -0
- package/skills-library/security/agent-security-scanner.md +445 -0
- package/skills-library/specialists/api-architecture/api-designer.md +49 -0
- package/skills-library/specialists/api-architecture/graphql-architect.md +49 -0
- package/skills-library/specialists/api-architecture/mcp-developer.md +51 -0
- package/skills-library/specialists/api-architecture/microservices-architect.md +50 -0
- package/skills-library/specialists/api-architecture/websocket-engineer.md +48 -0
- package/skills-library/specialists/backend/django-expert.md +52 -0
- package/skills-library/specialists/backend/fastapi-expert.md +52 -0
- package/skills-library/specialists/backend/laravel-specialist.md +52 -0
- package/skills-library/specialists/backend/nestjs-expert.md +51 -0
- package/skills-library/specialists/backend/rails-expert.md +53 -0
- package/skills-library/specialists/backend/spring-boot-engineer.md +56 -0
- package/skills-library/specialists/data-ml/fine-tuning-expert.md +48 -0
- package/skills-library/specialists/data-ml/ml-pipeline.md +47 -0
- package/skills-library/specialists/data-ml/pandas-pro.md +47 -0
- package/skills-library/specialists/data-ml/rag-architect.md +51 -0
- package/skills-library/specialists/data-ml/spark-engineer.md +47 -0
- package/skills-library/specialists/frontend/angular-architect.md +52 -0
- package/skills-library/specialists/frontend/flutter-expert.md +51 -0
- package/skills-library/specialists/frontend/nextjs-developer.md +54 -0
- package/skills-library/specialists/frontend/react-native-expert.md +50 -0
- package/skills-library/specialists/frontend/vue-expert.md +51 -0
- package/skills-library/specialists/infrastructure/chaos-engineer.md +74 -0
- package/skills-library/specialists/infrastructure/cloud-architect.md +70 -0
- package/skills-library/specialists/infrastructure/database-optimizer.md +64 -0
- package/skills-library/specialists/infrastructure/devops-engineer.md +70 -0
- package/skills-library/specialists/infrastructure/kubernetes-specialist.md +52 -0
- package/skills-library/specialists/infrastructure/monitoring-expert.md +70 -0
- package/skills-library/specialists/infrastructure/sre-engineer.md +70 -0
- package/skills-library/specialists/infrastructure/terraform-engineer.md +51 -0
- package/skills-library/specialists/languages/cpp-pro.md +74 -0
- package/skills-library/specialists/languages/csharp-developer.md +69 -0
- package/skills-library/specialists/languages/dotnet-core-expert.md +54 -0
- package/skills-library/specialists/languages/golang-pro.md +51 -0
- package/skills-library/specialists/languages/java-architect.md +49 -0
- package/skills-library/specialists/languages/javascript-pro.md +68 -0
- package/skills-library/specialists/languages/kotlin-specialist.md +68 -0
- package/skills-library/specialists/languages/php-pro.md +49 -0
- package/skills-library/specialists/languages/python-pro.md +52 -0
- package/skills-library/specialists/languages/react-expert.md +51 -0
- package/skills-library/specialists/languages/rust-engineer.md +50 -0
- package/skills-library/specialists/languages/sql-pro.md +56 -0
- package/skills-library/specialists/languages/swift-expert.md +69 -0
- package/skills-library/specialists/languages/typescript-pro.md +51 -0
- package/skills-library/specialists/platform/atlassian-mcp.md +52 -0
- package/skills-library/specialists/platform/embedded-systems.md +53 -0
- package/skills-library/specialists/platform/game-developer.md +53 -0
- package/skills-library/specialists/platform/salesforce-developer.md +53 -0
- package/skills-library/specialists/platform/shopify-expert.md +49 -0
- package/skills-library/specialists/platform/wordpress-pro.md +49 -0
- package/skills-library/specialists/quality/code-documenter.md +51 -0
- package/skills-library/specialists/quality/code-reviewer.md +67 -0
- package/skills-library/specialists/quality/debugging-wizard.md +51 -0
- package/skills-library/specialists/quality/fullstack-guardian.md +51 -0
- package/skills-library/specialists/quality/legacy-modernizer.md +50 -0
- package/skills-library/specialists/quality/playwright-expert.md +65 -0
- package/skills-library/specialists/quality/spec-miner.md +56 -0
- package/skills-library/specialists/quality/test-master.md +65 -0
- package/skills-library/specialists/security/secure-code-guardian.md +55 -0
- package/skills-library/specialists/security/security-reviewer.md +53 -0
- package/skills-library/specialists/workflow/architecture-designer.md +53 -0
- package/skills-library/specialists/workflow/cli-developer.md +70 -0
- package/skills-library/specialists/workflow/feature-forge.md +65 -0
- package/skills-library/specialists/workflow/prompt-engineer.md +54 -0
- package/skills-library/specialists/workflow/the-fool.md +62 -0
- package/templates/ASSUMPTIONS.md +125 -0
- package/templates/BLOCKERS.md +73 -0
- package/templates/DECISION_LOG.md +116 -0
- package/templates/UAT.md +96 -0
- package/templates/blueprint.md +94 -0
- package/templates/brainstorm.md +185 -0
- package/templates/conscience.md +92 -0
- package/templates/fire-handoff.md +159 -0
- package/templates/metrics.md +67 -0
- package/templates/phase-prompt.md +142 -0
- package/templates/record.md +131 -0
- package/templates/review-report.md +117 -0
- package/templates/skills-index.md +157 -0
- package/templates/verification.md +149 -0
- package/templates/vision.md +79 -0
- package/validation-config.yml +793 -0
- package/version.json +7 -0
- package/workflows/execute-phase.md +732 -0
- package/workflows/handoff-session.md +678 -0
- package/workflows/new-project.md +578 -0
- package/workflows/plan-phase.md +592 -0
- package/workflows/verify-phase.md +874 -0
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Systematic debugging with persistent state, skills library integration, and WARRIOR validation
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /fire-debug
|
|
6
|
+
|
|
7
|
+
> Systematic debugging with scientific method, persistent state recovery, and WARRIOR skills integration
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Debug issues using scientific method with subagent isolation. Combines Dominion Flow's proven debug orchestration with skills library (debugging patterns, domain knowledge) and honesty protocols.
|
|
14
|
+
|
|
15
|
+
**Orchestrator role:** Gather symptoms, spawn fire-debugger agent, handle checkpoints, spawn continuations.
|
|
16
|
+
|
|
17
|
+
**Why subagent:** Investigation burns context fast (reading files, forming hypotheses, testing). Fresh 200k context per investigation. Main context stays lean for user interaction.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Arguments
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
arguments:
|
|
25
|
+
issue_description:
|
|
26
|
+
required: false
|
|
27
|
+
type: string
|
|
28
|
+
description: "Brief description of the issue to debug"
|
|
29
|
+
example: "/fire-debug login fails with 500 error"
|
|
30
|
+
|
|
31
|
+
optional_flags:
|
|
32
|
+
--diagnose-only: "Find root cause but don't fix (for plan-based fixes)"
|
|
33
|
+
--verbose: "Show detailed investigation progress"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Process
|
|
39
|
+
|
|
40
|
+
### Step 1: Check Active Debug Sessions
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
ls .planning/debug/*.md 2>/dev/null | grep -v resolved | head -5
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**If active sessions exist AND no arguments:**
|
|
47
|
+
- Display sessions with status, hypothesis, next action
|
|
48
|
+
- User picks number to resume OR describes new issue
|
|
49
|
+
|
|
50
|
+
**If arguments provided OR user describes new issue:**
|
|
51
|
+
- Continue to symptom gathering
|
|
52
|
+
|
|
53
|
+
### Step 2: WARRIOR Enhancement - Skills Check + Context7 Live Docs
|
|
54
|
+
|
|
55
|
+
Before investigating, check skills library for relevant debugging patterns:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
/fire-search "[error type] debugging"
|
|
59
|
+
/fire-search "[technology] troubleshooting"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Load applicable skills:
|
|
63
|
+
- `@skills-library/debugging/` patterns
|
|
64
|
+
- `@skills-library/[domain]/` domain knowledge
|
|
65
|
+
- `@skills-library/integrations/` if external service involved
|
|
66
|
+
|
|
67
|
+
**Context7 Live Documentation Lookup (v5.0):**
|
|
68
|
+
|
|
69
|
+
If the issue involves a specific library/framework, pull current docs:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
# Resolve the library
|
|
73
|
+
mcp__plugin_context7_context7__resolve-library-id(libraryName="{library}")
|
|
74
|
+
|
|
75
|
+
# Query for relevant API docs, known issues, migration notes
|
|
76
|
+
mcp__plugin_context7_context7__query-docs(libraryId="{resolved-id}", query="{specific error}")
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**When to use Context7 during debugging:**
|
|
80
|
+
- Error message references a library API (check if API changed)
|
|
81
|
+
- Unexpected behavior from a dependency (check current docs vs assumptions)
|
|
82
|
+
- Stack trace points to library internals (understand expected behavior)
|
|
83
|
+
- Issue appeared after dependency update (check migration/changelog)
|
|
84
|
+
|
|
85
|
+
### Step 2.5: Search Past Reflections + Debug Resolutions (NEW — v5.0)
|
|
86
|
+
|
|
87
|
+
Before investigating, check if this problem has been seen before:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
# Search reflections for matching symptoms
|
|
91
|
+
Search ~/.claude/reflections/ for: "{error symptoms}" "{actual behavior}"
|
|
92
|
+
|
|
93
|
+
# If vector memory available:
|
|
94
|
+
/fire-remember "{symptoms}" --type reflection
|
|
95
|
+
/fire-remember "{symptoms}" --type debug_resolution
|
|
96
|
+
|
|
97
|
+
IF match found with >0.75 similarity:
|
|
98
|
+
Display:
|
|
99
|
+
"I've seen this before:
|
|
100
|
+
Previous issue: {reflection slug}
|
|
101
|
+
Root cause was: {root_cause}
|
|
102
|
+
Fix was: {fix}
|
|
103
|
+
Lesson: {lesson}
|
|
104
|
+
Confidence: {similarity_score}%"
|
|
105
|
+
|
|
106
|
+
Offer: [Apply same fix] [Investigate fresh] [Compare differences]
|
|
107
|
+
|
|
108
|
+
IF user selects "Apply same fix":
|
|
109
|
+
→ Skip to fix application (adapt previous solution to current context)
|
|
110
|
+
→ Still verify the fix works
|
|
111
|
+
|
|
112
|
+
IF user selects "Investigate fresh":
|
|
113
|
+
→ Continue to Step 3 as normal
|
|
114
|
+
→ Note in debug file: "Similar past issue: {slug}, chose to investigate fresh"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Step 3.5: Hypothesis Tree (ReflexTree v9.1)
|
|
118
|
+
|
|
119
|
+
> **Research basis:** ReflexTree (2025) — tree-structured reflection catches root causes
|
|
120
|
+
> faster than linear hypothesis lists by enabling branch-and-prune investigation.
|
|
121
|
+
|
|
122
|
+
Structure debugging as a branching tree, not a flat list.
|
|
123
|
+
|
|
124
|
+
**Tree file:** `.planning/debug/{slug}-tree.md`
|
|
125
|
+
|
|
126
|
+
```markdown
|
|
127
|
+
# Hypothesis Tree: {slug}
|
|
128
|
+
|
|
129
|
+
## H1: {hypothesis} [ACTIVE|PRUNED|CONFIRMED]
|
|
130
|
+
Evidence for: ...
|
|
131
|
+
Evidence against: ...
|
|
132
|
+
### H1.1: {sub-hypothesis} [ACTIVE|PRUNED|CONFIRMED]
|
|
133
|
+
Evidence for: ...
|
|
134
|
+
Evidence against: ...
|
|
135
|
+
### H1.2: {sub-hypothesis} [ACTIVE|PRUNED|CONFIRMED]
|
|
136
|
+
...
|
|
137
|
+
|
|
138
|
+
## H2: {hypothesis} [ACTIVE|PRUNED|CONFIRMED]
|
|
139
|
+
...
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Rules:**
|
|
143
|
+
1. Start with 2-3 top-level hypotheses based on symptoms + failure taxonomy
|
|
144
|
+
2. Each investigation MUST update evidence for/against on at least one hypothesis
|
|
145
|
+
3. When evidence eliminates a hypothesis → mark PRUNED (never delete — APPEND-only)
|
|
146
|
+
4. When a hypothesis needs deeper investigation → branch into sub-hypotheses (H1.1, H1.2)
|
|
147
|
+
5. Maximum depth: 3 levels (H1 → H1.1 → H1.1.1)
|
|
148
|
+
6. When CONFIRMED → stop branching, proceed to fix
|
|
149
|
+
|
|
150
|
+
**Add to Step 4's debugger prompt (hypothesis_tree block):**
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
<hypothesis_tree>
|
|
154
|
+
{contents of .planning/debug/{slug}-tree.md if it exists, otherwise "No tree yet — create one"}
|
|
155
|
+
</hypothesis_tree>
|
|
156
|
+
|
|
157
|
+
INSTRUCTION: Create or update the hypothesis tree after each investigation step.
|
|
158
|
+
Mark hypotheses PRUNED when evidence eliminates them.
|
|
159
|
+
Branch into sub-hypotheses when root cause is narrowing but not yet isolated.
|
|
160
|
+
Write the tree to .planning/debug/{slug}-tree.md after each update.
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Step 3: Gather Symptoms (if new issue)
|
|
164
|
+
|
|
165
|
+
Use AskUserQuestion for each:
|
|
166
|
+
|
|
167
|
+
1. **Expected behavior** - What should happen?
|
|
168
|
+
2. **Actual behavior** - What happens instead?
|
|
169
|
+
3. **Error messages** - Any errors? (paste or describe)
|
|
170
|
+
4. **Timeline** - When did this start? Ever worked?
|
|
171
|
+
5. **Reproduction** - How do you trigger it?
|
|
172
|
+
|
|
173
|
+
After all gathered, confirm ready to investigate.
|
|
174
|
+
|
|
175
|
+
### Step 4: Spawn fire-debugger Agent
|
|
176
|
+
|
|
177
|
+
Fill prompt and spawn:
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
<objective>
|
|
181
|
+
Investigate issue: {slug}
|
|
182
|
+
|
|
183
|
+
**Summary:** {trigger}
|
|
184
|
+
</objective>
|
|
185
|
+
|
|
186
|
+
<path_constraint>
|
|
187
|
+
<!-- v5.0: Path Verification Gate — MANDATORY -->
|
|
188
|
+
PROJECT_ROOT: {absolute path to current project}
|
|
189
|
+
ALLOWED_PATHS: {PROJECT_ROOT}/**
|
|
190
|
+
FORBIDDEN: Do NOT read, write, or search files outside PROJECT_ROOT.
|
|
191
|
+
If you discover you are in the wrong directory, STOP immediately and report.
|
|
192
|
+
</path_constraint>
|
|
193
|
+
|
|
194
|
+
<symptoms>
|
|
195
|
+
expected: {expected}
|
|
196
|
+
actual: {actual}
|
|
197
|
+
errors: {errors}
|
|
198
|
+
reproduction: {reproduction}
|
|
199
|
+
timeline: {timeline}
|
|
200
|
+
</symptoms>
|
|
201
|
+
|
|
202
|
+
<plan_context>
|
|
203
|
+
<!-- v5.0: Plan-Aware Debugging — compare "intended" vs "actual" -->
|
|
204
|
+
**Original plan for this feature/area (if available):**
|
|
205
|
+
@.planning/phases/{N}-{name}/*.BLUEPRINT.md
|
|
206
|
+
|
|
207
|
+
**Key must-haves from plan:**
|
|
208
|
+
{Extracted must_haves that relate to the buggy area}
|
|
209
|
+
|
|
210
|
+
**Assumptions made during planning:**
|
|
211
|
+
{Relevant assumptions from ASSUMPTIONS.md or DECISION_LOG.md}
|
|
212
|
+
</plan_context>
|
|
213
|
+
|
|
214
|
+
<library_docs>
|
|
215
|
+
<!-- v5.0: Context7 Live Documentation — current API docs for involved libraries -->
|
|
216
|
+
**Libraries involved:** {list from error/stack trace}
|
|
217
|
+
|
|
218
|
+
**Context7 findings:**
|
|
219
|
+
{Paste relevant Context7 query-docs results here, if available}
|
|
220
|
+
|
|
221
|
+
**Doc version vs installed version:** {match/mismatch noted}
|
|
222
|
+
</library_docs>
|
|
223
|
+
|
|
224
|
+
<warrior_context>
|
|
225
|
+
**Relevant skills loaded:**
|
|
226
|
+
@skills-library/{category}/{skill}.md
|
|
227
|
+
|
|
228
|
+
**Honesty protocol:** Before proposing fixes, you must:
|
|
229
|
+
1. Confirm root cause with evidence (not just theory)
|
|
230
|
+
2. Acknowledge what you don't know
|
|
231
|
+
3. Document eliminated hypotheses
|
|
232
|
+
4. Compare findings against the original plan context above
|
|
233
|
+
5. Verify assumptions against Context7 docs (not stale training data)
|
|
234
|
+
</warrior_context>
|
|
235
|
+
|
|
236
|
+
<code_comments>
|
|
237
|
+
<!-- v5.0: When writing fix code, include maintenance comments -->
|
|
238
|
+
When writing fix code, include simple comments explaining:
|
|
239
|
+
- What the fix does and WHY it solves the root cause
|
|
240
|
+
- Any assumptions marked with // ASSUMPTION: [reason]
|
|
241
|
+
- Reference to the debug session: // Fix for: {slug}
|
|
242
|
+
</code_comments>
|
|
243
|
+
|
|
244
|
+
<mode>
|
|
245
|
+
symptoms_prefilled: true
|
|
246
|
+
goal: {find_and_fix | find_root_cause_only}
|
|
247
|
+
</mode>
|
|
248
|
+
|
|
249
|
+
<debug_file>
|
|
250
|
+
Create: .planning/debug/{slug}.md
|
|
251
|
+
</debug_file>
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
Task(
|
|
256
|
+
prompt=filled_prompt,
|
|
257
|
+
subagent_type="fire-debugger",
|
|
258
|
+
description="Debug {slug}"
|
|
259
|
+
)
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Step 5: Handle Agent Return
|
|
263
|
+
|
|
264
|
+
**If `## ROOT CAUSE FOUND`:**
|
|
265
|
+
- Display root cause and evidence summary
|
|
266
|
+
- Offer options:
|
|
267
|
+
- "Fix now" - spawn fix subagent
|
|
268
|
+
- "Plan fix" - suggest /fire-2-plan --gaps
|
|
269
|
+
- "Manual fix" - done
|
|
270
|
+
|
|
271
|
+
**If `## CHECKPOINT REACHED`:**
|
|
272
|
+
- Present checkpoint details to user
|
|
273
|
+
- Get user response
|
|
274
|
+
- Spawn continuation agent (see step 6)
|
|
275
|
+
|
|
276
|
+
**If `## INVESTIGATION INCONCLUSIVE`:**
|
|
277
|
+
- Show what was checked and eliminated
|
|
278
|
+
- Offer options:
|
|
279
|
+
- "Continue investigating" - spawn new agent with additional context
|
|
280
|
+
- "Manual investigation" - done
|
|
281
|
+
- "Add more context" - gather more symptoms, spawn again
|
|
282
|
+
|
|
283
|
+
### Step 6: Spawn Continuation Agent (After Checkpoint)
|
|
284
|
+
|
|
285
|
+
When user responds to checkpoint, spawn fresh agent:
|
|
286
|
+
|
|
287
|
+
```markdown
|
|
288
|
+
<objective>
|
|
289
|
+
Continue debugging {slug}. Evidence is in the debug file.
|
|
290
|
+
</objective>
|
|
291
|
+
|
|
292
|
+
<path_constraint>
|
|
293
|
+
<!-- v5.0: Path Verification Gate — MANDATORY -->
|
|
294
|
+
PROJECT_ROOT: {absolute path to current project}
|
|
295
|
+
ALLOWED_PATHS: {PROJECT_ROOT}/**
|
|
296
|
+
FORBIDDEN: Do NOT read, write, or search files outside PROJECT_ROOT.
|
|
297
|
+
If you discover you are in the wrong directory, STOP immediately and report.
|
|
298
|
+
</path_constraint>
|
|
299
|
+
|
|
300
|
+
<prior_state>
|
|
301
|
+
Debug file: @.planning/debug/{slug}.md
|
|
302
|
+
</prior_state>
|
|
303
|
+
|
|
304
|
+
<plan_context>
|
|
305
|
+
<!-- v5.0: Re-inject plan context on continuation too -->
|
|
306
|
+
@.planning/phases/{N}-{name}/*.BLUEPRINT.md (if available)
|
|
307
|
+
Key decisions: @.planning/DECISION_LOG.md (relevant entries)
|
|
308
|
+
</plan_context>
|
|
309
|
+
|
|
310
|
+
<checkpoint_response>
|
|
311
|
+
**Type:** {checkpoint_type}
|
|
312
|
+
**Response:** {user_response}
|
|
313
|
+
</checkpoint_response>
|
|
314
|
+
|
|
315
|
+
<mode>
|
|
316
|
+
goal: find_and_fix
|
|
317
|
+
</mode>
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
```
|
|
321
|
+
Task(
|
|
322
|
+
prompt=continuation_prompt,
|
|
323
|
+
subagent_type="fire-debugger",
|
|
324
|
+
description="Continue debug {slug}"
|
|
325
|
+
)
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Step 7.5: Auto-Generate Reflection (NEW — v5.0)
|
|
329
|
+
|
|
330
|
+
After resolution (root cause found + fix verified), auto-generate a reflection:
|
|
331
|
+
|
|
332
|
+
```
|
|
333
|
+
IF status == "resolved":
|
|
334
|
+
# Extract reflection content from debug file
|
|
335
|
+
Read: .planning/debug/resolved/{slug}.md
|
|
336
|
+
|
|
337
|
+
reflection = {
|
|
338
|
+
date: today,
|
|
339
|
+
project: {from debug file},
|
|
340
|
+
trigger: "debug-resolution",
|
|
341
|
+
severity: classify_severity(time_spent, files_changed, hypothesis_count),
|
|
342
|
+
tags: extract_tags(root_cause, technology, symptoms),
|
|
343
|
+
|
|
344
|
+
problem: symptoms.actual + symptoms.errors,
|
|
345
|
+
tried: eliminated[].hypothesis + eliminated[].evidence,
|
|
346
|
+
worked: resolution.root_cause + resolution.fix,
|
|
347
|
+
lesson: synthesize_one_sentence(root_cause, fix),
|
|
348
|
+
search_triggers: [
|
|
349
|
+
symptoms.errors (normalized),
|
|
350
|
+
symptoms.actual (keywords),
|
|
351
|
+
technology + "not working"
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
# Write reflection file
|
|
356
|
+
Save to: ~/.claude/reflections/{date}_{slug}.md
|
|
357
|
+
|
|
358
|
+
# Notify user
|
|
359
|
+
Display:
|
|
360
|
+
"Reflection captured: {lesson}
|
|
361
|
+
File: ~/.claude/reflections/{date}_{slug}.md
|
|
362
|
+
Future debug sessions will find this automatically."
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
**Severity classification:**
|
|
366
|
+
- **critical**: 5+ eliminated hypotheses OR 10+ files changed OR required research
|
|
367
|
+
- **moderate**: 2-4 eliminated hypotheses OR multi-file fix
|
|
368
|
+
- **minor**: 1 hypothesis OR single-file fix
|
|
369
|
+
|
|
370
|
+
### Step 7.75: Index Resolved Debug for Replay (NEW — v5.0)
|
|
371
|
+
|
|
372
|
+
**Research basis:** ECHO (2025) — 80% improvement via experience replay
|
|
373
|
+
|
|
374
|
+
After resolution, index the debug file into vector memory for future replay:
|
|
375
|
+
|
|
376
|
+
```
|
|
377
|
+
IF status == "resolved" AND vector memory available:
|
|
378
|
+
# Move to resolved directory (if not already)
|
|
379
|
+
mv .planning/debug/{slug}.md → .planning/debug/resolved/{slug}.md
|
|
380
|
+
|
|
381
|
+
# Index into Qdrant as debug_resolution
|
|
382
|
+
cd ~/.claude/memory
|
|
383
|
+
npm run index-file -- ".planning/debug/resolved/{slug}.md"
|
|
384
|
+
|
|
385
|
+
# The file will be detected as sourceType: 'debug_resolution'
|
|
386
|
+
# Future /fire-debug Step 2.5 will find it via:
|
|
387
|
+
# /fire-remember "{symptoms}" --type debug_resolution
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
This enables experience replay: future debug sessions search for similar symptoms
|
|
391
|
+
and can shortcut investigation by applying known root causes.
|
|
392
|
+
|
|
393
|
+
### Step 7.8b: Failure Classification (v7.0 — AgentDebug)
|
|
394
|
+
|
|
395
|
+
> **Research basis:** AgentDebug (Sep 2025) — AgentErrorTaxonomy with 24% higher accuracy;
|
|
396
|
+
> PALADIN (ICLR 2026) — structured failure analysis enables targeted prevention strategies.
|
|
397
|
+
|
|
398
|
+
After debug resolution, classify the root cause into AgentDebug taxonomy:
|
|
399
|
+
|
|
400
|
+
```
|
|
401
|
+
IF status == "resolved":
|
|
402
|
+
|
|
403
|
+
Classify root cause:
|
|
404
|
+
|
|
405
|
+
| Category | Description | Example |
|
|
406
|
+
|------------|------------------------------------------|-------------------------------------------------|
|
|
407
|
+
| MEMORY | Forgot prior context or relevant knowledge | Didn't recall similar bug from last session |
|
|
408
|
+
| REFLECTION | Wrong self-assessment of progress | Thought fix was correct but missed edge case |
|
|
409
|
+
| PLANNING | Flawed approach selection | Started with wrong architecture pattern |
|
|
410
|
+
| ACTION | Correct plan, wrong execution | Typo in command, wrong file path |
|
|
411
|
+
| SYSTEM | Environment or tooling failure | Dependency not installed, port conflict |
|
|
412
|
+
|
|
413
|
+
Store in debug file:
|
|
414
|
+
failure_category: "{MEMORY|REFLECTION|PLANNING|ACTION|SYSTEM}"
|
|
415
|
+
|
|
416
|
+
Store in Qdrant payload (when indexing hindsight replay):
|
|
417
|
+
failure_category: "{category}"
|
|
418
|
+
source_type: "failure_pattern"
|
|
419
|
+
|
|
420
|
+
This enables future debugging to check:
|
|
421
|
+
"Previous {category} failures for similar symptoms → apply corrective strategy"
|
|
422
|
+
|
|
423
|
+
Category-specific strategies:
|
|
424
|
+
MEMORY → Force episodic recall search before investigating
|
|
425
|
+
REFLECTION → Require external validation (tests, not self-assessment)
|
|
426
|
+
PLANNING → Review plan context, check alternative approaches first
|
|
427
|
+
ACTION → Add pre-execution checklist, verify commands before running
|
|
428
|
+
SYSTEM → Check environment prerequisites before attempting fix
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### Step 7.8: Hindsight Experience Replay (v6.0 — ECHO)
|
|
432
|
+
|
|
433
|
+
> **Research basis:** ECHO (Oct 2025) — Hindsight optimization outperforms Reflexion by 80%.
|
|
434
|
+
> When a task fails, generating "what should have been done" creates synthetic positive
|
|
435
|
+
> examples that dramatically improve future performance. The key insight: learning from
|
|
436
|
+
> failures is 80% more effective when you also generate what success looks like.
|
|
437
|
+
|
|
438
|
+
After debug resolution, generate a structured hindsight replay:
|
|
439
|
+
|
|
440
|
+
```
|
|
441
|
+
IF status == "resolved":
|
|
442
|
+
|
|
443
|
+
# 1. Generate hindsight narrative
|
|
444
|
+
hindsight = generate:
|
|
445
|
+
"HINDSIGHT REPLAY — {slug}
|
|
446
|
+
|
|
447
|
+
## Original Symptoms
|
|
448
|
+
{symptoms from debug file — expected, actual, errors}
|
|
449
|
+
|
|
450
|
+
## Wrong Approaches Tried
|
|
451
|
+
{list eliminated hypotheses with why they failed}
|
|
452
|
+
|
|
453
|
+
## Correct Approach
|
|
454
|
+
Given these symptoms, the correct approach was:
|
|
455
|
+
{resolution.root_cause} → {resolution.fix}
|
|
456
|
+
|
|
457
|
+
## Pattern for Future
|
|
458
|
+
When you see: {symptom signature — the trigger pattern}
|
|
459
|
+
The root cause is likely: {root_cause category}
|
|
460
|
+
The fix is: {generalized fix approach}
|
|
461
|
+
|
|
462
|
+
## Key Diagnostic Step
|
|
463
|
+
The diagnostic that cracked it: {the evidence that confirmed root cause}"
|
|
464
|
+
|
|
465
|
+
# 2. Save as hindsight replay file
|
|
466
|
+
Save to: .planning/debug/resolved/{slug}-hindsight.md
|
|
467
|
+
|
|
468
|
+
# 3. Index into Qdrant as hindsight_replay
|
|
469
|
+
cd ~/.claude/memory
|
|
470
|
+
npm run index-file -- ".planning/debug/resolved/{slug}-hindsight.md"
|
|
471
|
+
# source_type will be detected as 'hindsight_replay'
|
|
472
|
+
|
|
473
|
+
# 4. Pre-seed utility score (hindsight replays are high-value)
|
|
474
|
+
npm run track-usage -- --source ".planning/debug/resolved/{slug}-hindsight.md" --helpful true
|
|
475
|
+
|
|
476
|
+
Display:
|
|
477
|
+
"Hindsight replay generated: {slug}
|
|
478
|
+
Pattern: {symptom signature} → {fix category}
|
|
479
|
+
Indexed for future debug sessions."
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
**Why this matters:** Future debug sessions (Step 2.5) will find both the raw debug file
|
|
483
|
+
AND the hindsight replay. The replay gives a direct "if you see X, do Y" shortcut
|
|
484
|
+
instead of requiring the agent to re-derive the solution from raw investigation notes.
|
|
485
|
+
|
|
486
|
+
---
|
|
487
|
+
|
|
488
|
+
### Step 7.9: Record Resolution Sequence (v7.0 — AgentRR)
|
|
489
|
+
|
|
490
|
+
> **Research basis:** AgentRR (May 2025) — dual-level record/replay with check functions;
|
|
491
|
+
> RLEP (Jul 2025) — blend replayed with new experiences for faster learning.
|
|
492
|
+
|
|
493
|
+
After debug resolution, record the exact steps at TWO levels:
|
|
494
|
+
|
|
495
|
+
```
|
|
496
|
+
IF status == "resolved":
|
|
497
|
+
|
|
498
|
+
## Low-Level (Exact Commands — for identical replay)
|
|
499
|
+
resolution_sequence = {
|
|
500
|
+
"preconditions": [
|
|
501
|
+
"file exists: {path}",
|
|
502
|
+
"package installed: {name}",
|
|
503
|
+
"working directory: {dir}"
|
|
504
|
+
],
|
|
505
|
+
"steps": [
|
|
506
|
+
{"type": "edit", "file": "{path}", "line": N, "old": "...", "new": "..."},
|
|
507
|
+
{"type": "bash", "command": "npm test", "expected_exit": 0}
|
|
508
|
+
],
|
|
509
|
+
"postconditions": [
|
|
510
|
+
"test passes: {test_name}",
|
|
511
|
+
"no errors in: {file}"
|
|
512
|
+
]
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
## High-Level (Narrative — for similar-but-different)
|
|
516
|
+
hindsight_narrative =
|
|
517
|
+
"When {symptom pattern}, the root cause is typically {category}.
|
|
518
|
+
Check {diagnostic step} first. The fix involves {general approach}."
|
|
519
|
+
|
|
520
|
+
Store both levels:
|
|
521
|
+
.planning/debug/resolved/{slug}-replay.json (low-level — exact steps)
|
|
522
|
+
.planning/debug/resolved/{slug}-hindsight.md (high-level — existing from Step 7.8)
|
|
523
|
+
|
|
524
|
+
Future debugging (Step 2.5) uses BOTH levels:
|
|
525
|
+
- If identical symptoms + identical preconditions → replay low-level exactly
|
|
526
|
+
- If similar symptoms + different context → adapt from high-level narrative
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### Step 7: Sabbath Rest - Context Persistence
|
|
530
|
+
|
|
531
|
+
After resolution or checkpoint, update persistent state:
|
|
532
|
+
|
|
533
|
+
```markdown
|
|
534
|
+
## .claude/dominion-flow.local.md
|
|
535
|
+
|
|
536
|
+
### Last Debug Session
|
|
537
|
+
- Issue: {slug}
|
|
538
|
+
- Status: {resolved | checkpoint | inconclusive}
|
|
539
|
+
- Root Cause: {if found}
|
|
540
|
+
- Files Changed: {list}
|
|
541
|
+
- Session: {timestamp}
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
---
|
|
545
|
+
|
|
546
|
+
## Debug File Protocol
|
|
547
|
+
|
|
548
|
+
### File Location
|
|
549
|
+
|
|
550
|
+
```
|
|
551
|
+
DEBUG_DIR=.planning/debug
|
|
552
|
+
DEBUG_RESOLVED_DIR=.planning/debug/resolved
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### File Structure
|
|
556
|
+
|
|
557
|
+
```markdown
|
|
558
|
+
---
|
|
559
|
+
status: gathering | investigating | fixing | verifying | resolved
|
|
560
|
+
trigger: "[verbatim user input]"
|
|
561
|
+
created: [ISO timestamp]
|
|
562
|
+
updated: [ISO timestamp]
|
|
563
|
+
skills_applied: []
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
## Current Focus
|
|
567
|
+
<!-- OVERWRITE on each update - reflects NOW -->
|
|
568
|
+
|
|
569
|
+
hypothesis: [current theory]
|
|
570
|
+
test: [how testing it]
|
|
571
|
+
expecting: [what result means]
|
|
572
|
+
next_action: [immediate next step]
|
|
573
|
+
|
|
574
|
+
## Symptoms
|
|
575
|
+
<!-- Written during gathering, then IMMUTABLE -->
|
|
576
|
+
|
|
577
|
+
expected: [what should happen]
|
|
578
|
+
actual: [what actually happens]
|
|
579
|
+
errors: [error messages]
|
|
580
|
+
reproduction: [how to trigger]
|
|
581
|
+
started: [when broke / always broken]
|
|
582
|
+
|
|
583
|
+
## Eliminated
|
|
584
|
+
<!-- APPEND only - prevents re-investigating -->
|
|
585
|
+
|
|
586
|
+
- hypothesis: [theory that was wrong]
|
|
587
|
+
evidence: [what disproved it]
|
|
588
|
+
timestamp: [when eliminated]
|
|
589
|
+
|
|
590
|
+
## Evidence
|
|
591
|
+
<!-- APPEND only - facts discovered -->
|
|
592
|
+
|
|
593
|
+
- timestamp: [when found]
|
|
594
|
+
checked: [what examined]
|
|
595
|
+
found: [what observed]
|
|
596
|
+
implication: [what this means]
|
|
597
|
+
|
|
598
|
+
## Resolution
|
|
599
|
+
<!-- OVERWRITE as understanding evolves -->
|
|
600
|
+
|
|
601
|
+
root_cause: [empty until found]
|
|
602
|
+
fix: [empty until applied]
|
|
603
|
+
verification: [empty until verified]
|
|
604
|
+
files_changed: []
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
---
|
|
608
|
+
|
|
609
|
+
## Completion Display
|
|
610
|
+
|
|
611
|
+
```
|
|
612
|
+
+------------------------------------------------------------------------------+
|
|
613
|
+
| POWER DEBUG COMPLETE |
|
|
614
|
+
+------------------------------------------------------------------------------+
|
|
615
|
+
| |
|
|
616
|
+
| Debug Session: .planning/debug/resolved/{slug}.md |
|
|
617
|
+
| |
|
|
618
|
+
| Root Cause: {what was wrong} |
|
|
619
|
+
| Fix Applied: {what was changed} |
|
|
620
|
+
| Verification: {how verified} |
|
|
621
|
+
| |
|
|
622
|
+
| Files Changed: |
|
|
623
|
+
| - {file1}: {change} |
|
|
624
|
+
| - {file2}: {change} |
|
|
625
|
+
| |
|
|
626
|
+
| Skills Applied: |
|
|
627
|
+
| - {skill1} |
|
|
628
|
+
| - {skill2} |
|
|
629
|
+
| |
|
|
630
|
+
| Commit: {hash} |
|
|
631
|
+
| |
|
|
632
|
+
+------------------------------------------------------------------------------+
|
|
633
|
+
| NEXT UP |
|
|
634
|
+
+------------------------------------------------------------------------------+
|
|
635
|
+
| |
|
|
636
|
+
| -> Run `/fire-4-verify` to validate the fix didn't break anything |
|
|
637
|
+
| -> Or continue with `/fire-dashboard` to check project status |
|
|
638
|
+
| |
|
|
639
|
+
+------------------------------------------------------------------------------+
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
---
|
|
643
|
+
|
|
644
|
+
## Success Criteria
|
|
645
|
+
|
|
646
|
+
- [ ] Active sessions checked
|
|
647
|
+
- [ ] Skills library searched for relevant patterns
|
|
648
|
+
- [ ] Symptoms gathered (if new)
|
|
649
|
+
- [ ] fire-debugger spawned with context
|
|
650
|
+
- [ ] Checkpoints handled correctly
|
|
651
|
+
- [ ] Root cause confirmed before fixing
|
|
652
|
+
- [ ] Reflection auto-generated after resolution (Step 7.5)
|
|
653
|
+
- [ ] Past reflections searched before investigating (Step 2.5)
|
|
654
|
+
- [ ] Sabbath Rest state updated
|
|
655
|
+
|
|
656
|
+
---
|
|
657
|
+
|
|
658
|
+
## References
|
|
659
|
+
|
|
660
|
+
- **Agent:** Uses `fire-debugger` agent (proven debug methodology)
|
|
661
|
+
- **Skills:** `@skills-library/debugging/` patterns
|
|
662
|
+
- **Protocol:** Scientific method with hypothesis testing
|
|
663
|
+
- **Brand:** `@references/ui-brand.md` - Visual output standards
|