agentic-qe 3.7.16 → 3.7.18

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 +29 -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 +2415 -624
  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 +79 -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 +18 -10
  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
@@ -66,27 +66,13 @@ Development Swarm asks "Is the code quality sufficient to ship?"
66
66
 
67
67
  ### QCSD Phase Positioning
68
68
 
69
- | Phase | Swarm | Question | Decision | When |
70
- |-------|-------|----------|----------|------|
71
- | Ideation | qcsd-ideation-swarm | Should we build this? | GO / CONDITIONAL / NO-GO | PI/Sprint Planning |
72
- | Refinement | qcsd-refinement-swarm | How should we test this? | READY / CONDITIONAL / NOT-READY | Sprint Refinement |
73
- | **Development** | **qcsd-development-swarm** | **Is the code quality sufficient?** | **SHIP / CONDITIONAL / HOLD** | **During Sprint** |
74
- | Verification | qcsd-cicd-swarm | Is this change safe to release? | RELEASE / REMEDIATE / BLOCK | Pre-Release / CI-CD |
75
-
76
- ### Key Differentiators from Refinement Swarm
77
-
78
- | Dimension | Refinement Swarm | Development Swarm |
79
- |-----------|------------------|-------------------|
80
- | Framework | SFDIPOT (7 factors) | TDD + Complexity + Coverage |
81
- | Agents | 10 (3 core + 6 conditional + 1 transformation) | 10 (3 core + 6 conditional + 1 analysis) |
82
- | Core Output | BDD Gherkin scenarios | Code quality assessment |
83
- | Decision | READY / CONDITIONAL / NOT-READY | SHIP / CONDITIONAL / HOLD |
84
- | Flags | HAS_API, HAS_REFACTORING, HAS_DEPENDENCIES, HAS_SECURITY, HAS_MIDDLEWARE, HAS_SAP_INTEGRATION, HAS_AUTHORIZATION | HAS_SECURITY_CODE, HAS_PERFORMANCE_CODE, HAS_CRITICAL_CODE, HAS_MIDDLEWARE, HAS_SAP_INTEGRATION, HAS_AUTHORIZATION |
85
- | Phase | Sprint Refinement | During Sprint Development |
86
- | Input | User stories + acceptance criteria | Source code + test files |
87
- | Final Step | Test idea rewriter transformation | Defect prediction analysis |
88
-
89
- ---
69
+ | Phase | Swarm | Decision | When |
70
+ |-------|-------|----------|------|
71
+ | Ideation | qcsd-ideation-swarm | GO / CONDITIONAL / NO-GO | PI/Sprint Planning |
72
+ | Refinement | qcsd-refinement-swarm | READY / CONDITIONAL / NOT-READY | Sprint Refinement |
73
+ | **Development** | **qcsd-development-swarm** | **SHIP / CONDITIONAL / HOLD** | **During Sprint** |
74
+ | Verification | qcsd-cicd-swarm | RELEASE / REMEDIATE / BLOCK | Pre-Release / CI-CD |
75
+ | Production | qcsd-production-swarm | HEALTHY / DEGRADED / CRITICAL | Post-Release |
90
76
 
91
77
  ### Parameters
92
78
 
@@ -98,2057 +84,123 @@ Development Swarm asks "Is the code quality sufficient to ship?"
98
84
 
99
85
  ## ENFORCEMENT RULES - READ FIRST
100
86
 
101
- **These rules are NON-NEGOTIABLE. Violation means skill execution failure.**
102
-
103
87
  | Rule | Enforcement |
104
88
  |------|-------------|
105
- | **E1** | You MUST spawn ALL THREE core agents (qe-tdd-specialist, qe-code-complexity, qe-coverage-specialist) in Phase 2. No exceptions. |
89
+ | **E1** | You MUST spawn ALL THREE core agents (qe-tdd-specialist, qe-code-complexity, qe-coverage-specialist) in Step 2. No exceptions. |
106
90
  | **E2** | You MUST put all parallel Task calls in a SINGLE message. |
107
91
  | **E3** | You MUST STOP and WAIT after each batch. No proceeding early. |
108
92
  | **E4** | You MUST spawn conditional agents if flags are TRUE. No skipping. |
109
- | **E5** | You MUST apply SHIP/CONDITIONAL/HOLD logic exactly as specified in Phase 5. |
93
+ | **E5** | You MUST apply SHIP/CONDITIONAL/HOLD logic exactly as specified in Step 5. |
110
94
  | **E6** | You MUST generate the full report structure. No abbreviated versions. |
111
95
  | **E7** | Each agent MUST read its reference files before analysis. |
112
- | **E8** | You MUST apply qe-defect-predictor analysis on ALL code changes in Phase 8. Always. |
113
- | **E9** | You MUST execute Phase 7 learning persistence. Store development findings to memory BEFORE Phase 8. No skipping. |
96
+ | **E8** | You MUST apply qe-defect-predictor analysis on ALL code changes in Step 8. Always. |
97
+ | **E9** | You MUST execute Step 7 learning persistence. No skipping. |
114
98
 
115
99
  **PROHIBITED BEHAVIORS:**
116
100
  - Summarizing instead of spawning agents
117
101
  - Skipping agents "for brevity"
118
102
  - Proceeding before background tasks complete
119
103
  - Providing your own analysis instead of spawning specialists
120
- - Omitting report sections
121
- - Using placeholder text like "[details here]"
122
- - Skipping the defect prediction analysis
123
- - Skipping learning persistence (Phase 7) or treating it as optional
124
- - Generating code analysis yourself instead of using specialist agents
104
+ - Omitting report sections or using placeholder text
125
105
 
126
106
  ---
127
107
 
128
- ## PHASE 1: Analyze Code Context (Flag Detection)
129
-
130
- **MANDATORY: You must complete this analysis before Phase 2.**
131
-
132
- Scan the source code, test files, and story context to SET these flags. Do not skip any flag.
133
-
134
- ### Flag Detection (Check ALL SIX)
135
-
136
- ```
137
- HAS_SECURITY_CODE = FALSE
138
- Set TRUE if code contains ANY of: auth, authentication, authorization,
139
- password, credential, token, JWT, OAuth, session, encrypt, decrypt,
140
- hash, salt, PII, GDPR, HIPAA, secret, private key, certificate,
141
- RBAC, ACL, sanitize, XSS, CSRF, injection, eval(
142
-
143
- HAS_PERFORMANCE_CODE = FALSE
144
- Set TRUE if code contains ANY of: loop, while, for, recursion,
145
- query, SELECT, JOIN, aggregate, cache, memoize, concurrent,
146
- parallel, async, await, Promise.all, batch, stream, buffer,
147
- pagination, lazy load, debounce, throttle, worker, thread,
148
- O(n^2), O(n log n), large dataset, bulk operation
149
-
150
- HAS_CRITICAL_CODE = FALSE
151
- Set TRUE if code contains ANY of: payment, billing, invoice,
152
- transaction, charge, refund, subscription, medical, health,
153
- patient, diagnosis, compliance, audit, regulatory, financial,
154
- accounting, tax, legal, contract, SLA, insurance, claim,
155
- safety-critical, life-critical
156
-
157
- HAS_MIDDLEWARE = FALSE
158
- Set TRUE if code contains ANY of: middleware, ESB, message broker, MQ,
159
- Kafka, RabbitMQ, integration bus, API gateway, message queue, pub/sub
160
-
161
- HAS_SAP_INTEGRATION = FALSE
162
- Set TRUE if code contains ANY of: SAP, RFC, BAPI, IDoc, OData,
163
- S/4HANA, EWM, ECC, ABAP, CDS view, Fiori
164
-
165
- HAS_AUTHORIZATION = FALSE
166
- Set TRUE if code contains ANY of: SoD, segregation of duties,
167
- role conflict, authorization object, T-code, user role,
168
- access control matrix, GRC
169
- ```
170
-
171
- ### Validation Checkpoint
172
-
173
- Before proceeding to Phase 2, confirm:
174
-
175
- ```
176
- +-- I have read the source code files under analysis
177
- +-- I have read the associated test files
178
- +-- I have evaluated ALL SIX flags
179
- +-- I have recorded which flags are TRUE
180
- +-- I understand which conditional agents will be needed
181
- ```
182
-
183
- **DO NOT proceed to Phase 2 until all checkboxes are confirmed.**
184
-
185
- ### MANDATORY: Output Flag Detection Results
186
-
187
- You MUST output flag detection results before proceeding:
188
-
189
- ```
190
- +-------------------------------------------------------------+
191
- | FLAG DETECTION RESULTS |
192
- +-------------------------------------------------------------+
193
- | |
194
- | HAS_SECURITY_CODE: [TRUE/FALSE] |
195
- | Evidence: [what triggered it - specific code] |
196
- | |
197
- | HAS_PERFORMANCE_CODE: [TRUE/FALSE] |
198
- | Evidence: [what triggered it - specific code] |
199
- | |
200
- | HAS_CRITICAL_CODE: [TRUE/FALSE] |
201
- | Evidence: [what triggered it - specific code] |
202
- | |
203
- | HAS_MIDDLEWARE: [TRUE/FALSE] |
204
- | Evidence: [what triggered it - specific code] |
205
- | |
206
- | HAS_SAP_INTEGRATION: [TRUE/FALSE] |
207
- | Evidence: [what triggered it - specific code] |
208
- | |
209
- | HAS_AUTHORIZATION: [TRUE/FALSE] |
210
- | Evidence: [what triggered it - specific code] |
211
- | |
212
- | EXPECTED AGENTS: |
213
- | - Core: 3 (always) |
214
- | - Conditional: [count based on TRUE flags] |
215
- | - Analysis: 1 (always) |
216
- | - TOTAL: [3 + conditional count + 1] |
217
- | |
218
- +-------------------------------------------------------------+
219
- ```
220
-
221
- **DO NOT proceed to Phase 2 without outputting flag detection results.**
222
-
223
- ---
224
-
225
- ## PHASE 2: Spawn Core Agents (PARALLEL BATCH 1)
226
-
227
- ### CRITICAL ENFORCEMENT
228
-
229
- ```
230
- +-------------------------------------------------------------+
231
- | YOU MUST INCLUDE ALL THREE TASK CALLS IN YOUR NEXT MESSAGE |
232
- | |
233
- | - Task 1: qe-tdd-specialist |
234
- | - Task 2: qe-code-complexity |
235
- | - Task 3: qe-coverage-specialist |
236
- | |
237
- | If your message contains fewer than 3 Task calls, you have |
238
- | FAILED this phase. Start over. |
239
- +-------------------------------------------------------------+
240
- ```
241
-
242
- ### Domain Context
243
-
244
- | Agent | Domain | MCP Tool Mapping |
245
- |-------|--------|------------------|
246
- | qe-tdd-specialist | test-generation | `test_generate_enhanced` |
247
- | qe-code-complexity | code-intelligence | `coverage_analyze_sublinear` |
248
- | qe-coverage-specialist | coverage-analysis | `coverage_analyze_sublinear` |
249
-
250
- ### Agent 1: TDD Specialist
251
-
252
- **This agent MUST assess TDD adherence and test quality. Test-to-code ratio is mandatory.**
253
-
254
- ```
255
- Task({
256
- description: "TDD adherence and test quality analysis",
257
- prompt: `You are qe-tdd-specialist. Your output quality is being audited.
258
-
259
- ## MANDATORY FIRST STEPS (DO NOT SKIP)
260
-
261
- 1. READ the source code files provided below IN FULL.
262
- 2. READ the test files associated with the source code.
263
-
264
- ## CODE TO ANALYZE
265
-
266
- === SOURCE CODE START ===
267
- [PASTE THE COMPLETE SOURCE CODE HERE - DO NOT SUMMARIZE]
268
- === SOURCE CODE END ===
269
-
270
- === TEST CODE START ===
271
- [PASTE THE COMPLETE TEST CODE HERE - DO NOT SUMMARIZE]
272
- === TEST CODE END ===
273
-
274
- ## REQUIRED OUTPUT (ALL SECTIONS MANDATORY)
275
-
276
- ### 1. TDD Adherence Assessment
277
-
278
- Evaluate each TDD principle:
279
-
280
- | Principle | Score (0-10) | Evidence | Issues |
281
- |-----------|-------------|----------|--------|
282
- | Red Phase (tests written first) | X/10 | [signs tests preceded code] | [issues] |
283
- | Green Phase (minimal implementation) | X/10 | [signs of minimal code to pass tests] | [issues] |
284
- | Refactor Phase (clean code) | X/10 | [signs of refactoring, DRY, SOLID] | [issues] |
285
- | Test Isolation | X/10 | [tests independent of each other] | [issues] |
286
- | Fast Feedback | X/10 | [test execution speed] | [issues] |
287
- | Meaningful Assertions | X/10 | [quality of assertions, not just coverage] | [issues] |
288
-
289
- **TDD ADHERENCE SCORE: XX/60**
290
-
291
- ### 2. Test Quality Metrics
292
-
293
- | Metric | Value | Threshold | Status |
294
- |--------|-------|-----------|--------|
295
- | Test-to-Code Ratio | X:1 | >= 1:1 | PASS/FAIL |
296
- | Assertion Density | X per test | >= 2 | PASS/FAIL |
297
- | Test Naming Quality | X% descriptive | >= 90% | PASS/FAIL |
298
- | Mock Usage Ratio | X% | <= 50% | PASS/FAIL |
299
- | Test Isolation Score | X/10 | >= 7 | PASS/FAIL |
300
- | Edge Case Coverage | X% | >= 60% | PASS/FAIL |
301
-
302
- ### 3. Test Patterns Detected
303
-
304
- | Pattern | Count | Quality | Recommendation |
305
- |---------|-------|---------|----------------|
306
- | Arrange-Act-Assert | X | Good/Poor | ... |
307
- | Given-When-Then | X | Good/Poor | ... |
308
- | Test Doubles (mocks) | X | Good/Poor | ... |
309
- | Integration Tests | X | Good/Poor | ... |
310
- | Property-Based Tests | X | Good/Poor | ... |
311
-
312
- ### 4. Missing Test Categories
313
-
314
- | Category | Status | Priority | Suggested Tests |
315
- |----------|--------|----------|-----------------|
316
- | Happy path | Covered/Missing | P0/P1/P2 | [specific tests] |
317
- | Error handling | Covered/Missing | P0/P1/P2 | [specific tests] |
318
- | Boundary values | Covered/Missing | P0/P1/P2 | [specific tests] |
319
- | Null/undefined | Covered/Missing | P0/P1/P2 | [specific tests] |
320
- | Concurrency | Covered/Missing/N-A | P0/P1/P2 | [specific tests] |
321
-
322
- ### 5. Recommendations
323
-
324
- | Priority | Recommendation | Impact |
325
- |----------|---------------|--------|
326
- | P0 | [must fix before merge] | [what improves] |
327
- | P1 | [should fix this sprint] | [what improves] |
328
- | P2 | [nice to have] | [what improves] |
329
-
330
- **MINIMUM: Assess all 6 TDD principles and identify at least 3 missing test categories.**
331
-
332
- ## OUTPUT FORMAT
333
-
334
- Save your complete analysis in Markdown to:
335
- ${OUTPUT_FOLDER}/02-tdd-adherence.md
336
-
337
- Use the Write tool to save BEFORE completing.
338
- Report MUST be complete - no placeholders.
339
-
340
- ## VALIDATION BEFORE SUBMITTING
341
-
342
- +-- Did I read all source code and test files?
343
- +-- Did I score all 6 TDD principles?
344
- +-- Did I calculate test-to-code ratio?
345
- +-- Did I identify missing test categories?
346
- +-- Did I provide specific recommendations?
347
- +-- Did I save the report to the correct output path?`,
348
- subagent_type: "qe-tdd-specialist",
349
- run_in_background: true
350
- })
351
- ```
352
-
353
- ### Agent 2: Code Complexity Analyzer
354
-
355
- **This agent MUST calculate cyclomatic and cognitive complexity. Hotspots are mandatory.**
108
+ ## Step Execution Protocol
356
109
 
357
- ```
358
- Task({
359
- description: "Cyclomatic and cognitive complexity analysis",
360
- prompt: `You are qe-code-complexity. Your output quality is being audited.
110
+ This skill uses a micro-file step architecture. Each step is a self-contained file
111
+ loaded one at a time to avoid "lost in the middle" context degradation.
361
112
 
362
- ## CODE TO ANALYZE
113
+ **Execute steps sequentially by reading each step file with the Read tool.**
363
114
 
364
- === SOURCE CODE START ===
365
- [PASTE THE COMPLETE SOURCE CODE HERE - DO NOT SUMMARIZE]
366
- === SOURCE CODE END ===
115
+ ### Steps
367
116
 
368
- ## REQUIRED OUTPUT (ALL SECTIONS MANDATORY)
117
+ 1. **Flag Detection** -- `steps/01-flag-detection.md` -- Scan source code and tests, detect all 6 flags
118
+ 2. **Core Agents** -- `steps/02-core-agents.md` -- Spawn qe-tdd-specialist, qe-code-complexity, qe-coverage-specialist in parallel
119
+ 3. **Batch 1 Results** -- `steps/03-batch1-results.md` -- Wait for core agents, extract all metrics
120
+ 4. **Conditional Agents** -- `steps/04-conditional-agents.md` -- Spawn flagged conditional agents in parallel
121
+ 5. **Decision Synthesis** -- `steps/05-decision-synthesis.md` -- Apply SHIP/CONDITIONAL/HOLD logic
122
+ 6. **Report Generation** -- `steps/06-report-generation.md` -- Generate executive summary and full report
123
+ 7. **Learning Persistence** -- `steps/07-learning-persistence.md` -- Store findings to memory, save persistence record
124
+ 8. **Defect Predictor** -- `steps/08-defect-predictor.md` -- Run qe-defect-predictor analysis on all code changes
125
+ 9. **Final Output** -- `steps/09-final-output.md` -- Display completion summary with all scores
369
126
 
370
- ### 1. Function-Level Complexity
127
+ ### Execution Instructions
371
128
 
372
- For EACH function/method in the codebase:
129
+ 1. Use the Read tool to load the current step file (e.g., `Read({ file_path: ".claude/skills/qcsd-development-swarm/steps/01-flag-detection.md" })`)
130
+ 2. Execute the step's instructions completely
131
+ 3. Verify all success criteria are met before proceeding
132
+ 4. Pass the step's output as context to the next step
133
+ 5. If a step fails, halt and report the failure point -- do not skip ahead
373
134
 
374
- | Function | File:Line | Cyclomatic | Cognitive | LOC | Risk |
375
- |----------|-----------|------------|-----------|-----|------|
376
- | functionName | file.ts:42 | X | X | X | High/Medium/Low |
135
+ ### Resume Support
377
136
 
378
- **Thresholds:**
379
- - Cyclomatic: <=10 (Good), 11-20 (Warning), >20 (Critical)
380
- - Cognitive: <=15 (Good), 16-25 (Warning), >25 (Critical)
381
- - LOC: <=50 (Good), 51-100 (Warning), >100 (Critical)
382
-
383
- ### 2. Hotspot Detection
384
-
385
- Identify the top 5 complexity hotspots:
386
-
387
- | Rank | Function | Cyclomatic | Cognitive | Change Frequency | Priority |
388
- |------|----------|------------|-----------|------------------|----------|
389
- | 1 | ... | X | X | High/Medium/Low | P0 |
390
- | 2 | ... | X | X | High/Medium/Low | P0/P1 |
391
- | ... | ... | X | X | ... | ... |
392
-
393
- ### 3. Code Smell Detection
394
-
395
- | Smell | Location | Severity | Refactoring Suggestion |
396
- |-------|----------|----------|----------------------|
397
- | Long Method | file:line | Critical/Major/Minor | Extract method: [specific suggestion] |
398
- | Deep Nesting | file:line | Critical/Major/Minor | Guard clauses, early returns |
399
- | God Class | file:line | Critical/Major/Minor | Split into: [specific classes] |
400
- | Feature Envy | file:line | Critical/Major/Minor | Move to: [target class] |
401
- | Duplicate Code | file:line | Critical/Major/Minor | Extract: [common abstraction] |
402
-
403
- **MINIMUM: Identify at least 3 code smells or explicitly state "No significant code smells found after thorough analysis".**
404
-
405
- ### 4. Maintainability Index
406
-
407
- | Component | MI Score (0-100) | Rating | Notes |
408
- |-----------|-----------------|--------|-------|
409
- | Overall | X | A/B/C/D/F | ... |
410
- | Module 1 | X | A/B/C/D/F | ... |
411
- | Module 2 | X | A/B/C/D/F | ... |
412
-
413
- **Rating Scale:**
414
- - A (85-100): Highly maintainable
415
- - B (65-84): Moderately maintainable
416
- - C (40-64): Difficult to maintain
417
- - D (20-39): Very difficult to maintain
418
- - F (0-19): Unmaintainable
419
-
420
- ### 5. Complexity Summary
421
-
422
- | Metric | Value | Threshold | Status |
423
- |--------|-------|-----------|--------|
424
- | Avg Cyclomatic Complexity | X | <= 10 | PASS/WARN/FAIL |
425
- | Max Cyclomatic Complexity | X | <= 20 | PASS/WARN/FAIL |
426
- | Avg Cognitive Complexity | X | <= 15 | PASS/WARN/FAIL |
427
- | Max Cognitive Complexity | X | <= 25 | PASS/WARN/FAIL |
428
- | Functions > 50 LOC | X% | <= 10% | PASS/WARN/FAIL |
429
- | Nesting Depth > 4 | X | 0 | PASS/WARN/FAIL |
430
-
431
- **COMPLEXITY SCORE: X/100** (inverse: lower complexity = higher score)
432
-
433
- ## OUTPUT FORMAT
434
-
435
- Save your complete analysis in Markdown to:
436
- ${OUTPUT_FOLDER}/03-code-complexity.md
437
-
438
- Use the Write tool to save BEFORE completing.
439
- Report MUST be complete - no placeholders.
440
-
441
- ## VALIDATION BEFORE SUBMITTING
442
-
443
- +-- Did I analyze every function/method?
444
- +-- Did I calculate both cyclomatic and cognitive complexity?
445
- +-- Did I identify top 5 hotspots?
446
- +-- Did I detect code smells?
447
- +-- Did I calculate maintainability index?
448
- +-- Did I save the report to the correct output path?`,
449
- subagent_type: "qe-code-complexity",
450
- run_in_background: true
451
- })
452
- ```
453
-
454
- ### Agent 3: Coverage Specialist
455
-
456
- **This agent MUST detect coverage gaps using O(log n) sublinear analysis. Gap count is mandatory.**
457
-
458
- ```
459
- Task({
460
- description: "O(log n) sublinear coverage gap detection",
461
- prompt: `You are qe-coverage-specialist. Your output quality is being audited.
462
-
463
- ## CODE TO ANALYZE
464
-
465
- === SOURCE CODE START ===
466
- [PASTE THE COMPLETE SOURCE CODE HERE - DO NOT SUMMARIZE]
467
- === SOURCE CODE END ===
468
-
469
- === TEST CODE START ===
470
- [PASTE THE COMPLETE TEST CODE HERE - DO NOT SUMMARIZE]
471
- === TEST CODE END ===
472
-
473
- ## REQUIRED OUTPUT (ALL SECTIONS MANDATORY)
474
-
475
- ### 1. Coverage Overview
476
-
477
- | Metric | Value | Threshold | Status |
478
- |--------|-------|-----------|--------|
479
- | Line Coverage | X% | >= 80% | PASS/WARN/FAIL |
480
- | Branch Coverage | X% | >= 70% | PASS/WARN/FAIL |
481
- | Function Coverage | X% | >= 90% | PASS/WARN/FAIL |
482
- | Statement Coverage | X% | >= 80% | PASS/WARN/FAIL |
483
-
484
- ### 2. Coverage Gap Analysis (O(log n) Sublinear)
485
-
486
- For EACH detected gap:
487
-
488
- | Gap ID | File:Line | Type | Risk Score | Description |
489
- |--------|-----------|------|------------|-------------|
490
- | G001 | file.ts:42-56 | Uncovered Branch | High/Medium/Low | [what is not tested] |
491
- | G002 | file.ts:78 | Missing Error Path | High/Medium/Low | [what error is not handled] |
492
- | G003 | ... | ... | ... | ... |
493
-
494
- **Gap Types:**
495
- - Uncovered Branch: if/else path not tested
496
- - Missing Error Path: catch/error handler not tested
497
- - Untested Function: entire function without tests
498
- - Partial Coverage: function tested but branches missed
499
- - Dead Code: unreachable code detected
500
-
501
- ### 3. Risk-Weighted Gap Prioritization
502
-
503
- | Priority | Gap IDs | Risk Rationale | Suggested Test |
504
- |----------|---------|---------------|----------------|
505
- | P0 - Critical | G001, G003 | [why critical] | [specific test to write] |
506
- | P1 - High | G002, G005 | [why high] | [specific test to write] |
507
- | P2 - Medium | G004 | [why medium] | [specific test to write] |
508
-
509
- ### 4. Module-Level Coverage Heatmap
510
-
511
- | Module | Line% | Branch% | Function% | Risk Level |
512
- |--------|-------|---------|-----------|------------|
513
- | Module 1 | X% | X% | X% | High/Medium/Low |
514
- | Module 2 | X% | X% | X% | High/Medium/Low |
515
- | ... | ... | ... | ... | ... |
516
-
517
- ### 5. Coverage Trend Assessment
518
-
519
- Based on code structure analysis:
520
-
521
- | Dimension | Assessment | Recommendation |
522
- |-----------|-----------|----------------|
523
- | Test-to-Code Alignment | Good/Partial/Poor | [specific action] |
524
- | Edge Case Coverage | Good/Partial/Poor | [specific action] |
525
- | Integration Coverage | Good/Partial/Poor | [specific action] |
526
- | Error Path Coverage | Good/Partial/Poor | [specific action] |
527
-
528
- **COVERAGE GAPS TOTAL: X**
529
- **CRITICAL GAPS (P0): X**
530
-
531
- **MINIMUM: Identify at least 3 coverage gaps or explicitly state "No coverage gaps found after thorough sublinear analysis".**
532
-
533
- ## OUTPUT FORMAT
534
-
535
- Save your complete analysis in Markdown to:
536
- ${OUTPUT_FOLDER}/04-coverage-analysis.md
537
-
538
- Use the Write tool to save BEFORE completing.
539
- Report MUST be complete - no placeholders.
540
-
541
- ## VALIDATION BEFORE SUBMITTING
542
-
543
- +-- Did I calculate all 4 coverage metrics?
544
- +-- Did I detect coverage gaps with specific file:line references?
545
- +-- Did I risk-weight and prioritize gaps?
546
- +-- Did I provide specific test suggestions for each gap?
547
- +-- Did I generate the module-level heatmap?
548
- +-- Did I save the report to the correct output path?`,
549
- subagent_type: "qe-coverage-specialist",
550
- run_in_background: true
551
- })
552
- ```
553
-
554
- ### Post-Spawn Confirmation
555
-
556
- After sending all three Task calls, you MUST tell the user:
557
-
558
- ```
559
- I've launched 3 core agents in parallel:
560
-
561
- qe-tdd-specialist [Domain: test-generation]
562
- - Assessing TDD red-green-refactor adherence
563
- - Calculating test-to-code ratio and assertion density
564
- - Identifying missing test categories
565
-
566
- qe-code-complexity [Domain: code-intelligence]
567
- - Computing cyclomatic and cognitive complexity per function
568
- - Detecting hotspots and code smells
569
- - Calculating maintainability index
570
-
571
- qe-coverage-specialist [Domain: coverage-analysis]
572
- - Running O(log n) sublinear coverage gap detection
573
- - Risk-weighting and prioritizing gaps
574
- - Generating module-level coverage heatmap
575
-
576
- WAITING for all agents to complete before proceeding...
577
- ```
578
-
579
- **DO NOT proceed to Phase 3 until you have sent this confirmation.**
137
+ To resume from a specific step: specify `--from-step N` and the orchestrator will
138
+ skip to step N. Ensure you have the required prerequisite data from prior steps.
580
139
 
581
140
  ---
582
141
 
583
- ## PHASE 3: Wait for Batch 1 Completion
584
-
585
- ### ENFORCEMENT: NO EARLY PROCEEDING
586
-
587
- ```
588
- +-------------------------------------------------------------+
589
- | YOU MUST WAIT FOR ALL THREE BACKGROUND TASKS TO COMPLETE |
590
- | |
591
- | DO NOT summarize what agents "would" find |
592
- | DO NOT proceed to Phase 4 early |
593
- | DO NOT provide your own analysis as substitute |
594
- | |
595
- | WAIT for actual agent results |
596
- | ONLY proceed when all three have returned |
597
- +-------------------------------------------------------------+
598
- ```
599
-
600
- ### Results Extraction Checklist
601
-
602
- When results return, extract and record:
603
-
604
- ```
605
- From qe-tdd-specialist:
606
- [ ] tddAdherence = __/60 TDD score
607
- [ ] testToCodeRatio = __:1
608
- [ ] assertionDensity = __ per test
609
- [ ] missingCategories = __ test categories missing
610
-
611
- From qe-code-complexity:
612
- [ ] avgCyclomatic = __ average cyclomatic complexity
613
- [ ] maxCyclomatic = __ maximum cyclomatic complexity
614
- [ ] complexityScore = __/100 (inverse complexity)
615
- [ ] hotspots = __ hotspots identified
616
- [ ] codeSmells = __ code smells detected
142
+ ## Agent Inventory
617
143
 
618
- From qe-coverage-specialist:
619
- [ ] lineCoverage = __% line coverage
620
- [ ] branchCoverage = __% branch coverage
621
- [ ] coverageGaps = __ total gaps
622
- [ ] criticalGaps = __ P0 gaps
623
- ```
144
+ | Agent | Type | Domain | Batch |
145
+ |-------|------|--------|-------|
146
+ | qe-tdd-specialist | Core (always) | test-generation | 1 |
147
+ | qe-code-complexity | Core (always) | code-intelligence | 1 |
148
+ | qe-coverage-specialist | Core (always) | coverage-analysis | 1 |
149
+ | qe-security-scanner | Conditional (HAS_SECURITY_CODE) | security-compliance | 2 |
150
+ | qe-performance-tester | Conditional (HAS_PERFORMANCE_CODE) | chaos-resilience | 2 |
151
+ | qe-mutation-tester | Conditional (HAS_CRITICAL_CODE) | test-generation | 2 |
152
+ | qe-message-broker-tester | Conditional (HAS_MIDDLEWARE) | enterprise-integration | 2 |
153
+ | qe-sap-idoc-tester | Conditional (HAS_SAP_INTEGRATION) | enterprise-integration | 2 |
154
+ | qe-sod-analyzer | Conditional (HAS_AUTHORIZATION) | enterprise-integration | 2 |
155
+ | qe-defect-predictor | Analysis (always) | defect-intelligence | 3 |
624
156
 
625
- ### Metrics Summary Box
626
-
627
- Output extracted metrics:
628
-
629
- ```
630
- +-------------------------------------------------------------+
631
- | BATCH 1 RESULTS SUMMARY |
632
- +-------------------------------------------------------------+
633
- | |
634
- | TDD Adherence: __/60 |
635
- | Test-to-Code Ratio: __:1 |
636
- | Assertion Density: __ per test |
637
- | Missing Test Categories: __ |
638
- | |
639
- | Avg Cyclomatic: __ |
640
- | Max Cyclomatic: __ |
641
- | Complexity Score: __/100 |
642
- | Hotspots: __ |
643
- | Code Smells: __ |
644
- | |
645
- | Line Coverage: __% |
646
- | Branch Coverage: __% |
647
- | Coverage Gaps: __ total |
648
- | Critical Gaps (P0): __ |
649
- | |
650
- +-------------------------------------------------------------+
651
- ```
652
-
653
- **DO NOT proceed to Phase 4 until ALL fields are filled.**
157
+ **Total: 10 agents (3 core + 6 conditional + 1 analysis)**
654
158
 
655
159
  ---
656
160
 
657
- ## PHASE 4: Spawn Conditional Agents (PARALLEL BATCH 2)
658
-
659
- ### ENFORCEMENT: NO SKIPPING CONDITIONAL AGENTS
660
-
661
- ```
662
- +-------------------------------------------------------------+
663
- | IF A FLAG IS TRUE, YOU MUST SPAWN THAT AGENT |
664
- | |
665
- | HAS_SECURITY_CODE = TRUE -> MUST spawn qe-security-scanner |
666
- | HAS_PERFORMANCE_CODE = TRUE -> MUST spawn qe-performance-tester |
667
- | HAS_CRITICAL_CODE = TRUE -> MUST spawn qe-mutation-tester |
668
- | HAS_MIDDLEWARE = TRUE -> MUST spawn qe-message-broker-tester|
669
- | HAS_SAP_INTEGRATION = TRUE -> MUST spawn qe-sap-idoc-tester |
670
- | HAS_AUTHORIZATION = TRUE -> MUST spawn qe-sod-analyzer |
671
- | |
672
- | Skipping a flagged agent is a FAILURE of this skill. |
673
- +-------------------------------------------------------------+
674
- ```
675
-
676
- ### Conditional Domain Mapping
677
-
678
- | Flag | Agent | Domain | MCP Tool |
679
- |------|-------|--------|----------|
680
- | HAS_SECURITY_CODE | qe-security-scanner | security-compliance | `security_scan_comprehensive` |
681
- | HAS_PERFORMANCE_CODE | qe-performance-tester | chaos-resilience | `performance_benchmark` |
682
- | HAS_CRITICAL_CODE | qe-mutation-tester | test-generation | `test_generate_enhanced` |
683
- | HAS_MIDDLEWARE | qe-message-broker-tester | enterprise-integration | `task_orchestrate` |
684
- | HAS_SAP_INTEGRATION | qe-sap-idoc-tester | enterprise-integration | `task_orchestrate` |
685
- | HAS_AUTHORIZATION | qe-sod-analyzer | enterprise-integration | `task_orchestrate` |
686
-
687
- ### Decision Tree
688
-
689
- ```
690
- IF HAS_SECURITY_CODE == FALSE AND HAS_PERFORMANCE_CODE == FALSE AND HAS_CRITICAL_CODE == FALSE AND HAS_MIDDLEWARE == FALSE AND HAS_SAP_INTEGRATION == FALSE AND HAS_AUTHORIZATION == FALSE:
691
- -> Skip to Phase 5 (no conditional agents needed)
692
- -> State: "No conditional agents needed based on code analysis"
693
-
694
- ELSE:
695
- -> Spawn ALL applicable agents in ONE message
696
- -> Count how many you're spawning: __
697
- ```
698
-
699
- ### IF HAS_SECURITY_CODE: Security Scanner (MANDATORY WHEN FLAGGED)
700
-
701
- ```
702
- Task({
703
- description: "SAST security scanning of source code",
704
- prompt: `You are qe-security-scanner. Your output quality is being audited.
705
-
706
- ## SOURCE CODE
707
-
708
- === SOURCE CODE START ===
709
- [PASTE THE COMPLETE SOURCE CODE HERE]
710
- === SOURCE CODE END ===
711
-
712
- ## REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)
713
-
714
- ### 1. OWASP Top 10 Assessment
715
-
716
- For each applicable OWASP category:
717
-
718
- | OWASP ID | Category | Applicable? | Findings | Severity |
719
- |----------|----------|-------------|----------|----------|
720
- | A01:2021 | Broken Access Control | Yes/No | [findings] | Critical/High/Medium/Low |
721
- | A02:2021 | Cryptographic Failures | Yes/No | [findings] | Critical/High/Medium/Low |
722
- | A03:2021 | Injection | Yes/No | [findings] | Critical/High/Medium/Low |
723
- | A04:2021 | Insecure Design | Yes/No | [findings] | Critical/High/Medium/Low |
724
- | A05:2021 | Security Misconfiguration | Yes/No | [findings] | Critical/High/Medium/Low |
725
- | A06:2021 | Vulnerable Components | Yes/No | [findings] | Critical/High/Medium/Low |
726
- | A07:2021 | Auth Failures | Yes/No | [findings] | Critical/High/Medium/Low |
727
- | A08:2021 | Software Integrity Failures | Yes/No | [findings] | Critical/High/Medium/Low |
728
- | A09:2021 | Logging Failures | Yes/No | [findings] | Critical/High/Medium/Low |
729
- | A10:2021 | SSRF | Yes/No | [findings] | Critical/High/Medium/Low |
730
-
731
- ### 2. Vulnerability Inventory
732
-
733
- | Vuln ID | File:Line | Type | Severity | CVSS | Remediation |
734
- |---------|-----------|------|----------|------|-------------|
735
- | V001 | ... | SQL Injection/XSS/etc | Critical/High/Medium/Low | X.X | [specific fix] |
736
-
737
- ### 3. Secrets Detection
738
-
739
- | Finding | File:Line | Type | Status |
740
- |---------|-----------|------|--------|
741
- | ... | ... | API Key/Password/Token/Cert | Exposed/Safe |
742
-
743
- ### 4. Dependency Vulnerability Check
744
-
745
- | Dependency | Version | Known CVEs | Severity | Fix Version |
746
- |------------|---------|------------|----------|-------------|
747
- | ... | X.Y.Z | CVE-XXXX-XXXXX | Critical/High | X.Y.Z+ |
748
-
749
- ### 5. Security Score
750
-
751
- | Dimension | Score (0-10) | Notes |
752
- |-----------|-------------|-------|
753
- | Input validation | X/10 | ... |
754
- | Authentication | X/10 | ... |
755
- | Authorization | X/10 | ... |
756
- | Data protection | X/10 | ... |
757
- | Error handling | X/10 | ... |
758
-
759
- **SECURITY SCORE: X/50**
760
-
761
- **MINIMUM: Assess all 10 OWASP categories and identify at least 3 security-related findings.**
762
-
763
- ## OUTPUT FORMAT
764
-
765
- Save to: ${OUTPUT_FOLDER}/05-security-scan.md
766
- Use the Write tool to save BEFORE completing.`,
767
- subagent_type: "qe-security-scanner",
768
- run_in_background: true
769
- })
770
- ```
771
-
772
- ### IF HAS_PERFORMANCE_CODE: Performance Tester (MANDATORY WHEN FLAGGED)
773
-
774
- ```
775
- Task({
776
- description: "Performance profiling and bottleneck detection",
777
- prompt: `You are qe-performance-tester. Your output quality is being audited.
778
-
779
- ## SOURCE CODE
780
-
781
- === SOURCE CODE START ===
782
- [PASTE THE COMPLETE SOURCE CODE HERE]
783
- === SOURCE CODE END ===
784
-
785
- ## REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)
786
-
787
- ### 1. Algorithm Complexity Analysis
788
-
789
- For each significant function:
790
-
791
- | Function | File:Line | Time Complexity | Space Complexity | Concern |
792
- |----------|-----------|-----------------|------------------|---------|
793
- | ... | ... | O(n)/O(n^2)/etc | O(1)/O(n)/etc | [if problematic] |
794
-
795
- ### 2. Performance Bottleneck Detection
796
-
797
- | Bottleneck | File:Line | Type | Impact | Recommendation |
798
- |------------|-----------|------|--------|----------------|
799
- | ... | ... | CPU/Memory/I-O/Network | High/Medium/Low | [specific fix] |
800
-
801
- **Bottleneck Types:**
802
- - CPU Bound: nested loops, complex calculations, regex backtracking
803
- - Memory Bound: large allocations, memory leaks, unbounded caches
804
- - I/O Bound: synchronous file ops, blocking network calls, N+1 queries
805
- - Network Bound: excessive API calls, large payloads, no batching
806
-
807
- ### 3. Database Query Analysis (if applicable)
808
-
809
- | Query | Location | Estimated Cost | Index Used? | Optimization |
810
- |-------|----------|---------------|-------------|-------------|
811
- | ... | file:line | High/Medium/Low | Yes/No | [specific fix] |
812
-
813
- ### 4. Resource Usage Estimation
814
-
815
- | Resource | Current Pattern | Risk | Recommendation |
816
- |----------|----------------|------|----------------|
817
- | Memory allocation | [pattern] | High/Medium/Low | [action] |
818
- | Connection pooling | [pattern] | High/Medium/Low | [action] |
819
- | Cache strategy | [pattern] | High/Medium/Low | [action] |
820
- | Concurrency model | [pattern] | High/Medium/Low | [action] |
821
-
822
- ### 5. Performance Score
823
-
824
- | Dimension | Score (0-10) | Notes |
825
- |-----------|-------------|-------|
826
- | Algorithm efficiency | X/10 | ... |
827
- | Memory management | X/10 | ... |
828
- | I/O optimization | X/10 | ... |
829
- | Concurrency safety | X/10 | ... |
830
-
831
- **PERFORMANCE SCORE: X/40**
832
-
833
- **MINIMUM: Analyze at least 5 functions for complexity or explain why fewer exist.**
834
-
835
- ## OUTPUT FORMAT
836
-
837
- Save to: ${OUTPUT_FOLDER}/06-performance-profile.md
838
- Use the Write tool to save BEFORE completing.`,
839
- subagent_type: "qe-performance-tester",
840
- run_in_background: true
841
- })
842
- ```
843
-
844
- ### IF HAS_CRITICAL_CODE: Mutation Tester (MANDATORY WHEN FLAGGED)
845
-
846
- ```
847
- Task({
848
- description: "Mutation testing for test suite effectiveness",
849
- prompt: `You are qe-mutation-tester. Your output quality is being audited.
850
-
851
- ## SOURCE CODE
852
-
853
- === SOURCE CODE START ===
854
- [PASTE THE COMPLETE SOURCE CODE HERE]
855
- === SOURCE CODE END ===
856
-
857
- === TEST CODE START ===
858
- [PASTE THE COMPLETE TEST CODE HERE]
859
- === TEST CODE END ===
860
-
861
- ## REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)
862
-
863
- ### 1. Mutation Analysis
864
-
865
- Apply these mutation operators to critical code paths:
866
-
867
- | Operator | Mutations Applied | Killed | Survived | Kill Rate |
868
- |----------|------------------|--------|----------|-----------|
869
- | Arithmetic (+,-,*,/) | X | X | X | X% |
870
- | Relational (<,>,==,!=) | X | X | X | X% |
871
- | Logical (&&, or, !) | X | X | X | X% |
872
- | Conditional (if/else) | X | X | X | X% |
873
- | Return Value | X | X | X | X% |
874
- | Null/Undefined | X | X | X | X% |
875
- | **TOTAL** | **X** | **X** | **X** | **X%** |
876
-
877
- ### 2. Surviving Mutants (Test Suite Weaknesses)
878
-
879
- For each surviving mutant:
880
-
881
- | Mutant ID | File:Line | Original | Mutation | Why Survived | Missing Test |
882
- |-----------|-----------|----------|----------|-------------|-------------|
883
- | M001 | file:42 | `a > b` | `a >= b` | No boundary test | Test for a == b case |
884
- | M002 | ... | ... | ... | ... | ... |
885
-
886
- ### 3. Critical Path Mutation Score
887
-
888
- | Critical Path | Mutations | Killed | Score | Status |
889
- |---------------|-----------|--------|-------|--------|
890
- | Payment flow | X | X | X% | PASS/FAIL (>= 95%) |
891
- | Auth flow | X | X | X% | PASS/FAIL (>= 95%) |
892
- | Data validation | X | X | X% | PASS/FAIL (>= 90%) |
893
- | Error handling | X | X | X% | PASS/FAIL (>= 85%) |
894
-
895
- ### 4. Test Suite Effectiveness
896
-
897
- | Metric | Value | Threshold | Status |
898
- |--------|-------|-----------|--------|
899
- | Overall Mutation Score | X% | >= 80% | PASS/FAIL |
900
- | Critical Path Score | X% | >= 95% | PASS/FAIL |
901
- | Equivalent Mutants | X | (informational) | - |
902
- | Test Strength Index | X/10 | >= 7 | PASS/FAIL |
903
-
904
- ### 5. Recommendations
905
-
906
- | Priority | Action | Impact | Effort |
907
- |----------|--------|--------|--------|
908
- | P0 | [critical path mutation escapes] | [what risk] | [effort] |
909
- | P1 | [high-value missing tests] | [what risk] | [effort] |
910
-
911
- **MUTATION SCORE: X%**
912
-
913
- **MINIMUM: Apply at least 20 mutations across at least 3 mutation operators.**
914
-
915
- ## OUTPUT FORMAT
916
-
917
- Save to: ${OUTPUT_FOLDER}/07-mutation-analysis.md
918
- Use the Write tool to save BEFORE completing.`,
919
- subagent_type: "qe-mutation-tester",
920
- run_in_background: true
921
- })
922
- ```
923
-
924
- ### IF HAS_MIDDLEWARE: Message Broker Tester (MANDATORY WHEN FLAGGED)
925
-
926
- ```
927
- Task({
928
- description: "Message broker and middleware testing for integration reliability",
929
- prompt: `You are qe-message-broker-tester. Your output quality is being audited.
930
-
931
- ## SOURCE CODE
932
-
933
- === SOURCE CODE START ===
934
- [PASTE THE COMPLETE SOURCE CODE HERE]
935
- === SOURCE CODE END ===
936
-
937
- === TEST CODE START ===
938
- [PASTE THE COMPLETE TEST CODE HERE]
939
- === TEST CODE END ===
940
-
941
- ## REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)
942
-
943
- ### 1. Message Broker Inventory
944
-
945
- Identify all middleware/message broker components in the source code:
946
-
947
- | Component | Type | Protocol | Direction | Status |
948
- |-----------|------|----------|-----------|--------|
949
- | [name] | Queue/Topic/Exchange | AMQP/Kafka/JMS/MQ | Producer/Consumer/Both | Active/Passive |
950
-
951
- ### 2. Message Flow Analysis
952
-
953
- For each message flow:
954
-
955
- | Flow ID | Producer | Broker | Consumer | Payload Schema | Ordering | Idempotency |
956
- |---------|----------|--------|----------|----------------|----------|-------------|
957
- | MF-001 | [source] | [broker] | [target] | [schema ref] | Guaranteed/Best-effort | Yes/No |
958
-
959
- ### 3. Error Handling & Retry Assessment
960
-
961
- | Pattern | Implemented | Correct | Issue |
962
- |---------|-------------|---------|-------|
963
- | Dead Letter Queue (DLQ) | Yes/No | Yes/No | [issue] |
964
- | Retry with backoff | Yes/No | Yes/No | [issue] |
965
- | Circuit breaker | Yes/No | Yes/No | [issue] |
966
- | Poison message handling | Yes/No | Yes/No | [issue] |
967
- | Duplicate detection | Yes/No | Yes/No | [issue] |
968
-
969
- ### 4. Pub/Sub Verification
970
-
971
- | Topic/Exchange | Publishers | Subscribers | Fan-out | Filtering | Test Coverage |
972
- |----------------|------------|-------------|---------|-----------|---------------|
973
- | [name] | [count] | [count] | [type] | [rules] | [%] |
974
-
975
- ### 5. Message Contract Validation
976
-
977
- | Contract | Schema Validation | Versioning | Backward Compatible | Breaking Changes |
978
- |----------|-------------------|------------|---------------------|------------------|
979
- | [name] | Yes/No | [strategy] | Yes/No | [list] |
980
-
981
- ### 6. Recommendations
982
-
983
- | Priority | Action | Impact | Effort |
984
- |----------|--------|--------|--------|
985
- | P0 | [critical middleware issues] | [what risk] | [effort] |
986
- | P1 | [important improvements] | [what risk] | [effort] |
987
-
988
- **MIDDLEWARE HEALTH SCORE: X/50**
989
-
990
- ## OUTPUT FORMAT
991
-
992
- Save to: $\{OUTPUT_FOLDER}/10-middleware-testing.md
993
- Use the Write tool to save BEFORE completing.`,
994
- subagent_type: "qe-message-broker-tester",
995
- run_in_background: true
996
- })
997
- ```
998
-
999
- ### IF HAS_SAP_INTEGRATION: SAP IDoc Tester (MANDATORY WHEN FLAGGED)
1000
-
1001
- ```
1002
- Task({
1003
- description: "SAP IDoc processing and BAPI testing for data flow validation",
1004
- prompt: `You are qe-sap-idoc-tester. Your output quality is being audited.
1005
-
1006
- ## SOURCE CODE
1007
-
1008
- === SOURCE CODE START ===
1009
- [PASTE THE COMPLETE SOURCE CODE HERE]
1010
- === SOURCE CODE END ===
1011
-
1012
- === TEST CODE START ===
1013
- [PASTE THE COMPLETE TEST CODE HERE]
1014
- === TEST CODE END ===
1015
-
1016
- ## REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)
1017
-
1018
- ### 1. SAP Integration Inventory
1019
-
1020
- Identify all SAP integration points in the source code:
1021
-
1022
- | Integration Point | Type | Direction | SAP System | Protocol | Status |
1023
- |-------------------|------|-----------|------------|----------|--------|
1024
- | [name] | RFC/BAPI/IDoc/OData/CDS | Inbound/Outbound | S/4HANA/ECC/EWM | [protocol] | Active/Passive |
1025
-
1026
- ### 2. IDoc Processing Analysis
1027
-
1028
- For each IDoc type:
1029
-
1030
- | IDoc Type | Message Type | Direction | Segments | Partner Profile | Error Handling | Test Coverage |
1031
- |-----------|-------------|-----------|----------|-----------------|----------------|---------------|
1032
- | [type] | [msg type] | In/Out | [count] | [profile] | [strategy] | [%] |
1033
-
1034
- ### 3. BAPI/RFC Call Assessment
1035
-
1036
- | BAPI/RFC | Parameters | Commit Handling | Error Codes | Rollback | Idempotency |
1037
- |----------|------------|-----------------|-------------|----------|-------------|
1038
- | [name] | In:[n] Out:[n] | BAPI_TRANSACTION_COMMIT? | [handled codes] | Yes/No | Yes/No |
1039
-
1040
- ### 4. Data Flow Validation
1041
-
1042
- | Flow | Source | Mapping | Target | Transformation | Validation Rules | Gaps |
1043
- |------|--------|---------|--------|----------------|------------------|------|
1044
- | [name] | [field map] | [logic] | [SAP field] | [rules] | [validation] | [gaps] |
1045
-
1046
- ### 5. SAP-Specific Test Coverage
1047
-
1048
- | Test Type | Coverage | Critical Gaps |
1049
- |-----------|----------|---------------|
1050
- | IDoc parsing/generation | [%] | [gaps] |
1051
- | BAPI call/response | [%] | [gaps] |
1052
- | RFC error handling | [%] | [gaps] |
1053
- | Data mapping accuracy | [%] | [gaps] |
1054
- | Transaction integrity | [%] | [gaps] |
1055
-
1056
- ### 6. Recommendations
1057
-
1058
- | Priority | Action | Impact | Effort |
1059
- |----------|--------|--------|--------|
1060
- | P0 | [critical SAP integration issues] | [what risk] | [effort] |
1061
- | P1 | [important improvements] | [what risk] | [effort] |
1062
-
1063
- **SAP INTEGRATION HEALTH SCORE: X/50**
1064
-
1065
- ## OUTPUT FORMAT
1066
-
1067
- Save to: $\{OUTPUT_FOLDER}/11-sap-idoc-testing.md
1068
- Use the Write tool to save BEFORE completing.`,
1069
- subagent_type: "qe-sap-idoc-tester",
1070
- run_in_background: true
1071
- })
1072
- ```
1073
-
1074
- ### IF HAS_AUTHORIZATION: SoD Analyzer (MANDATORY WHEN FLAGGED)
1075
-
1076
- ```
1077
- Task({
1078
- description: "Segregation of duties and authorization conflict analysis",
1079
- prompt: `You are qe-sod-analyzer. Your output quality is being audited.
1080
-
1081
- ## SOURCE CODE
1082
-
1083
- === SOURCE CODE START ===
1084
- [PASTE THE COMPLETE SOURCE CODE HERE]
1085
- === SOURCE CODE END ===
1086
-
1087
- === TEST CODE START ===
1088
- [PASTE THE COMPLETE TEST CODE HERE]
1089
- === TEST CODE END ===
1090
-
1091
- ## REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)
1092
-
1093
- ### 1. Authorization Model Inventory
1094
-
1095
- Identify all authorization constructs in the source code:
1096
-
1097
- | Component | Type | Mechanism | Granularity | Status |
1098
- |-----------|------|-----------|-------------|--------|
1099
- | [name] | Role/Permission/Policy | RBAC/ABAC/ACL | Resource/Action/Field | Active/Passive |
1100
-
1101
- ### 2. Segregation of Duties Matrix
1102
-
1103
- | Function A | Function B | Conflict Type | Risk Level | Mitigating Control | Test Coverage |
1104
- |------------|------------|---------------|------------|-------------------|---------------|
1105
- | [create order] | [approve order] | SoD violation | Critical/High/Med | [control] | [%] |
1106
-
1107
- ### 3. Role Conflict Detection
1108
-
1109
- | Role | Permissions | Conflicts With | Conflict Type | Remediation |
1110
- |------|-------------|---------------|---------------|-------------|
1111
- | [role] | [permissions list] | [conflicting role] | [SoD/privilege escalation] | [action] |
1112
-
1113
- ### 4. Authorization Test Coverage
1114
-
1115
- | Test Type | Coverage | Critical Gaps |
1116
- |-----------|----------|---------------|
1117
- | Positive access tests | [%] | [gaps] |
1118
- | Negative access tests | [%] | [gaps] |
1119
- | Cross-role access | [%] | [gaps] |
1120
- | Privilege escalation | [%] | [gaps] |
1121
- | SoD enforcement | [%] | [gaps] |
1122
-
1123
- ### 5. Access Control Code Quality
1124
-
1125
- | Metric | Value | Threshold | Status |
1126
- |--------|-------|-----------|--------|
1127
- | Authorization checks per endpoint | [ratio] | >= 1.0 | PASS/FAIL |
1128
- | Hardcoded roles/permissions | [count] | 0 | PASS/FAIL |
1129
- | Missing access control | [count] | 0 | PASS/FAIL |
1130
- | Default-allow patterns | [count] | 0 | PASS/FAIL |
1131
-
1132
- ### 6. Recommendations
1133
-
1134
- | Priority | Action | Impact | Effort |
1135
- |----------|--------|--------|--------|
1136
- | P0 | [critical authorization issues] | [what risk] | [effort] |
1137
- | P1 | [important improvements] | [what risk] | [effort] |
1138
-
1139
- **AUTHORIZATION HEALTH SCORE: X/50**
1140
-
1141
- ## OUTPUT FORMAT
1142
-
1143
- Save to: $\{OUTPUT_FOLDER}/12-sod-analysis.md
1144
- Use the Write tool to save BEFORE completing.`,
1145
- subagent_type: "qe-sod-analyzer",
1146
- run_in_background: true
1147
- })
1148
- ```
1149
-
1150
- ### Agent Count Validation
1151
-
1152
- **Before proceeding, verify agent count:**
1153
-
1154
- ```
1155
- +-------------------------------------------------------------+
1156
- | AGENT COUNT VALIDATION |
1157
- +-------------------------------------------------------------+
1158
- | |
1159
- | CORE AGENTS (ALWAYS 3): |
1160
- | [ ] qe-tdd-specialist - SPAWNED? [Y/N] |
1161
- | [ ] qe-code-complexity - SPAWNED? [Y/N] |
1162
- | [ ] qe-coverage-specialist - SPAWNED? [Y/N] |
1163
- | |
1164
- | CONDITIONAL AGENTS (based on flags): |
1165
- | [ ] qe-security-scanner - SPAWNED? [Y/N] (HAS_SECURITY) |
1166
- | [ ] qe-performance-tester - SPAWNED? [Y/N] (HAS_PERF) |
1167
- | [ ] qe-mutation-tester - SPAWNED? [Y/N] (HAS_CRITICAL) |
1168
- | [ ] qe-message-broker-tester - SPAWNED? [Y/N] (HAS_MIDDLEWARE) |
1169
- | [ ] qe-sap-idoc-tester - SPAWNED? [Y/N] (HAS_SAP_INTEG) |
1170
- | [ ] qe-sod-analyzer - SPAWNED? [Y/N] (HAS_AUTHORIZATION) |
1171
- | |
1172
- | VALIDATION: |
1173
- | Expected agents: [3 + count of TRUE flags] |
1174
- | Actual spawned: [count] |
1175
- | Status: [PASS/FAIL] |
1176
- | |
1177
- | If ACTUAL < EXPECTED, you have FAILED. Spawn missing |
1178
- | agents before proceeding. |
1179
- | |
1180
- +-------------------------------------------------------------+
1181
- ```
1182
-
1183
- **DO NOT proceed if validation FAILS.**
1184
-
1185
- ### Post-Spawn Confirmation (If Applicable)
1186
-
1187
- ```
1188
- I've launched [N] conditional agent(s) in parallel:
1189
-
1190
- [IF HAS_SECURITY_CODE] qe-security-scanner [Domain: security-compliance]
1191
- - OWASP Top 10, SAST scanning, secrets detection
1192
- [IF HAS_PERFORMANCE_CODE] qe-performance-tester [Domain: chaos-resilience]
1193
- - Algorithm complexity, bottleneck detection, resource analysis
1194
- [IF HAS_CRITICAL_CODE] qe-mutation-tester [Domain: test-generation]
1195
- - Mutation testing, surviving mutant analysis, test effectiveness
1196
- [IF HAS_MIDDLEWARE] qe-message-broker-tester [Domain: enterprise-integration]
1197
- - Message broker testing, queue validation, pub/sub verification
1198
- [IF HAS_SAP_INTEGRATION] qe-sap-idoc-tester [Domain: enterprise-integration]
1199
- - IDoc processing, BAPI testing, SAP data flow validation
1200
- [IF HAS_AUTHORIZATION] qe-sod-analyzer [Domain: enterprise-integration]
1201
- - Segregation of duties, role conflict, authorization analysis
1202
-
1203
- WAITING for conditional agents to complete...
1204
- ```
1205
-
1206
- ---
1207
-
1208
- ## PHASE 5: Synthesize Results & Determine Recommendation
1209
-
1210
- ### ENFORCEMENT: EXACT DECISION LOGIC
1211
-
1212
- **You MUST apply this logic EXACTLY. No interpretation.**
1213
-
1214
- ```
1215
- STEP 1: Derive composite metrics
1216
- -----------------------------------------------------------
1217
- testCoverage = (lineCoverage + branchCoverage) / 2
1218
- complexityScore = avgCyclomatic (use the average, not max)
1219
- coverageGaps = criticalGaps (P0 gaps only)
1220
- criticalDefects = (criticalVulnerabilities from security scan, if ran)
1221
- + (criticalGaps from coverage)
1222
- + (missingCategories where priority == P0)
1223
-
1224
- STEP 2: Check HOLD conditions (ANY triggers HOLD)
1225
- -----------------------------------------------------------
1226
- IF testCoverage < 50 -> HOLD ("Test coverage critically low")
1227
- IF complexityScore > 30 -> HOLD ("Code complexity dangerously high")
1228
- IF coverageGaps > 5 -> HOLD ("Too many critical coverage gaps")
1229
- IF criticalDefects > 2 -> HOLD ("Too many critical defects")
1230
-
1231
- STEP 3: Check SHIP conditions (ALL required for SHIP)
1232
- -----------------------------------------------------------
1233
- IF testCoverage >= 80
1234
- AND complexityScore <= 15
1235
- AND coverageGaps == 0
1236
- AND criticalDefects == 0 -> SHIP
1237
-
1238
- STEP 4: Default
1239
- -----------------------------------------------------------
1240
- ELSE -> CONDITIONAL
1241
- ```
1242
-
1243
- ### Decision Recording
1244
-
1245
- ```
1246
- METRICS:
1247
- - testCoverage = __% (average of line + branch)
1248
- - complexityScore = __ (average cyclomatic)
1249
- - coverageGaps = __ (P0 critical gaps only)
1250
- - criticalDefects = __
1251
-
1252
- HOLD CHECK:
1253
- - testCoverage < 50? __ (YES/NO)
1254
- - complexityScore > 30? __ (YES/NO)
1255
- - coverageGaps > 5? __ (YES/NO)
1256
- - criticalDefects > 2? __ (YES/NO)
1257
-
1258
- SHIP CHECK (only if no HOLD triggered):
1259
- - testCoverage >= 80? __ (YES/NO)
1260
- - complexityScore <= 15? __ (YES/NO)
1261
- - coverageGaps == 0? __ (YES/NO)
1262
- - criticalDefects == 0? __ (YES/NO)
1263
-
1264
- FINAL RECOMMENDATION: [SHIP / CONDITIONAL / HOLD]
1265
- REASON: ___
1266
- ```
1267
-
1268
- ### Conditional Recommendations
1269
-
1270
- If recommendation is CONDITIONAL, provide specific blockers:
1271
-
1272
- | Blocker | Current Value | Required Value | Owner | Action |
1273
- |---------|--------------|----------------|-------|--------|
1274
- | ... | ... | ... | [who] | [what to do] |
1275
-
1276
- If recommendation is HOLD, provide mandatory remediation:
1277
-
1278
- | Remediation | Priority | Effort | Deadline |
1279
- |-------------|----------|--------|----------|
1280
- | ... | P0 | [scope] | [before merge] |
1281
-
1282
- ---
1283
-
1284
- ## PHASE 6: Generate Development Report
1285
-
1286
- ### ENFORCEMENT: COMPLETE REPORT STRUCTURE
1287
-
1288
- **ALL sections below are MANDATORY. No abbreviations.**
1289
-
1290
- ```markdown
1291
- # QCSD Development Report: [Feature/Module Name]
1292
-
1293
- **Generated**: [Date/Time]
1294
- **Recommendation**: [SHIP / CONDITIONAL / HOLD]
1295
- **Agents Executed**: [List all agents that ran]
1296
- **Parallel Batches**: [2 or 3 depending on conditional agents]
1297
-
1298
- ---
1299
-
1300
- ## Executive Summary
1301
-
1302
- | Metric | Value | Threshold | Status |
1303
- |--------|-------|-----------|--------|
1304
- | Test Coverage | X% | >= 80% | PASS/WARN/FAIL |
1305
- | Avg Cyclomatic Complexity | X | <= 15 | PASS/WARN/FAIL |
1306
- | Coverage Gaps (P0) | X | 0 | PASS/WARN/FAIL |
1307
- | Critical Defects | X | 0 | PASS/WARN/FAIL |
1308
-
1309
- **Recommendation Rationale**: [1-2 sentences explaining why SHIP/CONDITIONAL/HOLD]
1310
-
1311
- ---
1312
-
1313
- ## TDD Adherence Analysis
1314
-
1315
- [EMBED or LINK the full report from qe-tdd-specialist]
1316
-
1317
- ### TDD Score Summary
1318
-
1319
- | Principle | Score | Status |
1320
- |-----------|-------|--------|
1321
- [All 6 TDD principles from qe-tdd-specialist]
1322
-
1323
- ### Test Quality Metrics
1324
- [Key metrics from agent output]
1325
-
1326
- ---
1327
-
1328
- ## Code Complexity Analysis
1329
-
1330
- [EMBED or LINK the full report from qe-code-complexity]
1331
-
1332
- ### Hotspot Summary
1333
-
1334
- | Rank | Function | Cyclomatic | Cognitive | Risk |
1335
- |------|----------|------------|-----------|------|
1336
- [Top 5 hotspots from qe-code-complexity]
1337
-
1338
- ### Code Smells Detected
1339
- [List from agent output]
1340
-
1341
- ---
1342
-
1343
- ## Coverage Analysis
1344
-
1345
- [EMBED or LINK the full report from qe-coverage-specialist]
1346
-
1347
- ### Coverage Metrics
1348
-
1349
- | Metric | Value | Status |
1350
- |--------|-------|--------|
1351
- | Line | X% | PASS/WARN/FAIL |
1352
- | Branch | X% | PASS/WARN/FAIL |
1353
- | Function | X% | PASS/WARN/FAIL |
1354
-
1355
- ### Coverage Gaps
1356
- [All gaps from qe-coverage-specialist]
1357
-
1358
- ---
1359
-
1360
- ## Conditional Analysis
1361
-
1362
- [INCLUDE ONLY IF APPLICABLE - based on which conditional agents ran]
1363
-
1364
- ### Security Scan (IF HAS_SECURITY_CODE)
1365
- [Full output from qe-security-scanner]
1366
-
1367
- ### Performance Profile (IF HAS_PERFORMANCE_CODE)
1368
- [Full output from qe-performance-tester]
1369
-
1370
- ### Mutation Analysis (IF HAS_CRITICAL_CODE)
1371
- [Full output from qe-mutation-tester]
1372
-
1373
- ### Middleware Testing (IF HAS_MIDDLEWARE)
1374
- [Full output from qe-message-broker-tester]
1375
-
1376
- ### SAP IDoc Testing (IF HAS_SAP_INTEGRATION)
1377
- [Full output from qe-sap-idoc-tester]
1378
-
1379
- ### SoD Analysis (IF HAS_AUTHORIZATION)
1380
- [Full output from qe-sod-analyzer]
1381
-
1382
- ---
1383
-
1384
- ## Recommended Actions
1385
-
1386
- ### Before Merge (P0 - Blockers)
1387
- - [ ] [Action based on findings]
1388
-
1389
- ### Before Sprint End (P1 - Important)
1390
- - [ ] [Action based on findings]
1391
-
1392
- ### Tech Debt Backlog (P2 - Improvement)
1393
- - [ ] [Action based on findings]
1394
-
1395
- ---
1396
-
1397
- ## Appendix: Agent Outputs
1398
-
1399
- [Link to or embed full outputs from each agent]
1400
-
1401
- ---
1402
-
1403
- *Generated by QCSD Development Swarm v1.0*
1404
- *Execution Model: Task Tool Parallel Swarm*
1405
- ```
1406
-
1407
- Write the executive summary report to:
1408
- `${OUTPUT_FOLDER}/01-executive-summary.md`
1409
-
1410
- ### Report Validation Checklist
1411
-
1412
- Before presenting report:
1413
-
1414
- ```
1415
- +-- Executive Summary table is complete with all 4 metrics
1416
- +-- Recommendation matches decision logic output
1417
- +-- TDD section includes all 6 principle scores
1418
- +-- Complexity section includes top 5 hotspots
1419
- +-- Coverage section includes all gap details
1420
- +-- Conditional sections included for all spawned agents
1421
- +-- Recommended actions are specific (not generic)
1422
- +-- Report saved to output folder
1423
- ```
1424
-
1425
- **DO NOT present an incomplete report.**
1426
-
1427
- ---
1428
-
1429
- ## PHASE 7: Store Learnings & Persist State
1430
-
1431
- ### ENFORCEMENT: ALWAYS RUN THIS PHASE
1432
-
1433
- ```
1434
- +-------------------------------------------------------------+
1435
- | LEARNING PERSISTENCE MUST ALWAYS EXECUTE |
1436
- | |
1437
- | This is NOT optional. It runs on EVERY development scan. |
1438
- | It stores findings for cross-phase feedback loops, |
1439
- | historical code quality tracking, and pattern learning. |
1440
- | |
1441
- | DO NOT skip this phase for any reason. |
1442
- | DO NOT treat this as "nice to have". |
1443
- | Enforcement Rule E9 applies. |
1444
- +-------------------------------------------------------------+
1445
- ```
1446
-
1447
- ### Purpose
1448
-
1449
- Store development findings for:
1450
- - Cross-phase feedback loops (Development -> Verification -> next Ideation)
1451
- - Historical code quality tracking across sprints
1452
- - Complexity trend analysis over time
1453
- - Pattern learning for defect prediction improvement
1454
-
1455
- ### Auto-Execution Steps (ALL THREE are MANDATORY)
1456
-
1457
- **Step 1: Store development findings to memory**
1458
-
1459
- You MUST execute this MCP call with actual values from the development analysis:
1460
-
1461
- ```javascript
1462
- mcp__agentic-qe__memory_store({
1463
- key: `qcsd-development-${featureId}-${Date.now()}`,
1464
- namespace: "qcsd-development",
1465
- value: {
1466
- featureId: featureId,
1467
- featureName: featureName,
1468
- recommendation: recommendation, // SHIP, CONDITIONAL, HOLD
1469
- metrics: {
1470
- testCoverage: testCoverage,
1471
- avgCyclomatic: avgCyclomatic,
1472
- complexityScore: complexityScore,
1473
- coverageGaps: coverageGaps,
1474
- criticalDefects: criticalDefects,
1475
- tddAdherence: tddAdherence,
1476
- mutationScore: mutationScore // if applicable
1477
- },
1478
- flags: {
1479
- HAS_SECURITY_CODE: HAS_SECURITY_CODE,
1480
- HAS_PERFORMANCE_CODE: HAS_PERFORMANCE_CODE,
1481
- HAS_CRITICAL_CODE: HAS_CRITICAL_CODE,
1482
- HAS_MIDDLEWARE: HAS_MIDDLEWARE,
1483
- HAS_SAP_INTEGRATION: HAS_SAP_INTEGRATION,
1484
- HAS_AUTHORIZATION: HAS_AUTHORIZATION
1485
- },
1486
- agentsInvoked: agentList,
1487
- timestamp: new Date().toISOString()
1488
- }
1489
- })
1490
- ```
1491
-
1492
- **Step 2: Share learnings with learning coordinator**
1493
-
1494
- You MUST execute this MCP call to propagate patterns cross-domain:
1495
-
1496
- ```javascript
1497
- mcp__agentic-qe__memory_share({
1498
- sourceAgentId: "qcsd-development-swarm",
1499
- targetAgentIds: ["qe-learning-coordinator", "qe-pattern-learner"],
1500
- knowledgeDomain: "development-patterns"
1501
- })
1502
- ```
1503
-
1504
- **Step 3: Save learning persistence record to output folder**
1505
-
1506
- You MUST use the Write tool to save a JSON record of the persisted learnings:
1507
-
1508
- ```
1509
- Save to: ${OUTPUT_FOLDER}/09-learning-persistence.json
1510
-
1511
- Contents:
1512
- {
1513
- "phase": "QCSD-Development",
1514
- "featureId": "[feature ID]",
1515
- "featureName": "[feature name]",
1516
- "recommendation": "[SHIP/CONDITIONAL/HOLD]",
1517
- "memoryKey": "qcsd-development-[featureId]-[timestamp]",
1518
- "namespace": "qcsd-development",
1519
- "metrics": {
1520
- "testCoverage": [0-100],
1521
- "avgCyclomatic": [N],
1522
- "complexityScore": [0-100],
1523
- "coverageGaps": [N],
1524
- "criticalDefects": [N],
1525
- "tddAdherence": [0-60],
1526
- "mutationScore": [0-100 or null]
1527
- },
1528
- "flags": {
1529
- "HAS_SECURITY_CODE": true/false,
1530
- "HAS_PERFORMANCE_CODE": true/false,
1531
- "HAS_CRITICAL_CODE": true/false,
1532
- "HAS_MIDDLEWARE": true/false,
1533
- "HAS_SAP_INTEGRATION": true/false,
1534
- "HAS_AUTHORIZATION": true/false
1535
- },
1536
- "agentsInvoked": ["list", "of", "agents"],
1537
- "crossPhaseSignals": {
1538
- "toVerification": "Quality metrics as verification baseline",
1539
- "toIdeation": "Complexity patterns for future risk assessment"
1540
- },
1541
- "persistedAt": "[ISO timestamp]"
1542
- }
1543
- ```
1544
-
1545
- ### Fallback: CLI Memory Commands
1546
-
1547
- If MCP memory_store tool is unavailable, use CLI instead (STILL MANDATORY):
1548
-
1549
- ```bash
1550
- npx @claude-flow/cli@latest memory store \
1551
- --key "qcsd-development-${FEATURE_ID}-$(date +%s)" \
1552
- --value '{"recommendation":"[VALUE]","testCoverage":[N],"avgCyclomatic":[N],"coverageGaps":[N]}' \
1553
- --namespace qcsd-development
1554
-
1555
- npx @claude-flow/cli@latest hooks post-task \
1556
- --task-id "qcsd-development-${FEATURE_ID}" \
1557
- --success true
1558
- ```
1559
-
1560
- ### Validation Before Proceeding to Phase 8
1561
-
1562
- ```
1563
- +-- Did I execute mcp__agentic-qe__memory_store with actual values? (not placeholders)
1564
- +-- Did I execute mcp__agentic-qe__memory_share to propagate learnings?
1565
- +-- Did I save 09-learning-persistence.json to the output folder?
1566
- +-- Does the JSON contain the correct recommendation from Phase 5?
1567
- +-- Does the JSON contain actual metrics from Phases 2-4?
1568
- +-- Does the JSON contain actual flag values from Phase 1?
1569
- ```
1570
-
1571
- **If ANY validation check fails, DO NOT proceed to Phase 8.**
1572
-
1573
- ### Cross-Phase Signal Consumption
1574
-
1575
- The Development Swarm both consumes and produces signals for other QCSD phases:
1576
-
1577
- ```
1578
- CONSUMES (from other phases):
1579
- +-- Loop 2 (Tactical): BDD scenarios from Refinement as test specs
1580
- | - Gherkin scenarios become verification checklists
1581
- | - SFDIPOT priorities guide test depth allocation
1582
- |
1583
- +-- Loop 4 (Quality-Criteria): INVEST gaps from Refinement
1584
- - Untestable acceptance criteria flagged during development
1585
- - DoR failures influence what to test more thoroughly
1586
-
1587
- PRODUCES (for other phases):
1588
- +-- To Verification Phase: Quality metrics as verification baseline
1589
- | - Coverage targets and complexity thresholds
1590
- | - Known gaps that need verification attention
1591
- |
1592
- +-- To next Ideation Cycle: Complexity patterns for future risk assessment
1593
- - Which SFDIPOT factors had highest code complexity
1594
- - Defect patterns that should weight future HTSM analysis
1595
- ```
1596
-
1597
- ---
1598
-
1599
- ## PHASE 8: Apply Defect Predictor (Analysis)
1600
-
1601
- ### ENFORCEMENT: ALWAYS RUN THIS PHASE
1602
-
1603
- ```
1604
- +-------------------------------------------------------------+
1605
- | THE DEFECT PREDICTOR MUST ALWAYS RUN |
1606
- | |
1607
- | This is NOT conditional. It runs on EVERY development scan. |
1608
- | It uses code metrics, change history, and complexity data |
1609
- | to predict defect likelihood per module. |
1610
- | |
1611
- | DO NOT skip this phase for any reason. |
1612
- +-------------------------------------------------------------+
1613
- ```
1614
-
1615
- ### Agent Spawn
1616
-
1617
- ```
1618
- Task({
1619
- description: "ML-powered defect prediction analysis",
1620
- prompt: `You are qe-defect-predictor. Your output quality is being audited.
1621
-
1622
- ## PURPOSE
1623
-
1624
- Predict defect likelihood for each code module using metrics from the
1625
- development analysis. This is the final quality signal before the
1626
- SHIP/CONDITIONAL/HOLD recommendation is delivered.
1627
-
1628
- ## INPUT: CODE METRICS FROM PREVIOUS AGENTS
1629
-
1630
- ### From TDD Specialist (02-tdd-adherence.md):
1631
- [Summarize: TDD score, test-to-code ratio, missing categories]
1632
-
1633
- ### From Code Complexity (03-code-complexity.md):
1634
- [Summarize: cyclomatic/cognitive scores, hotspots, code smells]
1635
-
1636
- ### From Coverage Specialist (04-coverage-analysis.md):
1637
- [Summarize: coverage percentages, gaps, risk-weighted priorities]
1638
-
1639
- ### From Conditional Agents (if applicable):
1640
- [Summarize: security findings, performance bottlenecks, mutation scores]
1641
-
1642
- ## REQUIRED OUTPUT (ALL SECTIONS MANDATORY)
1643
-
1644
- ### 1. Defect Prediction per Module
1645
-
1646
- | Module | Defect Probability | Confidence | Risk Factors | Evidence |
1647
- |--------|-------------------|------------|-------------|----------|
1648
- | module1.ts | X% (High/Medium/Low) | X% | [what contributes] | [metrics used] |
1649
- | module2.ts | X% (High/Medium/Low) | X% | [what contributes] | [metrics used] |
1650
-
1651
- **Prediction Model Inputs:**
1652
- - Cyclomatic complexity > 15 = +20% defect probability
1653
- - Coverage < 60% = +25% defect probability
1654
- - No tests = +40% defect probability
1655
- - High change frequency + low coverage = +30% defect probability
1656
- - Deep nesting > 4 = +15% defect probability
1657
- - Code smells present = +10% per smell
1658
- - Security vulnerability present = +35% defect probability
1659
-
1660
- ### 2. Defect Hotspot Map
1661
-
1662
- | Rank | File:Line | Defect Probability | Contributing Factors | Suggested Action |
1663
- |------|-----------|-------------------|---------------------|-----------------|
1664
- | 1 | ... | X% | [factors] | [specific remediation] |
1665
- | 2 | ... | X% | [factors] | [specific remediation] |
1666
- | 3 | ... | X% | [factors] | [specific remediation] |
1667
-
1668
- ### 3. Historical Pattern Matching
1669
-
1670
- | Pattern | Detected? | Historical Defect Rate | Recommendation |
1671
- |---------|-----------|----------------------|----------------|
1672
- | High complexity + low coverage | Yes/No | X% defect rate | [action] |
1673
- | Untested error paths | Yes/No | X% defect rate | [action] |
1674
- | Missing boundary tests | Yes/No | X% defect rate | [action] |
1675
- | Security-sensitive without SAST | Yes/No | X% defect rate | [action] |
1676
- | New code without integration tests | Yes/No | X% defect rate | [action] |
1677
-
1678
- ### 4. Prediction Summary
1679
-
1680
- | Metric | Value |
1681
- |--------|-------|
1682
- | Total modules analyzed | X |
1683
- | High-risk modules (>50% probability) | X |
1684
- | Medium-risk modules (25-50%) | X |
1685
- | Low-risk modules (<25%) | X |
1686
- | Average defect probability | X% |
1687
- | Prediction confidence | X% |
1688
-
1689
- **DEFECT PREDICTION SCORE: X/100** (inverse: lower probability = higher score)
1690
-
1691
- ## OUTPUT FORMAT
1692
-
1693
- Save to: ${OUTPUT_FOLDER}/08-defect-prediction.md
1694
- Use the Write tool to save BEFORE completing.
1695
-
1696
- ## VALIDATION BEFORE SUBMITTING
1697
-
1698
- +-- Did I analyze ALL modules from the codebase?
1699
- +-- Did I use metrics from ALL previous agent outputs?
1700
- +-- Did I rank defect hotspots by probability?
1701
- +-- Did I check historical patterns?
1702
- +-- Did I provide specific remediation actions?
1703
- +-- Did I save the report to the correct output path?`,
1704
- subagent_type: "qe-defect-predictor",
1705
- run_in_background: true
1706
- })
1707
- ```
1708
-
1709
- ### Wait for Analysis Completion
1710
-
1711
- ```
1712
- +-------------------------------------------------------------+
1713
- | WAIT for qe-defect-predictor to complete before |
1714
- | proceeding to Phase 9. |
1715
- | |
1716
- | The defect prediction is the FINAL quality signal of |
1717
- | the Development Swarm - it synthesizes all metrics into |
1718
- | actionable defect risk predictions. |
1719
- +-------------------------------------------------------------+
1720
- ```
1721
-
1722
- ---
1723
-
1724
- ## PHASE 9: Final Output
1725
-
1726
- **At the very end of swarm execution, ALWAYS output this completion summary:**
1727
-
1728
- ```
1729
- +---------------------------------------------------------------------+
1730
- | QCSD DEVELOPMENT SWARM COMPLETE |
1731
- +---------------------------------------------------------------------+
1732
- | |
1733
- | Code Analyzed: [Feature/Module Name] |
1734
- | Reports Generated: [count] |
1735
- | Output Folder: ${OUTPUT_FOLDER} |
1736
- | |
1737
- | DEVELOPMENT SCORES: |
1738
- | +-- Test Coverage: __% |
1739
- | +-- TDD Adherence: __/60 |
1740
- | +-- Complexity Score: __/100 |
1741
- | +-- Coverage Gaps (P0): __ |
1742
- | +-- Defect Probability: __% |
1743
- | [IF HAS_SECURITY_CODE] |
1744
- | +-- Security Score: __/50 |
1745
- | [IF HAS_PERFORMANCE_CODE] |
1746
- | +-- Performance Score: __/40 |
1747
- | [IF HAS_CRITICAL_CODE] |
1748
- | +-- Mutation Score: __% |
1749
- | [IF HAS_MIDDLEWARE] |
1750
- | +-- Middleware Health: __/50 |
1751
- | [IF HAS_SAP_INTEGRATION] |
1752
- | +-- SAP Integration: __/50 |
1753
- | [IF HAS_AUTHORIZATION] |
1754
- | +-- Authorization Health: __/50 |
1755
- | |
1756
- | RECOMMENDATION: [SHIP / CONDITIONAL / HOLD] |
1757
- | REASON: [1-2 sentence rationale] |
1758
- | |
1759
- | DELIVERABLES: |
1760
- | +-- 01-executive-summary.md |
1761
- | +-- 02-tdd-adherence.md |
1762
- | +-- 03-code-complexity.md |
1763
- | +-- 04-coverage-analysis.md |
1764
- | [IF HAS_SECURITY_CODE] |
1765
- | +-- 05-security-scan.md |
1766
- | [IF HAS_PERFORMANCE_CODE] |
1767
- | +-- 06-performance-profile.md |
1768
- | [IF HAS_CRITICAL_CODE] |
1769
- | +-- 07-mutation-analysis.md |
1770
- | [IF HAS_MIDDLEWARE] |
1771
- | +-- 10-middleware-testing.md |
1772
- | [IF HAS_SAP_INTEGRATION] |
1773
- | +-- 11-sap-idoc-testing.md |
1774
- | [IF HAS_AUTHORIZATION] |
1775
- | +-- 12-sod-analysis.md |
1776
- | +-- 08-defect-prediction.md |
1777
- | +-- 09-learning-persistence.json |
1778
- | |
1779
- +---------------------------------------------------------------------+
1780
- ```
1781
-
1782
- **IF recommendation is HOLD, ALSO output this prominent action box:**
1783
-
1784
- ```
1785
- +---------------------------------------------------------------------+
1786
- | ACTION REQUIRED: CODE IS NOT READY TO SHIP |
1787
- +---------------------------------------------------------------------+
1788
- | |
1789
- | The following blockers MUST be resolved before merge: |
1790
- | |
1791
- | 1. [Blocker 1 with specific remediation] |
1792
- | 2. [Blocker 2 with specific remediation] |
1793
- | 3. [Blocker 3 with specific remediation] |
1794
- | |
1795
- | NEXT STEPS: |
1796
- | - Address all P0 blockers listed above |
1797
- | - Re-run /qcsd-development-swarm after fixes |
1798
- | - Target: coverage >= 80%, complexity <= 15, 0 critical gaps |
1799
- | |
1800
- +---------------------------------------------------------------------+
1801
- ```
1802
-
1803
- **IF recommendation is CONDITIONAL, output this guidance box:**
1804
-
1805
- ```
1806
- +---------------------------------------------------------------------+
1807
- | CONDITIONAL: CODE NEEDS MINOR IMPROVEMENTS BEFORE MERGE |
1808
- +---------------------------------------------------------------------+
1809
- | |
1810
- | The code can be merged WITH these conditions: |
1811
- | |
1812
- | 1. [Condition 1 - must be addressed before merge] |
1813
- | 2. [Condition 2 - must be addressed in follow-up PR] |
1814
- | |
1815
- | RISK ACCEPTANCE: |
1816
- | - Tech lead acknowledges remaining quality gaps |
1817
- | - Follow-up issues created for deferred improvements |
1818
- | |
1819
- +---------------------------------------------------------------------+
1820
- ```
1821
-
1822
- **DO NOT end the swarm without displaying the completion summary.**
1823
-
1824
- ---
1825
-
1826
- ## Report Filename Mapping
1827
-
1828
- | Agent | Report Filename | Phase |
1829
- |-------|----------------|-------|
1830
- | qe-tdd-specialist | `02-tdd-adherence.md` | Batch 1 |
1831
- | qe-code-complexity | `03-code-complexity.md` | Batch 1 |
1832
- | qe-coverage-specialist | `04-coverage-analysis.md` | Batch 1 |
1833
- | qe-security-scanner | `05-security-scan.md` | Batch 2 (conditional) |
1834
- | qe-performance-tester | `06-performance-profile.md` | Batch 2 (conditional) |
1835
- | qe-mutation-tester | `07-mutation-analysis.md` | Batch 2 (conditional) |
1836
- | qe-message-broker-tester | `10-middleware-testing.md` | Batch 2 (conditional) |
1837
- | qe-sap-idoc-tester | `11-sap-idoc-testing.md` | Batch 2 (conditional) |
1838
- | qe-sod-analyzer | `12-sod-analysis.md` | Batch 2 (conditional) |
1839
- | qe-defect-predictor | `08-defect-prediction.md` | Batch 3 (analysis) |
1840
- | Learning Persistence | `09-learning-persistence.json` | Phase 7 (auto-execute) |
1841
- | Synthesis | `01-executive-summary.md` | Phase 6 |
1842
-
1843
- ---
1844
-
1845
- ## DDD Domain Integration
1846
-
1847
- This swarm operates across **3 primary domains**, **4 conditional domains**,
1848
- and **1 analysis domain**:
1849
-
1850
- ```
1851
- +-----------------------------------------------------------------------------+
1852
- | QCSD DEVELOPMENT - DOMAIN MAP |
1853
- +-----------------------------------------------------------------------------+
1854
- | |
1855
- | PRIMARY DOMAINS (Always Active) |
1856
- | +-------------------------------+ +-------------------------------+ |
1857
- | | test-generation | | coverage-analysis | |
1858
- | | --------------------------- | | --------------------------- | |
1859
- | | - qe-tdd-specialist | | - qe-coverage-specialist | |
1860
- | | (TDD adherence, test | | (O(log n) gap detection, | |
1861
- | | quality metrics) | | risk-weighted coverage) | |
1862
- | +-------------------------------+ +-------------------------------+ |
1863
- | |
1864
- | +-------------------------------+ |
1865
- | | code-intelligence | |
1866
- | | --------------------------- | |
1867
- | | - qe-code-complexity | |
1868
- | | (cyclomatic/cognitive, | |
1869
- | | hotspots, code smells) | |
1870
- | +-------------------------------+ |
1871
- | |
1872
- | CONDITIONAL DOMAINS (Based on Code Content) |
1873
- | +-----------------------+ +-----------------------+ +------------------+ |
1874
- | | security-compliance | | chaos-resilience | | test-generation | |
1875
- | | ───────────────────── | | ──────────────────── | | ──────────────── | |
1876
- | | qe-security-scanner | | qe-performance- | | qe-mutation- | |
1877
- | | [IF HAS_SECURITY_CODE]| | tester | | tester | |
1878
- | | | | [IF HAS_PERF_CODE] | | [IF HAS_CRITICAL]| |
1879
- | +-----------------------+ +-----------------------+ +------------------+ |
1880
- | |
1881
- | +-----------------------------------------------------------------------+ |
1882
- | | enterprise-integration | |
1883
- | | ----------------------------------------------------------------- | |
1884
- | | - qe-message-broker-tester [IF HAS_MIDDLEWARE] | |
1885
- | | - qe-sap-idoc-tester [IF HAS_SAP_INTEGRATION] | |
1886
- | | - qe-sod-analyzer [IF HAS_AUTHORIZATION] | |
1887
- | +-----------------------------------------------------------------------+ |
1888
- | |
1889
- | ANALYSIS DOMAIN (Always Active) |
1890
- | +-----------------------------------------------------------------------+ |
1891
- | | defect-intelligence | |
1892
- | | ----------------------------------------------------------------- | |
1893
- | | - qe-defect-predictor (ML-powered defect probability, hotspot map) | |
1894
- | +-----------------------------------------------------------------------+ |
1895
- | |
1896
- +-----------------------------------------------------------------------------+
1897
- ```
1898
-
1899
- ---
1900
-
1901
- ## Execution Model Options
1902
-
1903
- This skill supports **3 execution models**. Choose based on your environment:
1904
-
1905
- | Model | When to Use | Pros | Cons |
1906
- |-------|-------------|------|------|
1907
- | **Task Tool** (PRIMARY) | Claude Code sessions | Full agent capabilities, parallel execution | Requires Claude Code |
1908
- | **MCP Tools** | MCP server available | Fleet coordination, memory persistence | Requires MCP setup |
1909
- | **CLI** | Terminal/scripts | Works anywhere, scriptable | Sequential only |
1910
-
1911
- ### Quick Start by Model
1912
-
1913
- **Option A: Task Tool (RECOMMENDED)**
1914
- ```
1915
- Just follow the skill phases above - uses Task() calls with run_in_background: true
1916
- ```
1917
-
1918
- **Option B: MCP Tools**
1919
- ```javascript
1920
- // Initialize fleet for Development domains
1921
- mcp__agentic-qe__fleet_init({
1922
- topology: "hierarchical",
1923
- enabledDomains: ["test-generation", "coverage-analysis", "code-intelligence", "security-compliance", "chaos-resilience", "defect-intelligence"],
1924
- maxAgents: 7
1925
- })
1926
-
1927
- // Orchestrate development task
1928
- mcp__agentic-qe__task_orchestrate({
1929
- task: "qcsd-development-analysis",
1930
- strategy: "parallel"
1931
- })
1932
- ```
1933
-
1934
- **Option C: CLI**
1935
- ```bash
1936
- # Initialize coordination
1937
- npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 7
1938
-
1939
- # Route task
1940
- npx @claude-flow/cli@latest hooks pre-task --description "QCSD Development for [Feature]"
1941
-
1942
- # Execute agents
1943
- npx @claude-flow/cli@latest agent spawn --type qe-tdd-specialist
1944
- npx @claude-flow/cli@latest agent spawn --type qe-code-complexity
1945
- npx @claude-flow/cli@latest agent spawn --type qe-coverage-specialist
1946
- ```
1947
-
1948
- ---
1949
-
1950
- ## Quick Reference
1951
-
1952
- ### Enforcement Summary
1953
-
1954
- | Phase | Must Do | Failure Condition |
1955
- |-------|---------|-------------------|
1956
- | 1 | Check ALL 6 flags | Missing flag evaluation |
1957
- | 2 | Spawn ALL 3 core agents in ONE message | Fewer than 3 Task calls |
1958
- | 3 | WAIT for completion | Proceeding before results |
1959
- | 4 | Spawn ALL flagged conditional agents | Skipping a TRUE flag |
1960
- | 5 | Apply EXACT decision logic | Wrong recommendation |
1961
- | 6 | Generate COMPLETE report | Missing sections |
1962
- | 7 | ALWAYS store learnings + save 09-learning-persistence.json | Pattern loss, missing audit trail |
1963
- | 8 | ALWAYS run defect predictor | Skipping analysis |
1964
- | 9 | Output completion summary | Missing final output |
1965
-
1966
- ### Quality Gate Thresholds
161
+ ## Quality Gate Thresholds
1967
162
 
1968
163
  | Metric | SHIP | CONDITIONAL | HOLD |
1969
164
  |--------|------|-------------|------|
1970
- | Test Coverage | >= 80% | 50-79% | < 50% |
1971
- | Avg Cyclomatic | <= 15 | 16-30 | > 30 |
1972
- | Coverage Gaps (P0) | 0 | 1-5 | > 5 |
1973
- | Critical Defects | 0 | 1-2 | > 2 |
1974
-
1975
- ### Domain-to-Agent Mapping
1976
-
1977
- | Domain | Agent | Phase | Batch |
1978
- |--------|-------|-------|-------|
1979
- | test-generation | qe-tdd-specialist | Core | 1 |
1980
- | code-intelligence | qe-code-complexity | Core | 1 |
1981
- | coverage-analysis | qe-coverage-specialist | Core | 1 |
1982
- | security-compliance | qe-security-scanner | Conditional (HAS_SECURITY_CODE) | 2 |
1983
- | chaos-resilience | qe-performance-tester | Conditional (HAS_PERFORMANCE_CODE) | 2 |
1984
- | test-generation | qe-mutation-tester | Conditional (HAS_CRITICAL_CODE) | 2 |
1985
- | enterprise-integration | qe-message-broker-tester | Conditional (HAS_MIDDLEWARE) | 2 |
1986
- | enterprise-integration | qe-sap-idoc-tester | Conditional (HAS_SAP_INTEGRATION) | 2 |
1987
- | enterprise-integration | qe-sod-analyzer | Conditional (HAS_AUTHORIZATION) | 2 |
1988
- | defect-intelligence | qe-defect-predictor | Analysis (ALWAYS) | 3 |
1989
-
1990
- ### Execution Model Quick Reference
1991
-
1992
- | Model | Initialization | Agent Spawn | Memory Store |
1993
- |-------|---------------|-------------|--------------|
1994
- | **Task Tool** | N/A | `Task({ subagent_type, run_in_background: true })` | N/A (use MCP) |
1995
- | **MCP Tools** | `fleet_init({})` | `task_submit({})` | `memory_store({})` |
1996
- | **CLI** | `swarm init` | `agent spawn` | `memory store` |
1997
-
1998
- ### MCP Tools Quick Reference
1999
-
2000
- ```javascript
2001
- // Initialization
2002
- mcp__agentic-qe__fleet_init({
2003
- topology: "hierarchical",
2004
- enabledDomains: ["test-generation", "coverage-analysis", "code-intelligence", "security-compliance", "chaos-resilience", "defect-intelligence"],
2005
- maxAgents: 7
2006
- })
2007
-
2008
- // Task submission
2009
- mcp__agentic-qe__task_submit({ type: "...", priority: "p0", payload: {...} })
2010
- mcp__agentic-qe__task_orchestrate({ task: "...", strategy: "parallel" })
2011
-
2012
- // Status
2013
- mcp__agentic-qe__fleet_status({ verbose: true })
2014
- mcp__agentic-qe__task_list({ status: "pending" })
2015
-
2016
- // Memory
2017
- mcp__agentic-qe__memory_store({ key: "...", value: {...}, namespace: "qcsd-development" })
2018
- mcp__agentic-qe__memory_query({ pattern: "qcsd-development-*", namespace: "qcsd-development" })
2019
- mcp__agentic-qe__memory_share({
2020
- sourceAgentId: "qcsd-development-swarm",
2021
- targetAgentIds: ["qe-learning-coordinator"],
2022
- knowledgeDomain: "development-patterns"
2023
- })
2024
- ```
2025
-
2026
- ### CLI Quick Reference
2027
-
2028
- ```bash
2029
- # Initialization
2030
- npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 7
2031
-
2032
- # Agent operations
2033
- npx @claude-flow/cli@latest agent spawn --type [agent-type] --task "[description]"
2034
- npx @claude-flow/cli@latest hooks pre-task --description "[task]"
2035
- npx @claude-flow/cli@latest hooks post-task --task-id "[id]" --success true
2036
-
2037
- # Status
2038
- npx @claude-flow/cli@latest swarm status
2039
-
2040
- # Memory
2041
- npx @claude-flow/cli@latest memory store --key "[key]" --value "[json]" --namespace qcsd-development
2042
- npx @claude-flow/cli@latest memory search --query "[query]" --namespace qcsd-development
2043
- npx @claude-flow/cli@latest memory list --namespace qcsd-development
2044
- ```
165
+ | TDD Adherence | >= 80% | 60 - 79% | < 60% |
166
+ | Code Complexity | Avg <= 10 | Avg 11-15 | Avg > 15 |
167
+ | Test Coverage | >= 80% | 60 - 79% | < 60% |
168
+ | Mutation Score | >= 70% | 50 - 69% | < 50% |
169
+ | Security Issues | No HIGH/CRITICAL | MEDIUM only | HIGH/CRITICAL found |
2045
170
 
2046
171
  ---
2047
172
 
2048
- ## Swarm Topology
173
+ ## Report Filename Mapping
2049
174
 
2050
- ```
2051
- QCSD DEVELOPMENT SWARM v1.0
2052
- |
2053
- BATCH 1 (Core - Parallel)
2054
- +-----------+---+-----------+
2055
- | | |
2056
- +-----v-----+ +---v--------+ +---v-----------+
2057
- | TDD | | Code | | Coverage |
2058
- | Specialist| | Complexity | | Specialist |
2059
- | (R-G-R) | | (Cyc/Cog) | | (O(log n)) |
2060
- |-----------| |------------| |---------------|
2061
- | test-gen | | code-intel | | coverage-anly |
2062
- +-----+-----+ +-----+------+ +------+--------+
2063
- | | |
2064
- +--------------+---------------+
2065
- |
2066
- [METRICS GATE]
2067
- |
2068
- BATCH 2 (Conditional - Parallel)
2069
- +-----------+---+-----------+
2070
- | | |
2071
- +-----v-----+ +---v--------+ +---v----------+
2072
- | Security | | Performance| | Mutation |
2073
- | Scanner | | Tester | | Tester |
2074
- | [IF SEC] | | [IF PERF] | | [IF CRIT] |
2075
- |-----------| |------------| |--------------|
2076
- | sec-compl | | chaos-res | | test-gen |
2077
- +-----------+ +------------+ +--------------+
2078
- +-------------+---+-------------+
2079
- | | |
2080
- +-----v------+ +---v--------+ +------v-------+
2081
- | Msg Broker | | SAP IDoc | | SoD |
2082
- | Tester | | Tester | | Analyzer |
2083
- | [IF MIDW] | | [IF SAP] | | [IF AUTH] |
2084
- |------------| |------------| |--------------|
2085
- | ent-integ | | ent-integ | | ent-integ |
2086
- +------------+ +------------+ +--------------+
2087
- |
2088
- [SYNTHESIS]
2089
- |
2090
- PHASE 7 (Learning Persistence - Always)
2091
- |
2092
- +-------v-------+
2093
- | memory_store |
2094
- | memory_share |
2095
- | 09-learning- |
2096
- | persistence |
2097
- | (ALWAYS RUNS) |
2098
- +-------+-------+
2099
- |
2100
- BATCH 3 (Analysis - Always)
2101
- |
2102
- +-------v-------+
2103
- | Defect |
2104
- | Predictor |
2105
- | (ALWAYS RUNS) |
2106
- |---------------|
2107
- | defect-intel |
2108
- +-------+-------+
2109
- |
2110
- [FINAL REPORT]
2111
- ```
175
+ | Agent | Report Filename | Step |
176
+ |-------|----------------|------|
177
+ | qe-tdd-specialist | `02-tdd-analysis.md` | 2 |
178
+ | qe-code-complexity | `03-complexity-analysis.md` | 2 |
179
+ | qe-coverage-specialist | `04-coverage-analysis.md` | 2 |
180
+ | qe-security-scanner | `05-security-scan.md` | 4 |
181
+ | qe-performance-tester | `06-performance-analysis.md` | 4 |
182
+ | qe-mutation-tester | `07-mutation-testing.md` | 4 |
183
+ | qe-message-broker-tester | `08-middleware-health.md` | 4 |
184
+ | qe-sap-idoc-tester | `09-sap-integration.md` | 4 |
185
+ | qe-sod-analyzer | `10-sod-compliance.md` | 4 |
186
+ | Learning Persistence | `11-learning-persistence.json` | 7 |
187
+ | qe-defect-predictor | `12-defect-prediction.md` | 8 |
188
+ | Synthesis | `01-executive-summary.md` | 6 |
2112
189
 
2113
190
  ---
2114
191
 
2115
- ## Inventory Summary
2116
-
2117
- | Resource Type | Count | Primary | Conditional | Analysis |
2118
- |---------------|:-----:|:-------:|:-----------:|:--------:|
2119
- | **Agents** | 10 | 3 | 6 | 1 |
2120
- | **Sub-agents** | 0 | - | - | - |
2121
- | **Skills** | 4 | 4 | - | - |
2122
- | **Domains** | 8 | 3 | 4 | 1 |
2123
- | **Parallel Batches** | 3 | 1 | 1 | 1 |
2124
-
2125
- **Skills Used:**
2126
- 1. `tdd-london-chicago` - TDD methodology guidance
2127
- 2. `mutation-testing` - Mutation testing patterns
2128
- 3. `performance-testing` - Performance analysis framework
2129
- 4. `security-testing` - OWASP scanning patterns
192
+ ## Execution Model Options
2130
193
 
2131
- **Frameworks Applied:**
2132
- 1. TDD Red-Green-Refactor - Test-first development assessment
2133
- 2. Cyclomatic/Cognitive Complexity - Code complexity measurement
2134
- 3. Sublinear Coverage Analysis - O(log n) gap detection
2135
- 4. OWASP Top 10 - Security vulnerability assessment
2136
- 5. Mutation Testing - Test suite effectiveness validation
2137
- 6. ML Defect Prediction - Pattern-based defect forecasting
194
+ | Model | When to Use | Agent Spawn |
195
+ |-------|-------------|-------------|
196
+ | **Task Tool** (PRIMARY) | Claude Code sessions | `Task({ subagent_type, run_in_background: true })` |
197
+ | **MCP Tools** | MCP server available | `fleet_init({})` / `task_submit({})` |
198
+ | **CLI** | Terminal/scripts | `swarm init` / `agent spawn` |
2138
199
 
2139
200
  ---
2140
201
 
2141
202
  ## Key Principle
2142
203
 
2143
- **Code ships when quality is proven, not when deadlines arrive.**
2144
-
2145
- This swarm provides:
2146
- 1. **Is TDD practiced?** -> TDD Adherence Assessment (6 principles)
2147
- 2. **Is code maintainable?** -> Complexity Analysis (cyclomatic + cognitive)
2148
- 3. **Are there test gaps?** -> Coverage Gap Detection (O(log n) sublinear)
2149
- 4. **Is it secure?** -> SAST Security Scan (if security code present)
2150
- 5. **Is it performant?** -> Performance Profiling (if performance code present)
2151
- 6. **Are tests effective?** -> Mutation Analysis (if critical code present)
2152
- 7. **Where will bugs appear?** -> Defect Prediction (always)
2153
- 8. **Should we ship?** -> SHIP/CONDITIONAL/HOLD decision
2154
- 9. **What did we learn?** -> Memory persistence for future cycles
204
+ **Code quality is measured by evidence, not intentions. This swarm provides
205
+ in-sprint quality assessment to ensure code meets engineering standards before
206
+ entering the CI/CD pipeline.**