@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,274 @@
1
+ ---
2
+ id: domain-04
3
+ number: "04"
4
+ name: Security
5
+ owner_agents: [security-engineer]
6
+ ---
7
+
8
+ ## Overview
9
+
10
+ This domain covers authentication, authorization, secrets management, injection vulnerabilities, dependency security, cryptography implementation, supply chain risk, and trust boundary enforcement. Security failures represent existential risks to systems and organizations. This domain focuses on preventing unauthorized access, data breaches, and exploitation of code vulnerabilities. Does NOT cover compliance or privacy regulations (domain 05), security testing methodologies (domain 06), or infrastructure security outside the codebase scope.
11
+
12
+ ## Audit Questions
13
+
14
+ - Are authentication mechanisms resistant to common attacks like credential stuffing and session hijacking?
15
+ - Is authorization enforced consistently at all access points, or can it be bypassed?
16
+ - Are secrets stored outside the codebase and rotated regularly?
17
+ - Are all external inputs sanitized to prevent injection attacks?
18
+ - Are dependencies scanned for known vulnerabilities and updated promptly?
19
+ - Is cryptography implemented using vetted libraries rather than custom implementations?
20
+ - Are supply chain dependencies verified for integrity and provenance?
21
+ - Are trust boundaries clearly defined and enforced between system components?
22
+ - Is the principle of least privilege applied to service accounts and API keys?
23
+ - Are sensitive data (PII, credentials, tokens) excluded from logs and error messages?
24
+ - Do API endpoints require authentication by default, with public access as explicit exception?
25
+ - Are rate limits and input size restrictions enforced to prevent resource exhaustion?
26
+ - Is secure communication (TLS) enforced for all network traffic?
27
+ - Are file uploads validated for type, size, and content to prevent malicious payloads?
28
+ - Is Cross-Site Request Forgery (CSRF) protection enabled for state-changing operations?
29
+
30
+ ## Failure Patterns
31
+
32
+ ### Broken Authentication
33
+ - **Description:** Authentication mechanisms are weak, misconfigured, or bypassable, allowing unauthorized access to protected resources.
34
+ - **Indicators:**
35
+ - No password complexity requirements or rate limiting on login
36
+ - Session tokens that don't expire or can be reused indefinitely
37
+ - Authentication logic that can be bypassed with crafted requests
38
+ - Credentials transmitted over unencrypted connections
39
+ - Default credentials not changed in production deployments
40
+ - Authentication state stored client-side without integrity checks
41
+ - Missing multi-factor authentication for privileged accounts
42
+ - **Severity Tendency:** critical
43
+
44
+ ### Injection Vulnerabilities
45
+ - **Description:** Untrusted input is concatenated into queries or commands, allowing attackers to execute arbitrary code or access unauthorized data.
46
+ - **Indicators:**
47
+ - SQL queries constructed with string concatenation
48
+ - Shell commands built from user input without escaping
49
+ - XML/JSON parsers processing untrusted input without validation
50
+ - Template rendering with user input in executable contexts
51
+ - LDAP/NoSQL queries using string interpolation
52
+ - Regular expressions constructed from user input (ReDoS risk)
53
+ - Eval-like functions processing external data
54
+ - **Severity Tendency:** critical
55
+
56
+ ### Hardcoded Secrets
57
+ - **Description:** Credentials, API keys, or cryptographic keys are embedded directly in source code, making them visible to anyone with repository access.
58
+ - **Indicators:**
59
+ - Database passwords in configuration files
60
+ - API keys in source code or commit history
61
+ - Private keys checked into version control
62
+ - Encryption keys defined as string literals
63
+ - OAuth client secrets in client-side code
64
+ - JWT signing keys in application code
65
+ - AWS access keys in environment variable defaults
66
+ - **Severity Tendency:** critical
67
+
68
+ ### Missing Authorization Checks
69
+ - **Description:** Authorization is not enforced consistently, allowing users to access resources or perform actions beyond their privilege level.
70
+ - **Indicators:**
71
+ - API endpoints that validate authentication but not authorization
72
+ - Direct object references without ownership verification
73
+ - Authorization checks only in UI layer, not backend
74
+ - Privilege escalation possible through parameter tampering
75
+ - Inconsistent enforcement of role-based access control
76
+ - Authorization logic duplicated rather than centralized
77
+ - Missing checks on secondary code paths or error handlers
78
+ - **Severity Tendency:** critical
79
+
80
+ ### Dependency Vulnerabilities
81
+ - **Description:** Third-party libraries and frameworks contain known security vulnerabilities that are exploitable in the application context.
82
+ - **Indicators:**
83
+ - Dependencies not updated for months or years
84
+ - High or critical CVEs in direct or transitive dependencies
85
+ - No automated dependency scanning in CI/CD pipeline
86
+ - Outdated framework versions missing security patches
87
+ - Dependencies from untrusted or unmaintained sources
88
+ - Large dependency trees with unknown provenance
89
+ - No software bill of materials (SBOM) tracking
90
+ - **Severity Tendency:** high
91
+
92
+ ### Cryptography Misuse
93
+ - **Description:** Cryptographic operations use weak algorithms, insecure modes, or are implemented incorrectly, undermining security guarantees.
94
+ - **Indicators:**
95
+ - Use of MD5, SHA1, or other deprecated hash functions for security
96
+ - ECB mode for symmetric encryption
97
+ - Custom cryptography implementations instead of vetted libraries
98
+ - Hard-coded initialization vectors (IVs) or salts
99
+ - Insufficient key lengths (e.g., RSA <2048 bits)
100
+ - Missing or weak random number generation for security contexts
101
+ - Password hashing without proper salting or key derivation functions
102
+ - **Severity Tendency:** high
103
+
104
+ ### Insufficient Input Sanitization
105
+ - **Description:** User input is not properly validated, encoded, or sanitized before use, creating vectors for cross-site scripting, path traversal, and other attacks.
106
+ - **Indicators:**
107
+ - User input directly rendered in HTML without escaping
108
+ - File paths constructed from user input without validation
109
+ - URL redirects accepting arbitrary destinations
110
+ - File uploads without type/content validation
111
+ - No size limits on input fields enabling DoS attacks
112
+ - User-controlled data in security-sensitive contexts (cookies, headers)
113
+ - Missing output encoding for context (HTML, URL, JavaScript)
114
+ - **Severity Tendency:** high
115
+
116
+ ### Missing Trust Boundaries
117
+ - **Description:** Components trust data or actions from other components without validation, allowing compromise to spread laterally across system boundaries.
118
+ - **Indicators:**
119
+ - Internal APIs assuming all calls are legitimate
120
+ - Microservices that don't authenticate peer requests
121
+ - Database queries trusting data from message queues
122
+ - Frontend code trusting backend responses without validation
123
+ - Service-to-service communication without mutual TLS
124
+ - Shared secrets across multiple trust zones
125
+ - No network segmentation between application tiers
126
+ - **Severity Tendency:** high
127
+
128
+ ## Best Practice Patterns
129
+
130
+ ### Robust Authentication
131
+ - **Replaces Failure Pattern:** Broken Authentication
132
+ - **Abstract Pattern:** Implement multi-layered authentication using industry-standard protocols, enforce strong credentials, protect session integrity, and apply defense-in-depth with rate limiting and monitoring.
133
+ - **Framework Mappings:**
134
+ - OAuth 2.0 / OpenID Connect: Delegated authentication with token-based access
135
+ - Passport.js: Strategy-based authentication for Node.js applications
136
+ - Spring Security: Comprehensive authentication and authorization for Java
137
+ - **Language Patterns:**
138
+ - Python: Flask-Login or Django authentication with bcrypt password hashing
139
+ - Go: JWT middleware with RS256 signing and refresh token rotation
140
+ - .NET: ASP.NET Identity with configurable password policies and lockout
141
+
142
+ ### Parameterized Queries
143
+ - **Replaces Failure Pattern:** Injection Vulnerabilities
144
+ - **Abstract Pattern:** Use prepared statements, parameterized queries, or ORM abstractions that separate code from data, preventing injection of executable commands.
145
+ - **Framework Mappings:**
146
+ - SQLAlchemy: ORM with bound parameters for Python database access
147
+ - JDBC PreparedStatement: Parameterized queries for Java SQL
148
+ - Entity Framework: LINQ queries with automatic parameterization
149
+ - **Language Patterns:**
150
+ - JavaScript: Parameterized queries with `pg` or `mysql2` libraries
151
+ - PHP: PDO with prepared statements and bound parameters
152
+ - Ruby: ActiveRecord with query parameter binding
153
+
154
+ ### Externalized Secrets Management
155
+ - **Replaces Failure Pattern:** Hardcoded Secrets
156
+ - **Abstract Pattern:** Store secrets in dedicated secret management systems, inject them at runtime, rotate them regularly, and never commit them to version control.
157
+ - **Framework Mappings:**
158
+ - HashiCorp Vault: Centralized secret storage with dynamic secrets
159
+ - AWS Secrets Manager: Cloud-native secret rotation and access control
160
+ - Kubernetes Secrets: Encrypted secret distribution to pods
161
+ - **Language Patterns:**
162
+ - Python: Environment variable loading with `python-dotenv` and validation
163
+ - Go: Secret injection via environment variables with `viper` configuration
164
+ - Node.js: `dotenv` for development, cloud secret managers for production
165
+
166
+ ### Centralized Authorization
167
+ - **Replaces Failure Pattern:** Missing Authorization Checks
168
+ - **Abstract Pattern:** Enforce authorization through a single decision point using attribute-based or role-based access control, applied consistently across all entry points.
169
+ - **Framework Mappings:**
170
+ - Casbin: Policy-based authorization engine supporting RBAC, ABAC
171
+ - AWS IAM: Role and policy-based authorization for cloud resources
172
+ - Open Policy Agent (OPA): General-purpose policy engine for microservices
173
+ - **Language Patterns:**
174
+ - Python: Decorators for route-level authorization checks
175
+ - Java: Aspect-oriented programming for method-level security annotations
176
+ - TypeScript: Middleware chains enforcing authorization before handlers
177
+
178
+ ### Automated Dependency Scanning
179
+ - **Replaces Failure Pattern:** Dependency Vulnerabilities
180
+ - **Abstract Pattern:** Continuously scan dependencies for known vulnerabilities, automate updates for security patches, and maintain a software bill of materials.
181
+ - **Framework Mappings:**
182
+ - Dependabot: Automated dependency updates for GitHub repositories
183
+ - Snyk: Vulnerability scanning with remediation guidance
184
+ - OWASP Dependency-Check: SCA tool for detecting vulnerable dependencies
185
+ - **Language Patterns:**
186
+ - npm: `npm audit` with automated fix suggestions
187
+ - Maven: OWASP Dependency-Check plugin in build lifecycle
188
+ - Go: `govulncheck` for vulnerability detection in Go modules
189
+
190
+ ### Vetted Cryptography Libraries
191
+ - **Replaces Failure Pattern:** Cryptography Misuse
192
+ - **Abstract Pattern:** Use well-maintained cryptographic libraries implementing current standards, avoid custom implementations, and follow secure configuration guidelines.
193
+ - **Framework Mappings:**
194
+ - libsodium: Modern cryptography library with safe defaults
195
+ - AWS KMS: Managed cryptographic key storage and operations
196
+ - Bouncy Castle: Comprehensive cryptography library for Java/.NET
197
+ - **Language Patterns:**
198
+ - Python: `cryptography` library with high-level recipes
199
+ - Node.js: Native `crypto` module with secure random and modern algorithms
200
+ - Rust: `ring` or `RustCrypto` for memory-safe cryptographic operations
201
+
202
+ ### Context-Aware Input Validation
203
+ - **Replaces Failure Pattern:** Insufficient Input Sanitization
204
+ - **Abstract Pattern:** Validate input against expected schemas at entry points, sanitize for specific output contexts (HTML, SQL, shell), and enforce size and rate limits.
205
+ - **Framework Mappings:**
206
+ - OWASP Java Encoder: Context-specific output encoding library
207
+ - DOMPurify: HTML sanitization for browser environments
208
+ - bleach: HTML sanitization for Python web applications
209
+ - **Language Patterns:**
210
+ - JavaScript: Template literals with automatic escaping in modern frameworks
211
+ - Go: `html/template` package with automatic HTML escaping
212
+ - PHP: `htmlspecialchars()` with appropriate flags for context
213
+
214
+ ### Defense in Depth Boundaries
215
+ - **Replaces Failure Pattern:** Missing Trust Boundaries
216
+ - **Abstract Pattern:** Validate and authenticate at every trust boundary, use network segmentation, encrypt inter-service communication, and apply least privilege principles.
217
+ - **Framework Mappings:**
218
+ - Mutual TLS: Certificate-based authentication for service-to-service communication
219
+ - Service Mesh (Istio/Linkerd): Automatic encryption and authentication between services
220
+ - Zero Trust Architecture: Explicit verification at every access point
221
+ - **Language Patterns:**
222
+ - gRPC: Built-in TLS and token-based authentication between services
223
+ - REST: API gateways enforcing authentication and rate limiting
224
+ - Message Queues: ACLs and encryption for inter-component messaging
225
+
226
+ ## Red Flags
227
+
228
+ - Database query strings built with concatenation or template literals
229
+ - API keys or passwords visible in source code or configuration files
230
+ - Authentication cookies without HttpOnly, Secure, or SameSite flags
231
+ - Admin interfaces accessible without additional authentication layers
232
+ - Dependency versions pinned to outdated releases with known CVEs
233
+ - Use of `eval()` or similar dynamic code execution with external input
234
+ - File upload functionality without type/size validation
235
+ - Error messages exposing stack traces or internal paths to users
236
+ - HTTP endpoints handling sensitive data without TLS
237
+ - Authorization checks only on client side or in UI logic
238
+ - Cryptographic operations using MD5, SHA1, or DES
239
+ - Session tokens generated with predictable patterns
240
+ - CORS policies allowing all origins (`Access-Control-Allow-Origin: *`)
241
+ - Deserialization of untrusted data without type validation
242
+ - Missing rate limiting on authentication or resource-intensive endpoints
243
+
244
+ ## Tool Affinities
245
+
246
+ | Tool ID | Signal Type | Relevance |
247
+ |---------|-------------|-----------|
248
+ | Semgrep | Injection patterns, hardcoded secrets, crypto misuse | primary |
249
+ | Gitleaks | Secrets in code and commit history | primary |
250
+ | Trivy | Container and filesystem vulnerability scanning | primary |
251
+ | Syft+Grype | SBOM generation and dependency vulnerability matching | supporting |
252
+ | SonarQube | Security hotspots, authentication logic issues | supporting |
253
+ | Checkov | Infrastructure-as-code security misconfigurations | contextual |
254
+
255
+ ## Standards & Frameworks
256
+
257
+ - OWASP Top 10: Industry-standard classification of web application security risks
258
+ - CWE/SANS Top 25: Most dangerous software weaknesses with mitigation guidance
259
+ - NIST SP 800-53: Security controls for federal information systems (widely adopted)
260
+ - OWASP ASVS: Application Security Verification Standard for testing requirements
261
+ - NIST Cybersecurity Framework: Risk management framework applicable to application security
262
+ - MITRE ATT&CK: Adversary tactics and techniques for threat modeling
263
+ - PCI DSS: Payment card industry security standards for systems handling card data
264
+
265
+ ## Metrics
266
+
267
+ | Metric | What It Measures | Healthy Range |
268
+ |--------|-----------------|---------------|
269
+ | Critical CVE Count | Number of critical vulnerabilities in dependencies | 0 |
270
+ | Secrets Detected | Hardcoded secrets found by scanning tools | 0 |
271
+ | Input Validation Coverage | Percentage of external entry points with validation | >95% |
272
+ | Auth Centralization Ratio | Proportion of endpoints using centralized auth vs. custom | >90% centralized |
273
+ | Mean Time to Patch (MTTP) | Average time from CVE disclosure to deployment of patch | <7 days for critical, <30 days for high |
274
+ | Security Test Coverage | Percentage of security requirements validated by automated tests | >80% |
@@ -0,0 +1,228 @@
1
+ ---
2
+ id: domain-05
3
+ number: "05"
4
+ name: Compliance Privacy & Governance
5
+ owner_agents: [compliance-officer]
6
+ ---
7
+
8
+ ## Overview
9
+
10
+ This domain addresses PII handling, data classification, retention policies, encryption standards, audit logging, consent tracking, and regulatory exposure. Compliance failures lead to fines, lawsuits, operational shutdowns, and reputational damage. Senior engineers recognize that compliance is not optional and must be embedded in system design from the start. This domain does NOT cover general security vulnerabilities (domain 04), architectural patterns (domain 01), or operational monitoring concerns (domain 10).
11
+
12
+ ## Audit Questions
13
+
14
+ - Are all PII fields explicitly classified with data sensitivity labels in schema definitions or documentation?
15
+ - Does the codebase implement data retention policies with automated expiration for different data classifications?
16
+ - Is sensitive data encrypted at rest using industry-standard algorithms with proper key management?
17
+ - Are all sensitive data transmissions protected by TLS 1.2+ or equivalent transport encryption?
18
+ - Does the system maintain comprehensive audit logs capturing access, modification, and deletion of sensitive data?
19
+ - Is user consent explicitly tracked and stored with timestamps, scope, and version information?
20
+ - Can users request complete data deletion, and does the system enforce cascading deletion across all storage layers?
21
+ - Are access controls on PII enforced at the data layer with role-based or attribute-based policies?
22
+ - Does the system handle cross-border data transfers in compliance with regional data sovereignty requirements?
23
+ - Are third-party data sharing agreements documented, and is shared data minimized to necessary fields only?
24
+ - Can the system generate audit reports demonstrating compliance with relevant regulations (GDPR, CCPA, HIPAA)?
25
+ - Are data breach notification procedures documented and testable?
26
+
27
+ ## Failure Patterns
28
+
29
+ ### Unclassified PII
30
+ - **Description:** Personally identifiable information stored without explicit classification, sensitivity labels, or handling requirements. Fields containing names, emails, addresses, phone numbers, or financial data lack metadata indicating regulatory scope or protection requirements.
31
+ - **Indicators:**
32
+ - Database schemas or ORMs define user-related fields without sensitivity annotations or comments
33
+ - No centralized PII inventory mapping fields to regulatory frameworks (GDPR Article 4, CCPA 1798.140)
34
+ - Code comments or documentation do not distinguish PII from non-sensitive data
35
+ - API responses return user data without filtering based on data classification policies
36
+ - Search or analytics systems index PII fields without classification-aware controls
37
+ - **Severity Tendency:** high
38
+
39
+ ### Missing Data Retention Policy
40
+ - **Description:** System lacks automated enforcement of data retention periods, leading to indefinite storage of user data beyond legal or business requirements. No scheduled deletion or archival processes exist for expired data.
41
+ - **Indicators:**
42
+ - No TTL (time-to-live) configurations on database records or object storage buckets
43
+ - Absence of cron jobs, scheduled tasks, or event-driven workflows for data expiration
44
+ - Backup systems retain data indefinitely without retention period enforcement
45
+ - No documented retention periods per data classification in technical specifications
46
+ - User account deletion does not trigger cascading deletion of associated historical data
47
+ - **Severity Tendency:** high
48
+
49
+ ### Unencrypted Sensitive Data
50
+ - **Description:** PII or regulated data stored in plaintext without encryption at rest. Disk-level encryption alone is insufficient; application-layer encryption is required for sensitive fields.
51
+ - **Indicators:**
52
+ - Database columns containing passwords, SSNs, credit card numbers, or health records stored as plaintext strings
53
+ - Configuration files, environment variables, or secrets management systems expose sensitive data unencrypted
54
+ - File storage (S3, GCS, Azure Blob) lacks server-side encryption or customer-managed keys
55
+ - Log files or error messages contain plaintext sensitive data
56
+ - Backups and snapshots do not use encrypted storage with separate key management
57
+ - **Severity Tendency:** critical
58
+
59
+ ### Missing Audit Trail
60
+ - **Description:** System does not log access, modification, or deletion events for sensitive data, preventing investigation of data breaches or compliance audits. Audit logs are absent, incomplete, or not tamper-evident.
61
+ - **Indicators:**
62
+ - No logging for read operations on PII fields (user profiles, payment data, health records)
63
+ - Database triggers or ORM hooks do not capture UPDATE or DELETE operations on sensitive tables
64
+ - Application logs omit user identity, timestamp, operation type, or affected record identifiers
65
+ - Audit logs are stored in mutable locations without integrity verification (hashing, blockchain, write-once storage)
66
+ - No centralized audit log aggregation or retention separate from application logs
67
+ - **Severity Tendency:** high
68
+
69
+ ### No Consent Tracking
70
+ - **Description:** System does not record explicit user consent for data collection, processing, or sharing. Consent records lack timestamps, version information, or scope details required by GDPR Article 7 and CCPA 1798.120.
71
+ - **Indicators:**
72
+ - User account creation does not store consent agreements with version identifiers and acceptance timestamps
73
+ - Marketing preferences, analytics opt-ins, or third-party data sharing lack granular consent records
74
+ - No mechanism to withdraw consent or update preferences retroactively
75
+ - Terms of service or privacy policy changes do not trigger re-consent workflows
76
+ - Consent records are stored in session state or cookies rather than persistent, auditable storage
77
+ - **Severity Tendency:** high
78
+
79
+ ### Incomplete Data Deletion
80
+ - **Description:** User data deletion requests do not cascade across all storage layers, leaving orphaned records in caches, backups, analytics systems, or third-party integrations. Right-to-be-forgotten (GDPR Article 17) cannot be fully satisfied.
81
+ - **Indicators:**
82
+ - Soft-delete patterns mark records as inactive but do not purge data from primary storage
83
+ - CDN caches, Redis/Memcached, or search indexes retain deleted user data
84
+ - Backup restoration procedures do not exclude deleted user records
85
+ - Third-party analytics (Google Analytics, Mixpanel), CRMs, or email platforms retain data after account deletion
86
+ - No documented data deletion verification process or automated reconciliation checks
87
+ - **Severity Tendency:** high
88
+
89
+ ### Missing Access Controls on PII
90
+ - **Description:** PII is accessible to unauthorized roles, services, or processes due to insufficient role-based access control (RBAC) or attribute-based access control (ABAC). Data layer permissions are too broad or unenforced.
91
+ - **Indicators:**
92
+ - Database users or service accounts have SELECT privileges on PII tables without business justification
93
+ - API endpoints return PII fields without authentication or authorization checks
94
+ - Internal admin tools expose PII to non-compliance-trained personnel
95
+ - No column-level security or field-level encryption separating PII access from general application access
96
+ - Lack of principle-of-least-privilege enforcement in IAM policies or database grants
97
+ - **Severity Tendency:** high
98
+
99
+ ## Best Practice Patterns
100
+
101
+ ### Explicit PII Classification
102
+ - **Replaces Failure Pattern:** Unclassified PII
103
+ - **Abstract Pattern:** Annotate all data fields with sensitivity classifications at the schema level, enabling automated policy enforcement and audit trail generation. Maintain a centralized PII inventory mapping fields to regulatory frameworks.
104
+ - **Framework Mappings:**
105
+ - **Django ORM:** Use custom field metadata (e.g., `field.help_text = "PII: GDPR Art. 4"`) or third-party packages like `django-fernet-fields` with classification decorators.
106
+ - **Spring Boot (JPA):** Apply custom annotations (`@PII(classification = "sensitive")`) on entity fields, enforced by aspect-oriented programming (AOP) interceptors.
107
+ - **TypeORM:** Use column comment metadata (`@Column({ comment: "PII: email, CCPA covered" })`) combined with schema validation tools.
108
+ - **Language Patterns:**
109
+ - **Python:** Use dataclass metadata (`field(metadata={"pii": "email", "regulation": "GDPR"})`) with runtime validation.
110
+ - **Java:** Leverage JSR-303 annotations (`@Sensitive(category = "PII", regulation = "HIPAA")`) with bean validation integration.
111
+ - **TypeScript:** Apply decorator metadata (`@PII({ type: "email", retention: "7y" })`) with reflection-based policy engines.
112
+
113
+ ### Automated Retention Enforcement
114
+ - **Replaces Failure Pattern:** Missing Data Retention Policy
115
+ - **Abstract Pattern:** Implement time-based data expiration at the storage layer using TTL configurations, scheduled purge jobs, or event-driven deletion workflows. Document retention periods per data classification and automate enforcement.
116
+ - **Framework Mappings:**
117
+ - **PostgreSQL:** Use `pg_cron` extension to schedule DELETE operations with WHERE clauses on timestamp columns (`created_at < NOW() - INTERVAL '7 years'`).
118
+ - **MongoDB:** Apply TTL indexes on timestamp fields (`db.collection.createIndex({ "createdAt": 1 }, { expireAfterSeconds: 220752000 })`).
119
+ - **AWS S3:** Configure lifecycle policies with expiration rules for object age or versioning-based retention.
120
+ - **Language Patterns:**
121
+ - **Python:** Use Celery beat schedules or APScheduler to trigger periodic deletion tasks via ORM queries.
122
+ - **Java:** Implement `@Scheduled` methods in Spring Boot to execute retention policy enforcement via batch processing.
123
+ - **Node.js:** Use cron libraries (`node-cron`) to invoke Sequelize or TypeORM bulk delete operations on expired records.
124
+
125
+ ### Application-Layer Encryption
126
+ - **Replaces Failure Pattern:** Unencrypted Sensitive Data
127
+ - **Abstract Pattern:** Encrypt sensitive fields at the application layer using AES-256 or equivalent algorithms with customer-managed keys stored in dedicated secrets management systems. Ensure encryption at rest is separate from disk-level encryption.
128
+ - **Framework Mappings:**
129
+ - **Django:** Use `django-fernet-fields` or `django-cryptography` to transparently encrypt model fields with key rotation support.
130
+ - **Rails:** Apply `attr_encrypted` gem with AES-256-GCM and key storage in AWS KMS or HashiCorp Vault.
131
+ - **Laravel:** Use `laravel-encrypted-model` trait with `APP_KEY`-based encryption or external key management integration.
132
+ - **Language Patterns:**
133
+ - **Python:** Use `cryptography.fernet` for symmetric encryption with PBKDF2-derived keys stored in AWS Secrets Manager.
134
+ - **Java:** Leverage `javax.crypto.Cipher` with AES/GCM/NoPadding mode and key retrieval via Spring Cloud Config.
135
+ - **Go:** Apply `crypto/aes` with GCM mode and key management via HashiCorp Vault or Google Secret Manager.
136
+
137
+ ### Comprehensive Audit Logging
138
+ - **Replaces Failure Pattern:** Missing Audit Trail
139
+ - **Abstract Pattern:** Log all access, modification, and deletion events for sensitive data to immutable, centralized storage. Include user identity, timestamp, operation type, affected record identifiers, and integrity verification.
140
+ - **Framework Mappings:**
141
+ - **Django:** Use `django-auditlog` or `django-simple-history` with post-save/post-delete signals to capture changes with user context.
142
+ - **Spring Boot:** Apply `@EnableJpaAuditing` with `AuditorAware` beans and custom event listeners for sensitive entity operations.
143
+ - **Sequelize:** Use model hooks (`afterFind`, `afterUpdate`, `afterDestroy`) combined with Winston or Bunyan loggers.
144
+ - **Language Patterns:**
145
+ - **Python:** Integrate SQLAlchemy event listeners (`@event.listens_for`) with structured logging (structlog) to centralized sinks (ELK, Splunk).
146
+ - **Java:** Use Hibernate interceptors or JPA entity listeners to capture CRUD operations, published to Kafka or CloudWatch Logs.
147
+ - **JavaScript:** Apply Mongoose middleware (`pre`/`post` hooks) with immutable log storage in AWS CloudWatch or Azure Monitor.
148
+
149
+ ### Granular Consent Management
150
+ - **Replaces Failure Pattern:** No Consent Tracking
151
+ - **Abstract Pattern:** Store explicit user consent records with timestamps, version identifiers, scope details, and withdrawal mechanisms. Support consent history and granular opt-in/opt-out per data processing purpose.
152
+ - **Framework Mappings:**
153
+ - **Custom Consent Service:** Build dedicated consent microservice with versioned consent documents, user consent snapshots, and audit trail integration.
154
+ - **Django:** Use custom models (`ConsentRecord`) with foreign keys to users, consent document versions, and timestamp fields, queryable for compliance reports.
155
+ - **Firestore/DynamoDB:** Store consent records as nested documents with composite keys (user_id + consent_type + version) for efficient querying.
156
+ - **Language Patterns:**
157
+ - **Python:** Define Pydantic models for consent records with validation rules (required fields: user_id, consent_type, version, timestamp, scope).
158
+ - **Java:** Use JPA entities with composite primary keys and temporal tables for consent history tracking.
159
+ - **TypeScript:** Apply Zod schemas for consent payloads with strict validation and versioned API endpoints.
160
+
161
+ ### Cascading Data Deletion
162
+ - **Replaces Failure Pattern:** Incomplete Data Deletion
163
+ - **Abstract Pattern:** Implement comprehensive deletion workflows that purge user data across all storage layers: primary databases, caches, backups, analytics systems, and third-party integrations. Verify deletion with automated reconciliation checks.
164
+ - **Framework Mappings:**
165
+ - **Event-Driven Architecture:** Publish user deletion events to message queues (Kafka, RabbitMQ) with subscribers for each storage layer (database, Redis, S3, third-party APIs).
166
+ - **Django Signals:** Use `post_delete` signals with chained deletion tasks via Celery to purge caches, invalidate sessions, and call third-party deletion APIs.
167
+ - **Saga Pattern:** Implement distributed deletion workflows with compensating transactions for rollback on partial failures.
168
+ - **Language Patterns:**
169
+ - **Python:** Use Celery chains or groups to orchestrate deletion tasks across multiple storage backends with idempotent retry logic.
170
+ - **Java:** Implement Spring Batch jobs for bulk deletion with step listeners for cache invalidation and third-party API calls.
171
+ - **Node.js:** Use Bull queues with job dependencies to sequence deletion operations (database → cache → analytics → backup).
172
+
173
+ ### Field-Level Access Control
174
+ - **Replaces Failure Pattern:** Missing Access Controls on PII
175
+ - **Abstract Pattern:** Enforce role-based or attribute-based access control at the data layer, restricting PII access to authorized roles and services only. Apply column-level security or field-level encryption with separate key access policies.
176
+ - **Framework Mappings:**
177
+ - **PostgreSQL Row-Level Security:** Define RLS policies restricting SELECT/UPDATE/DELETE on PII columns based on session user roles (`USING (has_pii_access(current_user))`).
178
+ - **Django Guardian:** Apply object-level permissions with custom permission checks on model fields, enforced in serializers or views.
179
+ - **GraphQL:** Use field-level resolvers with authorization middleware (e.g., `@auth(requires: "PII_READ")`) to conditionally expose PII fields.
180
+ - **Language Patterns:**
181
+ - **Python:** Implement Django REST Framework serializer mixins that filter PII fields based on `request.user.has_perm('view_pii')` checks.
182
+ - **Java:** Use Spring Security method-level annotations (`@PreAuthorize("hasRole('COMPLIANCE_OFFICER')")`) on service methods returning PII.
183
+ - **JavaScript:** Apply Express.js middleware or NestJS guards to intercept requests and redact PII fields based on JWT claims or session roles.
184
+
185
+ ## Red Flags
186
+
187
+ - Database schemas contain fields like `ssn`, `credit_card`, `passport_number` without encryption or classification comments
188
+ - User deletion endpoints return HTTP 200 but only soft-delete records, leaving data in backups and caches
189
+ - No documented data retention policies or scheduled deletion jobs in codebase
190
+ - Audit logs stored in same database as application data, vulnerable to tampering
191
+ - Consent tracking implemented with boolean flags (`marketing_opt_in`) without timestamps or version history
192
+ - Third-party analytics scripts loaded without consent verification checks
193
+ - Admin panels expose full PII datasets to non-compliance-trained personnel
194
+ - API responses return full user objects with PII to frontend clients without field filtering
195
+ - Encryption keys stored in application code or environment variables without rotation mechanisms
196
+ - GDPR/CCPA compliance documentation missing from repository or outdated
197
+
198
+ ## Tool Affinities
199
+
200
+ | Tool ID | Signal Type | Relevance |
201
+ |---------|-------------|-----------|
202
+ | Semgrep | PII exposure patterns, unencrypted storage, missing audit logs | primary |
203
+ | Gitleaks | Hardcoded secrets, encryption keys, API tokens in code | supporting |
204
+ | Checkov | IaC misconfigurations (unencrypted S3, public RDS, missing KMS) | supporting |
205
+ | Trivy | Dependency vulnerabilities in encryption libraries, secrets in containers | contextual |
206
+ | SonarQube | Code smells in data handling logic, complexity in consent workflows | contextual |
207
+ | git-history | Historical exposure of PII in commits, deleted but recoverable secrets | contextual |
208
+
209
+ ## Standards & Frameworks
210
+
211
+ - **GDPR (General Data Protection Regulation):** Articles 4 (definitions), 7 (consent), 17 (right to erasure), 32 (security of processing)
212
+ - **CCPA (California Consumer Privacy Act):** Sections 1798.100 (consumer rights), 1798.120 (opt-out), 1798.140 (definitions)
213
+ - **HIPAA (Health Insurance Portability and Accountability Act):** Security Rule (encryption, access controls, audit logging)
214
+ - **SOC 2 Type II:** Trust Services Criteria for confidentiality, privacy, and availability
215
+ - **PCI-DSS (Payment Card Industry Data Security Standard):** Requirements 3 (protect stored data), 4 (encrypt transmission), 10 (track and monitor access)
216
+ - **ISO/IEC 27701:** Privacy Information Management System (PIMS) extension to ISO 27001
217
+ - **NIST Privacy Framework:** Core functions (identify, govern, control, communicate, protect)
218
+
219
+ ## Metrics
220
+
221
+ | Metric | What It Measures | Healthy Range |
222
+ |--------|-----------------|---------------|
223
+ | PII Field Classification Coverage | Percentage of database columns containing PII that are explicitly classified with sensitivity labels | ≥95% |
224
+ | Encryption-at-Rest Coverage | Percentage of PII fields using application-layer encryption (not just disk encryption) | 100% |
225
+ | Audit Log Completeness | Percentage of PII access/modification operations captured in tamper-evident audit logs | ≥99% |
226
+ | Retention Policy Compliance | Percentage of data classifications with automated retention enforcement (TTL, scheduled purge) | 100% |
227
+ | Consent Record Integrity | Percentage of user accounts with complete consent records (timestamp, version, scope) | ≥98% |
228
+ | Data Deletion Verification Rate | Percentage of deletion requests successfully verified across all storage layers within SLA | ≥95% |