@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.
Files changed (215) hide show
  1. package/.claude-plugin/plugin.json +64 -0
  2. package/ARCHITECTURE-DIAGRAM.md +440 -0
  3. package/COMMAND-REFERENCE.md +172 -0
  4. package/DOMINION-FLOW-OVERVIEW.md +421 -0
  5. package/LICENSE +21 -0
  6. package/QUICK-START.md +351 -0
  7. package/README.md +398 -0
  8. package/TROUBLESHOOTING.md +264 -0
  9. package/agents/fire-codebase-mapper.md +484 -0
  10. package/agents/fire-debugger.md +535 -0
  11. package/agents/fire-executor.md +949 -0
  12. package/agents/fire-fact-checker.md +276 -0
  13. package/agents/fire-learncoding-explainer.md +237 -0
  14. package/agents/fire-learncoding-walker.md +147 -0
  15. package/agents/fire-planner.md +675 -0
  16. package/agents/fire-project-researcher.md +155 -0
  17. package/agents/fire-research-synthesizer.md +166 -0
  18. package/agents/fire-researcher.md +723 -0
  19. package/agents/fire-reviewer.md +499 -0
  20. package/agents/fire-roadmapper.md +203 -0
  21. package/agents/fire-verifier.md +880 -0
  22. package/bin/cli.js +208 -0
  23. package/commands/fire-0-orient.md +476 -0
  24. package/commands/fire-1-new.md +281 -0
  25. package/commands/fire-1a-discuss.md +455 -0
  26. package/commands/fire-2-plan.md +527 -0
  27. package/commands/fire-3-execute.md +1303 -0
  28. package/commands/fire-4-verify.md +845 -0
  29. package/commands/fire-5-handoff.md +515 -0
  30. package/commands/fire-6-resume.md +501 -0
  31. package/commands/fire-7-review.md +409 -0
  32. package/commands/fire-add-new-skill.md +598 -0
  33. package/commands/fire-analytics.md +499 -0
  34. package/commands/fire-assumptions.md +78 -0
  35. package/commands/fire-autonomous.md +528 -0
  36. package/commands/fire-brainstorm.md +413 -0
  37. package/commands/fire-complete-milestone.md +270 -0
  38. package/commands/fire-dashboard.md +375 -0
  39. package/commands/fire-debug.md +663 -0
  40. package/commands/fire-discover.md +616 -0
  41. package/commands/fire-double-check.md +460 -0
  42. package/commands/fire-execute-plan.md +182 -0
  43. package/commands/fire-learncoding.md +242 -0
  44. package/commands/fire-loop-resume.md +272 -0
  45. package/commands/fire-loop-stop.md +198 -0
  46. package/commands/fire-loop.md +1168 -0
  47. package/commands/fire-map-codebase.md +313 -0
  48. package/commands/fire-new-milestone.md +356 -0
  49. package/commands/fire-reflect.md +235 -0
  50. package/commands/fire-research.md +246 -0
  51. package/commands/fire-search.md +330 -0
  52. package/commands/fire-security-audit-repo.md +293 -0
  53. package/commands/fire-security-scan.md +484 -0
  54. package/commands/fire-session-summary.md +252 -0
  55. package/commands/fire-skills-diff.md +506 -0
  56. package/commands/fire-skills-history.md +388 -0
  57. package/commands/fire-skills-rollback.md +408 -0
  58. package/commands/fire-skills-sync.md +470 -0
  59. package/commands/fire-test.md +520 -0
  60. package/commands/fire-todos.md +335 -0
  61. package/commands/fire-transition.md +186 -0
  62. package/commands/fire-update.md +312 -0
  63. package/commands/fire-verify-uat.md +146 -0
  64. package/commands/fire-vuln-scan.md +493 -0
  65. package/hooks/hooks.json +16 -0
  66. package/hooks/run-hook.cmd +69 -0
  67. package/hooks/run-hook.sh +8 -0
  68. package/hooks/run-session-end.cmd +49 -0
  69. package/hooks/run-session-end.sh +7 -0
  70. package/hooks/session-end.sh +90 -0
  71. package/hooks/session-start.sh +111 -0
  72. package/package.json +52 -0
  73. package/plugin.json +7 -0
  74. package/references/auto-skill-extraction.md +136 -0
  75. package/references/behavioral-directives.md +365 -0
  76. package/references/blocker-tracking.md +155 -0
  77. package/references/checkpoints.md +165 -0
  78. package/references/circuit-breaker.md +410 -0
  79. package/references/context-engineering.md +587 -0
  80. package/references/decision-time-guidance.md +289 -0
  81. package/references/error-classification.md +326 -0
  82. package/references/execution-mode-intelligence.md +242 -0
  83. package/references/git-integration.md +217 -0
  84. package/references/honesty-protocols.md +304 -0
  85. package/references/integration-architecture.md +470 -0
  86. package/references/issue-to-pr-pipeline.md +150 -0
  87. package/references/metrics-and-trends.md +234 -0
  88. package/references/playwright-e2e-testing.md +326 -0
  89. package/references/questioning.md +125 -0
  90. package/references/research-improvements.md +110 -0
  91. package/references/skills-usage-guide.md +429 -0
  92. package/references/tdd.md +131 -0
  93. package/references/testing-enforcement.md +192 -0
  94. package/references/ui-brand.md +383 -0
  95. package/references/validation-checklist.md +456 -0
  96. package/references/verification-patterns.md +187 -0
  97. package/references/warrior-principles.md +173 -0
  98. package/skills-library/SKILLS-INDEX.md +588 -0
  99. package/skills-library/_general/frontend/html-visual-reports.md +292 -0
  100. package/skills-library/_general/methodology/debug-swarm-researcher-escape-hatch.md +240 -0
  101. package/skills-library/_general/methodology/learncoding-agentic-pattern.md +114 -0
  102. package/skills-library/_general/methodology/shell-autonomous-loop-fixplan.md +238 -0
  103. package/skills-library/basics/api-rest-basics.md +162 -0
  104. package/skills-library/basics/env-variables.md +96 -0
  105. package/skills-library/basics/error-handling-basics.md +125 -0
  106. package/skills-library/basics/git-commit-conventions.md +106 -0
  107. package/skills-library/basics/readme-template.md +108 -0
  108. package/skills-library/common-tasks/async-await-patterns.md +157 -0
  109. package/skills-library/common-tasks/auth-jwt-basics.md +164 -0
  110. package/skills-library/common-tasks/database-schema-design.md +166 -0
  111. package/skills-library/common-tasks/file-upload-basics.md +166 -0
  112. package/skills-library/common-tasks/form-validation.md +159 -0
  113. package/skills-library/debugging/FAILURE_TAXONOMY_CLASSIFICATION.md +117 -0
  114. package/skills-library/debugging/THREE_AGENT_HYPOTHESIS_DEBUGGING.md +86 -0
  115. package/skills-library/methodology/BREATH_BASED_PARALLEL_EXECUTION.md +678 -0
  116. package/skills-library/methodology/CONFIDENCE_GATED_EXECUTION.md +243 -0
  117. package/skills-library/methodology/EVIDENCE_BASED_VALIDATION.md +308 -0
  118. package/skills-library/methodology/MULTI_PERSPECTIVE_CODE_REVIEW.md +330 -0
  119. package/skills-library/methodology/PATH_VERIFICATION_GATE.md +211 -0
  120. package/skills-library/methodology/REFLEXION_MEMORY_PATTERN.md +183 -0
  121. package/skills-library/methodology/RESEARCH_BACKED_WORKFLOW_UPGRADE.md +263 -0
  122. package/skills-library/methodology/SABBATH_REST_PATTERN.md +267 -0
  123. package/skills-library/methodology/STONE_AND_SCAFFOLD.md +220 -0
  124. package/skills-library/performance/cache-augmented-generation.md +172 -0
  125. package/skills-library/quality-safety/debugging-steps.md +147 -0
  126. package/skills-library/quality-safety/deployment-checklist.md +155 -0
  127. package/skills-library/quality-safety/security-checklist.md +204 -0
  128. package/skills-library/quality-safety/testing-basics.md +180 -0
  129. package/skills-library/security/agent-security-scanner.md +445 -0
  130. package/skills-library/specialists/api-architecture/api-designer.md +49 -0
  131. package/skills-library/specialists/api-architecture/graphql-architect.md +49 -0
  132. package/skills-library/specialists/api-architecture/mcp-developer.md +51 -0
  133. package/skills-library/specialists/api-architecture/microservices-architect.md +50 -0
  134. package/skills-library/specialists/api-architecture/websocket-engineer.md +48 -0
  135. package/skills-library/specialists/backend/django-expert.md +52 -0
  136. package/skills-library/specialists/backend/fastapi-expert.md +52 -0
  137. package/skills-library/specialists/backend/laravel-specialist.md +52 -0
  138. package/skills-library/specialists/backend/nestjs-expert.md +51 -0
  139. package/skills-library/specialists/backend/rails-expert.md +53 -0
  140. package/skills-library/specialists/backend/spring-boot-engineer.md +56 -0
  141. package/skills-library/specialists/data-ml/fine-tuning-expert.md +48 -0
  142. package/skills-library/specialists/data-ml/ml-pipeline.md +47 -0
  143. package/skills-library/specialists/data-ml/pandas-pro.md +47 -0
  144. package/skills-library/specialists/data-ml/rag-architect.md +51 -0
  145. package/skills-library/specialists/data-ml/spark-engineer.md +47 -0
  146. package/skills-library/specialists/frontend/angular-architect.md +52 -0
  147. package/skills-library/specialists/frontend/flutter-expert.md +51 -0
  148. package/skills-library/specialists/frontend/nextjs-developer.md +54 -0
  149. package/skills-library/specialists/frontend/react-native-expert.md +50 -0
  150. package/skills-library/specialists/frontend/vue-expert.md +51 -0
  151. package/skills-library/specialists/infrastructure/chaos-engineer.md +74 -0
  152. package/skills-library/specialists/infrastructure/cloud-architect.md +70 -0
  153. package/skills-library/specialists/infrastructure/database-optimizer.md +64 -0
  154. package/skills-library/specialists/infrastructure/devops-engineer.md +70 -0
  155. package/skills-library/specialists/infrastructure/kubernetes-specialist.md +52 -0
  156. package/skills-library/specialists/infrastructure/monitoring-expert.md +70 -0
  157. package/skills-library/specialists/infrastructure/sre-engineer.md +70 -0
  158. package/skills-library/specialists/infrastructure/terraform-engineer.md +51 -0
  159. package/skills-library/specialists/languages/cpp-pro.md +74 -0
  160. package/skills-library/specialists/languages/csharp-developer.md +69 -0
  161. package/skills-library/specialists/languages/dotnet-core-expert.md +54 -0
  162. package/skills-library/specialists/languages/golang-pro.md +51 -0
  163. package/skills-library/specialists/languages/java-architect.md +49 -0
  164. package/skills-library/specialists/languages/javascript-pro.md +68 -0
  165. package/skills-library/specialists/languages/kotlin-specialist.md +68 -0
  166. package/skills-library/specialists/languages/php-pro.md +49 -0
  167. package/skills-library/specialists/languages/python-pro.md +52 -0
  168. package/skills-library/specialists/languages/react-expert.md +51 -0
  169. package/skills-library/specialists/languages/rust-engineer.md +50 -0
  170. package/skills-library/specialists/languages/sql-pro.md +56 -0
  171. package/skills-library/specialists/languages/swift-expert.md +69 -0
  172. package/skills-library/specialists/languages/typescript-pro.md +51 -0
  173. package/skills-library/specialists/platform/atlassian-mcp.md +52 -0
  174. package/skills-library/specialists/platform/embedded-systems.md +53 -0
  175. package/skills-library/specialists/platform/game-developer.md +53 -0
  176. package/skills-library/specialists/platform/salesforce-developer.md +53 -0
  177. package/skills-library/specialists/platform/shopify-expert.md +49 -0
  178. package/skills-library/specialists/platform/wordpress-pro.md +49 -0
  179. package/skills-library/specialists/quality/code-documenter.md +51 -0
  180. package/skills-library/specialists/quality/code-reviewer.md +67 -0
  181. package/skills-library/specialists/quality/debugging-wizard.md +51 -0
  182. package/skills-library/specialists/quality/fullstack-guardian.md +51 -0
  183. package/skills-library/specialists/quality/legacy-modernizer.md +50 -0
  184. package/skills-library/specialists/quality/playwright-expert.md +65 -0
  185. package/skills-library/specialists/quality/spec-miner.md +56 -0
  186. package/skills-library/specialists/quality/test-master.md +65 -0
  187. package/skills-library/specialists/security/secure-code-guardian.md +55 -0
  188. package/skills-library/specialists/security/security-reviewer.md +53 -0
  189. package/skills-library/specialists/workflow/architecture-designer.md +53 -0
  190. package/skills-library/specialists/workflow/cli-developer.md +70 -0
  191. package/skills-library/specialists/workflow/feature-forge.md +65 -0
  192. package/skills-library/specialists/workflow/prompt-engineer.md +54 -0
  193. package/skills-library/specialists/workflow/the-fool.md +62 -0
  194. package/templates/ASSUMPTIONS.md +125 -0
  195. package/templates/BLOCKERS.md +73 -0
  196. package/templates/DECISION_LOG.md +116 -0
  197. package/templates/UAT.md +96 -0
  198. package/templates/blueprint.md +94 -0
  199. package/templates/brainstorm.md +185 -0
  200. package/templates/conscience.md +92 -0
  201. package/templates/fire-handoff.md +159 -0
  202. package/templates/metrics.md +67 -0
  203. package/templates/phase-prompt.md +142 -0
  204. package/templates/record.md +131 -0
  205. package/templates/review-report.md +117 -0
  206. package/templates/skills-index.md +157 -0
  207. package/templates/verification.md +149 -0
  208. package/templates/vision.md +79 -0
  209. package/validation-config.yml +793 -0
  210. package/version.json +7 -0
  211. package/workflows/execute-phase.md +732 -0
  212. package/workflows/handoff-session.md +678 -0
  213. package/workflows/new-project.md +578 -0
  214. package/workflows/plan-phase.md +592 -0
  215. package/workflows/verify-phase.md +874 -0
@@ -0,0 +1,234 @@
1
+ # Bottleneck Detection & Trend Analysis
2
+
3
+ ## Overview
4
+
5
+ Tracks execution performance across phases and plans to identify bottlenecks, predict durations, and surface improvement opportunities.
6
+
7
+ ## Metrics Collection Points
8
+
9
+ ### Per-Plan Metrics (collected in RECORD.md frontmatter)
10
+
11
+ ```yaml
12
+ ---
13
+ metrics:
14
+ duration_minutes: 12
15
+ tasks_completed: 4
16
+ tasks_blocked: 0
17
+ files_created: 3
18
+ files_modified: 5
19
+ lines_added: 245
20
+ lines_removed: 30
21
+ tests_added: 6
22
+ test_coverage_delta: "+3%"
23
+ skills_applied: 2
24
+ honesty_checkpoints: 1
25
+ commits: 4
26
+ blocker_count: 0
27
+ ---
28
+ ```
29
+
30
+ ### Per-Phase Metrics (aggregated in CONSCIENCE.md)
31
+
32
+ ```yaml
33
+ ## Phase Metrics
34
+ | Phase | Plans | Duration | Avg/Plan | Trend | Bottleneck |
35
+ |-------|-------|----------|----------|-------|------------|
36
+ | 3 | 4 | 45m | 11m | - | None |
37
+ | 3.1 | 3 | 35m | 12m | +8% | Breath 3 |
38
+ | 3.2 | 3 | 28m | 9m | -25% | None |
39
+ | 3.4 | 6 | 72m | 12m | +33% | Plan 05 |
40
+ ```
41
+
42
+ ### Per-Milestone Metrics (in MILESTONES.md)
43
+
44
+ ```yaml
45
+ ## Milestone: v1.0 LMS Core
46
+ - Total phases: 12
47
+ - Total plans: 49
48
+ - Total duration: ~430m (~7.2 hours)
49
+ - Average phase: 36m
50
+ - Average plan: 8.8m
51
+ - Longest phase: Phase 3.4 (72m, 6 plans)
52
+ - Shortest phase: Phase 3.2 (28m, 3 plans)
53
+ - Blocker rate: 2/49 plans (4%)
54
+ - Skill reuse rate: 35% (skills applied from library vs new)
55
+ ```
56
+
57
+ ### Per-Iteration Turn Rewards (v6.0 — AgentPRM)
58
+
59
+ > **Research basis:** AgentPRM (Feb 2025) — Process reward models score each turn,
60
+ > enabling fine-grained learning signals beyond binary success/fail.
61
+
62
+ ```yaml
63
+ ## Turn-Level Metrics (collected in dominion-flow.local.md per loop session)
64
+ iteration_rewards:
65
+ - iteration: 1
66
+ reward: 4.2
67
+ task: "fix auth bug in login controller"
68
+ completion: 5 # task fully completed first try
69
+ quality: 4 # 1 retry needed
70
+ efficiency: 4 # ~25k tokens used
71
+
72
+ - iteration: 2
73
+ reward: 2.1
74
+ task: "add input validation to API"
75
+ completion: 3 # partial completion
76
+ quality: 2 # 3 retries needed
77
+ efficiency: 2 # ~60k tokens used
78
+
79
+ session_summary:
80
+ total_iterations: 5
81
+ average_reward: 3.4
82
+ lowest_reward: {iteration: 2, reward: 2.1, task: "add input validation"}
83
+ highest_reward: {iteration: 4, reward: 4.8, task: "update test fixtures"}
84
+ reward_trend: "stable" # improving | stable | declining
85
+ ```
86
+
87
+ **Reward Formula:**
88
+ ```
89
+ turn_reward = (0.5 * task_completion) + (0.3 * approach_quality) + (0.2 * context_efficiency)
90
+
91
+ task_completion: 0-5 (5=complete, 0=no progress)
92
+ approach_quality: 0-5 (5=first try success, 1=4+ retries)
93
+ context_efficiency: 0-5 (5=<20k tokens, 1=>80k tokens)
94
+ ```
95
+
96
+ **Downstream Uses:**
97
+ 1. **Handoff:** Session average reward stored in WARRIOR handoff for cross-session trending
98
+ 2. **Skill pre-loading:** Low-reward task types trigger proactive skill search on next occurrence
99
+ 3. **Approach rotation:** Declining reward trend triggers earlier rotation in Step 9 classification
100
+ 4. **Episodic recall boost:** When similar task type found in memory, inject reward context:
101
+ "Previous sessions scored {avg_reward} on {task_type}. Common issue: {lowest_reward_task}"
102
+
103
+ ---
104
+
105
+ ## Bottleneck Detection Algorithm
106
+
107
+ ### What Constitutes a Bottleneck
108
+
109
+ A plan or phase is flagged as a bottleneck when:
110
+
111
+ 1. **Duration Outlier:** Plan takes >2x the average duration for its phase
112
+ 2. **Blocker Rate:** >20% of tasks in a plan are blocked
113
+ 3. **Rework Rate:** Plan requires >1 verification cycle (failed then re-executed)
114
+ 4. **Dependency Chain:** Plan blocks 2+ downstream plans
115
+ 5. **Complexity Spike:** Lines changed >3x average for similar plans
116
+
117
+ ### Detection Rules
118
+
119
+ ```
120
+ RULE 1: Slow Plan
121
+ IF plan.duration > (phase.avg_plan_duration * 2)
122
+ THEN flag as BOTTLENECK:SLOW
123
+ SUGGEST: Break into smaller plans, check for missing skills
124
+
125
+ RULE 2: Blocked Plan
126
+ IF plan.tasks_blocked > (plan.tasks_total * 0.2)
127
+ THEN flag as BOTTLENECK:BLOCKED
128
+ SUGGEST: Review dependencies, check BLOCKERS.md, missing prerequisites
129
+
130
+ RULE 3: Failed Verification
131
+ IF plan.verification_attempts > 1
132
+ THEN flag as BOTTLENECK:QUALITY
133
+ SUGGEST: Add more specific must-haves, improve assumption validation
134
+
135
+ RULE 4: Fan-Out Blocker
136
+ IF plan.blocks_count >= 2
137
+ THEN flag as BOTTLENECK:CRITICAL_PATH
138
+ SUGGEST: Prioritize this plan, consider breaking dependencies
139
+
140
+ RULE 5: Complexity Spike
141
+ IF plan.lines_changed > (phase.avg_lines * 3)
142
+ THEN flag as BOTTLENECK:COMPLEXITY
143
+ SUGGEST: Split into sub-plans, review scope creep
144
+ ```
145
+
146
+ ### Output Format
147
+
148
+ After each phase completion, `/fire-transition` outputs:
149
+
150
+ ```markdown
151
+ ## Bottleneck Report
152
+
153
+ ### Flagged Plans
154
+ | Plan | Flag | Duration | Detail | Suggestion |
155
+ |------|------|----------|--------|------------|
156
+ | 03.4-05 | SLOW | 18m (avg: 12m) | Frontend + testing | Break integration tests into separate plan |
157
+ | 03.4-04 | COMPLEXITY | 380 lines (avg: 120) | Multiple components | Consider splitting UI into sub-plans |
158
+
159
+ ### Phase Health Score
160
+ - Speed: 7/10 (2 plans exceeded 1.5x average)
161
+ - Quality: 9/10 (all verifications passed first attempt)
162
+ - Efficiency: 8/10 (35% skill reuse, 2 new skills discovered)
163
+ - Overall: 8/10
164
+ ```
165
+
166
+ ## Trend Analysis
167
+
168
+ ### What Trends Are Tracked
169
+
170
+ 1. **Duration Trend:** Are plans getting faster or slower over time?
171
+ 2. **Quality Trend:** Are verification pass rates improving?
172
+ 3. **Skill Reuse Trend:** Is the skills library being used more effectively?
173
+ 4. **Blocker Trend:** Are blockers decreasing over time?
174
+ 5. **Complexity Trend:** Is plan complexity stable or growing?
175
+
176
+ ### Trend Calculation
177
+
178
+ ```
179
+ For each metric across last 5 phases:
180
+ values = [phase_N-4, phase_N-3, phase_N-2, phase_N-1, phase_N]
181
+ trend = linear_regression_slope(values)
182
+
183
+ IF trend > +10%: "Increasing" (bad for duration/blockers, good for skill reuse)
184
+ IF trend < -10%: "Decreasing" (good for duration/blockers, bad for quality)
185
+ ELSE: "Stable"
186
+ ```
187
+
188
+ ### Trend Dashboard (in CONSCIENCE.md)
189
+
190
+ ```markdown
191
+ ## Trends (Last 5 Phases)
192
+
193
+ | Metric | P3 | P3.1 | P3.2 | P3.3 | P3.4 | Trend |
194
+ |--------|-----|------|------|------|------|-------|
195
+ | Avg Plan Duration | 11m | 12m | 9m | 10m | 12m | Stable |
196
+ | Verification Pass Rate | 100% | 100% | 100% | 100% | 100% | Stable |
197
+ | Skill Reuse | 20% | 25% | 30% | 35% | 35% | Improving |
198
+ | Blocker Rate | 10% | 5% | 0% | 0% | 0% | Improving |
199
+ | Lines/Plan | 150 | 120 | 100 | 180 | 145 | Stable |
200
+
201
+ Overall Trajectory: POSITIVE (efficiency improving, blockers decreasing)
202
+ ```
203
+
204
+ ## Integration Points
205
+
206
+ ### Where Metrics Are Collected
207
+
208
+ 1. **RECORD.md frontmatter** — Plan-level metrics (written by executor agent)
209
+ 2. **CONSCIENCE.md** — Phase-level aggregations (written by transition command)
210
+ 3. **MILESTONES.md** — Milestone-level summaries (written by complete-milestone)
211
+ 4. **BLOCKERS.md** — Blocker frequency tracking
212
+
213
+ ### Where Metrics Are Displayed
214
+
215
+ 1. **`/fire-dashboard`** — Visual project health dashboard
216
+ 2. **`/fire-transition`** — Post-phase bottleneck report
217
+ 3. **`/fire-analytics`** — Historical trend analysis
218
+ 4. **CONSCIENCE.md** — Always-visible trend table
219
+
220
+ ### Automated Actions
221
+
222
+ ```
223
+ IF blocker_trend == "Increasing" for 3+ phases:
224
+ SUGGEST: "Blocker rate rising. Consider: assumption validation before planning,
225
+ dependency review, breaking phases into smaller chunks."
226
+
227
+ IF duration_trend == "Increasing" for 3+ phases:
228
+ SUGGEST: "Plans taking longer. Consider: scope reduction, better skill reuse,
229
+ splitting complex plans, more parallel breaths."
230
+
231
+ IF skill_reuse < 20% for 3+ phases:
232
+ SUGGEST: "Low skill reuse. Consider: /fire-search before implementation,
233
+ adding auto-skill extraction markers, reviewing skills index."
234
+ ```
@@ -0,0 +1,326 @@
1
+ # Playwright E2E Testing Reference
2
+
3
+ > Patterns, setup, and integration guide for Playwright E2E testing in Dominion Flow
4
+
5
+ ---
6
+
7
+ ## Quick Reference
8
+
9
+ ```
10
+ Tool: Playwright (https://playwright.dev)
11
+ Config: playwright.config.ts
12
+ Test Dir: tests/e2e/ or e2e/
13
+ Run: npx playwright test
14
+ Report: npx playwright show-report
15
+ Debug: npx playwright test --ui
16
+ ```
17
+
18
+ ---
19
+
20
+ ## Setup
21
+
22
+ ### Initial Installation
23
+
24
+ ```bash
25
+ # Install Playwright
26
+ npm init playwright@latest
27
+
28
+ # Or add to existing project
29
+ npm install -D @playwright/test
30
+
31
+ # Install browsers
32
+ npx playwright install
33
+ ```
34
+
35
+ ### Recommended Config (playwright.config.ts)
36
+
37
+ ```typescript
38
+ import { defineConfig, devices } from '@playwright/test';
39
+
40
+ export default defineConfig({
41
+ testDir: './tests/e2e',
42
+ fullyParallel: true,
43
+ forbidOnly: !!process.env.CI,
44
+ retries: process.env.CI ? 2 : 0,
45
+ workers: process.env.CI ? 1 : undefined,
46
+ reporter: [
47
+ ['html'],
48
+ ['list'],
49
+ ...(process.env.CI ? [['github'] as const] : []),
50
+ ],
51
+ use: {
52
+ baseURL: process.env.BASE_URL || 'http://localhost:3000',
53
+ trace: 'on-first-retry',
54
+ screenshot: 'only-on-failure',
55
+ },
56
+ projects: [
57
+ {
58
+ name: 'chromium',
59
+ use: { ...devices['Desktop Chrome'] },
60
+ },
61
+ {
62
+ name: 'firefox',
63
+ use: { ...devices['Desktop Firefox'] },
64
+ },
65
+ {
66
+ name: 'mobile-chrome',
67
+ use: { ...devices['Pixel 5'] },
68
+ },
69
+ ],
70
+ webServer: {
71
+ command: 'npm run dev',
72
+ url: 'http://localhost:3000',
73
+ reuseExistingServer: !process.env.CI,
74
+ timeout: 120 * 1000,
75
+ },
76
+ });
77
+ ```
78
+
79
+ ### Package.json Scripts
80
+
81
+ ```json
82
+ {
83
+ "scripts": {
84
+ "test:e2e": "playwright test",
85
+ "test:e2e:ui": "playwright test --ui",
86
+ "test:e2e:headed": "playwright test --headed",
87
+ "test:e2e:debug": "playwright test --debug",
88
+ "test:e2e:report": "playwright show-report",
89
+ "test:e2e:update-snapshots": "playwright test --update-snapshots"
90
+ }
91
+ }
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Test Patterns
97
+
98
+ ### Page Object Model
99
+
100
+ ```typescript
101
+ // tests/e2e/pages/login.page.ts
102
+ import { type Page, type Locator } from '@playwright/test';
103
+
104
+ export class LoginPage {
105
+ readonly page: Page;
106
+ readonly emailInput: Locator;
107
+ readonly passwordInput: Locator;
108
+ readonly submitButton: Locator;
109
+ readonly errorMessage: Locator;
110
+
111
+ constructor(page: Page) {
112
+ this.page = page;
113
+ this.emailInput = page.getByTestId('email');
114
+ this.passwordInput = page.getByTestId('password');
115
+ this.submitButton = page.getByRole('button', { name: 'Sign In' });
116
+ this.errorMessage = page.getByTestId('error-message');
117
+ }
118
+
119
+ async goto() {
120
+ await this.page.goto('/login');
121
+ }
122
+
123
+ async login(email: string, password: string) {
124
+ await this.emailInput.fill(email);
125
+ await this.passwordInput.fill(password);
126
+ await this.submitButton.click();
127
+ }
128
+ }
129
+ ```
130
+
131
+ ### Authentication Setup
132
+
133
+ ```typescript
134
+ // tests/e2e/auth.setup.ts
135
+ import { test as setup, expect } from '@playwright/test';
136
+
137
+ const authFile = 'tests/e2e/.auth/user.json';
138
+
139
+ setup('authenticate as user', async ({ page }) => {
140
+ await page.goto('/login');
141
+ await page.getByTestId('email').fill('test@example.com');
142
+ await page.getByTestId('password').fill('testpassword');
143
+ await page.getByRole('button', { name: 'Sign In' }).click();
144
+ await page.waitForURL('/dashboard');
145
+ await page.context().storageState({ path: authFile });
146
+ });
147
+ ```
148
+
149
+ ### CRUD Flow Pattern
150
+
151
+ ```typescript
152
+ // tests/e2e/crud-feature.spec.ts
153
+ import { test, expect } from '@playwright/test';
154
+
155
+ test.describe('Feature CRUD', () => {
156
+ test('create item', async ({ page }) => {
157
+ await page.goto('/items/new');
158
+ await page.getByLabel('Name').fill('Test Item');
159
+ await page.getByRole('button', { name: 'Create' }).click();
160
+ await expect(page.getByText('Item created')).toBeVisible();
161
+ });
162
+
163
+ test('read item', async ({ page }) => {
164
+ await page.goto('/items');
165
+ await expect(page.getByText('Test Item')).toBeVisible();
166
+ });
167
+
168
+ test('update item', async ({ page }) => {
169
+ await page.goto('/items/1/edit');
170
+ await page.getByLabel('Name').fill('Updated Item');
171
+ await page.getByRole('button', { name: 'Save' }).click();
172
+ await expect(page.getByText('Item updated')).toBeVisible();
173
+ });
174
+
175
+ test('delete item', async ({ page }) => {
176
+ await page.goto('/items');
177
+ await page.getByRole('button', { name: 'Delete' }).click();
178
+ await page.getByRole('button', { name: 'Confirm' }).click();
179
+ await expect(page.getByText('Test Item')).not.toBeVisible();
180
+ });
181
+ });
182
+ ```
183
+
184
+ ### API Response Validation
185
+
186
+ ```typescript
187
+ test('form submission calls correct API', async ({ page }) => {
188
+ const responsePromise = page.waitForResponse(
189
+ (resp) => resp.url().includes('/api/items') && resp.request().method() === 'POST'
190
+ );
191
+
192
+ await page.goto('/items/new');
193
+ await page.getByLabel('Name').fill('Test');
194
+ await page.getByRole('button', { name: 'Create' }).click();
195
+
196
+ const response = await responsePromise;
197
+ expect(response.status()).toBe(201);
198
+ const body = await response.json();
199
+ expect(body.name).toBe('Test');
200
+ });
201
+ ```
202
+
203
+ ### Visual Regression
204
+
205
+ ```typescript
206
+ test('dashboard renders correctly', async ({ page }) => {
207
+ await page.goto('/dashboard');
208
+ await expect(page).toHaveScreenshot('dashboard.png', {
209
+ maxDiffPixels: 100,
210
+ });
211
+ });
212
+ ```
213
+
214
+ ### Network Mocking
215
+
216
+ ```typescript
217
+ test('handles API error gracefully', async ({ page }) => {
218
+ await page.route('**/api/items', (route) =>
219
+ route.fulfill({ status: 500, body: 'Server Error' })
220
+ );
221
+ await page.goto('/items');
222
+ await expect(page.getByText('Something went wrong')).toBeVisible();
223
+ });
224
+ ```
225
+
226
+ ---
227
+
228
+ ## Integration with Claude Code Playwright MCP
229
+
230
+ When running interactive E2E testing during Dominion Flow execution, the Playwright MCP tools provide direct browser control:
231
+
232
+ ### Available MCP Tools
233
+
234
+ | Tool | Use For |
235
+ |------|---------|
236
+ | `browser_navigate` | Go to pages |
237
+ | `browser_snapshot` | Capture accessibility tree (best for assertions) |
238
+ | `browser_click` | Click elements by ref |
239
+ | `browser_fill_form` | Fill form fields |
240
+ | `browser_type` | Type text into elements |
241
+ | `browser_take_screenshot` | Visual captures |
242
+ | `browser_console_messages` | Check for JS errors |
243
+ | `browser_network_requests` | Validate API calls |
244
+ | `browser_evaluate` | Run JS in browser |
245
+ | `browser_wait_for` | Wait for text/conditions |
246
+
247
+ ### MCP Testing Pattern
248
+
249
+ ```
250
+ 1. browser_navigate -> page URL
251
+ 2. browser_snapshot -> get element refs
252
+ 3. browser_fill_form -> fill inputs
253
+ 4. browser_click -> submit
254
+ 5. browser_wait_for -> expected text
255
+ 6. browser_snapshot -> verify result
256
+ 7. browser_console_messages -> check errors
257
+ 8. browser_take_screenshot -> visual evidence
258
+ ```
259
+
260
+ ---
261
+
262
+ ## Dominion Flow Integration Points
263
+
264
+ ### In /fire-3-execute (Step 8)
265
+
266
+ After all breath implementation completes:
267
+ 1. Detect existing `playwright.config.ts`
268
+ 2. Run `npx playwright test`
269
+ 3. If no tests exist for new features, write them
270
+ 4. Report results before spawning verifier
271
+
272
+ ### In /fire-4-verify (E2E Category)
273
+
274
+ 10-point E2E validation checklist:
275
+ - E2E-1: Playwright installed
276
+ - E2E-2: Browsers installed
277
+ - E2E-3: Critical flows covered
278
+ - E2E-4: All tests pass
279
+ - E2E-5: Cross-browser
280
+ - E2E-6: Mobile viewport
281
+ - E2E-7: API assertions
282
+ - E2E-8: Visual baselines
283
+ - E2E-9: Test isolation
284
+ - E2E-10: No console errors
285
+
286
+ ### In fire-executor Agent (Step 6)
287
+
288
+ Executor runs Playwright after task implementation:
289
+ 1. Check for existing E2E test files
290
+ 2. Run full suite
291
+ 3. Write new tests if missing for new features
292
+ 4. Report results in handoff
293
+
294
+ ### In fire-verifier Agent (Section 3.7)
295
+
296
+ Verifier validates E2E coverage and results:
297
+ - Run `npx playwright test` with reporter
298
+ - Check test count vs feature count
299
+ - Verify cross-browser results
300
+ - Score 0-10 points
301
+
302
+ ---
303
+
304
+ ## Flags
305
+
306
+ | Flag | Purpose |
307
+ |------|---------|
308
+ | `--skip-e2e` | Skip E2E testing step in `/fire-3-execute` |
309
+ | `--e2e-only` | Run only E2E tests without re-executing implementation |
310
+
311
+ ---
312
+
313
+ ## Best Practices
314
+
315
+ 1. **Use data-testid attributes** - Don't rely on CSS classes or text that changes
316
+ 2. **Test user flows, not implementation** - E2E tests should mirror real user behavior
317
+ 3. **Keep tests independent** - Each test should set up its own state
318
+ 4. **Use auth setup** - Share auth state via storage state, not repeated logins
319
+ 5. **Retry on CI only** - Local tests should fail fast for fast feedback
320
+ 6. **Trace on failure** - Enable trace recording for debugging failed CI tests
321
+ 7. **Parallel by default** - Let Playwright parallelize for speed
322
+ 8. **Mobile-first** - Include mobile viewport in default projects
323
+
324
+ ---
325
+
326
+ *Added to Dominion Flow v3.0 - Playwright E2E Testing Integration (2026-02-10)*
@@ -0,0 +1,125 @@
1
+ # Dominion Flow Questioning Reference
2
+
3
+ > **Origin:** Ported from Dominion Flow `questioning.md` with SDLC-aware questioning additions.
4
+
5
+ ## Philosophy
6
+
7
+ **You are a thinking partner, not an interviewer.** The user often has a fuzzy idea. Your job is to help them sharpen it. Ask questions that make them think "oh, I hadn't considered that" or "yes, that's exactly what I mean."
8
+
9
+ ---
10
+
11
+ ## The Goal
12
+
13
+ By the end of questioning, you need enough clarity to write a PROJECT.md:
14
+
15
+ - **Research:** What domain to research, what unknowns exist
16
+ - **Requirements:** Clear enough vision to scope v1 features
17
+ - **Roadmap:** Clear enough to decompose into phases
18
+ - **Testing:** Which flows are critical and require mandatory testing
19
+ - **Branch strategy:** Project complexity determines Git Flow depth
20
+ - **Blocker risks:** Known technical risks that might become blockers
21
+
22
+ ---
23
+
24
+ ## How to Question
25
+
26
+ - **Start open.** Let them dump their mental model.
27
+ - **Follow energy.** Whatever they emphasized, dig into that.
28
+ - **Challenge vagueness.** "Good" means what? "Users" means who?
29
+ - **Make abstract concrete.** "Walk me through using this."
30
+ - **Surface critical flows early.** Payment, auth, data mutation.
31
+ - **Know when to stop.** Offer to proceed when you understand enough.
32
+
33
+ ---
34
+
35
+ ## Question Types
36
+
37
+ ### Motivation
38
+ - "What prompted this?"
39
+ - "What are you doing today that this replaces?"
40
+
41
+ ### Concreteness
42
+ - "Walk me through using this"
43
+ - "Give me an example"
44
+
45
+ ### Clarification
46
+ - "When you say Z, do you mean A or B?"
47
+
48
+ ### Success
49
+ - "How will you know this is working?"
50
+ - "What does done look like?"
51
+
52
+ ### Critical Flows (Dominion Flow)
53
+ - "Is there any payment or billing involved?"
54
+ - "How do users log in?"
55
+ - "What data can users create, edit, or delete?"
56
+ - "What happens if [critical action] fails halfway?"
57
+
58
+ ### Technical Risks (Dominion Flow)
59
+ - "Have you tried building this before? What went wrong?"
60
+ - "Any third-party services this depends on?"
61
+ - "Is there existing code or data we need to work with?"
62
+
63
+ ### Deployment Context (Dominion Flow)
64
+ - "Where does this need to be deployed?"
65
+ - "Any existing infrastructure?"
66
+
67
+ ---
68
+
69
+ ## Context Checklist
70
+
71
+ Check these mentally as you go:
72
+
73
+ ### Core
74
+ - [ ] What they are building (concrete enough to explain)
75
+ - [ ] Why it needs to exist (the problem driving it)
76
+ - [ ] Who it is for
77
+ - [ ] What "done" looks like
78
+
79
+ ### SDLC Awareness (Dominion Flow)
80
+ - [ ] Critical flows identified (payment, auth, data mutation)
81
+ - [ ] Known technical risks surfaced
82
+ - [ ] Third-party dependencies listed
83
+ - [ ] Deployment target understood
84
+ - [ ] Data sensitivity level (PII, financial, public)
85
+
86
+ ---
87
+
88
+ ## Decision Gate
89
+
90
+ When you could write a clear PROJECT.md, offer to proceed:
91
+
92
+ - header: "Ready?"
93
+ - question: "I think I understand what you are after. Ready to create PROJECT.md?"
94
+ - options: ["Create PROJECT.md", "Keep exploring"]
95
+
96
+ ---
97
+
98
+ ## Dominion Flow PROJECT.md Additions
99
+
100
+ ```markdown
101
+ ## Critical Flows (Mandatory Testing)
102
+ - [ ] [Flow 1]: requires [unit/integration/e2e] tests
103
+ - [ ] [Flow 2]: requires [unit/integration/e2e] tests
104
+
105
+ ## Known Risks
106
+ | Risk | Severity | Mitigation |
107
+ |------|----------|------------|
108
+ | [Risk 1] | High | [Plan] |
109
+
110
+ ## Third-Party Dependencies
111
+ | Service | Purpose | Fallback |
112
+ |---------|---------|----------|
113
+ | [Service] | [Why] | [If unavailable] |
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Anti-Patterns
119
+
120
+ - Checklist walking (going through domains regardless of context)
121
+ - Corporate speak ("Who are your stakeholders?" for solo project)
122
+ - Interrogation (firing questions without building on answers)
123
+ - Shallow acceptance (taking vague answers without probing)
124
+ - Skipping critical flows (not asking about payment/auth/mutations)
125
+ - Asking about user's technical experience (Claude builds, not the user)