@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.
- package/CLAUDE.md +19 -0
- package/LICENSE +33 -0
- package/README.md +275 -0
- package/bin/install.js +661 -0
- package/docs/getting-started.md +164 -0
- package/docs/module-guide.md +139 -0
- package/modules/drive/LICENSE +21 -0
- package/modules/drive/PAUL-VS-GSD.md +171 -0
- package/modules/drive/README.md +555 -0
- package/modules/drive/assets/terminal.svg +67 -0
- package/modules/drive/bin/install.js +210 -0
- package/modules/drive/integration.js +76 -0
- package/modules/drive/package.json +38 -0
- package/modules/drive/src/commands/add-phase.md +36 -0
- package/modules/drive/src/commands/apply.md +83 -0
- package/modules/drive/src/commands/assumptions.md +37 -0
- package/modules/drive/src/commands/audit.md +57 -0
- package/modules/drive/src/commands/complete-milestone.md +36 -0
- package/modules/drive/src/commands/config.md +175 -0
- package/modules/drive/src/commands/consider-issues.md +41 -0
- package/modules/drive/src/commands/discover.md +48 -0
- package/modules/drive/src/commands/discuss-milestone.md +33 -0
- package/modules/drive/src/commands/discuss.md +34 -0
- package/modules/drive/src/commands/flows.md +73 -0
- package/modules/drive/src/commands/handoff.md +201 -0
- package/modules/drive/src/commands/help.md +525 -0
- package/modules/drive/src/commands/init.md +54 -0
- package/modules/drive/src/commands/map-codebase.md +34 -0
- package/modules/drive/src/commands/milestone.md +34 -0
- package/modules/drive/src/commands/pause.md +44 -0
- package/modules/drive/src/commands/plan-fix.md +216 -0
- package/modules/drive/src/commands/plan.md +36 -0
- package/modules/drive/src/commands/progress.md +138 -0
- package/modules/drive/src/commands/register.md +29 -0
- package/modules/drive/src/commands/remove-phase.md +37 -0
- package/modules/drive/src/commands/research-phase.md +209 -0
- package/modules/drive/src/commands/research.md +47 -0
- package/modules/drive/src/commands/resume.md +49 -0
- package/modules/drive/src/commands/status.md +78 -0
- package/modules/drive/src/commands/unify.md +87 -0
- package/modules/drive/src/commands/verify.md +60 -0
- package/modules/drive/src/references/checkpoints.md +234 -0
- package/modules/drive/src/references/context-management.md +219 -0
- package/modules/drive/src/references/git-strategy.md +206 -0
- package/modules/drive/src/references/loop-phases.md +254 -0
- package/modules/drive/src/references/plan-format.md +263 -0
- package/modules/drive/src/references/quality-principles.md +152 -0
- package/modules/drive/src/references/research-quality-control.md +247 -0
- package/modules/drive/src/references/sonarqube-integration.md +244 -0
- package/modules/drive/src/references/specialized-workflow-integration.md +186 -0
- package/modules/drive/src/references/subagent-criteria.md +179 -0
- package/modules/drive/src/references/tdd.md +219 -0
- package/modules/drive/src/references/work-units.md +161 -0
- package/modules/drive/src/rules/commands.md +108 -0
- package/modules/drive/src/rules/references.md +107 -0
- package/modules/drive/src/rules/style.md +123 -0
- package/modules/drive/src/rules/templates.md +51 -0
- package/modules/drive/src/rules/workflows.md +133 -0
- package/modules/drive/src/templates/CONTEXT.md +88 -0
- package/modules/drive/src/templates/DEBUG.md +164 -0
- package/modules/drive/src/templates/DISCOVERY.md +148 -0
- package/modules/drive/src/templates/HANDOFF.md +77 -0
- package/modules/drive/src/templates/ISSUES.md +93 -0
- package/modules/drive/src/templates/MILESTONES.md +167 -0
- package/modules/drive/src/templates/PLAN.md +328 -0
- package/modules/drive/src/templates/PROJECT.md +219 -0
- package/modules/drive/src/templates/RESEARCH.md +130 -0
- package/modules/drive/src/templates/ROADMAP.md +328 -0
- package/modules/drive/src/templates/SPECIAL-FLOWS.md +70 -0
- package/modules/drive/src/templates/STATE.md +210 -0
- package/modules/drive/src/templates/SUMMARY.md +221 -0
- package/modules/drive/src/templates/UAT-ISSUES.md +139 -0
- package/modules/drive/src/templates/codebase/architecture.md +259 -0
- package/modules/drive/src/templates/codebase/concerns.md +329 -0
- package/modules/drive/src/templates/codebase/conventions.md +311 -0
- package/modules/drive/src/templates/codebase/integrations.md +284 -0
- package/modules/drive/src/templates/codebase/stack.md +190 -0
- package/modules/drive/src/templates/codebase/structure.md +287 -0
- package/modules/drive/src/templates/codebase/testing.md +484 -0
- package/modules/drive/src/templates/config.md +181 -0
- package/modules/drive/src/templates/milestone-archive.md +236 -0
- package/modules/drive/src/templates/milestone-context.md +190 -0
- package/modules/drive/src/templates/paul-json.md +147 -0
- package/modules/drive/src/vector-config/PAUL +26 -0
- package/modules/drive/src/vector-config/PAUL.manifest +11 -0
- package/modules/drive/src/workflows/apply-phase.md +393 -0
- package/modules/drive/src/workflows/audit-plan.md +344 -0
- package/modules/drive/src/workflows/complete-milestone.md +479 -0
- package/modules/drive/src/workflows/configure-special-flows.md +283 -0
- package/modules/drive/src/workflows/consider-issues.md +172 -0
- package/modules/drive/src/workflows/create-milestone.md +268 -0
- package/modules/drive/src/workflows/debug.md +292 -0
- package/modules/drive/src/workflows/discovery.md +187 -0
- package/modules/drive/src/workflows/discuss-milestone.md +245 -0
- package/modules/drive/src/workflows/discuss-phase.md +231 -0
- package/modules/drive/src/workflows/init-project.md +698 -0
- package/modules/drive/src/workflows/map-codebase.md +459 -0
- package/modules/drive/src/workflows/pause-work.md +259 -0
- package/modules/drive/src/workflows/phase-assumptions.md +181 -0
- package/modules/drive/src/workflows/plan-phase.md +385 -0
- package/modules/drive/src/workflows/quality-gate.md +263 -0
- package/modules/drive/src/workflows/register-manifest.md +107 -0
- package/modules/drive/src/workflows/research.md +241 -0
- package/modules/drive/src/workflows/resume-project.md +200 -0
- package/modules/drive/src/workflows/roadmap-management.md +334 -0
- package/modules/drive/src/workflows/transition-phase.md +368 -0
- package/modules/drive/src/workflows/unify-phase.md +290 -0
- package/modules/drive/src/workflows/verify-work.md +241 -0
- package/modules/forge/README.md +281 -0
- package/modules/forge/bin/install.js +200 -0
- package/modules/forge/package.json +32 -0
- package/modules/forge/skillsmith/rules/checklists-rules.md +42 -0
- package/modules/forge/skillsmith/rules/context-rules.md +43 -0
- package/modules/forge/skillsmith/rules/entry-point-rules.md +44 -0
- package/modules/forge/skillsmith/rules/frameworks-rules.md +43 -0
- package/modules/forge/skillsmith/rules/tasks-rules.md +52 -0
- package/modules/forge/skillsmith/rules/templates-rules.md +43 -0
- package/modules/forge/skillsmith/skillsmith.md +82 -0
- package/modules/forge/skillsmith/tasks/audit.md +277 -0
- package/modules/forge/skillsmith/tasks/discover.md +145 -0
- package/modules/forge/skillsmith/tasks/distill.md +276 -0
- package/modules/forge/skillsmith/tasks/scaffold.md +349 -0
- package/modules/forge/specs/checklists.md +193 -0
- package/modules/forge/specs/context.md +223 -0
- package/modules/forge/specs/entry-point.md +320 -0
- package/modules/forge/specs/frameworks.md +228 -0
- package/modules/forge/specs/rules.md +245 -0
- package/modules/forge/specs/tasks.md +344 -0
- package/modules/forge/specs/templates.md +335 -0
- package/modules/forge/terminal.svg +70 -0
- package/modules/ignition/README.md +245 -0
- package/modules/ignition/bin/install.js +184 -0
- package/modules/ignition/checklists/planning-quality.md +55 -0
- package/modules/ignition/data/application/config.md +21 -0
- package/modules/ignition/data/application/guide.md +51 -0
- package/modules/ignition/data/application/skill-loadout.md +11 -0
- package/modules/ignition/data/campaign/config.md +18 -0
- package/modules/ignition/data/campaign/guide.md +36 -0
- package/modules/ignition/data/campaign/skill-loadout.md +10 -0
- package/modules/ignition/data/client/config.md +18 -0
- package/modules/ignition/data/client/guide.md +36 -0
- package/modules/ignition/data/client/skill-loadout.md +11 -0
- package/modules/ignition/data/utility/config.md +18 -0
- package/modules/ignition/data/utility/guide.md +31 -0
- package/modules/ignition/data/utility/skill-loadout.md +8 -0
- package/modules/ignition/data/workflow/config.md +19 -0
- package/modules/ignition/data/workflow/guide.md +41 -0
- package/modules/ignition/data/workflow/skill-loadout.md +10 -0
- package/modules/ignition/integration.js +54 -0
- package/modules/ignition/package.json +35 -0
- package/modules/ignition/seed.md +81 -0
- package/modules/ignition/tasks/add-type.md +164 -0
- package/modules/ignition/tasks/graduate.md +182 -0
- package/modules/ignition/tasks/ideate.md +221 -0
- package/modules/ignition/tasks/launch.md +137 -0
- package/modules/ignition/tasks/status.md +71 -0
- package/modules/ignition/templates/planning-application.md +193 -0
- package/modules/ignition/templates/planning-campaign.md +138 -0
- package/modules/ignition/templates/planning-client.md +149 -0
- package/modules/ignition/templates/planning-utility.md +112 -0
- package/modules/ignition/templates/planning-workflow.md +125 -0
- package/modules/ignition/terminal.svg +74 -0
- package/modules/mission-control/CONTEXT-CONTINUITY-SPEC.md +293 -0
- package/modules/mission-control/CONTEXT-ENGINEERING-GUIDE.md +282 -0
- package/modules/mission-control/README.md +91 -0
- package/modules/mission-control/assets/terminal.svg +80 -0
- package/modules/mission-control/examples/entities.example.json +133 -0
- package/modules/mission-control/examples/projects.example.json +318 -0
- package/modules/mission-control/examples/state.example.json +183 -0
- package/modules/mission-control/examples/vector.example.json +245 -0
- package/modules/mission-control/mission-control/checklists/install-verification.md +46 -0
- package/modules/mission-control/mission-control/frameworks/framework-registry.md +83 -0
- package/modules/mission-control/mission-control/mission-control.md +83 -0
- package/modules/mission-control/mission-control/tasks/insights.md +73 -0
- package/modules/mission-control/mission-control/tasks/install.md +194 -0
- package/modules/mission-control/mission-control/tasks/status.md +125 -0
- package/modules/mission-control/schemas/entities.schema.json +89 -0
- package/modules/mission-control/schemas/projects.schema.json +221 -0
- package/modules/mission-control/schemas/state.schema.json +108 -0
- package/modules/mission-control/schemas/vector.schema.json +200 -0
- package/modules/momentum/README.md +678 -0
- package/modules/momentum/bin/install.js +563 -0
- package/modules/momentum/integration.js +131 -0
- package/modules/momentum/package.json +42 -0
- package/modules/momentum/schemas/entities.schema.json +89 -0
- package/modules/momentum/schemas/projects.schema.json +221 -0
- package/modules/momentum/schemas/state.schema.json +108 -0
- package/modules/momentum/src/commands/audit-claude-md.md +31 -0
- package/modules/momentum/src/commands/audit.md +33 -0
- package/modules/momentum/src/commands/groom.md +35 -0
- package/modules/momentum/src/commands/history.md +27 -0
- package/modules/momentum/src/commands/pulse.md +33 -0
- package/modules/momentum/src/commands/scaffold.md +33 -0
- package/modules/momentum/src/commands/status.md +28 -0
- package/modules/momentum/src/commands/surface-convert.md +35 -0
- package/modules/momentum/src/commands/surface-create.md +34 -0
- package/modules/momentum/src/commands/surface-list.md +27 -0
- package/modules/momentum/src/commands/vector-hygiene.md +33 -0
- package/modules/momentum/src/framework/context/momentum-principles.md +71 -0
- package/modules/momentum/src/framework/frameworks/audit-strategies.md +53 -0
- package/modules/momentum/src/framework/frameworks/satellite-registration.md +44 -0
- package/modules/momentum/src/framework/tasks/audit-claude-md.md +68 -0
- package/modules/momentum/src/framework/tasks/audit.md +64 -0
- package/modules/momentum/src/framework/tasks/groom.md +164 -0
- package/modules/momentum/src/framework/tasks/history.md +34 -0
- package/modules/momentum/src/framework/tasks/pulse.md +83 -0
- package/modules/momentum/src/framework/tasks/scaffold.md +202 -0
- package/modules/momentum/src/framework/tasks/status.md +35 -0
- package/modules/momentum/src/framework/tasks/surface-convert.md +143 -0
- package/modules/momentum/src/framework/tasks/surface-create.md +184 -0
- package/modules/momentum/src/framework/tasks/surface-list.md +42 -0
- package/modules/momentum/src/framework/tasks/vector-hygiene.md +160 -0
- package/modules/momentum/src/framework/templates/workspace-json.md +96 -0
- package/modules/momentum/src/hooks/_template.py +129 -0
- package/modules/momentum/src/hooks/active-hook.py +178 -0
- package/modules/momentum/src/hooks/backlog-hook.py +115 -0
- package/modules/momentum/src/hooks/mission-control-insights.py +169 -0
- package/modules/momentum/src/hooks/momentum-pulse-check.py +351 -0
- package/modules/momentum/src/hooks/operator.py +53 -0
- package/modules/momentum/src/hooks/psmm-injector.py +67 -0
- package/modules/momentum/src/hooks/satellite-detection.py +248 -0
- package/modules/momentum/src/packages/momentum-mcp/index.js +119 -0
- package/modules/momentum/src/packages/momentum-mcp/package.json +10 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/entities.js +226 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/operator.js +106 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/projects.js +322 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/psmm.js +206 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/state.js +199 -0
- package/modules/momentum/src/packages/momentum-mcp/tools/surfaces.js +404 -0
- package/modules/momentum/src/skill/momentum.md +111 -0
- package/modules/momentum/src/tasks/groom.md +164 -0
- package/modules/momentum/src/templates/operator.json +66 -0
- package/modules/momentum/src/templates/workspace.json +111 -0
- package/modules/momentum/terminal.svg +77 -0
- package/modules/radar/README.md +1552 -0
- package/modules/radar/commands/audit.md +233 -0
- package/modules/radar/commands/guardrails.md +194 -0
- package/modules/radar/commands/init.md +207 -0
- package/modules/radar/commands/playbook.md +176 -0
- package/modules/radar/commands/remediate.md +156 -0
- package/modules/radar/commands/report.md +172 -0
- package/modules/radar/commands/resume.md +176 -0
- package/modules/radar/commands/status.md +148 -0
- package/modules/radar/commands/transform.md +205 -0
- package/modules/radar/commands/validate.md +177 -0
- package/modules/radar/docs/ARCHITECTURE.md +336 -0
- package/modules/radar/docs/GETTING-STARTED.md +287 -0
- package/modules/radar/docs/standards/agents.md +197 -0
- package/modules/radar/docs/standards/commands.md +250 -0
- package/modules/radar/docs/standards/domains.md +191 -0
- package/modules/radar/docs/standards/personas.md +211 -0
- package/modules/radar/docs/standards/rules.md +218 -0
- package/modules/radar/docs/standards/runtime.md +445 -0
- package/modules/radar/docs/standards/schemas.md +269 -0
- package/modules/radar/docs/standards/tools.md +273 -0
- package/modules/radar/docs/standards/workflows.md +254 -0
- package/modules/radar/docs/terminal.svg +72 -0
- package/modules/radar/docs/validation/convention-compliance-report.md +183 -0
- package/modules/radar/docs/validation/cross-reference-report.md +195 -0
- package/modules/radar/docs/validation/validation-summary.md +118 -0
- package/modules/radar/docs/validation/version-manifest.yaml +363 -0
- package/modules/radar/install.sh +711 -0
- package/modules/radar/integration.js +53 -0
- package/modules/radar/src/core/agents/architect.md +25 -0
- package/modules/radar/src/core/agents/compliance-officer.md +25 -0
- package/modules/radar/src/core/agents/data-engineer.md +25 -0
- package/modules/radar/src/core/agents/devils-advocate.md +22 -0
- package/modules/radar/src/core/agents/performance-engineer.md +25 -0
- package/modules/radar/src/core/agents/principal-engineer.md +23 -0
- package/modules/radar/src/core/agents/reality-gap-analyst.md +22 -0
- package/modules/radar/src/core/agents/security-engineer.md +25 -0
- package/modules/radar/src/core/agents/senior-app-engineer.md +25 -0
- package/modules/radar/src/core/agents/sre.md +25 -0
- package/modules/radar/src/core/agents/staff-engineer.md +23 -0
- package/modules/radar/src/core/agents/test-engineer.md +25 -0
- package/modules/radar/src/core/personas/architect.md +111 -0
- package/modules/radar/src/core/personas/compliance-officer.md +104 -0
- package/modules/radar/src/core/personas/data-engineer.md +113 -0
- package/modules/radar/src/core/personas/devils-advocate.md +105 -0
- package/modules/radar/src/core/personas/performance-engineer.md +119 -0
- package/modules/radar/src/core/personas/principal-engineer.md +119 -0
- package/modules/radar/src/core/personas/reality-gap-analyst.md +111 -0
- package/modules/radar/src/core/personas/security-engineer.md +108 -0
- package/modules/radar/src/core/personas/senior-app-engineer.md +111 -0
- package/modules/radar/src/core/personas/sre.md +117 -0
- package/modules/radar/src/core/personas/staff-engineer.md +109 -0
- package/modules/radar/src/core/personas/test-engineer.md +109 -0
- package/modules/radar/src/core/workflows/disagreement-resolution.md +183 -0
- package/modules/radar/src/core/workflows/phase-0-context.md +148 -0
- package/modules/radar/src/core/workflows/phase-1-reconnaissance.md +169 -0
- package/modules/radar/src/core/workflows/phase-2-domain-audits.md +190 -0
- package/modules/radar/src/core/workflows/phase-3-cross-domain.md +177 -0
- package/modules/radar/src/core/workflows/phase-4-adversarial-review.md +165 -0
- package/modules/radar/src/core/workflows/phase-5-report.md +189 -0
- package/modules/radar/src/core/workflows/phase-checkpoint.md +222 -0
- package/modules/radar/src/core/workflows/session-handoff.md +152 -0
- package/modules/radar/src/domains/00-context.md +201 -0
- package/modules/radar/src/domains/01-architecture.md +248 -0
- package/modules/radar/src/domains/02-data.md +224 -0
- package/modules/radar/src/domains/03-correctness.md +230 -0
- package/modules/radar/src/domains/04-security.md +274 -0
- package/modules/radar/src/domains/05-compliance.md +228 -0
- package/modules/radar/src/domains/06-testing.md +228 -0
- package/modules/radar/src/domains/07-reliability.md +246 -0
- package/modules/radar/src/domains/08-performance.md +247 -0
- package/modules/radar/src/domains/09-maintainability.md +271 -0
- package/modules/radar/src/domains/10-operability.md +250 -0
- package/modules/radar/src/domains/11-change-risk.md +246 -0
- package/modules/radar/src/domains/12-team-risk.md +221 -0
- package/modules/radar/src/domains/13-risk-synthesis.md +202 -0
- package/modules/radar/src/rules/agent-boundaries.md +78 -0
- package/modules/radar/src/rules/disagreement-protocol.md +76 -0
- package/modules/radar/src/rules/epistemic-hygiene.md +78 -0
- package/modules/radar/src/schemas/confidence.md +185 -0
- package/modules/radar/src/schemas/disagreement.md +238 -0
- package/modules/radar/src/schemas/finding.md +287 -0
- package/modules/radar/src/schemas/report-section.md +150 -0
- package/modules/radar/src/schemas/signal.md +108 -0
- package/modules/radar/src/tools/checkov.md +463 -0
- package/modules/radar/src/tools/git-history.md +581 -0
- package/modules/radar/src/tools/gitleaks.md +447 -0
- package/modules/radar/src/tools/grype.md +611 -0
- package/modules/radar/src/tools/semgrep.md +378 -0
- package/modules/radar/src/tools/sonarqube.md +550 -0
- package/modules/radar/src/tools/syft.md +539 -0
- package/modules/radar/src/tools/trivy.md +439 -0
- package/modules/radar/src/transform/agents/change-risk-modeler.md +24 -0
- package/modules/radar/src/transform/agents/execution-validator.md +24 -0
- package/modules/radar/src/transform/agents/guardrail-generator.md +24 -0
- package/modules/radar/src/transform/agents/pedagogy-agent.md +24 -0
- package/modules/radar/src/transform/agents/remediation-architect.md +24 -0
- package/modules/radar/src/transform/personas/change-risk-modeler.md +95 -0
- package/modules/radar/src/transform/personas/execution-validator.md +95 -0
- package/modules/radar/src/transform/personas/guardrail-generator.md +103 -0
- package/modules/radar/src/transform/personas/pedagogy-agent.md +105 -0
- package/modules/radar/src/transform/personas/remediation-architect.md +95 -0
- package/modules/radar/src/transform/rules/change-risk-rules.md +87 -0
- package/modules/radar/src/transform/rules/safety-governance.md +87 -0
- package/modules/radar/src/transform/schemas/change-risk.md +139 -0
- package/modules/radar/src/transform/schemas/intervention-level.md +207 -0
- package/modules/radar/src/transform/schemas/playbook.md +205 -0
- package/modules/radar/src/transform/schemas/verification-plan.md +134 -0
- package/modules/radar/src/transform/workflows/phase-6-remediation.md +148 -0
- package/modules/radar/src/transform/workflows/phase-7-risk-validation.md +161 -0
- package/modules/radar/src/transform/workflows/phase-8-execution-planning.md +159 -0
- package/modules/radar/src/transform/workflows/transform-safety.md +158 -0
- package/modules/vector/.vector-template/sessions/.gitkeep +0 -0
- package/modules/vector/.vector-template/vector.json +72 -0
- package/modules/vector/AUDIT-CLAUDEMD.md +154 -0
- package/modules/vector/INSTALL.md +185 -0
- package/modules/vector/LICENSE +21 -0
- package/modules/vector/README.md +409 -0
- package/modules/vector/VECTOR-BLOCK.md +57 -0
- package/modules/vector/assets/terminal.svg +68 -0
- package/modules/vector/bin/install.js +455 -0
- package/modules/vector/bin/migrate-v1-to-v2.sh +492 -0
- package/modules/vector/commands/help.md +46 -0
- package/modules/vector/hooks/vector-hook.py +775 -0
- package/modules/vector/mcp/index.js +118 -0
- package/modules/vector/mcp/package.json +10 -0
- package/modules/vector/mcp/tools/decisions.js +269 -0
- package/modules/vector/mcp/tools/domains.js +361 -0
- package/modules/vector/mcp/tools/staging.js +252 -0
- package/modules/vector/mcp/tools/vector-json.js +647 -0
- package/modules/vector/package.json +38 -0
- package/modules/vector/schemas/vector.schema.json +237 -0
- package/package.json +39 -0
- package/shared/branding/branding.js +70 -0
- package/shared/config/defaults.json +59 -0
- package/shared/events/README.md +175 -0
- package/shared/events/event-bus.js +134 -0
- package/shared/events/event_bus.py +255 -0
- package/shared/events/integrations.js +161 -0
- package/shared/events/schemas/audit-complete.schema.json +21 -0
- package/shared/events/schemas/phase-progress.schema.json +23 -0
- 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()
|