@limina-labs/momentum 0.30.2

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 (182) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +214 -0
  3. package/adapters/antigravity/adapter.js +196 -0
  4. package/adapters/antigravity/hooks.json +39 -0
  5. package/adapters/antigravity/instructions/AGENTS.md +638 -0
  6. package/adapters/antigravity/instructions/header.md +3 -0
  7. package/adapters/antigravity/instructions/surfaces.md +153 -0
  8. package/adapters/antigravity/instructions/vars.json +1 -0
  9. package/adapters/antigravity/scripts/antigravity-hook-adapter.sh +147 -0
  10. package/adapters/antigravity/skills/momentum-orient/SKILL.md +29 -0
  11. package/adapters/antigravity/skills/momentum-reviewer-architecture/SKILL.md +39 -0
  12. package/adapters/antigravity/skills/momentum-reviewer-qa/SKILL.md +38 -0
  13. package/adapters/antigravity/skills/momentum-reviewer-security/SKILL.md +42 -0
  14. package/adapters/antigravity/skills/swarm-supervisor/SKILL.md +75 -0
  15. package/adapters/antigravity/workflows/continue.md +39 -0
  16. package/adapters/antigravity/workflows/dispatch.md +49 -0
  17. package/adapters/antigravity/workflows/handoff.md +38 -0
  18. package/adapters/antigravity/workflows/review-code.md +84 -0
  19. package/adapters/antigravity/workflows/scout.md +42 -0
  20. package/adapters/antigravity/workflows/swarm.md +203 -0
  21. package/adapters/claude-code/adapter.js +148 -0
  22. package/adapters/claude-code/commands/continue.md +82 -0
  23. package/adapters/claude-code/commands/dispatch.md +154 -0
  24. package/adapters/claude-code/commands/handoff.md +85 -0
  25. package/adapters/claude-code/commands/review-code.md +194 -0
  26. package/adapters/claude-code/commands/scout.md +119 -0
  27. package/adapters/claude-code/commands/swarm.md +242 -0
  28. package/adapters/claude-code/instructions/header.md +3 -0
  29. package/adapters/claude-code/instructions/vars.json +1 -0
  30. package/adapters/claude-code/settings.json +36 -0
  31. package/adapters/codex/adapter.js +225 -0
  32. package/adapters/codex/agents/momentum-reviewer-architecture.toml +57 -0
  33. package/adapters/codex/agents/momentum-reviewer-qa.toml +52 -0
  34. package/adapters/codex/agents/momentum-reviewer-security.toml +57 -0
  35. package/adapters/codex/agents/swarm-supervisor.toml +76 -0
  36. package/adapters/codex/commands/continue.md +40 -0
  37. package/adapters/codex/commands/dispatch.md +111 -0
  38. package/adapters/codex/commands/handoff.md +57 -0
  39. package/adapters/codex/commands/scout.md +90 -0
  40. package/adapters/codex/commands/swarm.md +334 -0
  41. package/adapters/codex/hooks.json +36 -0
  42. package/adapters/codex/instructions/AGENTS.md +691 -0
  43. package/adapters/codex/instructions/header.md +3 -0
  44. package/adapters/codex/instructions/surfaces.md +206 -0
  45. package/adapters/codex/instructions/vars.json +1 -0
  46. package/adapters/codex/skills/momentum-orient/SKILL.md +29 -0
  47. package/adapters/opencode/adapter.js +224 -0
  48. package/adapters/opencode/agents/momentum-reviewer-architecture.md +54 -0
  49. package/adapters/opencode/agents/momentum-reviewer-qa.md +48 -0
  50. package/adapters/opencode/agents/momentum-reviewer-security.md +48 -0
  51. package/adapters/opencode/agents/swarm-supervisor.md +51 -0
  52. package/adapters/opencode/commands/continue.md +40 -0
  53. package/adapters/opencode/commands/dispatch.md +111 -0
  54. package/adapters/opencode/commands/handoff.md +57 -0
  55. package/adapters/opencode/commands/review-code.md +194 -0
  56. package/adapters/opencode/commands/scout.md +90 -0
  57. package/adapters/opencode/commands/swarm.md +334 -0
  58. package/adapters/opencode/instructions/AGENTS.md +604 -0
  59. package/adapters/opencode/instructions/header.md +3 -0
  60. package/adapters/opencode/instructions/surfaces.md +119 -0
  61. package/adapters/opencode/instructions/vars.json +1 -0
  62. package/adapters/opencode/plugins/momentum.js +219 -0
  63. package/adapters/opencode/skills/momentum-lanes/SKILL.md +30 -0
  64. package/adapters/opencode/skills/momentum-orient/SKILL.md +29 -0
  65. package/adapters/opencode/skills/momentum-track/SKILL.md +28 -0
  66. package/adapters/opencode/skills/momentum-validate/SKILL.md +31 -0
  67. package/bin/antigravity.js +112 -0
  68. package/bin/ecosystem.js +1302 -0
  69. package/bin/lanes.js +300 -0
  70. package/bin/momentum.js +1857 -0
  71. package/bin/okf.js +72 -0
  72. package/bin/orchestration-commands.js +305 -0
  73. package/bin/state-commands.js +218 -0
  74. package/bin/swarm.js +1104 -0
  75. package/bin/waves.js +147 -0
  76. package/core/adapter-capabilities.md +112 -0
  77. package/core/adapter-parity-matrix.md +170 -0
  78. package/core/commands/brainstorm-idea.md +98 -0
  79. package/core/commands/brainstorm-phase.md +129 -0
  80. package/core/commands/complete-phase.md +130 -0
  81. package/core/commands/ecosystem.md +161 -0
  82. package/core/commands/hotfix.md +64 -0
  83. package/core/commands/initiative.md +119 -0
  84. package/core/commands/lanes.md +94 -0
  85. package/core/commands/log.md +45 -0
  86. package/core/commands/migrate.md +70 -0
  87. package/core/commands/review.md +31 -0
  88. package/core/commands/session.md +79 -0
  89. package/core/commands/start-phase.md +161 -0
  90. package/core/commands/start-project.md +142 -0
  91. package/core/commands/sync-docs.md +81 -0
  92. package/core/commands/systematic-debug.md +46 -0
  93. package/core/commands/track.md +54 -0
  94. package/core/commands/validate.md +96 -0
  95. package/core/ecosystem/layout.md +128 -0
  96. package/core/ecosystem/lib/index.js +245 -0
  97. package/core/ecosystem/lib/initiative.js +258 -0
  98. package/core/ecosystem/lib/pointer.js +198 -0
  99. package/core/ecosystem/lib/state.js +295 -0
  100. package/core/ecosystem/schema/ecosystem.schema.json +85 -0
  101. package/core/ecosystem/schema/initiative.schema.json +61 -0
  102. package/core/ecosystem/scripts/session-append.sh +167 -0
  103. package/core/ecosystem/templates/ecosystem-agents.md +79 -0
  104. package/core/ecosystem/templates/ecosystem-claude.md +79 -0
  105. package/core/ecosystem/templates/ecosystem-settings-claude.json +14 -0
  106. package/core/ecosystem/templates/initiative-template.md +50 -0
  107. package/core/engines/subagent-dispatch.md +80 -0
  108. package/core/git-hooks/commit-msg +14 -0
  109. package/core/git-hooks/contract.js +176 -0
  110. package/core/git-hooks/pre-push +15 -0
  111. package/core/git-hooks/run-check.js +160 -0
  112. package/core/instructions/legacy-project-md-hashes.json +12 -0
  113. package/core/instructions/navigation.md +14 -0
  114. package/core/instructions/rules-body.md +454 -0
  115. package/core/lanes/lib/board.js +161 -0
  116. package/core/lanes/lib/land.js +301 -0
  117. package/core/lanes/lib/signals.js +207 -0
  118. package/core/lanes/lib/state.js +325 -0
  119. package/core/lib/frontmatter.js +163 -0
  120. package/core/lib/okf-migrate.js +374 -0
  121. package/core/lib/okf-types.js +61 -0
  122. package/core/lifecycle-contract.md +59 -0
  123. package/core/orchestration/capability-routing.js +120 -0
  124. package/core/orchestration/continue.js +102 -0
  125. package/core/orchestration/dispatch.js +366 -0
  126. package/core/orchestration/events.js +197 -0
  127. package/core/orchestration/handoff.js +317 -0
  128. package/core/orchestration/index.js +50 -0
  129. package/core/orchestration/run-artifact.js +93 -0
  130. package/core/orchestration/scout.js +327 -0
  131. package/core/orchestration/session-log.js +123 -0
  132. package/core/orchestration/tracking.js +180 -0
  133. package/core/orchestration/types.js +131 -0
  134. package/core/scripts/brainstorm-gate.sh +157 -0
  135. package/core/scripts/check-history-reminder.sh +110 -0
  136. package/core/scripts/sessionstart-handoff.sh +180 -0
  137. package/core/specs-templates/CLAUDE.md +484 -0
  138. package/core/specs-templates/README.md +32 -0
  139. package/core/specs-templates/specs/README.md +30 -0
  140. package/core/specs-templates/specs/adhoc/README.md +31 -0
  141. package/core/specs-templates/specs/adhoc/_TEMPLATE.md +29 -0
  142. package/core/specs-templates/specs/architecture/ecosystem.md +214 -0
  143. package/core/specs-templates/specs/backlog/backlog.md +46 -0
  144. package/core/specs-templates/specs/backlog/details/.gitkeep +0 -0
  145. package/core/specs-templates/specs/changelog/.gitkeep +0 -0
  146. package/core/specs-templates/specs/decisions/0000-template.md +33 -0
  147. package/core/specs-templates/specs/decisions/README.md +29 -0
  148. package/core/specs-templates/specs/decisions/impact-map.md +14 -0
  149. package/core/specs-templates/specs/decisions/index.md +4 -0
  150. package/core/specs-templates/specs/index.md +16 -0
  151. package/core/specs-templates/specs/phases/README.md +41 -0
  152. package/core/specs-templates/specs/phases/index.md +6 -0
  153. package/core/specs-templates/specs/planning/roadmap.md +23 -0
  154. package/core/specs-templates/specs/status.md +70 -0
  155. package/core/specs-templates/specs/vision/principles.md +16 -0
  156. package/core/specs-templates/specs/vision/project-charter.md +35 -0
  157. package/core/specs-templates/specs/vision/success-criteria.md +19 -0
  158. package/core/swarm/absorb.js +294 -0
  159. package/core/swarm/conductor.js +499 -0
  160. package/core/swarm/focus.js +151 -0
  161. package/core/swarm/inbox.js +222 -0
  162. package/core/swarm/join.js +138 -0
  163. package/core/swarm/lib/board.js +178 -0
  164. package/core/swarm/lib/brief.js +157 -0
  165. package/core/swarm/lib/git-sha-cache.js +71 -0
  166. package/core/swarm/lib/incremental-log.js +117 -0
  167. package/core/swarm/lib/manifest.js +578 -0
  168. package/core/swarm/lib/pre-merge.js +112 -0
  169. package/core/swarm/lib/saga.js +146 -0
  170. package/core/swarm/lib/sessions.js +83 -0
  171. package/core/swarm/lib/tokens.js +255 -0
  172. package/core/swarm/lib/wave-ordering.js +55 -0
  173. package/core/swarm/schema/board.schema.json +54 -0
  174. package/core/swarm/schema/contract.schema.json +56 -0
  175. package/core/swarm/schema/dispatch-run.schema.json +70 -0
  176. package/core/swarm/schema/manifest.schema.json +234 -0
  177. package/core/swarm/schema/signal.schema.json +61 -0
  178. package/core/swarm/signals.js +296 -0
  179. package/core/swarm/supervise.md +81 -0
  180. package/core/waves/lib/plan-graph.js +175 -0
  181. package/core/waves/lib/waves.js +83 -0
  182. package/package.json +46 -0
@@ -0,0 +1,691 @@
1
+ <!-- momentum-managed (generated) — regenerate with `npm run generate-instructions`
2
+ in the momentum repo; sources: core/instructions/ + adapters/<agent>/instructions/.
3
+ Everything above '## Project Extensions' may be replaced by `momentum upgrade`. -->
4
+
5
+ # Project Rules: <Project Name>
6
+
7
+ > Codex configuration for this momentum-managed project.
8
+
9
+ ## Navigation (Where to Find Things)
10
+
11
+ | Question | File |
12
+ |----------|------|
13
+ | Current state / what phase? | `specs/status.md` |
14
+ | What's in the backlog? | `specs/backlog/backlog.md` |
15
+ | Phase tasks/progress? | `specs/phases/phase-N-*/tasks.md` |
16
+ | Why was X chosen? | `specs/decisions/NNNN-*.md` |
17
+ | Roadmap / timeline? | `specs/planning/roadmap.md` |
18
+ | How to contribute? | `docs/developer-guide.md` |
19
+
20
+ > **First file to read: ALWAYS `specs/status.md`.**
21
+
22
+ ---
23
+
24
+ ## Momentum Recipes — Codex Skills
25
+
26
+ Each momentum recipe ships as a native Codex skill at
27
+ `.agents/skills/<name>/SKILL.md` ([Codex skills
28
+ docs](https://developers.openai.com/codex/skills)). Codex auto-discovers
29
+ skills under `.agents/skills/` at session start across CLI, IDE, and
30
+ desktop app — so when the user invokes `/brainstorm-phase`, asks "run
31
+ brainstorm-phase", or types `$brainstorm-phase`, Codex routes directly
32
+ to that skill.
33
+
34
+ The shipped recipe set (one skill per recipe, all under
35
+ `.agents/skills/`):
36
+
37
+ | Recipe | What it does |
38
+ |---|---|
39
+ | brainstorm-idea | Explore an idea before scaffolding anything |
40
+ | brainstorm-phase | Plan the next implementation phase (gate-protected) |
41
+ | start-project | Scaffold a new spec-driven project |
42
+ | start-phase | Begin a planned phase (autonomous execution contract) |
43
+ | complete-phase | Verify, retro, release a finished phase |
44
+ | sync-docs | Propagate history entries to other spec docs |
45
+ | track | Track a backlog item (bug / feature / tech debt / enhancement) |
46
+ | review | Review and groom the backlog between phases |
47
+ | log | Append a manual narrative entry to the history of the phase bound to your branch (fallback: status.md) |
48
+ | migrate | Onboard an existing project into momentum |
49
+ | validate | Check spec structure health |
50
+ | ecosystem | Cross-repo ecosystem coordination |
51
+ | initiative | Manage cross-repo initiatives |
52
+ | session | Append a manual narrative entry to today's ecosystem session log |
53
+ | systematic-debug | Systematically isolate, reproduce, and resolve task execution failures |
54
+ | scout | Read-only context fetch from one ecosystem member repo |
55
+ | dispatch | Parallel multi-repo fan-out + synthesis |
56
+ | handoff | Cross-session control transfer with structured context block |
57
+ | continue | Pick up a pending handoff in this repo |
58
+ | review-code | Multi-perspective code review (uses momentum-reviewer-* subagents) |
59
+ | swarm | Sustained parallel multi-project feature delivery (uses swarm-supervisor subagent) |
60
+ | momentum-orient | Read `specs/status.md` before starting any work (Rule 1) |
61
+
62
+ Each `SKILL.md` declares `name` + `description` frontmatter and includes
63
+ the full recipe body. The recipes are platform-independent — they
64
+ describe what to do, not how Codex specifically should do it. When you
65
+ read a recipe that mentions "use the Task tool" (Claude Code
66
+ terminology), translate to Codex's equivalent: spawn the relevant
67
+ `momentum-reviewer-*` subagent (see below), or use natural-language
68
+ parallel fan-out.
69
+
70
+ > Legacy installs from momentum ≤ v0.20.0 shipped recipes as Markdown
71
+ > fragments under `.codex/commands/`. `momentum upgrade --agent codex`
72
+ > regenerates skills under `.agents/skills/` and removes the old
73
+ > lookup directory.
74
+
75
+ ## Codex Subagents
76
+
77
+ Momentum ships four subagents discoverable at `.codex/agents/`:
78
+
79
+ - `momentum-reviewer-security.toml` — OWASP/STRIDE-focused
80
+ - `momentum-reviewer-qa.toml` — test coverage + edge cases + regression risk
81
+ - `momentum-reviewer-architecture.toml` — rule compliance + pattern consistency
82
+ - `swarm-supervisor.toml` — Phase 18 / v0.20.4. Per-repo supervisor spawned by `/swarm start`. Drives one repo's phase to completion under a pinned cwd (see MCP cwd shim section below).
83
+
84
+ The three reviewers each declare `sandbox_mode = "read-only"` so they
85
+ cannot modify the codebase. The `review-code` recipe dispatches all
86
+ three in a single turn so Codex can fan them out in parallel (subject
87
+ to `agents.max_threads`, default 6). The swarm supervisor does not
88
+ declare a read-only sandbox — supervisors write code, that's the job.
89
+
90
+ To add a project-specific reviewer, drop another `*.toml` into
91
+ `.codex/agents/` with required keys `name`, `description`,
92
+ `developer_instructions`. Optionally set `sandbox_mode = "read-only"` if
93
+ the subagent shouldn't modify files.
94
+
95
+ ## Codex Hooks
96
+
97
+ Codex hook wiring lives in `.codex/hooks.json`. Momentum installs reusable
98
+ shell scripts to `scripts/` and references them from this file:
99
+
100
+ | Event | Matcher | Script | Purpose |
101
+ |---|---|---|---|
102
+ | `PreToolUse` | `apply_patch\|Bash` | `scripts/brainstorm-gate.sh` | Blocks writes to `specs/` while a `/brainstorm-*` session is active (sentinel `.momentum/brainstorm-active`). Exits 2 to block. |
103
+ | `PostToolUse` | `apply_patch\|Bash` | `scripts/check-history-reminder.sh` | Prompts for `history.md` append when meaningful edits land during phase work — resolved to the phase bound to the current branch (fallback: `status.md`) (Rule 8). |
104
+ | `SessionStart` | (none) | `scripts/sessionstart-handoff.sh` | Auto-greets with any pending handoff banner + ecosystem context. |
105
+
106
+ > Matcher uses `Bash` (not `shell`) because that's the canonical
107
+ > `tool_name` Codex emits for shell tool calls — see the [Codex hooks
108
+ > reference](https://developers.openai.com/codex/hooks).
109
+
110
+ ### Trust review
111
+
112
+ Hooks are **enabled by default** in current Codex CLI (`hooks` is `stable`
113
+ in `codex features list`). The first time momentum's hooks run in a fresh
114
+ project, Codex prompts you to review and trust them via `/hooks`. Trust is
115
+ recorded per-hash, so any change to the hook command requires re-approval.
116
+
117
+ If hooks don't appear to fire:
118
+
119
+ 1. Run `/hooks` inside Codex and confirm `brainstorm-gate.sh`,
120
+ `check-history-reminder.sh`, and `sessionstart-handoff.sh` are listed
121
+ and marked trusted.
122
+ 2. Run `codex doctor` and confirm `hooks` shows as `stable: true`.
123
+ 3. Only as a last resort, force-enable in `~/.codex/config.toml`:
124
+
125
+ ```toml
126
+ [features]
127
+ hooks = true
128
+ ```
129
+
130
+ The `brainstorm-gate.sh` script resolves the project root from
131
+ `CLAUDE_PROJECT_DIR` → `MOMENTUM_PROJECT_DIR` → `pwd`, so Codex's default
132
+ cwd-as-session-root behavior works without env-var configuration.
133
+
134
+ ## Codex Skills
135
+
136
+ All momentum recipes ship as Codex skills under `.agents/skills/<name>/SKILL.md`
137
+ (see the "Momentum Recipes — Codex Skills" section above for the full
138
+ shipped set). Each `SKILL.md` declares `name` + `description` frontmatter
139
+ per the [Codex skills format](https://developers.openai.com/codex/skills).
140
+
141
+ Add additional project-specific skills under
142
+ `.agents/skills/<name>/SKILL.md` following the same convention. Invoke
143
+ via the `/skills` picker or `$<skill-name>` mention.
144
+
145
+ ## Swarm — Lookup Pattern
146
+
147
+ Momentum's swarm primitive — sustained parallel multi-project feature
148
+ delivery — ships on Codex as of Phase 18 / v0.20.4. The swarm recipe
149
+ lives as a Codex skill at `.agents/skills/swarm/SKILL.md`; Codex
150
+ auto-discovers and routes `/swarm <sub>` to it.
151
+
152
+ The CLI floor is `momentum swarm <sub> [args]`. The slash command and
153
+ the CLI produce the same on-disk artifacts — pick whichever fits the
154
+ moment.
155
+
156
+ | Subcommand | What it does |
157
+ |---|---|
158
+ | `start` | Plan + spawn Wave 1. Presents wave plan for approval before any spawn. |
159
+ | `status` | Render the materialized board cache. Read-only. |
160
+ | `tell` | Push a one-shot context note to one supervisor (`swarm-context.md`). |
161
+ | `broadcast` | Push context to every supervisor in the swarm. |
162
+ | `verify` | Contract verifier + manifest+brief drift check. |
163
+ | `complete` | Synthesize the cross-repo changeset and finalize the swarm. |
164
+ | `resume` | Re-attach this session to a swarm; renews owned leases. |
165
+ | `cancel` | Graceful halt; preserves all artifacts for forensics. |
166
+ | `budget` | Adjust a per-repo token budget. |
167
+ | `claim` | Multi-session ownership primitive (Phase 17.5). |
168
+ | `release` | Release ownership; idempotent. |
169
+ | `focus` | Issue a single-use focus token to hand a repo to a side session. |
170
+ | `join` | Register a second session as co-conductor; optionally consume a token. |
171
+ | `absorb` | Converge two swarms back into one (forensic-preserving). |
172
+ | `inbox` | Supervisor → conductor questions (`list` / `write` / `resolve`). |
173
+ | `preview-merge` | Dry-run `git merge --no-commit` per supervisor branch. |
174
+
175
+ **Supervisor declaration**: `.codex/agents/swarm-supervisor.toml`. Each
176
+ supervisor reads `core/swarm/supervise.md` end-to-end on boot. The
177
+ conductor (this user session) dispatches spawns through
178
+ `adapters/codex/adapter.js::spawn(directive)` — which shells
179
+ `codex --cwd <repoPath>` with the supervisor TOML.
180
+
181
+ If `codex` CLI isn't on PATH, `momentum swarm start --spawn` degrades
182
+ to dry-run: it prints the spawn directives so the user can launch
183
+ sessions manually.
184
+
185
+ ## MCP cwd shim — Codex configuration
186
+
187
+ > Phase 18 / v0.20.4. Required for the swarm primitive to honor the
188
+ > per-repo cwd pin every supervisor needs.
189
+
190
+ Each supervisor must run with its `repoPath` as its working directory —
191
+ that's the hard invariant the supervise.md recipe is written against
192
+ (every "stay in repoPath, never cd out" guard in `swarm-supervisor.toml`).
193
+
194
+ Codex's CLI accepts `--cwd <path>` for each `codex` invocation, so the
195
+ conductor's spawn call honors cwd at process boundary. Inside a
196
+ supervisor session, momentum relies on Codex's MCP filesystem server to
197
+ keep file ops scoped to that cwd — which means you (the user) configure
198
+ the MCP filesystem server's `--root` to follow `$PWD`.
199
+
200
+ In `~/.codex/config.toml` add:
201
+
202
+ ```toml
203
+ [mcp_servers.filesystem]
204
+ command = "npx"
205
+ args = ["-y", "@modelcontextprotocol/server-filesystem", "${PWD}"]
206
+ ```
207
+
208
+ (See [Codex MCP servers](https://developers.openai.com/codex/mcp) for
209
+ the canonical form. `${PWD}` is interpolated by Codex at server-spawn
210
+ time, so each supervisor sees its own pinned `repoPath` as the
211
+ filesystem server root.)
212
+
213
+ **Verifying the shim**: inside a supervisor session, run:
214
+
215
+ ```bash
216
+ pwd
217
+ ls -la
218
+ ```
219
+
220
+ You should see `repoPath` and the repo's top-level contents, not the
221
+ ecosystem root. If you see the ecosystem root, the shim isn't applied —
222
+ exit and reconfigure before launching supervisors.
223
+
224
+ **If the doc-only shim doesn't hold on your Codex version**: file a
225
+ bug against momentum and fall back to running each supervisor in a
226
+ separate terminal with `cd <repoPath> && codex …` — a manual cwd pin.
227
+ This is the documented escalation point referenced in Phase 18 G1
228
+ plan.md; if the MCP shim is widely broken, momentum will ship a
229
+ minimal `core/swarm/mcp-cwd-server.js` in a follow-up.
230
+
231
+ ## Autonomous Behaviors (Always-On Rules)
232
+
233
+ ### Rule 1: Always Orient First
234
+
235
+ Before ANY work, read `specs/status.md`. This tells you:
236
+ - What phase is active
237
+ - What's blocking progress
238
+ - What P0 items need attention
239
+
240
+ ### Rule 2: Auto-Update Tracking After Changes
241
+
242
+ After completing ANY meaningful work, automatically update:
243
+
244
+ 1. **Your phase's `tasks.md`** (the phase bound to your branch — Rule 15) — mark completed `[x]`, in-progress `[/]`
245
+ 2. **`specs/status.md`** — if phase progress, blockers, or P0 items changed (touch only your own lane's row — Rule 15)
246
+ 3. **`specs/changelog/YYYY-MM.md`** — log what changed (one line per change, append-only)
247
+
248
+ Use the built-in **plan** tool to track in-session task progress. Do NOT wait for the user to ask you to update tracking.
249
+
250
+ #### Why
251
+ Tracking debt compounds invisibly. A task list one day stale is recoverable; one week stale is fiction. Status drift is how phases silently lose direction.
252
+
253
+ #### Red Flags — STOP and update tracking now
254
+
255
+ | If you find yourself thinking… | …STOP and update before doing anything else |
256
+ |---|---|
257
+ | "I'll batch the tracking updates at the end" | The end never comes — context fades and details get lost |
258
+ | "This change is too small to log" | Small changes accumulate into invisible drift |
259
+ | "The diff makes it obvious what changed" | The diff shows *what*; the changelog explains *why* |
260
+ | "The user can read git log" | Git log doesn't index by phase or backlog ID |
261
+ | "I'll log this as part of the next bigger update" | Bigger updates conflate decisions and lose per-step reasoning |
262
+
263
+ #### Anti-Rationalization Counters
264
+
265
+ - "It's faster to do the work first and track at the end" — wrong: reconstruction takes 2-3× longer than real-time logging.
266
+ - "The plan tool is enough" — The plan tool is in-session only; `tasks.md` is the durable record.
267
+ - "Mid-task tracking interrupts flow" — a one-line update costs <30s; reconstructing a day later costs 30 minutes.
268
+
269
+ ### Rule 3: Auto-Track Discoveries
270
+
271
+ When you discover a bug, tech debt, or enhancement during work:
272
+ - Add it to `specs/backlog/backlog.md` immediately with appropriate priority
273
+ - Mention it to the user: "I found [issue] and added it as [ID] to backlog"
274
+
275
+ ### Rule 4: Pre-Phase Bug Check
276
+
277
+ Before starting work on a new phase:
278
+ - Scan `specs/backlog/backlog.md` for P0/P1 bugs
279
+ - If any exist, recommend addressing them first
280
+ - Present: "N open bugs (X critical), recommend fixing before proceeding"
281
+
282
+ Starting a phase while other lanes are active is normal (Rule 15) — the bug
283
+ check still runs per phase start.
284
+
285
+ ### Rule 5: Phase Boundary Awareness
286
+
287
+ When completing the last task in a phase:
288
+ - Prompt the user: "All tasks in Phase N are complete. Run `/complete-phase` to verify and release?"
289
+ - Do NOT auto-complete a phase without user confirmation
290
+ - "Complete" means the phase bound to YOUR branch (Rule 15); landing it on
291
+ `main` follows the Rule 6 landing order when other lanes are in flight
292
+
293
+ ### Rule 6: Git Lifecycle
294
+
295
+ > **Enforced vs advised.** momentum installs git hooks that *enforce* the
296
+ > high-stakes parts of this lifecycle (see `core/lifecycle-contract.md`):
297
+ > `commit-msg` validates Conventional Commits; `pre-push` blocks direct pushes
298
+ > to `main`/`staging` without the single-use `.momentum/merge-approved`
299
+ > sentinel, and blocks release-tag pushes lacking verification evidence
300
+ > (Rule 12). Hooks install to `.githooks/` via `core.hooksPath`. Emergency
301
+ > bypass (auditable, preferred over `--no-verify`): `MOMENTUM_SKIP_HOOKS=1`.
302
+ > Everything else below is agent convention, not mechanism.
303
+ >
304
+ > *Optional hardening:* enable your forge's server-side branch protection
305
+ > (GitHub Rulesets / GitLab protected branches / Bitbucket permissions) as an
306
+ > unbypassable backstop. momentum stays forge-neutral and ships no forge code.
307
+
308
+ #### Starting Work
309
+ - **Before ANY code change**, check current branch
310
+ - If on `main` or `staging`, **auto-create a feature branch**:
311
+ - Phase work: `phase-N-shortname`
312
+ - Bug fix: `fix/BUG-NNN-short-desc`
313
+ - Feature: `feat/short-desc`
314
+ - Tech debt: `refactor/TD-NNN-short-desc`
315
+
316
+ #### During Work
317
+ - **Auto-commit** after each logical unit with conventional commits:
318
+ - `feat(scope):` | `fix(scope):` | `docs:` | `refactor(scope):` | `chore:` | `infra:`
319
+ - Keep commits atomic — one logical change per commit
320
+ - Push to remote after significant milestones
321
+
322
+ #### Completing Work
323
+ - Commit all remaining changes, push branch
324
+ - **ASK the user** before merging to `staging` or `main`
325
+
326
+ | Action | Agent does automatically | Needs approval | Hook enforcement |
327
+ |--------|--------------------------|----------------|------------------|
328
+ | Create feature branch | Yes | No | — (convention) |
329
+ | Commit to feature branch | Yes | No | `commit-msg` validates the message |
330
+ | Push feature branch | Yes | No | `pre-push` allows (non-protected) |
331
+ | Delete merged feature branch | Yes (after confirmed merge) | No | `/complete-phase` step 13 |
332
+ | Merge to `staging`/`main` | No | **Yes** | `pre-push` **blocks** without `.momentum/merge-approved` |
333
+ | Tag a release | No | **Yes** | `pre-push` **blocks** without verification evidence |
334
+
335
+ #### Landing Order — Concurrent Lanes (Rule 15)
336
+
337
+ When more than one lane is in flight, `main` is the runway — lanes land
338
+ **one at a time**:
339
+
340
+ 1. One lane merges (with its approval gate above).
341
+ 2. The full suite runs green on the updated `main` **before** the next landing.
342
+ 3. Remaining lanes **rebase onto the updated `main`** before they land.
343
+ 4. Stacked (dependent) lanes land parent-first; a child rebases onto its
344
+ parent until the parent lands, then onto `main`.
345
+
346
+ Never land two lanes back-to-back without the suite passing in between — a
347
+ green suite on each lane's branch does not prove the *combination* is green.
348
+
349
+ #### Why
350
+ Direct commits to `main` bypass review, history, and rollback. A single rushed commit on `main` is harder to revert than ten commits on a branch. The branch convention is the cheapest possible insurance against catastrophic mistakes.
351
+
352
+ #### Red Flags — STOP and check the branch
353
+
354
+ | If you find yourself thinking… | …STOP and switch to a branch |
355
+ |---|---|
356
+ | "Just one tiny commit to main" | One becomes ten — branch first, decide later |
357
+ | "I'll create the branch after these edits" | The edits are the work; the branch is non-optional |
358
+ | "The hook is in the way, --no-verify just this once" | The momentum hooks are real now. Fix the cause; for a genuine emergency use the auditable `MOMENTUM_SKIP_HOOKS=1`, never blanket `--no-verify`. |
359
+ | "Force push is fine, nobody else is on this branch" | Future you is on this branch. `--force-with-lease` at minimum. |
360
+
361
+ #### Anti-Rationalization Counters
362
+
363
+ - "It's a one-line typo fix on main" — branches are free; revert is cheap; main is sacred.
364
+ - "The branch protection isn't set up yet" — that's a reason to be more careful, not less.
365
+ - "I'll squash-merge later, so the intermediate commits don't matter" — they matter for `git bisect` and for narrating *why*.
366
+
367
+ ### Rule 7: Plan Before Implementing
368
+
369
+ For any non-trivial implementation (new feature, architectural change):
370
+ - Use `/brainstorm-phase` to design the approach first
371
+ - Present the plan for user approval before making changes
372
+
373
+ ### Rule 8: Record Phase History
374
+
375
+ While working on a phase, append meaningful changes to that phase's history log — `specs/phases/<phase-bound-to-your-branch>/history.md` (Rule 15; each lane writes only its own history).
376
+
377
+ #### What counts as "meaningful"
378
+
379
+ Append a history entry when ANY of these occur:
380
+
381
+ | Trigger | Entry type |
382
+ |---|---|
383
+ | ADR was created or its status/decision changed | `[DECISION]` |
384
+ | Phase scope was added to or reduced | `[SCOPE_CHANGE]` |
385
+ | Bug, tech debt, or enhancement was added to backlog | `[DISCOVERY]` |
386
+ | New feature was added to the phase plan | `[FEATURE]` |
387
+ | Architectural pattern or integration approach changed | `[ARCH_CHANGE]` |
388
+ | Locked evaluator was defined or its evaluation set changed | `[EVALUATOR]` |
389
+ | Anything else worth a future reader's time | `[NOTE]` |
390
+
391
+ After writing a history entry, check `specs/decisions/impact-map.md` and add any new topics so `/sync-docs` can find affected files.
392
+
393
+ The hook script `scripts/check-history-reminder.sh` runs after edits as a safety net — heed its prompts.
394
+
395
+ #### Format (APPEND ONLY)
396
+
397
+ ```
398
+ ### [TYPE] YYYY-MM-DD — Short title
399
+ Topics: topic-1, topic-2
400
+ Affects-phases: phase-N-name (or "none")
401
+ Affects-specs: path/to/file.md#section (or "none")
402
+ Detail: One to three sentences describing what changed and why.
403
+
404
+ ---
405
+ ```
406
+
407
+ #### Why
408
+ The history log is the only place that preserves *why* a decision was made at the moment it was made. Specs document the current state; commits document mechanical changes; only history captures motivation. Without it, six months later nobody can reconstruct whether a constraint is load-bearing or accidental.
409
+
410
+ #### Red Flags — STOP and log
411
+
412
+ | If you find yourself thinking… | …STOP and append the entry now |
413
+ |---|---|
414
+ | "I'll write the history at the end of the phase" | You won't remember the *why*. Log when the decision is fresh. |
415
+ | "This decision isn't important enough to log" | If it's not worth logging, it's not worth deciding — log it or revert it. |
416
+ | "I already mentioned it in the commit message" | Commit messages get buried; history.md is the canonical source. |
417
+ | "The change is obvious from the diff" | Diffs show *what*; history shows *why*. |
418
+
419
+ #### Anti-Rationalization Counters
420
+
421
+ - "We didn't decide anything — just discovered an issue" — that's `[DISCOVERY]`, log it.
422
+ - "It's a minor scope tweak, not a real `[SCOPE_CHANGE]`" — every scope change is real, log it.
423
+ - "I'll consolidate entries later" — consolidation loses per-decision context.
424
+
425
+ ### Rule 9: Doc Sync Protocol — Never Mid-Phase, Always at Completion
426
+
427
+ - **During a phase**: Record to history. Do NOT update other specs.
428
+ - **At phase completion**: Run `/sync-docs` BEFORE `/complete-phase`.
429
+
430
+ #### Multi-repo projects only
431
+
432
+ If this project depends on, or is depended on by, other repos in a parent workspace:
433
+ - NEVER modify docs that live in another repo during `/sync-docs`. You only own this repo's docs.
434
+ - If a history entry's `Affects-specs:` path starts with `../` (or otherwise points outside this repo), leave that file alone.
435
+ - Flag the cross-repo impact to the user — give the exact path — so they can sync the other repo manually.
436
+ - Cross-repo doc ownership is a structural choice. Never quietly change docs you don't own.
437
+
438
+ ### Rule 10: Architecture Specs Stability (monorepo only)
439
+
440
+ Files under `specs/architecture/` are constitutional documents. Treat them as a stable reference *during* phase work. The key distinction is **additive bookkeeping** vs **architectural decisions**.
441
+
442
+ **During phase implementation (both types — no spec changes):**
443
+ - READ specs as stable reference
444
+ - NEVER modify them based on implementation discoveries
445
+ - Log all gaps and changes as `[ARCH_CHANGE]` in phase history with `Affects-specs:`
446
+
447
+ **At phase completion (via `/sync-docs`):**
448
+ - **Additive changes** (new fields, new ports, new modes — extending an existing design): update specs directly. No ADR required.
449
+ - **Decisional changes** (approach changes, trade-off choices, design direction shifts): require an ADR amendment **before** any spec update.
450
+
451
+ #### Why
452
+ The original "all spec changes via ADR" rule worked when the architecture was stabilizing and every change was a decision. By mid-to-late phases, the architecture is proven — most changes are additive extensions, not decisions. Requiring ADRs for bookkeeping creates spec staleness while adding no value. ADRs capture *why* a path was chosen; they're not required when you're just recording *what was added*.
453
+
454
+ #### Red Flags — STOP and route correctly
455
+
456
+ | If you find yourself thinking… | …STOP |
457
+ |---|---|
458
+ | "I just need to update one field, not a real change" | Additive — fine at completion; not now. Log `[ARCH_CHANGE]`. |
459
+ | "It's faster to fix the spec than to log the gap" | Faster locally, catastrophic globally — specs out of sync with rationale. |
460
+ | "The implementation diverged because the spec was wrong" | That's a decision — ADR first, spec update second. Don't silently rewrite. |
461
+ | "I'll log it as `[NOTE]` instead of `[ARCH_CHANGE]`" | If it touches `specs/architecture/`, it's `[ARCH_CHANGE]`. |
462
+
463
+ #### Anti-Rationalization Counters
464
+
465
+ - "Specs are wrong, code is right, so update specs" — only after an ADR documents *why* the design shifted.
466
+ - "Mid-phase spec edits are fine if I'm careful" — the rule isn't about care; it's about preventing reference instability while you're depending on the reference.
467
+ - "This is just renaming, not redesigning" — renames are decisions when others read the spec.
468
+
469
+ ### Rule 11: Evaluator Discipline — Lock Evaluators Before Loops
470
+
471
+ Before building any learning, optimization, or self-improvement loop:
472
+
473
+ 1. Define the **evaluation set** — a fixed corpus with known-good outputs
474
+ 2. Define the **scalar** — a single number that improves or doesn't
475
+ 3. Commit the evaluator to `tests/benchmarks/` with a version tag
476
+ 4. Build the loop **AFTER** the evaluator is committed
477
+ 5. **NEVER** change the evaluator while the loop is being optimized
478
+
479
+ #### Why
480
+ Optimization loops with mutable evaluators don't measure progress — they measure motion. Every "small fix" to the eval set silently rewrites the score history and makes A-vs-B comparisons meaningless. Locking the evaluator first costs an hour; not locking it costs the entire experiment.
481
+
482
+ #### Red Flags — STOP and freeze
483
+
484
+ | If you find yourself thinking… | …STOP |
485
+ |---|---|
486
+ | "Just one tweak to the eval so this run looks better" | That's exactly the failure mode. Freeze first; tweak in a v2 evaluator. |
487
+ | "We'll lock the evaluator after we know what works" | You can't know what works without a locked evaluator. |
488
+ | "The current eval doesn't measure what we actually care about" | Correct — but freeze it before optimizing, then version-bump to a new locked eval. |
489
+ | "It's just an internal experiment, locking is overkill" | Internal experiments produce internal beliefs that drive external decisions. Lock. |
490
+
491
+ #### Anti-Rationalization Counters
492
+
493
+ - "The eval set is too small, I'll just add a few more cases" — version-bump the evaluator (`v1` → `v2`); don't mutate `v1`.
494
+ - "I noticed a bug in the scorer mid-run" — fix it in `v2`; rerun the prior runs against `v2`; don't backfill `v1` scores.
495
+ - "Production data drifted, I should refresh the eval" — that's a `v2` decision, not a `v1` patch.
496
+
497
+ ### Rule 12: Verify Before Claim — No Completion Without Evidence
498
+
499
+ Before claiming any task, fix, or implementation is "done":
500
+
501
+ 1. Run the actual verification command (test, lint, typecheck, smoke test, build)
502
+ 2. Read the output — both exit code and content
503
+ 3. If the output isn't fresh from this attempt in this session, treat the task as unverified
504
+ 4. Only mark a task `[x]` after a verification command produced passing output in this session
505
+
506
+ #### Why
507
+ The most common agentic-workflow failure is "should work now" — claiming completion based on intent rather than evidence. Fresh, observable output is the only signal that the change actually achieves what was claimed. Box-checking without verification compounds across phases until shipped releases contain unrun code paths.
508
+
509
+ #### Red Flags — STOP and run the verification
510
+
511
+ | If you find yourself thinking… | …STOP and run the verification before marking done |
512
+ |---|---|
513
+ | "I'm confident this works — no need to test" | Confidence is not evidence. Run the test. |
514
+ | "The change is small enough that I can skip verification" | "Small" is the most common predicate of a regression. Run it. |
515
+ | "I already tested something similar earlier" | Earlier ≠ now. Re-run against the current code. |
516
+ | "The unit tests pass — that's enough" | Unit tests don't catch wiring bugs. Run the integration / smoke path too. |
517
+ | "I'll batch verifications at the end of the phase" | At the end you can't tell which change caused which failure. Verify per-task. |
518
+
519
+ #### Anti-Rationalization Counters
520
+
521
+ - "The diff is obviously correct" — diffs lie when context is incomplete. Run the test.
522
+ - "The CI will catch any issue" — CI catches it after you claimed done; that's the failure mode this rule prevents.
523
+ - "Type checking passed, so it works" — types catch shape errors, not behavior. Run the runtime check.
524
+ - "I read the code carefully and it looks right" — careful reading misses race conditions, missing imports, off-by-one bugs. Verification commands don't.
525
+ - "The previous task was similar and that worked" — previous ≠ current. Each task gets its own verification.
526
+
527
+ If a verification command does not exist for the task, write one before marking done. If a command can't run in the current environment, say so explicitly — do not silently downgrade to "looks correct".
528
+
529
+ ---
530
+
531
+ ### Rule 13: Test-Driven Development (TDD) — Opt-in
532
+
533
+ If enabled in the project rules extensions (under `## Project Extensions` in this file), follow a strict test-first development loop:
534
+
535
+ 1. **Red**: Write a unit or integration test that specifies the new behavior *before* writing any application code.
536
+ 2. **Verify Failure**: Run the test runner and verify that the newly added test fails. Do not write any implementation code until you have seen the test fail.
537
+ 3. **Green**: Write the minimal application code necessary to make the test pass.
538
+ 4. **Refactor**: Clean up and optimize the code while keeping all tests green.
539
+
540
+ #### Red Flags — STOP and write the test first
541
+
542
+ | If you find yourself thinking… | …STOP |
543
+ |---|---|
544
+ | "I will write the tests at the end" | Post-facto tests are not TDD — they inherit confirmation bias from the implementation. |
545
+ | "The change is too simple to warrant a test-first approach" | Simple changes are excellent TDD candidates to establish correct wiring. |
546
+
547
+ ### Rule 14: Work-Type Escalation — Pick the Lightest Type That Fits
548
+
549
+ Not every change is a phase. momentum has three work types (see
550
+ `specs/adhoc/README.md`):
551
+
552
+ | Type | When | How |
553
+ |---|---|---|
554
+ | `phase` | Net-new features; cross-cutting or architectural work | `/brainstorm-phase` → `/start-phase` → … → `/complete-phase` |
555
+ | `quick-task` | A bounded bugfix / chore / audit / dependency bump | `/hotfix` — ad-hoc record + Rule 12 gate, no phase scaffold |
556
+ | `spike` | Time-boxed, throwaway exploration | `/hotfix --spike` — declared, gate-exempt, record what was learned |
557
+
558
+ **Governing principle:** select the lightest work type that fits; escalate only
559
+ when scope/risk/cross-cutting impact justifies it. (Per Anthropic's "build the
560
+ simplest thing first; add structure only when it demonstrably helps.")
561
+
562
+ **A quick-task MUST escalate to a phase when it:** touches more than ~5 files of
563
+ production code, modifies anything under `specs/architecture/`, needs an ADR,
564
+ changes a public contract/interface, or displaces a planned phase.
565
+
566
+ #### Red Flags — STOP and escalate (or de-escalate)
567
+
568
+ | If you find yourself thinking… | …STOP |
569
+ |---|---|
570
+ | "This `/hotfix` is growing — I'll just keep going" | If it now touches architecture or many files, it's a phase. Escalate. |
571
+ | "I'll spin up a whole phase for this one-line fix" | Over-ceremony. A `/hotfix` quick-task is the right size. |
572
+ | "It's exploratory but I'll ship it straight to main" | A spike is gate-exempt *because* it's throwaway. Harden it as a quick-task first. |
573
+
574
+ ### Rule 15: Concurrent Workstreams — Lanes
575
+
576
+ Multiple workstreams may be active in one repo at the same time (see
577
+ ADR-0001). A **lane** is one workstream: a branch (usually in its own
578
+ worktree) bound to one phase or ad-hoc record.
579
+
580
+ #### Lane binding — which phase is yours
581
+
582
+ - Your phase is **the phase bound to your branch**: branch
583
+ `phase-N-shortname` ↔ directory `specs/phases/phase-N-shortname/`.
584
+ - `specs/status.md`'s Active Phase table is the **fallback and the
585
+ cross-lane overview** — read it to see what else is in flight, not to
586
+ decide which phase is yours.
587
+ - Non-phase branches (`fix/*`, `chore/*`, `feat/*`) bind to the ad-hoc lane
588
+ (`specs/adhoc/`, Rule 14). Detached HEAD → fall back to `status.md`.
589
+
590
+ #### Lane-scoped tracking
591
+
592
+ - Write ONLY your own phase's artifacts (`tasks.md`, `history.md`,
593
+ `evidence/`) — these are parallel-safe by construction.
594
+ - Shared tracking files (`status.md`, `backlog.md`, `changelog/`) are
595
+ **append / own-row-touch only** from a lane: add or edit your own
596
+ row/line; never reformat, renumber, or rewrite other lanes' entries.
597
+ - The Active Phase table holds **one row per active lane**
598
+ (Phase | Branch | Status | Progress). Add your row at phase start; update
599
+ only your row; mark it at completion.
600
+
601
+ #### Landing
602
+
603
+ Lanes integrate per the Rule 6 **Landing Order** — one lane at a time, suite
604
+ green on updated `main` between landings, remaining lanes rebase.
605
+
606
+ **Mechanism:** `momentum lanes` — open/board/queue/signal/inbox/done/land
607
+ (see the `/lanes` recipe). The board shows every lane + queue pressure from
608
+ any session; `lanes land` enforces turn, rebase-freshness, and the
609
+ Rule-14-graded evidence gate before merging.
610
+
611
+ #### Off-lane work
612
+
613
+ Brainstorms and spikes are **off-lane** — zero tracking contention by
614
+ design. `/brainstorm-idea` writes no files; a spike writes only its own
615
+ `specs/adhoc/<id>/` record. Neither touches the Active Phase table.
616
+
617
+ #### Why
618
+ Two concurrent sessions cannot both be right about "the active phase" when
619
+ the spec layer models exactly one. Binding phase to branch makes each
620
+ session's context unambiguous, and append-only discipline on shared files
621
+ keeps N lanes trivially mergeable. Git isolation (worktrees) was never the
622
+ problem — the spec layer was.
623
+
624
+ #### Red Flags — STOP and re-scope to your lane
625
+
626
+ | If you find yourself thinking… | …STOP |
627
+ |---|---|
628
+ | "I'll just fix this line in the other phase's tasks.md while I'm here" | That's another lane's artifact. Leave it; tell the user or file a backlog item. |
629
+ | "status.md is stale for that other lane, I'll update their row" | Their session owns that row. Touch only your own. |
630
+ | "I'll reformat the Active Phase table while adding my row" | Reformatting rewrites every lane's row — append yours, change nothing else. |
631
+ | "Which phase am I on? I'll take status.md's first row" | Your branch decides your phase. status.md is the overview, not the binding. |
632
+ | "Both lanes are done, I'll merge them together to save a suite run" | One at a time; suite green between landings (Rule 6 Landing Order). |
633
+
634
+ #### Anti-Rationalization Counters
635
+
636
+ - "The other lane's edit is tiny and obviously right" — cross-lane edits are how tracking corrupts; smallness is irrelevant.
637
+ - "Rebasing my lane again is wasted work" — rebasing is the price of a green runway; a stale lane landing on moved `main` is how combination bugs ship.
638
+ - "There's only one lane active right now, Rule 15 doesn't apply" — a single lane is the N=1 case; the binding still defines which phase is yours.
639
+
640
+ ---
641
+
642
+ ## Naming Conventions
643
+
644
+ ### Backlog IDs
645
+ | Type | Prefix | Example |
646
+ |------|--------|---------|
647
+ | Bug | `BUG-` | `BUG-001` |
648
+ | Feature | `FEAT-` | `FEAT-001` |
649
+ | Tech Debt | `TD-` | `TD-001` |
650
+ | Enhancement | `ENH-` | `ENH-001` |
651
+
652
+ ### Priorities
653
+ | Level | Meaning | SLA |
654
+ |-------|---------|-----|
655
+ | `P0` | Critical — blocks current phase | < 1 day |
656
+ | `P1` | High — current/next phase | < 1 week |
657
+ | `P2` | Medium — within 2 phases | < 1 phase |
658
+ | `P3` | Low — nice to have | best-effort |
659
+
660
+ ### Git Branches
661
+ | Type | Pattern |
662
+ |------|---------|
663
+ | Phase | `phase-N-shortname` |
664
+ | Feature | `feat/description` |
665
+ | Bug fix | `fix/description` |
666
+ | Refactor | `refactor/description` |
667
+ | Infrastructure | `infra/description` |
668
+ | Delete after merge | `git push origin --delete <branch>` once merged |
669
+
670
+ ### Git Commits (Conventional)
671
+ `feat:` | `fix:` | `docs:` | `refactor:` | `chore:` | `infra:`
672
+
673
+ Also accepted by the `commit-msg` hook: `test:` `perf:` `build:` `ci:` `style:` `revert:` (standard Conventional-Commit types). Scope and breaking-change `!` are optional, e.g. `fix(install)!: …`.
674
+
675
+ Use `infra:` for CI, build, deploy, tooling, and release-pipeline changes that don't ship code.
676
+
677
+ ---
678
+
679
+ ## Constraints
680
+
681
+ 1. **No secrets in code** — all credentials via env vars
682
+ 2. **Never commit to main** — always use feature/phase branches
683
+ 3. **Plan before implementing** — use `/brainstorm-phase` for non-trivial work
684
+
685
+ ---
686
+
687
+ ## Project Extensions
688
+
689
+ > Everything below this heading is preserved across `momentum upgrade`.
690
+ > Add project-specific navigation, rules, cross-repo references, etc. here.
691
+ > Anything above this heading is managed by momentum and may be replaced on upgrade.