@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,160 @@
1
+ <purpose>
2
+ Structured Vector domain maintenance. Review staged proposals, flag stale rules, audit domain health, and keep Vector lean and accurate.
3
+ </purpose>
4
+
5
+ <user-story>
6
+ As an AI builder, I want a guided Vector maintenance session, so that my domain rules stay relevant, staged proposals get decided on, and Vector doesn't become a dumping ground of stale rules.
7
+ </user-story>
8
+
9
+ <when-to-use>
10
+ - Monthly (on configured cadence)
11
+ - When pulse reports overdue Vector hygiene
12
+ - When user says "vector hygiene", "review vector rules", "clean up vector"
13
+ - Entry point routes here via /momentum:vector-hygiene
14
+ </when-to-use>
15
+
16
+ <steps>
17
+
18
+ <step name="assess" priority="first">
19
+ Gather Vector health data and present summary.
20
+
21
+ 1. Read `.accel/momentum/workspace.json` for `vector_hygiene` config (threshold, max rules, last run)
22
+ 2. Read `.accel/momentum/staging.json` for pending proposals (via `vector_get_staged`)
23
+ 3. For each domain file in `.vector/`:
24
+ - Count rules
25
+ - Parse metadata comments (`# Last reviewed:` lines)
26
+ - Flag rules where last_reviewed is older than `staleness_threshold_days`
27
+ - Flag domains exceeding `max_rules_per_domain`
28
+ 4. Present summary:
29
+ ```
30
+ Vector Hygiene Assessment
31
+ ━━━━━━━━━━━━━━━━━━━━━━
32
+ Staged proposals: {N} pending
33
+ Domains: {N} total, {N} with stale rules, {N} over max
34
+ Total rules: {N} across all domains
35
+ Last hygiene: {date or "never"}
36
+ ```
37
+
38
+ **Wait for operator confirmation before proceeding.**
39
+ </step>
40
+
41
+ <step name="review_proposals">
42
+ Process each pending staged proposal.
43
+
44
+ For each pending proposal from `vector_get_staged`:
45
+ 1. Present:
46
+ ```
47
+ Proposal {id} — {domain}
48
+ Proposed: {date} | Source: {source}
49
+ Rule: "{rule_text}"
50
+ Rationale: {rationale}
51
+ ```
52
+ 2. Ask: "**Approve**, **Kill**, **Archive**, or **Defer**?"
53
+ 3. Execute:
54
+ - Approve → `vector_approve_proposal(id)` (writes rule to domain file with metadata)
55
+ - Kill → `vector_kill_proposal(id)`
56
+ - Archive → `vector_archive_proposal(id)`
57
+ - Defer → skip (stays pending for next hygiene)
58
+
59
+ **After approval:** Add metadata comments above the new rule in the domain file:
60
+ ```
61
+ # Rule added: {today}
62
+ # Last reviewed: {today}
63
+ # Source: {proposal.source}
64
+ {DOMAIN}_RULE_{N}={rule_text}
65
+ ```
66
+
67
+ Process one proposal at a time. Wait for response between each.
68
+ </step>
69
+
70
+ <step name="review_stale_rules">
71
+ Review rules flagged as stale (last_reviewed > threshold).
72
+
73
+ For each domain with stale rules:
74
+ 1. Present domain name and total rule count
75
+ 2. For each stale rule:
76
+ ```
77
+ [{DOMAIN}] Rule {N} — last reviewed {date} ({days} days ago)
78
+ "{rule_text}"
79
+ ```
80
+ 3. Ask: "**Keep** (update reviewed date), **Archive**, or **Kill**?"
81
+ 4. Execute:
82
+ - Keep → Update `# Last reviewed:` comment to today
83
+ - Archive → Remove rule from domain file, add to `.vector/archive/archived-rules.json` with context
84
+ - Kill → Remove rule from domain file (with "Are you sure?" confirmation)
85
+
86
+ **When archiving:** Read `.vector/archive/archived-rules.json`, append:
87
+ ```json
88
+ {
89
+ "domain": "DOMAIN",
90
+ "rule_number": N,
91
+ "rule_text": "the rule",
92
+ "added": "original-added-date",
93
+ "archived": "today",
94
+ "reason": "operator's reason"
95
+ }
96
+ ```
97
+
98
+ Then renumber remaining rules in the domain file to close gaps.
99
+
100
+ Process one domain at a time.
101
+ </step>
102
+
103
+ <step name="review_domains">
104
+ Quick domain health check — guided Q&A.
105
+
106
+ 1. List all active domains with rule counts
107
+ 2. Cross-reference with `.accel/momentum/ACTIVE.md` current projects:
108
+ - Any active projects missing a domain?
109
+ - Any domains for inactive/completed projects?
110
+ 3. Check recall phrases:
111
+ - "Do the recall phrases for {domain} still match how you talk about this work?"
112
+ 4. Check for domains over `max_rules_per_domain`:
113
+ - "Domain {X} has {N} rules (max: {max}). Any candidates to archive or consolidate?"
114
+ 5. Ask: "Any new domains to create? Any to deactivate?"
115
+
116
+ **Guided Q&A — don't force changes, just surface questions.**
117
+ </step>
118
+
119
+ <step name="review_decisions">
120
+ Quick check on per-domain decision health.
121
+
122
+ 1. List `.vector/decisions/*.json` files with counts
123
+ 2. Flag domains with 0 decisions (might be missing logging)
124
+ 3. Flag decisions older than 90 days (might be outdated)
125
+ 4. Ask: "Any decisions to review or archive?"
126
+
127
+ **Brief pass — decisions are mostly self-maintaining.**
128
+ </step>
129
+
130
+ <step name="log">
131
+ Record the hygiene session.
132
+
133
+ 1. Update `.accel/momentum/workspace.json` → `vector_hygiene.last_run` to today's date
134
+ 2. Update `.accel/momentum/STATE.md` → note Vector hygiene completed
135
+ 3. Report:
136
+ ```
137
+ Vector Hygiene Complete
138
+ ━━━━━━━━━━━━━━━━━━━━━
139
+ Proposals: {N} processed ({N} approved, {N} killed, {N} archived, {N} deferred)
140
+ Rules reviewed: {N} ({N} kept, {N} archived, {N} killed)
141
+ Domains: {N} active
142
+ Next hygiene due: {date based on cadence}
143
+ ```
144
+ </step>
145
+
146
+ </steps>
147
+
148
+ <output>
149
+ Vector domains reviewed and maintained. Staged proposals decided. Stale rules addressed. Domain health verified. Hygiene session logged to workspace.json.
150
+ </output>
151
+
152
+ <acceptance-criteria>
153
+ - [ ] All pending proposals presented and decided (approve/kill/archive/defer)
154
+ - [ ] Stale rules flagged and reviewed with operator
155
+ - [ ] Domain health check completed (rule counts, recall phrases)
156
+ - [ ] Archived rules moved to .vector/archive/archived-rules.json
157
+ - [ ] workspace.json vector_hygiene.last_run updated
158
+ - [ ] STATE.md updated with hygiene completion
159
+ - [ ] Operator confirmed completion of each step
160
+ </acceptance-criteria>
@@ -0,0 +1,96 @@
1
+ # Workspace Manifest Template
2
+
3
+ Output file: `.accel/momentum/workspace.json`
4
+
5
+ ```template
6
+ {
7
+ "workspace": "{workspace-name}",
8
+ "created": "{YYYY-MM-DD}",
9
+ "groom_cadence": "{weekly|bi-weekly|monthly}",
10
+ "groom_day": "{day-of-week}",
11
+ "areas": {
12
+ "{area-name}": {
13
+ "type": "{working-memory|directory|config-cross-ref|system-layer|custom}",
14
+ "description": "[Human-readable purpose of this area]",
15
+ "paths": ["{file-or-directory-paths}"],
16
+ "groom": "{weekly|bi-weekly|monthly}",
17
+ "audit": {
18
+ "strategy": "{staleness|classify|cross-reference|dead-code|pipeline-status}",
19
+ "config": {}
20
+ }
21
+ }
22
+ },
23
+ "vector_hygiene": {
24
+ "proactive": true,
25
+ "cadence": "monthly",
26
+ "staleness_threshold_days": 60,
27
+ "max_rules_per_domain": 15,
28
+ "last_run": null
29
+ },
30
+ "surfaces": {
31
+ "{surface-name}": {
32
+ "file": "data/{name}.json",
33
+ "description": "[What this surface tracks]",
34
+ "hook": true,
35
+ "silent": true,
36
+ "schema": {
37
+ "id_prefix": "{PREFIX}",
38
+ "required_fields": ["{field1}", "{field2}"],
39
+ "priority_levels": ["{level1}", "{level2}"],
40
+ "status_values": ["{status1}", "{status2}"]
41
+ }
42
+ }
43
+ },
44
+ "satellites": {
45
+ "{project-name}": {
46
+ "path": "{relative-path-to-project}",
47
+ "engine": "{drive|custom|none}",
48
+ "state": "{path-to-state-file}",
49
+ "registered": "{YYYY-MM-DD}",
50
+ "groom_check": true,
51
+ "last_activity": null,
52
+ "phase_name": null,
53
+ "phase_number": null,
54
+ "phase_status": null,
55
+ "loop_position": "IDLE",
56
+ "handoff": false,
57
+ "last_plan_completed_at": null
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ ## Field Documentation
64
+
65
+ | Field | Type | Description |
66
+ |-------|------|------------|
67
+ | workspace | string | Name of this workspace (typically the directory name) |
68
+ | created | date | When Momentum was initialized in this workspace |
69
+ | groom_cadence | enum | Default grooming frequency for the workspace |
70
+ | groom_day | string | Preferred day for weekly grooming |
71
+ | areas | object | Map of tracked workspace areas |
72
+ | areas.*.type | enum | Classification of the area for audit strategy selection |
73
+ | areas.*.paths | array | Files or directories this area tracks |
74
+ | areas.*.groom | enum | Grooming frequency for this specific area (overrides default) |
75
+ | areas.*.audit.strategy | enum | Which audit strategy to apply (see audit-strategies.md) |
76
+ | areas.*.audit.config | object | Strategy-specific configuration |
77
+ | vector_hygiene | object | Vector rule lifecycle management config (optional — only if Vector is installed) |
78
+ | vector_hygiene.proactive | boolean | Auto-surface stale rules during groom |
79
+ | vector_hygiene.cadence | enum | How often to run Vector hygiene |
80
+ | vector_hygiene.staleness_threshold_days | number | Days before a rule is flagged as stale |
81
+ | vector_hygiene.max_rules_per_domain | number | Soft cap per domain (warn, not enforce) |
82
+ | surfaces | object | Registered data surfaces with schemas |
83
+ | surfaces.*.file | string | Path to JSON file relative to .accel/momentum/ |
84
+ | surfaces.*.hook | boolean | Whether a hook auto-injects this surface |
85
+ | surfaces.*.silent | boolean | Whether hook output is passive (no proactive mentions) |
86
+ | surfaces.*.schema | object | Validation schema for surface items |
87
+ | surfaces.*.schema.id_prefix | string | Auto-generated ID prefix (e.g., "ACT", "BL") |
88
+ | surfaces.*.schema.required_fields | array | Fields required on every item |
89
+ | satellites | object | External projects tracked by Momentum but managed by their own engines |
90
+ | satellites.*.engine | enum | What orchestration tool manages this project |
91
+ | satellites.*.state | string | Path to the project's state file for health checks |
92
+ | satellites.*.groom_check | boolean | Whether Momentum checks this project's health during groom (default: true) |
93
+ | satellites.*.last_activity | string | ISO timestamp of last project activity (synced from drive.json) |
94
+ | satellites.*.phase_name | string | Current phase name (synced from drive.json) |
95
+ | satellites.*.loop_position | string | Drive loop state: IDLE, PLAN, APPLY, UNIFY |
96
+ | satellites.*.handoff | boolean | Whether a handoff file exists for this project |
@@ -0,0 +1,129 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Momentum Hook Template — Canonical reference for data surface injection hooks.
4
+
5
+ THIS IS A TEMPLATE, NOT A RUNNABLE HOOK.
6
+ Copy this file, rename it to {surface}-hook.py, and customize the marked sections.
7
+
8
+ === CONTRACT ===
9
+ Every data surface hook MUST follow this contract:
10
+ 1. Reads ONE JSON file from .accel/momentum/data/{SURFACE_NAME}.json
11
+ 2. Outputs a compact XML-tagged block to stdout
12
+ 3. Wraps output in <{SURFACE_NAME}-awareness> tags
13
+ 4. Includes a BEHAVIOR directive block
14
+ 5. Exits cleanly (exit 0) — never crashes, never blocks
15
+
16
+ === DO ===
17
+ - Read the JSON file using absolute paths (Path(__file__).resolve())
18
+ - Format a compact summary: IDs, one-line descriptions, grouped by priority/status
19
+ - Include item count summaries
20
+ - Include the behavioral directive (passive by default)
21
+ - Handle missing/empty/malformed files gracefully (output nothing, exit 0)
22
+ - Keep output compact — hooks fire every prompt, token cost matters
23
+
24
+ === DO NOT ===
25
+ - Never write to any file
26
+ - Never make network calls
27
+ - Never import heavy dependencies (sys, json, pathlib ONLY)
28
+ - Never read multiple data files (one hook = one surface)
29
+ - Never include full item details in injection (that's what MCP tools are for)
30
+ - Never include dynamic logic that changes based on time of day, session count, etc.
31
+
32
+ === TRIGGERS ===
33
+ Register in .claude/settings.json under UserPromptSubmit:
34
+ {
35
+ "type": "command",
36
+ "command": "python3 /absolute/path/to/.accel/momentum/hooks/{surface}-hook.py"
37
+ }
38
+ """
39
+
40
+ import sys
41
+ import json
42
+ from pathlib import Path
43
+
44
+ # ============================================================
45
+ # CONFIGURATION — CUSTOMIZE THIS
46
+ # ============================================================
47
+
48
+ SURFACE_NAME = "example" # CHANGE THIS: your surface name (e.g., "active", "backlog")
49
+
50
+ # ============================================================
51
+ # PATH RESOLUTION — DO NOT CHANGE
52
+ # ============================================================
53
+
54
+ HOOK_DIR = Path(__file__).resolve().parent
55
+ WORKSPACE_ROOT = HOOK_DIR.parent # .accel/momentum/hooks/ → .accel/momentum/ → workspace root is parent of .accel/momentum/
56
+ # Fix: .accel/momentum/hooks/_template.py → .accel/momentum/ is parent, workspace root is parent of .accel/momentum/
57
+ WORKSPACE_ROOT = HOOK_DIR.parent.parent
58
+ DATA_FILE = WORKSPACE_ROOT / ".accel/momentum" / "data" / f"{SURFACE_NAME}.json"
59
+
60
+ # ============================================================
61
+ # BEHAVIORAL DIRECTIVE — CUSTOMIZE IF NEEDED
62
+ # ============================================================
63
+
64
+ BEHAVIOR_DIRECTIVE = f"""BEHAVIOR: This context is PASSIVE AWARENESS ONLY.
65
+ Do NOT proactively mention these items unless:
66
+ - User explicitly asks (e.g., "what should I work on?", "what's next?")
67
+ - A deadline is within 24 hours AND user hasn't acknowledged it this session
68
+ For details on any item, use momentum_get_item("{SURFACE_NAME}", id)."""
69
+
70
+
71
+ def main():
72
+ # --- Read hook input from stdin (Claude Code provides session context) ---
73
+ try:
74
+ input_data = json.loads(sys.stdin.read())
75
+ session_id = input_data.get("session_id", "")
76
+ except (json.JSONDecodeError, OSError):
77
+ session_id = ""
78
+
79
+ # --- Guard: file must exist ---
80
+ if not DATA_FILE.exists():
81
+ sys.exit(0)
82
+
83
+ # --- Read and parse JSON ---
84
+ try:
85
+ data = json.loads(DATA_FILE.read_text())
86
+ except (json.JSONDecodeError, OSError):
87
+ sys.exit(0)
88
+
89
+ # ============================================================
90
+ # ITEM EXTRACTION — CUSTOMIZE THIS
91
+ # ============================================================
92
+ # Default expects: { "items": [ { "id": "...", "title": "...", ... }, ... ] }
93
+ # Adjust the key and field names to match your surface's schema.
94
+
95
+ items = data.get("items", [])
96
+
97
+ if not items:
98
+ sys.exit(0)
99
+
100
+ # ============================================================
101
+ # SUMMARY FORMATTING — CUSTOMIZE THIS
102
+ # ============================================================
103
+ # Build compact summary lines. Keep it SHORT — one line per item max.
104
+ # Group by status/priority if your schema supports it.
105
+ # Example format: "- [ID] Title (status)"
106
+
107
+ lines = []
108
+ for item in items:
109
+ item_id = item.get("id", "?")
110
+ title = item.get("title", "untitled")
111
+ status = item.get("status", "")
112
+ status_suffix = f" ({status})" if status else ""
113
+ lines.append(f"- [{item_id}] {title}{status_suffix}")
114
+
115
+ # --- Output ---
116
+ if lines:
117
+ count = len(items)
118
+ summary = "\n".join(lines)
119
+ print(f"""<{SURFACE_NAME}-awareness items="{count}">
120
+ {summary}
121
+
122
+ {BEHAVIOR_DIRECTIVE}
123
+ </{SURFACE_NAME}-awareness>""")
124
+
125
+ sys.exit(0)
126
+
127
+
128
+ if __name__ == "__main__":
129
+ main()
@@ -0,0 +1,178 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Momentum Hook v2: active-hook-v2.py
4
+ Source: .accel/momentum/data/projects.json (Mission Control unified project management)
5
+ Output: <active-awareness> compact summary grouped by priority
6
+ Filters: items with status NOT in [backlog, archived]
7
+
8
+ Drop-in replacement for active-hook.py. Swap in settings.json when ready.
9
+ Legacy active-hook.py reads from .accel/momentum/data/active.json (unchanged).
10
+ """
11
+
12
+ import sys
13
+ import json
14
+ from pathlib import Path
15
+ from datetime import date, datetime
16
+
17
+ SURFACE_NAME = "active"
18
+
19
+ HOOK_DIR = Path(__file__).resolve().parent
20
+ WORKSPACE_ROOT = HOOK_DIR.parent.parent
21
+ DATA_FILE = WORKSPACE_ROOT / ".accel/momentum" / "data" / "projects.json"
22
+
23
+ BEHAVIOR_DIRECTIVE = f"""BEHAVIOR: This context is PASSIVE AWARENESS ONLY.
24
+ Do NOT proactively mention these items unless:
25
+ - User explicitly asks (e.g., "what should I work on?", "what's next?")
26
+ - A deadline is within 24 hours AND user hasn't acknowledged it this session
27
+ For details on any item, use momentum_get_project(id)."""
28
+
29
+ PRIORITY_ORDER = ["urgent", "high", "medium", "low", "ongoing", "deferred"]
30
+
31
+ # Staleness thresholds (days since last update)
32
+ STALE_THRESHOLDS = {
33
+ "urgent": 3,
34
+ "high": 5,
35
+ "medium": 7,
36
+ "low": 14,
37
+ "ongoing": 14,
38
+ "deferred": 30,
39
+ }
40
+
41
+ # Statuses that are NOT active (excluded from active view)
42
+ EXCLUDED_STATUSES = {"backlog", "archived", "completed"}
43
+
44
+ # Types to exclude from active awareness (checked via MCP during grooms)
45
+ EXCLUDED_TYPES = {"initiative"}
46
+
47
+
48
+ def days_since_update(item):
49
+ """Calculate days since last update. Uses updated_at (ISO datetime)."""
50
+ ts = item.get("updated_at") or item.get("created_at")
51
+ if not ts:
52
+ return None
53
+ try:
54
+ d = date.fromisoformat(ts[:10])
55
+ return (date.today() - d).days
56
+ except (ValueError, TypeError):
57
+ return None
58
+
59
+
60
+ def main():
61
+ try:
62
+ input_data = json.loads(sys.stdin.read())
63
+ except (json.JSONDecodeError, OSError):
64
+ pass
65
+
66
+ if not DATA_FILE.exists():
67
+ sys.exit(0)
68
+
69
+ try:
70
+ data = json.loads(DATA_FILE.read_text())
71
+ except (json.JSONDecodeError, OSError):
72
+ sys.exit(0)
73
+
74
+ items = data.get("items", [])
75
+ if not items:
76
+ sys.exit(0)
77
+
78
+ # Filter: only active items (not backlog, archived, completed), exclude initiatives
79
+ active_items = [i for i in items if i.get("status") not in EXCLUDED_STATUSES and i.get("type") not in EXCLUDED_TYPES]
80
+ if not active_items:
81
+ sys.exit(0)
82
+
83
+ # Group by priority
84
+ groups = {}
85
+ for item in active_items:
86
+ p = item.get("priority", "medium")
87
+ groups.setdefault(p, []).append(item)
88
+
89
+ # Workload balance header
90
+ blocked_count = sum(1 for i in active_items if i.get("blocked_by"))
91
+ ongoing_count = sum(1 for i in active_items if i.get("priority") == "ongoing")
92
+ deferred_count = sum(1 for i in active_items if i.get("status") == "deferred")
93
+ working_count = len(active_items) - ongoing_count - deferred_count
94
+ lines = [f"Load: {working_count} active | {blocked_count} blocked | {ongoing_count} ongoing | {deferred_count} deferred"]
95
+
96
+ for priority in PRIORITY_ORDER:
97
+ group = groups.get(priority, [])
98
+ if not group:
99
+ continue
100
+ lines.append(f"[{priority.upper()}]")
101
+ for item in group:
102
+ item_id = item.get("id", "?")
103
+ title = item.get("title", "untitled")
104
+ status = item.get("status", "")
105
+ category = item.get("category", "")
106
+ cat_tag = f"({category}) " if category else ""
107
+ parts = [f"- [{item_id}] {cat_tag}{title}"]
108
+ if status:
109
+ parts[0] += f" ({status})"
110
+ # Drive signal (phase, loop, plan age, handoff) — only if drive data has real values
111
+ drive_info = item.get("drive")
112
+ if drive_info and drive_info.get("is_drive_project") and drive_info.get("phase"):
113
+ drive_parts = []
114
+ p_phase = drive_info.get("phase", "?")
115
+ p_completed = drive_info.get("completed_phases", "?")
116
+ p_total = drive_info.get("total_phases", "?")
117
+ p_loop = drive_info.get("loop_position", "?")
118
+ drive_parts.append(f"Phase {p_completed}/{p_total} ({p_phase})")
119
+ drive_parts.append(str(p_loop))
120
+ # Plan age
121
+ last_plan = drive_info.get("last_plan_completed_at") or drive_info.get("last_update")
122
+ if last_plan:
123
+ try:
124
+ lp = last_plan.replace("Z", "+00:00")
125
+ if "T" in lp:
126
+ lp_date = datetime.fromisoformat(lp).date() if hasattr(datetime, 'fromisoformat') else date.fromisoformat(lp[:10])
127
+ else:
128
+ lp_date = date.fromisoformat(lp)
129
+ age = (date.today() - lp_date).days
130
+ drive_parts.append(f"plan {age}d ago")
131
+ except (ValueError, TypeError):
132
+ pass
133
+ # Handoff flag
134
+ p_handoff = drive_info.get("handoff")
135
+ if isinstance(p_handoff, dict) and p_handoff.get("present"):
136
+ drive_parts.append("HANDOFF")
137
+ elif isinstance(p_handoff, bool) and p_handoff:
138
+ drive_parts.append("HANDOFF")
139
+ parts.append(f" Drive: {' | '.join(drive_parts)}")
140
+
141
+ # Revenue signal
142
+ rev = item.get("revenue")
143
+ if rev and rev.get("amount"):
144
+ rev_type = rev.get("type", "")
145
+ parts.append(f" REV: {rev['amount']} ({rev_type})")
146
+
147
+ blocked = item.get("blocked_by")
148
+ if blocked:
149
+ parts.append(f" BLOCKED: {blocked}")
150
+ next_action = item.get("next")
151
+ if next_action and priority != "ongoing":
152
+ parts.append(f" NEXT: {next_action}")
153
+ deadline = item.get("due_date")
154
+ if deadline:
155
+ parts.append(f" DUE: {deadline}")
156
+ days = days_since_update(item)
157
+ threshold = STALE_THRESHOLDS.get(priority, 7)
158
+ if days is not None:
159
+ if days >= threshold:
160
+ parts.append(f" STALE: {days}d since update (threshold: {threshold}d)")
161
+ else:
162
+ parts.append(f" updated: {days}d ago")
163
+ lines.append("\n".join(parts))
164
+
165
+ if lines:
166
+ count = len(active_items)
167
+ summary = "\n".join(lines)
168
+ print(f"""<{SURFACE_NAME}-awareness items="{count}">
169
+ {summary}
170
+
171
+ {BEHAVIOR_DIRECTIVE}
172
+ </{SURFACE_NAME}-awareness>""")
173
+
174
+ sys.exit(0)
175
+
176
+
177
+ if __name__ == "__main__":
178
+ main()
@@ -0,0 +1,115 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Momentum Hook v2: backlog-hook-v2.py
4
+ Source: .accel/momentum/data/projects.json (Mission Control unified project management)
5
+ Output: <backlog-awareness> compact summary grouped by priority
6
+ Filters: only items with status "backlog"
7
+
8
+ Drop-in replacement for backlog-hook.py. Swap in settings.json when ready.
9
+ Legacy backlog-hook.py reads from .accel/momentum/data/backlog.json (unchanged).
10
+ """
11
+
12
+ import sys
13
+ import json
14
+ from pathlib import Path
15
+ from datetime import date
16
+
17
+ SURFACE_NAME = "backlog"
18
+
19
+ HOOK_DIR = Path(__file__).resolve().parent
20
+ WORKSPACE_ROOT = HOOK_DIR.parent.parent
21
+ DATA_FILE = WORKSPACE_ROOT / ".accel/momentum" / "data" / "projects.json"
22
+
23
+ BEHAVIOR_DIRECTIVE = f"""BEHAVIOR: This context is PASSIVE AWARENESS ONLY.
24
+ Do NOT proactively mention these items unless:
25
+ - User explicitly asks (e.g., "what's in the backlog?", "what's queued?")
26
+ - A review_by date has passed AND user hasn't acknowledged it this session
27
+ For details on any item, use momentum_get_project(id)."""
28
+
29
+ PRIORITY_ORDER = ["high", "medium", "low"]
30
+
31
+ # Staleness thresholds (days since last update)
32
+ STALE_THRESHOLDS = {
33
+ "high": 7,
34
+ "medium": 14,
35
+ "low": 30,
36
+ }
37
+
38
+
39
+ def days_since_update(item):
40
+ """Calculate days since last update. Uses updated_at (ISO datetime)."""
41
+ ts = item.get("updated_at") or item.get("created_at")
42
+ if not ts:
43
+ return None
44
+ try:
45
+ d = date.fromisoformat(ts[:10])
46
+ return (date.today() - d).days
47
+ except (ValueError, TypeError):
48
+ return None
49
+
50
+
51
+ def main():
52
+ try:
53
+ input_data = json.loads(sys.stdin.read())
54
+ except (json.JSONDecodeError, OSError):
55
+ pass
56
+
57
+ if not DATA_FILE.exists():
58
+ sys.exit(0)
59
+
60
+ try:
61
+ data = json.loads(DATA_FILE.read_text())
62
+ except (json.JSONDecodeError, OSError):
63
+ sys.exit(0)
64
+
65
+ items = data.get("items", [])
66
+ if not items:
67
+ sys.exit(0)
68
+
69
+ # Filter: only backlog items
70
+ backlog_items = [i for i in items if i.get("status") == "backlog"]
71
+ if not backlog_items:
72
+ sys.exit(0)
73
+
74
+ # Group by priority
75
+ groups = {}
76
+ for item in backlog_items:
77
+ p = item.get("priority", "medium")
78
+ groups.setdefault(p, []).append(item)
79
+
80
+ lines = []
81
+ for priority in PRIORITY_ORDER:
82
+ group = groups.get(priority, [])
83
+ if not group:
84
+ continue
85
+ lines.append(f"[{priority.upper()}]")
86
+ for item in group:
87
+ item_id = item.get("id", "?")
88
+ title = item.get("title", "untitled")
89
+ review_by = item.get("review_by")
90
+ entry = f"- [{item_id}] {title}"
91
+ if review_by:
92
+ entry += f" [review by: {review_by}]"
93
+ days = days_since_update(item)
94
+ threshold = STALE_THRESHOLDS.get(priority, 14)
95
+ if days is not None:
96
+ if days >= threshold:
97
+ entry += f" STALE: {days}d"
98
+ else:
99
+ entry += f" ({days}d ago)"
100
+ lines.append(entry)
101
+
102
+ if lines:
103
+ count = len(backlog_items)
104
+ summary = "\n".join(lines)
105
+ print(f"""<{SURFACE_NAME}-awareness items="{count}">
106
+ {summary}
107
+
108
+ {BEHAVIOR_DIRECTIVE}
109
+ </{SURFACE_NAME}-awareness>""")
110
+
111
+ sys.exit(0)
112
+
113
+
114
+ if __name__ == "__main__":
115
+ main()