@accelerationguy/accel 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/CLAUDE.md +19 -0
  2. package/LICENSE +33 -0
  3. package/README.md +275 -0
  4. package/bin/install.js +661 -0
  5. package/docs/getting-started.md +164 -0
  6. package/docs/module-guide.md +139 -0
  7. package/modules/drive/LICENSE +21 -0
  8. package/modules/drive/PAUL-VS-GSD.md +171 -0
  9. package/modules/drive/README.md +555 -0
  10. package/modules/drive/assets/terminal.svg +67 -0
  11. package/modules/drive/bin/install.js +210 -0
  12. package/modules/drive/integration.js +76 -0
  13. package/modules/drive/package.json +38 -0
  14. package/modules/drive/src/commands/add-phase.md +36 -0
  15. package/modules/drive/src/commands/apply.md +83 -0
  16. package/modules/drive/src/commands/assumptions.md +37 -0
  17. package/modules/drive/src/commands/audit.md +57 -0
  18. package/modules/drive/src/commands/complete-milestone.md +36 -0
  19. package/modules/drive/src/commands/config.md +175 -0
  20. package/modules/drive/src/commands/consider-issues.md +41 -0
  21. package/modules/drive/src/commands/discover.md +48 -0
  22. package/modules/drive/src/commands/discuss-milestone.md +33 -0
  23. package/modules/drive/src/commands/discuss.md +34 -0
  24. package/modules/drive/src/commands/flows.md +73 -0
  25. package/modules/drive/src/commands/handoff.md +201 -0
  26. package/modules/drive/src/commands/help.md +525 -0
  27. package/modules/drive/src/commands/init.md +54 -0
  28. package/modules/drive/src/commands/map-codebase.md +34 -0
  29. package/modules/drive/src/commands/milestone.md +34 -0
  30. package/modules/drive/src/commands/pause.md +44 -0
  31. package/modules/drive/src/commands/plan-fix.md +216 -0
  32. package/modules/drive/src/commands/plan.md +36 -0
  33. package/modules/drive/src/commands/progress.md +138 -0
  34. package/modules/drive/src/commands/register.md +29 -0
  35. package/modules/drive/src/commands/remove-phase.md +37 -0
  36. package/modules/drive/src/commands/research-phase.md +209 -0
  37. package/modules/drive/src/commands/research.md +47 -0
  38. package/modules/drive/src/commands/resume.md +49 -0
  39. package/modules/drive/src/commands/status.md +78 -0
  40. package/modules/drive/src/commands/unify.md +87 -0
  41. package/modules/drive/src/commands/verify.md +60 -0
  42. package/modules/drive/src/references/checkpoints.md +234 -0
  43. package/modules/drive/src/references/context-management.md +219 -0
  44. package/modules/drive/src/references/git-strategy.md +206 -0
  45. package/modules/drive/src/references/loop-phases.md +254 -0
  46. package/modules/drive/src/references/plan-format.md +263 -0
  47. package/modules/drive/src/references/quality-principles.md +152 -0
  48. package/modules/drive/src/references/research-quality-control.md +247 -0
  49. package/modules/drive/src/references/sonarqube-integration.md +244 -0
  50. package/modules/drive/src/references/specialized-workflow-integration.md +186 -0
  51. package/modules/drive/src/references/subagent-criteria.md +179 -0
  52. package/modules/drive/src/references/tdd.md +219 -0
  53. package/modules/drive/src/references/work-units.md +161 -0
  54. package/modules/drive/src/rules/commands.md +108 -0
  55. package/modules/drive/src/rules/references.md +107 -0
  56. package/modules/drive/src/rules/style.md +123 -0
  57. package/modules/drive/src/rules/templates.md +51 -0
  58. package/modules/drive/src/rules/workflows.md +133 -0
  59. package/modules/drive/src/templates/CONTEXT.md +88 -0
  60. package/modules/drive/src/templates/DEBUG.md +164 -0
  61. package/modules/drive/src/templates/DISCOVERY.md +148 -0
  62. package/modules/drive/src/templates/HANDOFF.md +77 -0
  63. package/modules/drive/src/templates/ISSUES.md +93 -0
  64. package/modules/drive/src/templates/MILESTONES.md +167 -0
  65. package/modules/drive/src/templates/PLAN.md +328 -0
  66. package/modules/drive/src/templates/PROJECT.md +219 -0
  67. package/modules/drive/src/templates/RESEARCH.md +130 -0
  68. package/modules/drive/src/templates/ROADMAP.md +328 -0
  69. package/modules/drive/src/templates/SPECIAL-FLOWS.md +70 -0
  70. package/modules/drive/src/templates/STATE.md +210 -0
  71. package/modules/drive/src/templates/SUMMARY.md +221 -0
  72. package/modules/drive/src/templates/UAT-ISSUES.md +139 -0
  73. package/modules/drive/src/templates/codebase/architecture.md +259 -0
  74. package/modules/drive/src/templates/codebase/concerns.md +329 -0
  75. package/modules/drive/src/templates/codebase/conventions.md +311 -0
  76. package/modules/drive/src/templates/codebase/integrations.md +284 -0
  77. package/modules/drive/src/templates/codebase/stack.md +190 -0
  78. package/modules/drive/src/templates/codebase/structure.md +287 -0
  79. package/modules/drive/src/templates/codebase/testing.md +484 -0
  80. package/modules/drive/src/templates/config.md +181 -0
  81. package/modules/drive/src/templates/milestone-archive.md +236 -0
  82. package/modules/drive/src/templates/milestone-context.md +190 -0
  83. package/modules/drive/src/templates/paul-json.md +147 -0
  84. package/modules/drive/src/vector-config/PAUL +26 -0
  85. package/modules/drive/src/vector-config/PAUL.manifest +11 -0
  86. package/modules/drive/src/workflows/apply-phase.md +393 -0
  87. package/modules/drive/src/workflows/audit-plan.md +344 -0
  88. package/modules/drive/src/workflows/complete-milestone.md +479 -0
  89. package/modules/drive/src/workflows/configure-special-flows.md +283 -0
  90. package/modules/drive/src/workflows/consider-issues.md +172 -0
  91. package/modules/drive/src/workflows/create-milestone.md +268 -0
  92. package/modules/drive/src/workflows/debug.md +292 -0
  93. package/modules/drive/src/workflows/discovery.md +187 -0
  94. package/modules/drive/src/workflows/discuss-milestone.md +245 -0
  95. package/modules/drive/src/workflows/discuss-phase.md +231 -0
  96. package/modules/drive/src/workflows/init-project.md +698 -0
  97. package/modules/drive/src/workflows/map-codebase.md +459 -0
  98. package/modules/drive/src/workflows/pause-work.md +259 -0
  99. package/modules/drive/src/workflows/phase-assumptions.md +181 -0
  100. package/modules/drive/src/workflows/plan-phase.md +385 -0
  101. package/modules/drive/src/workflows/quality-gate.md +263 -0
  102. package/modules/drive/src/workflows/register-manifest.md +107 -0
  103. package/modules/drive/src/workflows/research.md +241 -0
  104. package/modules/drive/src/workflows/resume-project.md +200 -0
  105. package/modules/drive/src/workflows/roadmap-management.md +334 -0
  106. package/modules/drive/src/workflows/transition-phase.md +368 -0
  107. package/modules/drive/src/workflows/unify-phase.md +290 -0
  108. package/modules/drive/src/workflows/verify-work.md +241 -0
  109. package/modules/forge/README.md +281 -0
  110. package/modules/forge/bin/install.js +200 -0
  111. package/modules/forge/package.json +32 -0
  112. package/modules/forge/skillsmith/rules/checklists-rules.md +42 -0
  113. package/modules/forge/skillsmith/rules/context-rules.md +43 -0
  114. package/modules/forge/skillsmith/rules/entry-point-rules.md +44 -0
  115. package/modules/forge/skillsmith/rules/frameworks-rules.md +43 -0
  116. package/modules/forge/skillsmith/rules/tasks-rules.md +52 -0
  117. package/modules/forge/skillsmith/rules/templates-rules.md +43 -0
  118. package/modules/forge/skillsmith/skillsmith.md +82 -0
  119. package/modules/forge/skillsmith/tasks/audit.md +277 -0
  120. package/modules/forge/skillsmith/tasks/discover.md +145 -0
  121. package/modules/forge/skillsmith/tasks/distill.md +276 -0
  122. package/modules/forge/skillsmith/tasks/scaffold.md +349 -0
  123. package/modules/forge/specs/checklists.md +193 -0
  124. package/modules/forge/specs/context.md +223 -0
  125. package/modules/forge/specs/entry-point.md +320 -0
  126. package/modules/forge/specs/frameworks.md +228 -0
  127. package/modules/forge/specs/rules.md +245 -0
  128. package/modules/forge/specs/tasks.md +344 -0
  129. package/modules/forge/specs/templates.md +335 -0
  130. package/modules/forge/terminal.svg +70 -0
  131. package/modules/ignition/README.md +245 -0
  132. package/modules/ignition/bin/install.js +184 -0
  133. package/modules/ignition/checklists/planning-quality.md +55 -0
  134. package/modules/ignition/data/application/config.md +21 -0
  135. package/modules/ignition/data/application/guide.md +51 -0
  136. package/modules/ignition/data/application/skill-loadout.md +11 -0
  137. package/modules/ignition/data/campaign/config.md +18 -0
  138. package/modules/ignition/data/campaign/guide.md +36 -0
  139. package/modules/ignition/data/campaign/skill-loadout.md +10 -0
  140. package/modules/ignition/data/client/config.md +18 -0
  141. package/modules/ignition/data/client/guide.md +36 -0
  142. package/modules/ignition/data/client/skill-loadout.md +11 -0
  143. package/modules/ignition/data/utility/config.md +18 -0
  144. package/modules/ignition/data/utility/guide.md +31 -0
  145. package/modules/ignition/data/utility/skill-loadout.md +8 -0
  146. package/modules/ignition/data/workflow/config.md +19 -0
  147. package/modules/ignition/data/workflow/guide.md +41 -0
  148. package/modules/ignition/data/workflow/skill-loadout.md +10 -0
  149. package/modules/ignition/integration.js +54 -0
  150. package/modules/ignition/package.json +35 -0
  151. package/modules/ignition/seed.md +81 -0
  152. package/modules/ignition/tasks/add-type.md +164 -0
  153. package/modules/ignition/tasks/graduate.md +182 -0
  154. package/modules/ignition/tasks/ideate.md +221 -0
  155. package/modules/ignition/tasks/launch.md +137 -0
  156. package/modules/ignition/tasks/status.md +71 -0
  157. package/modules/ignition/templates/planning-application.md +193 -0
  158. package/modules/ignition/templates/planning-campaign.md +138 -0
  159. package/modules/ignition/templates/planning-client.md +149 -0
  160. package/modules/ignition/templates/planning-utility.md +112 -0
  161. package/modules/ignition/templates/planning-workflow.md +125 -0
  162. package/modules/ignition/terminal.svg +74 -0
  163. package/modules/mission-control/CONTEXT-CONTINUITY-SPEC.md +293 -0
  164. package/modules/mission-control/CONTEXT-ENGINEERING-GUIDE.md +282 -0
  165. package/modules/mission-control/README.md +91 -0
  166. package/modules/mission-control/assets/terminal.svg +80 -0
  167. package/modules/mission-control/examples/entities.example.json +133 -0
  168. package/modules/mission-control/examples/projects.example.json +318 -0
  169. package/modules/mission-control/examples/state.example.json +183 -0
  170. package/modules/mission-control/examples/vector.example.json +245 -0
  171. package/modules/mission-control/mission-control/checklists/install-verification.md +46 -0
  172. package/modules/mission-control/mission-control/frameworks/framework-registry.md +83 -0
  173. package/modules/mission-control/mission-control/mission-control.md +83 -0
  174. package/modules/mission-control/mission-control/tasks/insights.md +73 -0
  175. package/modules/mission-control/mission-control/tasks/install.md +194 -0
  176. package/modules/mission-control/mission-control/tasks/status.md +125 -0
  177. package/modules/mission-control/schemas/entities.schema.json +89 -0
  178. package/modules/mission-control/schemas/projects.schema.json +221 -0
  179. package/modules/mission-control/schemas/state.schema.json +108 -0
  180. package/modules/mission-control/schemas/vector.schema.json +200 -0
  181. package/modules/momentum/README.md +678 -0
  182. package/modules/momentum/bin/install.js +563 -0
  183. package/modules/momentum/integration.js +131 -0
  184. package/modules/momentum/package.json +42 -0
  185. package/modules/momentum/schemas/entities.schema.json +89 -0
  186. package/modules/momentum/schemas/projects.schema.json +221 -0
  187. package/modules/momentum/schemas/state.schema.json +108 -0
  188. package/modules/momentum/src/commands/audit-claude-md.md +31 -0
  189. package/modules/momentum/src/commands/audit.md +33 -0
  190. package/modules/momentum/src/commands/groom.md +35 -0
  191. package/modules/momentum/src/commands/history.md +27 -0
  192. package/modules/momentum/src/commands/pulse.md +33 -0
  193. package/modules/momentum/src/commands/scaffold.md +33 -0
  194. package/modules/momentum/src/commands/status.md +28 -0
  195. package/modules/momentum/src/commands/surface-convert.md +35 -0
  196. package/modules/momentum/src/commands/surface-create.md +34 -0
  197. package/modules/momentum/src/commands/surface-list.md +27 -0
  198. package/modules/momentum/src/commands/vector-hygiene.md +33 -0
  199. package/modules/momentum/src/framework/context/momentum-principles.md +71 -0
  200. package/modules/momentum/src/framework/frameworks/audit-strategies.md +53 -0
  201. package/modules/momentum/src/framework/frameworks/satellite-registration.md +44 -0
  202. package/modules/momentum/src/framework/tasks/audit-claude-md.md +68 -0
  203. package/modules/momentum/src/framework/tasks/audit.md +64 -0
  204. package/modules/momentum/src/framework/tasks/groom.md +164 -0
  205. package/modules/momentum/src/framework/tasks/history.md +34 -0
  206. package/modules/momentum/src/framework/tasks/pulse.md +83 -0
  207. package/modules/momentum/src/framework/tasks/scaffold.md +202 -0
  208. package/modules/momentum/src/framework/tasks/status.md +35 -0
  209. package/modules/momentum/src/framework/tasks/surface-convert.md +143 -0
  210. package/modules/momentum/src/framework/tasks/surface-create.md +184 -0
  211. package/modules/momentum/src/framework/tasks/surface-list.md +42 -0
  212. package/modules/momentum/src/framework/tasks/vector-hygiene.md +160 -0
  213. package/modules/momentum/src/framework/templates/workspace-json.md +96 -0
  214. package/modules/momentum/src/hooks/_template.py +129 -0
  215. package/modules/momentum/src/hooks/active-hook.py +178 -0
  216. package/modules/momentum/src/hooks/backlog-hook.py +115 -0
  217. package/modules/momentum/src/hooks/mission-control-insights.py +169 -0
  218. package/modules/momentum/src/hooks/momentum-pulse-check.py +351 -0
  219. package/modules/momentum/src/hooks/operator.py +53 -0
  220. package/modules/momentum/src/hooks/psmm-injector.py +67 -0
  221. package/modules/momentum/src/hooks/satellite-detection.py +248 -0
  222. package/modules/momentum/src/packages/momentum-mcp/index.js +119 -0
  223. package/modules/momentum/src/packages/momentum-mcp/package.json +10 -0
  224. package/modules/momentum/src/packages/momentum-mcp/tools/entities.js +226 -0
  225. package/modules/momentum/src/packages/momentum-mcp/tools/operator.js +106 -0
  226. package/modules/momentum/src/packages/momentum-mcp/tools/projects.js +322 -0
  227. package/modules/momentum/src/packages/momentum-mcp/tools/psmm.js +206 -0
  228. package/modules/momentum/src/packages/momentum-mcp/tools/state.js +199 -0
  229. package/modules/momentum/src/packages/momentum-mcp/tools/surfaces.js +404 -0
  230. package/modules/momentum/src/skill/momentum.md +111 -0
  231. package/modules/momentum/src/tasks/groom.md +164 -0
  232. package/modules/momentum/src/templates/operator.json +66 -0
  233. package/modules/momentum/src/templates/workspace.json +111 -0
  234. package/modules/momentum/terminal.svg +77 -0
  235. package/modules/radar/README.md +1552 -0
  236. package/modules/radar/commands/audit.md +233 -0
  237. package/modules/radar/commands/guardrails.md +194 -0
  238. package/modules/radar/commands/init.md +207 -0
  239. package/modules/radar/commands/playbook.md +176 -0
  240. package/modules/radar/commands/remediate.md +156 -0
  241. package/modules/radar/commands/report.md +172 -0
  242. package/modules/radar/commands/resume.md +176 -0
  243. package/modules/radar/commands/status.md +148 -0
  244. package/modules/radar/commands/transform.md +205 -0
  245. package/modules/radar/commands/validate.md +177 -0
  246. package/modules/radar/docs/ARCHITECTURE.md +336 -0
  247. package/modules/radar/docs/GETTING-STARTED.md +287 -0
  248. package/modules/radar/docs/standards/agents.md +197 -0
  249. package/modules/radar/docs/standards/commands.md +250 -0
  250. package/modules/radar/docs/standards/domains.md +191 -0
  251. package/modules/radar/docs/standards/personas.md +211 -0
  252. package/modules/radar/docs/standards/rules.md +218 -0
  253. package/modules/radar/docs/standards/runtime.md +445 -0
  254. package/modules/radar/docs/standards/schemas.md +269 -0
  255. package/modules/radar/docs/standards/tools.md +273 -0
  256. package/modules/radar/docs/standards/workflows.md +254 -0
  257. package/modules/radar/docs/terminal.svg +72 -0
  258. package/modules/radar/docs/validation/convention-compliance-report.md +183 -0
  259. package/modules/radar/docs/validation/cross-reference-report.md +195 -0
  260. package/modules/radar/docs/validation/validation-summary.md +118 -0
  261. package/modules/radar/docs/validation/version-manifest.yaml +363 -0
  262. package/modules/radar/install.sh +711 -0
  263. package/modules/radar/integration.js +53 -0
  264. package/modules/radar/src/core/agents/architect.md +25 -0
  265. package/modules/radar/src/core/agents/compliance-officer.md +25 -0
  266. package/modules/radar/src/core/agents/data-engineer.md +25 -0
  267. package/modules/radar/src/core/agents/devils-advocate.md +22 -0
  268. package/modules/radar/src/core/agents/performance-engineer.md +25 -0
  269. package/modules/radar/src/core/agents/principal-engineer.md +23 -0
  270. package/modules/radar/src/core/agents/reality-gap-analyst.md +22 -0
  271. package/modules/radar/src/core/agents/security-engineer.md +25 -0
  272. package/modules/radar/src/core/agents/senior-app-engineer.md +25 -0
  273. package/modules/radar/src/core/agents/sre.md +25 -0
  274. package/modules/radar/src/core/agents/staff-engineer.md +23 -0
  275. package/modules/radar/src/core/agents/test-engineer.md +25 -0
  276. package/modules/radar/src/core/personas/architect.md +111 -0
  277. package/modules/radar/src/core/personas/compliance-officer.md +104 -0
  278. package/modules/radar/src/core/personas/data-engineer.md +113 -0
  279. package/modules/radar/src/core/personas/devils-advocate.md +105 -0
  280. package/modules/radar/src/core/personas/performance-engineer.md +119 -0
  281. package/modules/radar/src/core/personas/principal-engineer.md +119 -0
  282. package/modules/radar/src/core/personas/reality-gap-analyst.md +111 -0
  283. package/modules/radar/src/core/personas/security-engineer.md +108 -0
  284. package/modules/radar/src/core/personas/senior-app-engineer.md +111 -0
  285. package/modules/radar/src/core/personas/sre.md +117 -0
  286. package/modules/radar/src/core/personas/staff-engineer.md +109 -0
  287. package/modules/radar/src/core/personas/test-engineer.md +109 -0
  288. package/modules/radar/src/core/workflows/disagreement-resolution.md +183 -0
  289. package/modules/radar/src/core/workflows/phase-0-context.md +148 -0
  290. package/modules/radar/src/core/workflows/phase-1-reconnaissance.md +169 -0
  291. package/modules/radar/src/core/workflows/phase-2-domain-audits.md +190 -0
  292. package/modules/radar/src/core/workflows/phase-3-cross-domain.md +177 -0
  293. package/modules/radar/src/core/workflows/phase-4-adversarial-review.md +165 -0
  294. package/modules/radar/src/core/workflows/phase-5-report.md +189 -0
  295. package/modules/radar/src/core/workflows/phase-checkpoint.md +222 -0
  296. package/modules/radar/src/core/workflows/session-handoff.md +152 -0
  297. package/modules/radar/src/domains/00-context.md +201 -0
  298. package/modules/radar/src/domains/01-architecture.md +248 -0
  299. package/modules/radar/src/domains/02-data.md +224 -0
  300. package/modules/radar/src/domains/03-correctness.md +230 -0
  301. package/modules/radar/src/domains/04-security.md +274 -0
  302. package/modules/radar/src/domains/05-compliance.md +228 -0
  303. package/modules/radar/src/domains/06-testing.md +228 -0
  304. package/modules/radar/src/domains/07-reliability.md +246 -0
  305. package/modules/radar/src/domains/08-performance.md +247 -0
  306. package/modules/radar/src/domains/09-maintainability.md +271 -0
  307. package/modules/radar/src/domains/10-operability.md +250 -0
  308. package/modules/radar/src/domains/11-change-risk.md +246 -0
  309. package/modules/radar/src/domains/12-team-risk.md +221 -0
  310. package/modules/radar/src/domains/13-risk-synthesis.md +202 -0
  311. package/modules/radar/src/rules/agent-boundaries.md +78 -0
  312. package/modules/radar/src/rules/disagreement-protocol.md +76 -0
  313. package/modules/radar/src/rules/epistemic-hygiene.md +78 -0
  314. package/modules/radar/src/schemas/confidence.md +185 -0
  315. package/modules/radar/src/schemas/disagreement.md +238 -0
  316. package/modules/radar/src/schemas/finding.md +287 -0
  317. package/modules/radar/src/schemas/report-section.md +150 -0
  318. package/modules/radar/src/schemas/signal.md +108 -0
  319. package/modules/radar/src/tools/checkov.md +463 -0
  320. package/modules/radar/src/tools/git-history.md +581 -0
  321. package/modules/radar/src/tools/gitleaks.md +447 -0
  322. package/modules/radar/src/tools/grype.md +611 -0
  323. package/modules/radar/src/tools/semgrep.md +378 -0
  324. package/modules/radar/src/tools/sonarqube.md +550 -0
  325. package/modules/radar/src/tools/syft.md +539 -0
  326. package/modules/radar/src/tools/trivy.md +439 -0
  327. package/modules/radar/src/transform/agents/change-risk-modeler.md +24 -0
  328. package/modules/radar/src/transform/agents/execution-validator.md +24 -0
  329. package/modules/radar/src/transform/agents/guardrail-generator.md +24 -0
  330. package/modules/radar/src/transform/agents/pedagogy-agent.md +24 -0
  331. package/modules/radar/src/transform/agents/remediation-architect.md +24 -0
  332. package/modules/radar/src/transform/personas/change-risk-modeler.md +95 -0
  333. package/modules/radar/src/transform/personas/execution-validator.md +95 -0
  334. package/modules/radar/src/transform/personas/guardrail-generator.md +103 -0
  335. package/modules/radar/src/transform/personas/pedagogy-agent.md +105 -0
  336. package/modules/radar/src/transform/personas/remediation-architect.md +95 -0
  337. package/modules/radar/src/transform/rules/change-risk-rules.md +87 -0
  338. package/modules/radar/src/transform/rules/safety-governance.md +87 -0
  339. package/modules/radar/src/transform/schemas/change-risk.md +139 -0
  340. package/modules/radar/src/transform/schemas/intervention-level.md +207 -0
  341. package/modules/radar/src/transform/schemas/playbook.md +205 -0
  342. package/modules/radar/src/transform/schemas/verification-plan.md +134 -0
  343. package/modules/radar/src/transform/workflows/phase-6-remediation.md +148 -0
  344. package/modules/radar/src/transform/workflows/phase-7-risk-validation.md +161 -0
  345. package/modules/radar/src/transform/workflows/phase-8-execution-planning.md +159 -0
  346. package/modules/radar/src/transform/workflows/transform-safety.md +158 -0
  347. package/modules/vector/.vector-template/sessions/.gitkeep +0 -0
  348. package/modules/vector/.vector-template/vector.json +72 -0
  349. package/modules/vector/AUDIT-CLAUDEMD.md +154 -0
  350. package/modules/vector/INSTALL.md +185 -0
  351. package/modules/vector/LICENSE +21 -0
  352. package/modules/vector/README.md +409 -0
  353. package/modules/vector/VECTOR-BLOCK.md +57 -0
  354. package/modules/vector/assets/terminal.svg +68 -0
  355. package/modules/vector/bin/install.js +455 -0
  356. package/modules/vector/bin/migrate-v1-to-v2.sh +492 -0
  357. package/modules/vector/commands/help.md +46 -0
  358. package/modules/vector/hooks/vector-hook.py +775 -0
  359. package/modules/vector/mcp/index.js +118 -0
  360. package/modules/vector/mcp/package.json +10 -0
  361. package/modules/vector/mcp/tools/decisions.js +269 -0
  362. package/modules/vector/mcp/tools/domains.js +361 -0
  363. package/modules/vector/mcp/tools/staging.js +252 -0
  364. package/modules/vector/mcp/tools/vector-json.js +647 -0
  365. package/modules/vector/package.json +38 -0
  366. package/modules/vector/schemas/vector.schema.json +237 -0
  367. package/package.json +39 -0
  368. package/shared/branding/branding.js +70 -0
  369. package/shared/config/defaults.json +59 -0
  370. package/shared/events/README.md +175 -0
  371. package/shared/events/event-bus.js +134 -0
  372. package/shared/events/event_bus.py +255 -0
  373. package/shared/events/integrations.js +161 -0
  374. package/shared/events/schemas/audit-complete.schema.json +21 -0
  375. package/shared/events/schemas/phase-progress.schema.json +23 -0
  376. package/shared/events/schemas/plan-created.schema.json +21 -0
@@ -0,0 +1,247 @@
1
+ ---
2
+ id: domain-08
3
+ number: "08"
4
+ name: Scalability & Performance
5
+ owner_agents: [performance-engineer]
6
+ ---
7
+
8
+ ## Overview
9
+
10
+ Covers algorithmic complexity, N+1 queries, caching strategy, resource usage patterns, async behavior, bottlenecks, and backpressure. Scaling failures are often design bugs, not hardware limits — an O(n^2) algorithm in a hot path or an N+1 query pattern in a list endpoint will defeat any amount of horizontal scaling.
11
+
12
+ Scope: algorithmic complexity in critical paths, database query patterns, caching strategy and invalidation, connection pool management, async/blocking behavior, memory allocation patterns, batch processing efficiency, pagination, and backpressure mechanisms. Does NOT cover infrastructure capacity planning (domain 10), data model optimization (domain 02), or business logic correctness (domain 03).
13
+
14
+ ## Audit Questions
15
+
16
+ - Are there algorithmic complexity hotspots — O(n^2) or worse operations in request-handling paths?
17
+ - Does the system exhibit N+1 query patterns in list/collection endpoints?
18
+ - Is there a caching strategy, and how is cache invalidation handled?
19
+ - Are connection pools properly sized for database, HTTP clients, and message brokers?
20
+ - Is I/O handled asynchronously where appropriate, or do synchronous blocking calls bottleneck throughput?
21
+ - Are there memory allocation patterns that grow with request volume rather than staying bounded?
22
+ - Is batch processing used where appropriate, or are operations performed one-at-a-time in loops?
23
+ - Is pagination implemented for all list endpoints, and does it use efficient cursor-based or keyset pagination?
24
+ - Is backpressure implemented — what happens when producers outpace consumers?
25
+ - What system resources grow linearly with user count, and what grows sub-linearly?
26
+ - Are there known performance bottlenecks, and are they instrumented for monitoring?
27
+ - Are database queries optimized with appropriate indexes for common access patterns?
28
+
29
+ ## Failure Patterns
30
+
31
+ ### N+1 Query Problem
32
+
33
+ - **Description:** A list operation issues one query to fetch a collection, then N additional queries to fetch related data for each item — turning what should be 1-2 queries into N+1 queries that scale linearly with data size.
34
+ - **Indicators:**
35
+ - ORM lazy-loading of relationships inside loops
36
+ - Database query count that scales linearly with list size
37
+ - Slow list endpoints where individual item endpoints are fast
38
+ - Database monitoring showing thousands of nearly identical queries per request
39
+ - **Severity Tendency:** high
40
+
41
+ ### Missing Pagination
42
+
43
+ - **Description:** Endpoints return unbounded result sets, causing memory exhaustion and timeout failures as data grows.
44
+ - **Indicators:**
45
+ - API endpoints that return all records without limit/offset or cursor
46
+ - Database queries without LIMIT clause in list operations
47
+ - Memory usage that spikes proportional to table size during API calls
48
+ - "SELECT *" patterns without pagination in production code
49
+ - **Severity Tendency:** high
50
+
51
+ ### Unbounded Memory Growth
52
+
53
+ - **Description:** Memory usage grows continuously without bound, either through genuine leaks (unreleased references) or through design that accumulates data proportional to traffic or time.
54
+ - **Indicators:**
55
+ - In-memory caches without eviction policies or TTL
56
+ - Event listener registrations without corresponding cleanup
57
+ - Growing collections (maps, arrays) that are never pruned
58
+ - Memory profiling shows steadily increasing heap that doesn't recover after GC
59
+ - **Severity Tendency:** high
60
+
61
+ ### Synchronous Bottlenecks
62
+
63
+ - **Description:** I/O-bound operations (HTTP calls, file reads, database queries) are performed synchronously, blocking threads and limiting concurrency to the thread pool size.
64
+ - **Indicators:**
65
+ - Synchronous HTTP calls in async-capable frameworks
66
+ - Blocking file I/O in request handlers
67
+ - Sequential database queries that could be parallelized
68
+ - Thread pool exhaustion under moderate load
69
+ - **Severity Tendency:** medium
70
+
71
+ ### Cache Stampede
72
+
73
+ - **Description:** When a popular cache entry expires, many concurrent requests simultaneously compute the same expensive result, overwhelming the backend.
74
+ - **Indicators:**
75
+ - All cache entries for the same key type expire at the same time
76
+ - Backend load spikes correlating with cache TTL intervals
77
+ - No locking or probabilistic early expiration on cache refresh
78
+ - Database query spikes immediately after cache flush or restart
79
+ - **Severity Tendency:** high
80
+
81
+ ### Missing Connection Pooling
82
+
83
+ - **Description:** Database or HTTP connections are created per-request rather than pooled and reused, causing connection overhead, exhaustion of server-side connection limits, and performance degradation.
84
+ - **Indicators:**
85
+ - New connection created inside each request handler
86
+ - Connection count at database approaches server maximum under moderate load
87
+ - "Too many connections" errors in logs
88
+ - No connection pool library in dependencies or configuration
89
+ - **Severity Tendency:** high
90
+
91
+ ### Algorithmic Complexity Bombs
92
+
93
+ - **Description:** O(n^2) or worse algorithms in code paths that process user-controlled input sizes, creating operations whose execution time grows dramatically with data volume.
94
+ - **Indicators:**
95
+ - Nested loops iterating over the same or related collections
96
+ - Array `.includes()` or `.indexOf()` called inside loops (O(n) search * O(n) iteration = O(n^2))
97
+ - String concatenation in loops instead of builder/join patterns
98
+ - Sort operations inside loops, or repeated full-collection scans
99
+ - **Severity Tendency:** high
100
+
101
+ ### Missing Backpressure
102
+
103
+ - **Description:** Producers can generate work faster than consumers can process it, with no mechanism to slow producers down, leading to queue overflow, memory exhaustion, or dropped work.
104
+ - **Indicators:**
105
+ - Unbounded in-memory queues between producer and consumer
106
+ - No rate limiting on API endpoints that trigger expensive background work
107
+ - Message queue consumers with no prefetch limit
108
+ - Worker processes that accept unlimited concurrent tasks
109
+ - **Severity Tendency:** high
110
+
111
+ ## Best Practice Patterns
112
+
113
+ ### Eager Loading / DataLoader Pattern
114
+
115
+ - **Replaces Failure Pattern:** N+1 Query Problem
116
+ - **Abstract Pattern:** Batch related-data fetching into a single query per relationship type. Either eagerly load relationships when the collection is fetched, or use a DataLoader that collects individual requests and batches them into one query.
117
+ - **Framework Mappings:**
118
+ - Rails: `includes(:association)` for eager loading, `preload` for separate queries, `eager_load` for JOIN-based loading
119
+ - Django: `select_related()` for FK joins, `prefetch_related()` for separate batched queries
120
+ - GraphQL: DataLoader pattern — collects individual `load(id)` calls within a tick and batches into `loadMany(ids)`
121
+ - **Language Patterns:**
122
+ - SQL: `SELECT * FROM orders JOIN users ON orders.user_id = users.id WHERE orders.id IN (...)` — single query for all related data
123
+ - TypeScript: `dataloader` library with per-request caching and automatic batching within event loop tick
124
+
125
+ ### Cursor-Based Pagination
126
+
127
+ - **Replaces Failure Pattern:** Missing Pagination
128
+ - **Abstract Pattern:** Use cursor-based (keyset) pagination for stable, efficient pagination that doesn't degrade with table size. Each page returns a cursor pointing to the last item, and the next page starts from that cursor.
129
+ - **Framework Mappings:**
130
+ - GraphQL Relay: Connections spec with `first`, `after`, `last`, `before` cursor arguments
131
+ - Django REST Framework: `CursorPagination` class using encoded cursor tokens
132
+ - Spring Data: `Pageable` with keyset-based `ScrollPosition` for efficient deep pagination
133
+ - **Language Patterns:**
134
+ - SQL: `SELECT * FROM items WHERE id > :cursor ORDER BY id ASC LIMIT :page_size` — no OFFSET, uses index scan
135
+ - Any: Encode last-seen ID or sort key as opaque cursor token returned to client
136
+
137
+ ### Bounded Caching with Eviction
138
+
139
+ - **Replaces Failure Pattern:** Cache Stampede
140
+ - **Abstract Pattern:** Caches have explicit maximum size, TTL-based expiration, and eviction policies. Cache stampede is prevented through probabilistic early refresh, locking, or stale-while-revalidate patterns.
141
+ - **Framework Mappings:**
142
+ - Redis: `SETEX` with TTL, `maxmemory-policy allkeys-lru` for automatic eviction, Redlock for distributed locking on refresh
143
+ - Caffeine (Java): `maximumSize()`, `expireAfterWrite()`, `refreshAfterWrite()` with async refresh to prevent stampede
144
+ - Node.js: `lru-cache` with `max` entries and `ttl`, `fetchMethod` for stale-while-revalidate
145
+ - **Language Patterns:**
146
+ - Any: Cache-aside pattern: check cache → if miss, acquire lock → compute → store → release lock (other waiters get lock or read fresh cache)
147
+ - Any: Probabilistic early expiration: refresh cache entry when `remaining_ttl < random(0, base_ttl * 0.1)` to spread refresh across time
148
+
149
+ ### Resource Lifecycle Management
150
+
151
+ - **Replaces Failure Pattern:** Unbounded Memory Growth
152
+ - **Abstract Pattern:** Every allocated resource (cache entries, event listeners, connections, buffers) has a defined lifecycle — creation, usage, and cleanup. In-memory collections have maximum sizes or TTL-based eviction. Subscriptions and listeners are deregistered when their owners are destroyed.
153
+ - **Framework Mappings:**
154
+ - Java: `try-with-resources` for AutoCloseable resources, WeakReferences for cache entries, `@PreDestroy` for cleanup
155
+ - .NET: `IDisposable` pattern with `using` blocks, `ConditionalWeakTable` for metadata caches
156
+ - React: `useEffect` cleanup functions for subscriptions, `AbortController` for fetch cancellation on unmount
157
+ - **Language Patterns:**
158
+ - Go: `defer` for cleanup, `context.WithCancel()` for goroutine lifecycle management
159
+ - Python: Context managers (`with` statements) for resource cleanup, `weakref` for cache entries that don't prevent GC
160
+
161
+ ### Async-First Architecture
162
+
163
+ - **Replaces Failure Pattern:** Synchronous Bottlenecks
164
+ - **Abstract Pattern:** I/O-bound operations use async/non-blocking APIs by default. Synchronous blocking is only used for CPU-bound work on dedicated thread pools. The system's concurrency model matches its workload profile.
165
+ - **Framework Mappings:**
166
+ - Spring WebFlux: Reactive streams with non-blocking I/O throughout the stack
167
+ - Fastify/Express: `async/await` handlers with non-blocking database drivers (pg-pool, ioredis)
168
+ - Go: Goroutines with channels — lightweight concurrency without callback complexity
169
+ - **Language Patterns:**
170
+ - Node.js: `async/await` for all I/O, `Promise.all()` for parallel independent operations
171
+ - Python: `asyncio` with `aiohttp` for HTTP, `asyncpg` for database — event loop for I/O concurrency
172
+
173
+ ### Connection Pooling
174
+
175
+ - **Replaces Failure Pattern:** Missing Connection Pooling
176
+ - **Abstract Pattern:** Database and HTTP client connections are managed through pools with configured minimum, maximum, idle timeout, and connection lifetime. Pools are shared across request handlers and monitored for exhaustion.
177
+ - **Framework Mappings:**
178
+ - HikariCP (Java): High-performance JDBC connection pool with `maximumPoolSize`, `minimumIdle`, `connectionTimeout`, `maxLifetime`
179
+ - pg-pool (Node.js): PostgreSQL connection pool with `max`, `idleTimeoutMillis`, `connectionTimeoutMillis`
180
+ - SQLAlchemy (Python): `pool_size`, `max_overflow`, `pool_recycle` configuration for database engine
181
+ - **Language Patterns:**
182
+ - Any: Pool size = `(core_count * 2) + effective_spindle_count` as starting point (PostgreSQL recommendation)
183
+ - Any: Connection pool metrics (active, idle, waiting, timeouts) exported to monitoring
184
+
185
+ ### Backpressure Mechanisms
186
+
187
+ - **Replaces Failure Pattern:** Missing Backpressure
188
+ - **Abstract Pattern:** Consumers communicate capacity to producers. When consumers fall behind, producers are slowed (blocking backpressure), work is shed (load shedding), or excess is redirected (overflow routing). Queue depths are bounded and monitored.
189
+ - **Framework Mappings:**
190
+ - RabbitMQ: `prefetch_count` limiting unacked messages per consumer, queue `x-max-length` with dead letter routing
191
+ - Kafka: Consumer group rebalancing with `max.poll.records` controlling batch size
192
+ - Reactive Streams (Java): `Flux.onBackpressureBuffer(maxSize)` or `onBackpressureDrop()` for explicit strategy
193
+ - **Language Patterns:**
194
+ - Go: Buffered channels with select-default pattern for non-blocking sends
195
+ - Node.js: Streams with `highWaterMark` and `drain` event for built-in backpressure
196
+
197
+ ### Complexity-Aware Data Structure Selection
198
+
199
+ - **Replaces Failure Pattern:** Algorithmic Complexity Bombs
200
+ - **Abstract Pattern:** Data structures and algorithms are chosen based on the complexity requirements of the access patterns they serve. Hot paths are profiled and audited for quadratic or worse operations. Linear search in loops is replaced with hash-based lookups.
201
+ - **Framework Mappings:**
202
+ - Java: `HashMap`/`HashSet` for O(1) lookups replacing `List.contains()` in loops, `StringBuilder` replacing string concatenation in loops
203
+ - Python: Set/dict comprehensions for membership testing replacing list iteration, `collections.defaultdict` for grouping
204
+ - PostgreSQL: Query plan analysis with `EXPLAIN ANALYZE` to detect sequential scans on large tables where index scans are expected
205
+ - **Language Patterns:**
206
+ - JavaScript/TypeScript: Convert arrays to `Set` or `Map` before loop-based lookups: `const idSet = new Set(ids)` then `idSet.has(id)` instead of `ids.includes(id)`
207
+ - Any: Pre-sort + binary search or hash-based index for repeated lookups against the same collection
208
+
209
+ ## Red Flags
210
+
211
+ - ORM calls inside loops (`.find()`, `.get()`, `.load()` per iteration)
212
+ - API endpoints returning collections without pagination parameters
213
+ - In-memory caches without TTL or maximum size
214
+ - Database queries without LIMIT clause in any list operation
215
+ - Nested loops over collections where inner collection size depends on outer
216
+ - No connection pool configuration in database client setup
217
+ - `SELECT *` in production queries
218
+ - Synchronous HTTP calls in async request handlers
219
+ - No rate limiting on public-facing API endpoints
220
+ - Growing memory usage visible in production metrics without plateau
221
+
222
+ ## Tool Affinities
223
+
224
+ | Tool ID | Signal Type | Relevance |
225
+ |---------|-------------|-----------|
226
+ | sonarqube | Cognitive complexity hotspots, code duplication in performance-critical paths, method length as proxy for algorithmic complexity | primary |
227
+ | semgrep | Pattern detection for N+1 queries, missing pagination, synchronous calls in async contexts, unbounded loops | supporting |
228
+ | git-history | Performance-related commit patterns (commits mentioning "slow", "timeout", "optimize") reveal historical pain points | contextual |
229
+
230
+ ## Standards & Frameworks
231
+
232
+ - Google SRE performance guidelines — Latency budgets, load testing principles, capacity planning
233
+ - USE Method (Brendan Gregg) — Utilization, Saturation, Errors for resource performance analysis
234
+ - Database optimization patterns — Index design, query planning, denormalization trade-offs
235
+ - Reactive Manifesto — Responsive, Resilient, Elastic, Message-Driven principles for scalable systems
236
+ - Little's Law — L = λW (concurrent requests = arrival rate × average latency) for capacity modeling
237
+
238
+ ## Metrics
239
+
240
+ | Metric | What It Measures | Healthy Range |
241
+ |--------|-----------------|---------------|
242
+ | Query count per request | Average database queries per API request | <10 for list endpoints, <5 for detail endpoints |
243
+ | P95/P99 response time | Tail latency for API endpoints | P95 <500ms, P99 <2s (application-dependent) |
244
+ | Cache hit ratio | Percentage of reads served from cache | >80% for read-heavy endpoints |
245
+ | Connection pool utilization | Active connections as percentage of max pool size | 30-70% at normal load, <90% at peak |
246
+ | Memory growth rate | Rate of heap growth between GC cycles | Flat or near-zero (no sustained growth) |
247
+ | Algorithmic hotspot count | Number of O(n^2)+ operations in request-handling paths | 0 in hot paths |
@@ -0,0 +1,271 @@
1
+ ---
2
+ id: domain-09
3
+ number: "09"
4
+ name: Maintainability & Code Health
5
+ owner_agents: [senior-app-engineer]
6
+ ---
7
+
8
+ ## Overview
9
+
10
+ Maintainability encompasses code smells, duplication, naming clarity, documentation accuracy, intent visibility, and technical debt management. Research indicates that maintenance activities consume 60-80% of total software lifecycle costs. This domain focuses on code-level quality factors that directly impact the ease and safety of making changes. It does NOT cover architectural patterns (domain 01), testing strategies (domain 06), or change risk analysis (domain 11).
11
+
12
+ ## Audit Questions
13
+
14
+ - What percentage of the codebase consists of duplicated code blocks or logic?
15
+ - Are class, function, and variable names self-documenting and aligned with domain terminology?
16
+ - How much dead code exists that is no longer called or used by the system?
17
+ - Do comments and documentation accurately reflect current code behavior and intent?
18
+ - Are primitive types used directly where domain objects would improve clarity?
19
+ - What is the average cognitive complexity of functions across the codebase?
20
+ - Is code style consistent within and across modules?
21
+ - Are configuration values scattered throughout the code or centralized?
22
+ - How many functions exceed recommended length thresholds for the language?
23
+ - Does the codebase exhibit patterns of primitive obsession or feature envy?
24
+ - Are magic numbers and strings replaced with named constants?
25
+ - How frequently do developers report confusion about code intent during reviews?
26
+
27
+ ## Failure Patterns
28
+
29
+ ### Excessive Duplication
30
+
31
+ - **Description:** Identical or near-identical code blocks repeated across multiple locations, increasing maintenance burden and bug propagation risk. Violates the DRY principle and creates change amplification.
32
+ - **Indicators:**
33
+ - Copy-pasted code blocks with minor variations in variable names
34
+ - Identical business logic implemented in multiple services or modules
35
+ - Repeated error handling patterns without abstraction
36
+ - Similar data transformation logic scattered across layers
37
+ - Multiple implementations of the same algorithm
38
+ - **Severity Tendency:** medium
39
+
40
+ ### Poor Naming
41
+
42
+ - **Description:** Class, function, variable, and module names that fail to communicate intent, use inconsistent terminology, or create cognitive load through abbreviations and ambiguity. Forces readers to constantly reference context.
43
+ - **Indicators:**
44
+ - Generic names like "data," "manager," "handler," "process," "doStuff"
45
+ - Inconsistent terminology for the same concept across modules
46
+ - Single-letter variables outside conventional loop contexts
47
+ - Names that require comments to explain their purpose
48
+ - Abbreviations that are not universally understood
49
+ - Names that don't reflect the domain language
50
+ - **Severity Tendency:** medium
51
+
52
+ ### Dead Code Accumulation
53
+
54
+ - **Description:** Functions, classes, modules, or entire features that are no longer called or used but remain in the codebase. Creates maintenance burden, confusion about system behavior, and false positives in search results.
55
+ - **Indicators:**
56
+ - Functions with no call sites in the entire codebase
57
+ - Commented-out code blocks spanning dozens of lines
58
+ - Modules imported nowhere in the dependency graph
59
+ - Feature flags that are permanently disabled
60
+ - Deprecated APIs with no migration path or timeline
61
+ - Build artifacts for components no longer compiled
62
+ - **Severity Tendency:** low
63
+
64
+ ### Missing Intent Documentation
65
+
66
+ - **Description:** Code that performs non-obvious operations without explaining why specific decisions were made. Leaves future maintainers guessing about business rules, edge cases, and architectural constraints.
67
+ - **Indicators:**
68
+ - Complex algorithms with no explanation of their purpose
69
+ - Magic numbers without comments explaining their significance
70
+ - Non-obvious workarounds for third-party library issues
71
+ - Business logic with no reference to requirements or tickets
72
+ - Conditional branches with unclear business meaning
73
+ - Performance optimizations without justification
74
+ - **Severity Tendency:** medium
75
+
76
+ ### Primitive Obsession
77
+
78
+ - **Description:** Overuse of primitive data types (strings, integers, arrays) instead of small domain objects or value types. Scatters validation logic, reduces type safety, and obscures domain concepts.
79
+ - **Indicators:**
80
+ - String parameters representing enumerated concepts
81
+ - Parallel arrays or tuples instead of structured objects
82
+ - Repeated validation of primitive values across the codebase
83
+ - Functions with multiple primitive parameters instead of domain objects
84
+ - Type aliases for primitives without behavior or validation
85
+ - Business logic operating on raw primitives instead of domain types
86
+ - **Severity Tendency:** medium
87
+
88
+ ### Long Methods/Functions
89
+
90
+ - **Description:** Functions or methods that exceed cognitive complexity thresholds, contain multiple levels of abstraction, or perform many unrelated operations. Reduces comprehensibility and testability.
91
+ - **Indicators:**
92
+ - Functions exceeding 50 lines in most languages
93
+ - Multiple levels of nested conditionals or loops
94
+ - Functions performing I/O, business logic, and presentation in sequence
95
+ - More than 5 local variables tracking state
96
+ - Functions requiring horizontal scrolling to read
97
+ - Methods mixing abstraction levels without clear separation
98
+ - **Severity Tendency:** medium
99
+
100
+ ### Inconsistent Code Style
101
+
102
+ - **Description:** Lack of uniform formatting, naming conventions, and structural patterns across the codebase. Creates friction during reading, increases cognitive load, and signals weak quality standards.
103
+ - **Indicators:**
104
+ - Mixed indentation styles (tabs vs. spaces, different widths)
105
+ - Inconsistent brace placement and spacing conventions
106
+ - Variable naming that switches between camelCase, snake_case, PascalCase
107
+ - Some files formatted by linters, others not
108
+ - Inconsistent error handling patterns (some throw, some return codes)
109
+ - Mixed quote styles or trailing comma conventions
110
+ - **Severity Tendency:** low
111
+
112
+ ### Scattered Configuration
113
+
114
+ - **Description:** Configuration values, feature flags, and environment-specific settings spread throughout the codebase rather than centralized. Makes deployment difficult and increases risk of missed configuration during environment changes.
115
+ - **Indicators:**
116
+ - Hardcoded URLs or connection strings in multiple files
117
+ - Environment-specific logic in business code
118
+ - Configuration values duplicated across services
119
+ - No single source of truth for feature flags
120
+ - Magic strings representing configuration keys
121
+ - Configuration embedded in class constructors throughout the codebase
122
+ - **Severity Tendency:** medium
123
+
124
+ ## Best Practice Patterns
125
+
126
+ ### Extract Common Abstractions
127
+
128
+ - **Replaces Failure Pattern:** Excessive Duplication
129
+ - **Abstract Pattern:** Identify repeated code blocks and extract them into shared functions, classes, or modules with clear single responsibilities. Use parameterization to handle variations while maintaining a single implementation.
130
+ - **Framework Mappings:**
131
+ - React: Extract custom hooks for repeated stateful logic or component patterns
132
+ - Spring: Use service classes and utility methods for common business logic
133
+ - Django: Create model mixins, manager methods, or template tags for reusable patterns
134
+ - **Language Patterns:**
135
+ - Python: Extract functions/classes, use decorators for cross-cutting concerns
136
+ - TypeScript: Create utility functions, generic types, and higher-order components
137
+ - Java: Use inheritance, composition, and utility classes for shared behavior
138
+
139
+ ### Domain-Aligned Naming
140
+
141
+ - **Replaces Failure Pattern:** Poor Naming
142
+ - **Abstract Pattern:** Use names that directly reflect domain concepts and business terminology. Names should read like natural language and require no additional context to understand their purpose.
143
+ - **Framework Mappings:**
144
+ - Domain-Driven Design: Use ubiquitous language from bounded contexts
145
+ - Clean Architecture: Name entities, use cases, and interfaces after business concepts
146
+ - REST APIs: Use resource nouns and HTTP verbs that match business operations
147
+ - **Language Patterns:**
148
+ - Python: Use descriptive snake_case names; avoid abbreviations unless domain-standard
149
+ - TypeScript: Use clear camelCase; leverage type names for additional clarity
150
+ - Java: Use verbose PascalCase for classes; verbs for methods reflecting actions
151
+
152
+ ### Aggressive Dead Code Removal
153
+
154
+ - **Replaces Failure Pattern:** Dead Code Accumulation
155
+ - **Abstract Pattern:** Continuously identify and delete unused code. Trust version control for historical reference rather than leaving commented code in place. Use feature flags for temporary disablement, not code comments.
156
+ - **Framework Mappings:**
157
+ - Git: Use branches for experimental code; rely on history for recovery
158
+ - Feature Flag Systems: Use LaunchDarkly, Unleash for temporary feature disablement
159
+ - CI/CD: Add automated dead code detection to build pipelines
160
+ - **Language Patterns:**
161
+ - Python: Use coverage tools to identify unused modules; remove commented blocks
162
+ - TypeScript: Use "unused" linting rules; remove imports with no references
163
+ - Java: Use IDE analysis to find unused classes; delete deprecated code after migration
164
+
165
+ ### Intent-Revealing Documentation
166
+
167
+ - **Replaces Failure Pattern:** Missing Intent Documentation
168
+ - **Abstract Pattern:** Document the "why" rather than the "what." Focus on business context, architectural constraints, non-obvious trade-offs, and edge cases. Use code structure and naming to make the "what" self-evident.
169
+ - **Framework Mappings:**
170
+ - JSDoc/TSDoc: Document non-obvious parameters, return value meanings, side effects
171
+ - Javadoc: Explain design decisions, link to tickets, note performance considerations
172
+ - Python Docstrings: Use Google or NumPy format for structured intent documentation
173
+ - **Language Patterns:**
174
+ - Python: Use module-level docstrings for context; inline comments for "why" only
175
+ - TypeScript: Use TSDoc for public APIs; inline comments for business rule references
176
+ - Java: Use Javadoc for public interfaces; comments for complex algorithms only
177
+
178
+ ### Value Objects and Domain Types
179
+
180
+ - **Replaces Failure Pattern:** Primitive Obsession
181
+ - **Abstract Pattern:** Replace primitive types with small, immutable domain objects that encapsulate validation, behavior, and business meaning. Use type systems to enforce domain constraints at compile time.
182
+ - **Framework Mappings:**
183
+ - Domain-Driven Design: Create value objects for domain concepts like Money, EmailAddress
184
+ - Type Systems: Use branded types or newtypes to prevent primitive mixing
185
+ - ORMs: Define custom column types for domain value objects
186
+ - **Language Patterns:**
187
+ - Python: Use dataclasses or attrs for value objects with validation
188
+ - TypeScript: Use branded types, classes, or Zod schemas for domain types
189
+ - Java: Use records or immutable classes with private constructors
190
+
191
+ ### Single-Purpose Functions
192
+
193
+ - **Replaces Failure Pattern:** Long Methods/Functions
194
+ - **Abstract Pattern:** Extract functions to perform one task at one level of abstraction. Functions should read like a table of contents, delegating details to lower-level functions. Aim for functions under 20 lines in most cases.
195
+ - **Framework Mappings:**
196
+ - Clean Code: Apply Extract Method refactoring until each function has one reason to change
197
+ - Functional Programming: Use function composition to build complex operations from simple ones
198
+ - SOLID Principles: Apply Single Responsibility Principle at function level
199
+ - **Language Patterns:**
200
+ - Python: Use clear function names; extract inner functions or private methods
201
+ - TypeScript: Use arrow functions for small operations; extract named functions for clarity
202
+ - Java: Use private methods for decomposition; apply Extract Method refactoring
203
+
204
+ ### Automated Style Enforcement
205
+
206
+ - **Replaces Failure Pattern:** Inconsistent Code Style
207
+ - **Abstract Pattern:** Use automated formatters and linters integrated into development workflow and CI/CD pipeline. Remove style decisions from code review by enforcing standards automatically.
208
+ - **Framework Mappings:**
209
+ - Pre-commit Hooks: Use Husky, pre-commit to format before commit
210
+ - CI/CD: Fail builds on style violations; use formatters as validation steps
211
+ - IDE Integration: Configure auto-format on save with project-wide settings
212
+ - **Language Patterns:**
213
+ - Python: Use Black for formatting, Ruff or Flake8 for linting
214
+ - TypeScript: Use Prettier for formatting, ESLint for code quality rules
215
+ - Java: Use Google Java Format or Prettier Java; Checkstyle for validation
216
+
217
+ ### Centralized Configuration Management
218
+
219
+ - **Replaces Failure Pattern:** Scattered Configuration
220
+ - **Abstract Pattern:** Consolidate all configuration into dedicated files or configuration management systems. Load configuration once at application startup and inject it through dependency injection or context objects.
221
+ - **Framework Mappings:**
222
+ - 12-Factor App: Store config in environment variables; never in code
223
+ - Spring: Use application.properties/yml with profiles for environment-specific config
224
+ - Environment Management: Use dotenv, viper, or similar libraries for configuration loading
225
+ - **Language Patterns:**
226
+ - Python: Use python-dotenv, pydantic Settings for typed configuration
227
+ - TypeScript: Use dotenv with Zod validation; create typed config objects
228
+ - Java: Use Spring @ConfigurationProperties or MicroProfile Config
229
+
230
+ ## Red Flags
231
+
232
+ - Duplication percentage above 5% of total codebase
233
+ - More than 10% of functions exceed language-specific complexity thresholds
234
+ - Class or function names containing "Manager," "Utility," "Helper," "Data" without qualifiers
235
+ - Dead code percentage above 2% of total codebase
236
+ - Configuration values hardcoded in more than one location
237
+ - Inconsistent indentation or formatting across files
238
+ - Functions regularly exceeding 50 lines
239
+ - Comments explaining what code does rather than why it exists
240
+ - Multiple implementations of the same business logic
241
+ - Magic numbers without named constants
242
+ - Over 15% of codebase consists of commented-out code blocks
243
+
244
+ ## Tool Affinities
245
+
246
+ | Tool ID | Signal Type | Relevance |
247
+ |---------|-------------|-----------|
248
+ | sonarqube | Code smells, duplication, cognitive complexity | primary |
249
+ | semgrep | Anti-patterns, code smells, custom rules | supporting |
250
+ | git-history | Code churn patterns, refactoring history | supporting |
251
+ | gitleaks | Hardcoded secrets in configuration | contextual |
252
+
253
+ ## Standards & Frameworks
254
+
255
+ - Clean Code (Robert Martin) — principles for readable, maintainable code
256
+ - Refactoring (Martin Fowler) — catalog of code smell patterns and refactorings
257
+ - Cognitive Complexity (SonarSource) — metric for measuring code understandability
258
+ - DRY Principle (Don't Repeat Yourself) — minimizing duplication through abstraction
259
+ - Code Complete (Steve McConnell) — comprehensive guidance on code construction quality
260
+ - SOLID Principles — single responsibility applies to functions and modules
261
+
262
+ ## Metrics
263
+
264
+ | Metric | What It Measures | Healthy Range |
265
+ |--------|-----------------|---------------|
266
+ | Duplication Percentage | Percentage of codebase that is duplicated code | < 3% |
267
+ | Cognitive Complexity Average | Average cognitive complexity per function | < 10 |
268
+ | Dead Code Percentage | Percentage of codebase that is unused | < 1% |
269
+ | Code Churn Rate | Percentage of code rewritten within 3 weeks | < 15% |
270
+ | Function Length Average | Average lines of code per function | < 25 lines |
271
+ | Comment-to-Code Ratio | Ratio of comment lines to code lines | 10-20% |