agentic-qe 3.7.16 → 3.7.17

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 (280) hide show
  1. package/.claude/agents/v3/qe-devils-advocate.md +20 -0
  2. package/.claude/agents/v3/qe-gap-detector.md +25 -0
  3. package/.claude/agents/v3/qe-quality-gate.md +8 -0
  4. package/.claude/agents/v3/qe-requirements-validator.md +25 -0
  5. package/.claude/agents/v3/subagents/qe-code-reviewer.md +11 -0
  6. package/.claude/agents/v3/subagents/qe-integration-reviewer.md +11 -0
  7. package/.claude/agents/v3/subagents/qe-performance-reviewer.md +11 -0
  8. package/.claude/agents/v3/subagents/qe-security-reviewer.md +11 -0
  9. package/.claude/helpers/adr-compliance.sh +10 -10
  10. package/.claude/helpers/auto-memory-hook.mjs +24 -9
  11. package/.claude/helpers/brain-checkpoint.cjs +55 -145
  12. package/.claude/helpers/ddd-tracker.sh +2 -2
  13. package/.claude/helpers/guidance-hooks.sh +2 -2
  14. package/.claude/helpers/hook-handler.cjs +57 -18
  15. package/.claude/helpers/statusline.cjs +414 -595
  16. package/.claude/helpers/v3/quality-criteria/evidence-classification.md +116 -116
  17. package/.claude/helpers/v3/quality-criteria/htsm-categories.md +139 -139
  18. package/.claude/skills/README.md +8 -11
  19. package/.claude/skills/brutal-honesty-review/SKILL.md +3 -0
  20. package/.claude/skills/code-review-quality/SKILL.md +3 -0
  21. package/.claude/skills/qcsd-cicd-swarm/SKILL.md +79 -2075
  22. package/.claude/skills/qcsd-cicd-swarm/steps/01-flag-detection.md +62 -0
  23. package/.claude/skills/qcsd-cicd-swarm/steps/02-core-agents.md +33 -0
  24. package/.claude/skills/qcsd-cicd-swarm/steps/03-batch1-results.md +21 -0
  25. package/.claude/skills/qcsd-cicd-swarm/steps/04-conditional-agents.md +23 -0
  26. package/.claude/skills/qcsd-cicd-swarm/steps/05-decision-synthesis.md +30 -0
  27. package/.claude/skills/qcsd-cicd-swarm/steps/06-report-generation.md +17 -0
  28. package/.claude/skills/qcsd-cicd-swarm/steps/07-learning-persistence.md +27 -0
  29. package/.claude/skills/qcsd-cicd-swarm/steps/08-deployment-advisor.md +25 -0
  30. package/.claude/skills/qcsd-cicd-swarm/steps/09-final-output.md +16 -0
  31. package/.claude/skills/qcsd-development-swarm/SKILL.md +79 -2027
  32. package/.claude/skills/qcsd-development-swarm/steps/01-flag-detection.md +50 -0
  33. package/.claude/skills/qcsd-development-swarm/steps/02-core-agents.md +29 -0
  34. package/.claude/skills/qcsd-development-swarm/steps/03-batch1-results.md +14 -0
  35. package/.claude/skills/qcsd-development-swarm/steps/04-conditional-agents.md +23 -0
  36. package/.claude/skills/qcsd-development-swarm/steps/05-decision-synthesis.md +30 -0
  37. package/.claude/skills/qcsd-development-swarm/steps/06-report-generation.md +16 -0
  38. package/.claude/skills/qcsd-development-swarm/steps/07-learning-persistence.md +25 -0
  39. package/.claude/skills/qcsd-development-swarm/steps/08-defect-predictor.md +25 -0
  40. package/.claude/skills/qcsd-development-swarm/steps/09-final-output.md +16 -0
  41. package/.claude/skills/qcsd-ideation-swarm/SKILL.md +94 -1894
  42. package/.claude/skills/qcsd-ideation-swarm/steps/01-flag-detection.md +57 -0
  43. package/.claude/skills/qcsd-ideation-swarm/steps/02-core-agents.md +29 -0
  44. package/.claude/skills/qcsd-ideation-swarm/steps/03-batch1-results.md +15 -0
  45. package/.claude/skills/qcsd-ideation-swarm/steps/04-conditional-agents.md +23 -0
  46. package/.claude/skills/qcsd-ideation-swarm/steps/05-decision-synthesis.md +29 -0
  47. package/.claude/skills/qcsd-ideation-swarm/steps/06-report-generation.md +18 -0
  48. package/.claude/skills/qcsd-ideation-swarm/steps/07-learning-persistence.md +29 -0
  49. package/.claude/skills/qcsd-ideation-swarm/steps/08-final-output.md +18 -0
  50. package/.claude/skills/qcsd-production-swarm/SKILL.md +88 -2663
  51. package/.claude/skills/qcsd-production-swarm/steps/01-flag-detection.md +206 -0
  52. package/.claude/skills/qcsd-production-swarm/steps/02-core-agents.md +428 -0
  53. package/.claude/skills/qcsd-production-swarm/steps/03-batch1-results.md +101 -0
  54. package/.claude/skills/qcsd-production-swarm/steps/04-conditional-agents.md +125 -0
  55. package/.claude/skills/qcsd-production-swarm/steps/05-decision-synthesis.md +136 -0
  56. package/.claude/skills/qcsd-production-swarm/steps/06-report-generation.md +181 -0
  57. package/.claude/skills/qcsd-production-swarm/steps/07-learning-persistence.md +185 -0
  58. package/.claude/skills/qcsd-production-swarm/steps/08-feedback-loop.md +122 -0
  59. package/.claude/skills/qcsd-production-swarm/steps/09-final-output.md +140 -0
  60. package/.claude/skills/qcsd-refinement-swarm/SKILL.md +59 -2312
  61. package/.claude/skills/qcsd-refinement-swarm/steps/01-flag-detection.md +91 -0
  62. package/.claude/skills/qcsd-refinement-swarm/steps/02-core-agents.md +40 -0
  63. package/.claude/skills/qcsd-refinement-swarm/steps/03-batch1-results.md +40 -0
  64. package/.claude/skills/qcsd-refinement-swarm/steps/04-conditional-agents.md +35 -0
  65. package/.claude/skills/qcsd-refinement-swarm/steps/05-decision-synthesis.md +43 -0
  66. package/.claude/skills/qcsd-refinement-swarm/steps/06-report-generation.md +42 -0
  67. package/.claude/skills/qcsd-refinement-swarm/steps/07-learning-persistence.md +53 -0
  68. package/.claude/skills/qcsd-refinement-swarm/steps/08-transformation.md +36 -0
  69. package/.claude/skills/qcsd-refinement-swarm/steps/09-final-output.md +46 -0
  70. package/.claude/skills/sherlock-review/SKILL.md +3 -0
  71. package/.claude/skills/skill-builder/SKILL.md +103 -0
  72. package/.claude/skills/skills-manifest.json +1 -1
  73. package/CHANGELOG.md +22 -0
  74. package/assets/agents/v3/qe-devils-advocate.md +20 -0
  75. package/assets/agents/v3/qe-gap-detector.md +25 -0
  76. package/assets/agents/v3/qe-quality-gate.md +8 -0
  77. package/assets/agents/v3/qe-requirements-validator.md +25 -0
  78. package/assets/agents/v3/subagents/qe-code-reviewer.md +11 -0
  79. package/assets/agents/v3/subagents/qe-integration-reviewer.md +11 -0
  80. package/assets/agents/v3/subagents/qe-performance-reviewer.md +11 -0
  81. package/assets/agents/v3/subagents/qe-security-reviewer.md +11 -0
  82. package/assets/helpers/statusline-v3.cjs +693 -0
  83. package/assets/skills/brutal-honesty-review/SKILL.md +3 -0
  84. package/assets/skills/code-review-quality/SKILL.md +3 -0
  85. package/assets/skills/qcsd-cicd-swarm/SKILL.md +79 -2075
  86. package/assets/skills/qcsd-cicd-swarm/steps/01-flag-detection.md +62 -0
  87. package/assets/skills/qcsd-cicd-swarm/steps/02-core-agents.md +33 -0
  88. package/assets/skills/qcsd-cicd-swarm/steps/03-batch1-results.md +21 -0
  89. package/assets/skills/qcsd-cicd-swarm/steps/04-conditional-agents.md +23 -0
  90. package/assets/skills/qcsd-cicd-swarm/steps/05-decision-synthesis.md +30 -0
  91. package/assets/skills/qcsd-cicd-swarm/steps/06-report-generation.md +17 -0
  92. package/assets/skills/qcsd-cicd-swarm/steps/07-learning-persistence.md +27 -0
  93. package/assets/skills/qcsd-cicd-swarm/steps/08-deployment-advisor.md +25 -0
  94. package/assets/skills/qcsd-cicd-swarm/steps/09-final-output.md +16 -0
  95. package/assets/skills/qcsd-development-swarm/SKILL.md +79 -2027
  96. package/assets/skills/qcsd-development-swarm/steps/01-flag-detection.md +50 -0
  97. package/assets/skills/qcsd-development-swarm/steps/02-core-agents.md +29 -0
  98. package/assets/skills/qcsd-development-swarm/steps/03-batch1-results.md +14 -0
  99. package/assets/skills/qcsd-development-swarm/steps/04-conditional-agents.md +23 -0
  100. package/assets/skills/qcsd-development-swarm/steps/05-decision-synthesis.md +30 -0
  101. package/assets/skills/qcsd-development-swarm/steps/06-report-generation.md +16 -0
  102. package/assets/skills/qcsd-development-swarm/steps/07-learning-persistence.md +25 -0
  103. package/assets/skills/qcsd-development-swarm/steps/08-defect-predictor.md +25 -0
  104. package/assets/skills/qcsd-development-swarm/steps/09-final-output.md +16 -0
  105. package/assets/skills/qcsd-ideation-swarm/SKILL.md +94 -1894
  106. package/assets/skills/qcsd-ideation-swarm/steps/01-flag-detection.md +57 -0
  107. package/assets/skills/qcsd-ideation-swarm/steps/02-core-agents.md +29 -0
  108. package/assets/skills/qcsd-ideation-swarm/steps/03-batch1-results.md +15 -0
  109. package/assets/skills/qcsd-ideation-swarm/steps/04-conditional-agents.md +23 -0
  110. package/assets/skills/qcsd-ideation-swarm/steps/05-decision-synthesis.md +29 -0
  111. package/assets/skills/qcsd-ideation-swarm/steps/06-report-generation.md +18 -0
  112. package/assets/skills/qcsd-ideation-swarm/steps/07-learning-persistence.md +29 -0
  113. package/assets/skills/qcsd-ideation-swarm/steps/08-final-output.md +18 -0
  114. package/assets/skills/qcsd-production-swarm/SKILL.md +88 -2663
  115. package/assets/skills/qcsd-production-swarm/steps/01-flag-detection.md +206 -0
  116. package/assets/skills/qcsd-production-swarm/steps/02-core-agents.md +428 -0
  117. package/assets/skills/qcsd-production-swarm/steps/03-batch1-results.md +101 -0
  118. package/assets/skills/qcsd-production-swarm/steps/04-conditional-agents.md +125 -0
  119. package/assets/skills/qcsd-production-swarm/steps/05-decision-synthesis.md +136 -0
  120. package/assets/skills/qcsd-production-swarm/steps/06-report-generation.md +181 -0
  121. package/assets/skills/qcsd-production-swarm/steps/07-learning-persistence.md +185 -0
  122. package/assets/skills/qcsd-production-swarm/steps/08-feedback-loop.md +122 -0
  123. package/assets/skills/qcsd-production-swarm/steps/09-final-output.md +140 -0
  124. package/assets/skills/qcsd-refinement-swarm/SKILL.md +59 -2312
  125. package/assets/skills/qcsd-refinement-swarm/steps/01-flag-detection.md +91 -0
  126. package/assets/skills/qcsd-refinement-swarm/steps/02-core-agents.md +40 -0
  127. package/assets/skills/qcsd-refinement-swarm/steps/03-batch1-results.md +40 -0
  128. package/assets/skills/qcsd-refinement-swarm/steps/04-conditional-agents.md +35 -0
  129. package/assets/skills/qcsd-refinement-swarm/steps/05-decision-synthesis.md +43 -0
  130. package/assets/skills/qcsd-refinement-swarm/steps/06-report-generation.md +42 -0
  131. package/assets/skills/qcsd-refinement-swarm/steps/07-learning-persistence.md +53 -0
  132. package/assets/skills/qcsd-refinement-swarm/steps/08-transformation.md +36 -0
  133. package/assets/skills/qcsd-refinement-swarm/steps/09-final-output.md +46 -0
  134. package/assets/skills/sherlock-review/SKILL.md +3 -0
  135. package/assets/templates/agent-override-example.yaml +39 -0
  136. package/dist/agents/devils-advocate/agent.d.ts +25 -1
  137. package/dist/agents/devils-advocate/agent.js +108 -4
  138. package/dist/agents/devils-advocate/types.d.ts +54 -0
  139. package/dist/agents/devils-advocate/types.js +14 -0
  140. package/dist/agents/overlay-loader.d.ts +28 -0
  141. package/dist/agents/overlay-loader.js +232 -0
  142. package/dist/agents/overlay-schema.d.ts +56 -0
  143. package/dist/agents/overlay-schema.js +77 -0
  144. package/dist/analysis/branch-enumerator.d.ts +68 -0
  145. package/dist/analysis/branch-enumerator.js +393 -0
  146. package/dist/analysis/index.d.ts +2 -0
  147. package/dist/analysis/index.js +2 -0
  148. package/dist/cli/bundle.js +2396 -614
  149. package/dist/cli/commands/coverage.js +50 -0
  150. package/dist/context/compiler.d.ts +62 -0
  151. package/dist/context/compiler.js +143 -0
  152. package/dist/context/index.d.ts +8 -0
  153. package/dist/context/index.js +6 -0
  154. package/dist/context/sources/coverage-source.d.ts +15 -0
  155. package/dist/context/sources/coverage-source.js +77 -0
  156. package/dist/context/sources/git-source.d.ts +12 -0
  157. package/dist/context/sources/git-source.js +33 -0
  158. package/dist/context/sources/index.d.ts +6 -0
  159. package/dist/context/sources/index.js +5 -0
  160. package/dist/context/sources/memory-source.d.ts +17 -0
  161. package/dist/context/sources/memory-source.js +94 -0
  162. package/dist/context/sources/test-source.d.ts +13 -0
  163. package/dist/context/sources/test-source.js +53 -0
  164. package/dist/context/sources/types.d.ts +42 -0
  165. package/dist/context/sources/types.js +5 -0
  166. package/dist/init/agents-installer.d.ts +9 -0
  167. package/dist/init/agents-installer.js +72 -0
  168. package/dist/init/phases/07-hooks.d.ts +11 -0
  169. package/dist/init/phases/07-hooks.js +67 -0
  170. package/dist/init/phases/09-assets.js +3 -0
  171. package/dist/init/settings-merge.js +1 -1
  172. package/dist/mcp/bundle.js +4411 -3979
  173. package/dist/mcp/services/task-router.d.ts +11 -0
  174. package/dist/mcp/services/task-router.js +26 -0
  175. package/dist/routing/qe-agent-registry.d.ts +11 -0
  176. package/dist/routing/qe-agent-registry.js +34 -0
  177. package/dist/routing/qe-task-router.d.ts +1 -0
  178. package/dist/routing/qe-task-router.js +34 -2
  179. package/dist/routing/types.d.ts +2 -0
  180. package/dist/validation/index.d.ts +3 -0
  181. package/dist/validation/index.js +10 -0
  182. package/dist/validation/pipeline.d.ts +80 -0
  183. package/dist/validation/pipeline.js +173 -0
  184. package/dist/validation/steps/requirements.d.ts +32 -0
  185. package/dist/validation/steps/requirements.js +596 -0
  186. package/package.json +6 -6
  187. package/.claude/agents/consensus/README.md +0 -253
  188. package/.claude/agents/deprecated/qe-api-contract-validator.md.v2 +0 -162
  189. package/.claude/agents/deprecated/qe-coverage-analyzer.md.v2 +0 -208
  190. package/.claude/agents/deprecated/qe-test-generator.md.v2 +0 -212
  191. package/.claude/agents/deprecated/qe-visual-tester.md.v2 +0 -216
  192. package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -130
  193. package/.claude/agents/hive-mind/queen-coordinator.md +0 -203
  194. package/.claude/agents/hive-mind/scout-explorer.md +0 -242
  195. package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -193
  196. package/.claude/agents/hive-mind/worker-specialist.md +0 -217
  197. package/.claude/agents/neural/safla-neural.md +0 -74
  198. package/.claude/agents/optimization/README.md +0 -250
  199. package/.claude/agents/reasoning/agent.md +0 -816
  200. package/.claude/agents/reasoning/goal-planner.md +0 -73
  201. package/.claude/agents/subagents/qe-code-reviewer.md +0 -76
  202. package/.claude/agents/subagents/qe-coverage-gap-analyzer.md +0 -76
  203. package/.claude/agents/subagents/qe-data-generator.md +0 -77
  204. package/.claude/agents/subagents/qe-flaky-investigator.md +0 -91
  205. package/.claude/agents/subagents/qe-integration-tester.md +0 -90
  206. package/.claude/agents/subagents/qe-performance-validator.md +0 -92
  207. package/.claude/agents/subagents/qe-security-auditor.md +0 -94
  208. package/.claude/agents/subagents/qe-test-data-architect-sub.md +0 -93
  209. package/.claude/agents/subagents/qe-test-implementer.md +0 -106
  210. package/.claude/agents/subagents/qe-test-refactorer.md +0 -117
  211. package/.claude/agents/subagents/qe-test-writer.md +0 -112
  212. package/.claude/agents/swarm/README.md +0 -190
  213. package/.claude/agents/templates/migration-plan.md +0 -746
  214. package/.claude/agents/testing/unit/tdd-london-swarm.md +0 -244
  215. package/.claude/agents/testing/validation/production-validator.md +0 -395
  216. package/.claude/agents/v3/README.md +0 -39
  217. package/.claude/agents/v3/typescript-specialist.yaml +0 -21
  218. package/.claude/agents/v3/v3-memory-specialist.md +0 -318
  219. package/.claude/agents/v3/v3-performance-engineer.md +0 -397
  220. package/.claude/agents/v3/v3-queen-coordinator.md +0 -98
  221. package/.claude/agents/v3/v3-security-architect.md +0 -174
  222. package/.claude/commands/README.md +0 -106
  223. package/.claude/commands/agents/README.md +0 -10
  224. package/.claude/commands/agents/agent-capabilities.md +0 -21
  225. package/.claude/commands/agents/agent-coordination.md +0 -28
  226. package/.claude/commands/agents/agent-spawning.md +0 -28
  227. package/.claude/commands/agents/agent-types.md +0 -26
  228. package/.claude/commands/coordination/README.md +0 -9
  229. package/.claude/commands/coordination/agent-spawn.md +0 -25
  230. package/.claude/commands/coordination/init.md +0 -44
  231. package/.claude/commands/coordination/orchestrate.md +0 -43
  232. package/.claude/commands/coordination/spawn.md +0 -45
  233. package/.claude/commands/coordination/swarm-init.md +0 -85
  234. package/.claude/commands/coordination/task-orchestrate.md +0 -25
  235. package/.claude/commands/hive-mind/README.md +0 -17
  236. package/.claude/commands/hive-mind/hive-mind-consensus.md +0 -8
  237. package/.claude/commands/hive-mind/hive-mind-init.md +0 -18
  238. package/.claude/commands/hive-mind/hive-mind-memory.md +0 -8
  239. package/.claude/commands/hive-mind/hive-mind-metrics.md +0 -8
  240. package/.claude/commands/hive-mind/hive-mind-resume.md +0 -8
  241. package/.claude/commands/hive-mind/hive-mind-sessions.md +0 -8
  242. package/.claude/commands/hive-mind/hive-mind-spawn.md +0 -21
  243. package/.claude/commands/hive-mind/hive-mind-status.md +0 -8
  244. package/.claude/commands/hive-mind/hive-mind-stop.md +0 -8
  245. package/.claude/commands/hive-mind/hive-mind-wizard.md +0 -8
  246. package/.claude/commands/hive-mind/hive-mind.md +0 -27
  247. package/.claude/commands/memory/README.md +0 -9
  248. package/.claude/commands/memory/memory-persist.md +0 -25
  249. package/.claude/commands/memory/memory-search.md +0 -25
  250. package/.claude/commands/memory/memory-usage.md +0 -25
  251. package/.claude/commands/memory/neural.md +0 -47
  252. package/.claude/commands/swarm/README.md +0 -15
  253. package/.claude/commands/swarm/swarm-analysis.md +0 -8
  254. package/.claude/commands/swarm/swarm-background.md +0 -8
  255. package/.claude/commands/swarm/swarm-init.md +0 -19
  256. package/.claude/commands/swarm/swarm-modes.md +0 -8
  257. package/.claude/commands/swarm/swarm-monitor.md +0 -8
  258. package/.claude/commands/swarm/swarm-spawn.md +0 -19
  259. package/.claude/commands/swarm/swarm-status.md +0 -8
  260. package/.claude/commands/swarm/swarm-strategies.md +0 -8
  261. package/.claude/commands/swarm/swarm.md +0 -27
  262. package/.claude/commands/training/README.md +0 -9
  263. package/.claude/commands/training/model-update.md +0 -25
  264. package/.claude/commands/training/neural-patterns.md +0 -74
  265. package/.claude/commands/training/neural-train.md +0 -25
  266. package/.claude/commands/training/pattern-learn.md +0 -25
  267. package/.claude/commands/training/specialization.md +0 -63
  268. package/.claude/commands/workflows/README.md +0 -9
  269. package/.claude/commands/workflows/development.md +0 -78
  270. package/.claude/commands/workflows/research.md +0 -63
  271. package/.claude/commands/workflows/workflow-create.md +0 -25
  272. package/.claude/commands/workflows/workflow-execute.md +0 -25
  273. package/.claude/commands/workflows/workflow-export.md +0 -25
  274. package/.claude/skills/agentic-jujutsu/SKILL.md +0 -645
  275. package/.claude/skills/hive-mind-advanced/SKILL.md +0 -712
  276. package/.claude/skills/iterative-loop/SKILL.md +0 -371
  277. package/.claude/skills/performance-analysis/SKILL.md +0 -569
  278. package/.claude/skills/performance-analysis/evals/performance-analysis.yaml +0 -144
  279. package/.claude/skills/performance-analysis/schemas/output.json +0 -588
  280. package/.claude/skills/performance-analysis/scripts/validate-config.json +0 -36
@@ -1,371 +0,0 @@
1
- ---
2
- name: "Iterative Loop"
3
- description: "Implement continuous AI iteration loops for complex development tasks. Use when building features requiring test-driven refinement, implementing tasks with clear success criteria, or automating iterative improvement workflows. Based on the Ralph Wiggum technique from Claude Code plugins."
4
- ---
5
-
6
- # Iterative Loop
7
-
8
- ## Overview
9
-
10
- The Iterative Loop skill implements **continuous AI-driven development loops** that persist until completion criteria are met. Inspired by the Ralph Wiggum technique, this approach enables autonomous, self-correcting development cycles where the AI sees its previous work in files and git history, iteratively improving until success.
11
-
12
- ## Core Philosophy
13
-
14
- 1. **Iteration > Perfection** - Don't aim for perfect on first try; let the loop refine the work
15
- 2. **Failures Are Data** - Each failure provides information to improve the next attempt
16
- 3. **Clear Criteria** - Success must be objectively measurable (tests, metrics, validations)
17
- 4. **Persistence Wins** - Keep trying until success; the loop handles retry logic automatically
18
-
19
- ## Prerequisites
20
-
21
- - Claude Code with session management
22
- - Clear completion criteria (tests, linting, metrics)
23
- - Version control (git) for tracking iterations
24
-
25
- ---
26
-
27
- ## Quick Start
28
-
29
- ### Basic Iterative Development Pattern
30
-
31
- ```bash
32
- # Define task with clear completion criteria
33
- TASK="Implement user authentication with JWT.
34
- Success criteria:
35
- - All unit tests pass
36
- - Integration tests pass
37
- - No TypeScript errors
38
- - Security audit passes
39
- Output <promise>COMPLETE</promise> when all criteria met."
40
-
41
- # Execute iterative loop (conceptual)
42
- while ! task_complete; do
43
- claude_execute "$TASK"
44
- check_completion_criteria
45
- done
46
- ```
47
-
48
- ### AQE v3 Integration Example
49
-
50
- ```bash
51
- # Using claude-flow hooks for iterative task
52
- npx @claude-flow/cli@latest hooks pre-task --description "Implement auth with iteration" --taskId "auth-impl"
53
-
54
- # Store iteration state in memory
55
- npx @claude-flow/cli@latest memory store \
56
- --key "iteration-auth" \
57
- --value '{"iteration": 1, "maxIterations": 20, "criteria": "all tests pass"}' \
58
- --namespace iterations
59
- ```
60
-
61
- ---
62
-
63
- ## Step-by-Step Guide
64
-
65
- ### Step 1: Define Clear Success Criteria
66
-
67
- **Essential**: Every iterative task MUST have objectively measurable completion criteria.
68
-
69
- **Good Criteria Examples:**
70
- ```markdown
71
- ✅ All unit tests pass (npm test returns exit code 0)
72
- ✅ Coverage > 80% (coverage report shows 80%+)
73
- ✅ No TypeScript errors (tsc --noEmit returns 0)
74
- ✅ Linting passes (eslint returns 0)
75
- ✅ Performance < 100ms (benchmark shows < 100ms)
76
- ```
77
-
78
- **Bad Criteria Examples:**
79
- ```markdown
80
- ❌ "Code looks good" (subjective)
81
- ❌ "Works properly" (undefined)
82
- ❌ "Well-structured" (no measurable check)
83
- ```
84
-
85
- ### Step 2: Structure the Task with Phases
86
-
87
- Break complex tasks into incremental phases:
88
-
89
- ```markdown
90
- ## Task: Implement User Authentication
91
-
92
- ### Phase 1: Data Layer
93
- - Create User model with Prisma schema
94
- - Write migration
95
- - Run tests: `npm test -- --grep "User model"`
96
- - Criteria: Model tests pass
97
-
98
- ### Phase 2: Service Layer
99
- - Implement AuthService with JWT
100
- - Add token generation/validation
101
- - Run tests: `npm test -- --grep "AuthService"`
102
- - Criteria: Service tests pass
103
-
104
- ### Phase 3: API Layer
105
- - Create /auth/login endpoint
106
- - Create /auth/register endpoint
107
- - Run tests: `npm test -- --grep "auth API"`
108
- - Criteria: API tests pass
109
-
110
- ### Phase 4: Integration
111
- - End-to-end authentication flow
112
- - Run tests: `npm test`
113
- - Criteria: ALL tests pass
114
-
115
- Output <promise>AUTH_COMPLETE</promise> when Phase 4 passes.
116
- ```
117
-
118
- ### Step 3: Implement Safety Mechanisms
119
-
120
- Always include escape conditions:
121
-
122
- ```markdown
123
- ## Safety Rules
124
-
125
- 1. **Max Iterations**: Stop after 20 attempts
126
- 2. **Stuck Detection**: After 5 iterations without progress:
127
- - Document what's blocking
128
- - List attempted approaches
129
- - Suggest alternative strategies
130
- 3. **Critical Errors**: Stop immediately if:
131
- - Database corruption detected
132
- - Security vulnerability introduced
133
- - Breaking changes to existing features
134
- ```
135
-
136
- ### Step 4: Execute with Verification
137
-
138
- Each iteration should:
139
- 1. Make targeted changes
140
- 2. Run verification (tests, lint, build)
141
- 3. Analyze results
142
- 4. Plan next iteration based on feedback
143
-
144
- ```bash
145
- # Iteration pattern
146
- 1. Read previous state (files, git log)
147
- 2. Identify remaining work
148
- 3. Implement specific change
149
- 4. Run verification suite
150
- 5. If all pass -> output completion promise
151
- 6. If failures -> analyze and continue iteration
152
- ```
153
-
154
- ---
155
-
156
- ## Iterative Patterns
157
-
158
- ### Pattern 1: Test-Driven Iteration
159
-
160
- ```markdown
161
- ## TDD Iteration Task
162
-
163
- 1. Write failing test for [feature]
164
- 2. Implement minimal code to pass test
165
- 3. Run `npm test`
166
- 4. If test fails -> debug and fix implementation
167
- 5. If test passes -> check if more tests needed
168
- 6. Repeat until all acceptance tests pass
169
- 7. Refactor if needed
170
- 8. Output <promise>TDD_COMPLETE</promise>
171
- ```
172
-
173
- ### Pattern 2: Bug Fix Iteration
174
-
175
- ```markdown
176
- ## Bug Fix Task
177
-
178
- 1. Write failing test that reproduces bug
179
- 2. Implement fix
180
- 3. Run test suite
181
- 4. If reproduction test fails -> analyze why fix didn't work
182
- 5. If other tests fail -> fix regressions
183
- 6. If all tests pass -> output <promise>BUG_FIXED</promise>
184
-
185
- Max iterations: 10
186
- After 5 iterations without fix:
187
- - Document root cause analysis
188
- - Suggest alternative approaches
189
- ```
190
-
191
- ### Pattern 3: Coverage Improvement Iteration
192
-
193
- ```markdown
194
- ## Coverage Improvement Task
195
-
196
- Target: 80% line coverage
197
-
198
- 1. Run coverage analysis
199
- 2. Identify uncovered code paths
200
- 3. Write test for highest-impact uncovered path
201
- 4. Run tests with coverage
202
- 5. If coverage >= 80% -> output <promise>COVERAGE_ACHIEVED</promise>
203
- 6. If coverage < 80% -> continue iteration
204
-
205
- Max iterations: 30
206
- Progress check: If coverage doesn't improve for 3 iterations -> analyze blockers
207
- ```
208
-
209
- ### Pattern 4: Performance Optimization Iteration
210
-
211
- ```markdown
212
- ## Performance Optimization Task
213
-
214
- Target: Response time < 100ms
215
-
216
- 1. Run performance benchmark
217
- 2. Identify slowest operation
218
- 3. Implement optimization
219
- 4. Run benchmark again
220
- 5. If target met -> output <promise>PERF_TARGET_MET</promise>
221
- 6. If not improved -> try different approach
222
-
223
- Max iterations: 15
224
- Record metrics each iteration for trend analysis
225
- ```
226
-
227
- ---
228
-
229
- ## Integration with Claude Flow
230
-
231
- ### Memory-Enhanced Iteration
232
-
233
- ```bash
234
- # Store iteration state
235
- npx @claude-flow/cli@latest memory store \
236
- --key "current-iteration" \
237
- --value '{"task": "auth", "iteration": 5, "lastResult": "2 tests failing"}' \
238
- --namespace iterations
239
-
240
- # Search for similar past iterations
241
- npx @claude-flow/cli@latest memory search \
242
- --query "auth implementation" \
243
- --namespace iterations
244
-
245
- # Learn from successful completions
246
- npx @claude-flow/cli@latest hooks post-task \
247
- --taskId "auth-impl" \
248
- --success true \
249
- --quality 0.9
250
- ```
251
-
252
- ### Swarm-Coordinated Iteration
253
-
254
- For complex tasks, use multiple agents iterating in parallel:
255
-
256
- ```bash
257
- # Initialize swarm for parallel iteration
258
- npx @claude-flow/cli@latest swarm init --topology mesh --max-agents 5
259
-
260
- # Spawn specialized iterators
261
- Task("Iterate on unit tests", "Fix failing unit tests until all pass", "tester")
262
- Task("Iterate on integration", "Fix integration tests until all pass", "tester")
263
- Task("Iterate on performance", "Optimize until benchmarks pass", "performance-engineer")
264
- ```
265
-
266
- ---
267
-
268
- ## Best Practices
269
-
270
- ### Prompt Engineering for Iteration
271
-
272
- **Include:**
273
- - Explicit completion criteria with verification commands
274
- - Phase-based breakdown for complex tasks
275
- - Safety limits (max iterations)
276
- - Progress tracking instructions
277
- - Stuck detection and recovery procedures
278
-
279
- **Example Well-Structured Prompt:**
280
- ```markdown
281
- ## Task: Implement Feature X
282
-
283
- ### Success Criteria (ALL must pass):
284
- 1. `npm test` exits with code 0
285
- 2. `npm run lint` exits with code 0
286
- 3. `npm run typecheck` exits with code 0
287
- 4. No console.log statements in production code
288
-
289
- ### Phases:
290
- 1. Write failing tests
291
- 2. Implement feature
292
- 3. Fix any failures
293
- 4. Clean up and refactor
294
-
295
- ### Safety:
296
- - Max iterations: 20
297
- - After 10 iterations: summarize blockers
298
- - Stop if security issues detected
299
-
300
- ### Completion:
301
- When ALL success criteria pass, output:
302
- <promise>FEATURE_X_COMPLETE</promise>
303
- ```
304
-
305
- ### When to Use Iterative Loops
306
-
307
- **Ideal for:**
308
- - Well-defined tasks with measurable success
309
- - Test-driven development
310
- - Bug fixing with reproducible tests
311
- - Coverage improvement
312
- - Performance optimization
313
- - Linting/formatting fixes
314
-
315
- **Not ideal for:**
316
- - Tasks requiring human judgment
317
- - Design decisions
318
- - Vague or subjective goals
319
- - One-time operations
320
- - Production debugging without tests
321
-
322
- ---
323
-
324
- ## Troubleshooting
325
-
326
- ### Issue: Infinite Loop / No Progress
327
-
328
- **Symptoms**: Same errors repeat without improvement
329
-
330
- **Solutions**:
331
- 1. Increase specificity in completion criteria
332
- 2. Add "stuck detection" with alternative approaches
333
- 3. Lower max iterations
334
- 4. Break task into smaller phases
335
-
336
- ### Issue: False Completion
337
-
338
- **Symptoms**: Loop ends but task not actually complete
339
-
340
- **Solutions**:
341
- 1. Add more verification commands
342
- 2. Make completion criteria more explicit
343
- 3. Add integration tests alongside unit tests
344
-
345
- ### Issue: Regression in Later Iterations
346
-
347
- **Symptoms**: Previously passing tests fail after new changes
348
-
349
- **Solutions**:
350
- 1. Add regression check step
351
- 2. Use git to compare iterations
352
- 3. Implement smaller, targeted changes
353
-
354
- ---
355
-
356
- ## Related Skills
357
-
358
- - [tdd-london-chicago](../tdd-london-chicago/) - TDD approaches for iterative development
359
- - [qe-iterative-loop](../qe-iterative-loop/) - AQE v3 fleet-specific iteration patterns
360
- - [hooks-automation](../hooks-automation/) - Claude Flow hooks for automation
361
-
362
- ## Resources
363
-
364
- - [Ralph Wiggum Technique](https://ghuntley.com/ralph/) - Original methodology
365
- - [Ralph Orchestrator](https://github.com/mikeyobrien/ralph-orchestrator) - Orchestration tools
366
- - [Claude Code Plugins](https://github.com/anthropics/claude-code) - Official plugins
367
-
368
- ---
369
-
370
- **Origin**: Based on Ralph Wiggum plugin from claude-code repository (anthropics/claude-code)
371
- **Adapted for**: Agentic QE v3 with Claude Flow integration