odd-studio 3.6.0 → 3.7.4

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.
@@ -12,16 +12,13 @@
12
12
  # swarm-write Write|Edit — blocks source writes without swarm + agent token
13
13
  # verify-gate Edit|Write — blocks marking outcomes verified without checklist
14
14
  # confirm-gate Edit|Write — blocks briefConfirmed without odd-flow store
15
- # checkpoint-gate Bash — blocks commits until a fresh Checkpoint scan clears the latest source changes
16
- # commit-gate Bash — blocks git commit without odd-flow state stored
17
15
  #
18
16
  # PostToolUse (exit 0 + stderr = coaching):
19
- # session-save Bash — auto-save state after git commit
20
- # store-validate mcp__odd-flow__memory_store — creates ready marker
21
- # sync-validate mcp__odd-flow__coordination_sync — creates agents-ready marker
17
+ # session-save Bash — updates last-commit metadata after git commit
18
+ # store-validate mcp__odd-flow__memory_store — touches brief-stored marker
19
+ # sync-validate mcp__odd-flow__coordination_sync — activates swarm markers
22
20
  # code-quality Write|Edit — code elegance check
23
- # security-quality Write|Edit — security baseline check + checkpoint dirty marker
24
- # checkpoint-validate Bash — marks checkpoint clear after a successful scan
21
+ # security-quality Write|Edit — security baseline warnings (non-blocking)
25
22
  # brief-quality Write — session brief quality check
26
23
  # outcome-quality Write — outcome/persona quality check
27
24
  #
@@ -85,7 +82,7 @@ is_source_file() {
85
82
  return 1
86
83
  fi
87
84
  # Non-source locations — allow
88
- if echo "$fp" | grep -qE '(\.odd/|docs/|memory/|MEMORY\.md|CLAUDE\.md|\.odd-flow)'; then
85
+ if echo "$fp" | grep -qE '(\.odd/|docs/|memory/|MEMORY\.md|CLAUDE\.md|\.odd-flow|\.claude/)'; then
89
86
  return 1
90
87
  fi
91
88
  # Hook/skill/script files — allow
@@ -176,6 +173,12 @@ swarm-write)
176
173
  exit 2
177
174
  fi
178
175
 
176
+ # Debug session bypass: orchestrator writes allowed when *debug mode is active
177
+ DEBUG_SESSION=$(get_state_field "debugSession")
178
+ if [ "$DEBUG_SESSION" = "true" ]; then
179
+ exit 0
180
+ fi
181
+
179
182
  # Gate 2: Agent write token must be fresh (120s TTL)
180
183
  # Only Task agents create this token — the orchestrator must NOT.
181
184
  if ! marker_valid ".odd/.odd-flow-agent-token" 120; then
@@ -223,11 +226,7 @@ verify-gate)
223
226
  exit 2
224
227
  fi
225
228
 
226
- if [ -f ".odd/.checkpoint-dirty" ] || [ ! -f ".odd/.checkpoint-clear" ]; then
227
- echo "ODD STUDIO [verify-gate]: Verification blocked — a fresh Checkpoint scan has not cleared the latest source changes." >&2
228
- echo "Run: npx @darrenjcoxon/vibeguard --security-only -o json" >&2
229
- exit 2
230
- fi
229
+ # Checkpoint pre-check removed in v3.7.3 (see checkpoint-gate note below).
231
230
 
232
231
  VERIFIED_CONFIRMED=$(get_state_field "verificationConfirmed")
233
232
  if [ "$VERIFIED_CONFIRMED" != "true" ]; then
@@ -239,27 +238,12 @@ verify-gate)
239
238
  ;;
240
239
 
241
240
  # ─────────────────────────────────────────────────────────────────────────────
242
- # PreToolUse: Bash blocks commit while checkpoint is dirty
241
+ # checkpoint-gateREMOVED in v3.7.3
242
+ # Vibeguard/Checkpoint was treating dependency-lockfile CVEs as equivalent to
243
+ # code vulnerabilities, making every commit impossible while any transitive
244
+ # dep had an open advisory. Re-introduce only with a scoped scanner that
245
+ # ignores lockfile-only findings.
243
246
  # ─────────────────────────────────────────────────────────────────────────────
244
- checkpoint-gate)
245
- [ "$TOOL_NAME" = "Bash" ] || exit 0
246
- [ "$CURRENT_PHASE" = "build" ] || exit 0
247
- COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
248
- echo "$COMMAND" | grep -qE 'git\s+commit' || exit 0
249
-
250
- if [ "$BUILD_MODE" = "debug" ]; then
251
- echo "ODD STUDIO [checkpoint-gate]: Commit blocked — debug mode is active." >&2
252
- echo "Resolve the failure, return to verify mode, then commit only after verification passes." >&2
253
- exit 2
254
- fi
255
-
256
- if [ -f ".odd/.checkpoint-dirty" ] || [ ! -f ".odd/.checkpoint-clear" ]; then
257
- echo "ODD STUDIO [checkpoint-gate]: Commit blocked — latest source changes have not passed Checkpoint." >&2
258
- echo "Run: npx @darrenjcoxon/vibeguard --security-only -o json" >&2
259
- exit 2
260
- fi
261
- exit 0
262
- ;;
263
247
 
264
248
  # ─────────────────────────────────────────────────────────────────────────────
265
249
  # PreToolUse: Edit|Write — blocks briefConfirmed without odd-flow store
@@ -272,7 +256,7 @@ confirm-gate)
272
256
  NEW_CONTENT=$(echo "$INPUT" | jq -r '.tool_input.new_string // .tool_input.content // empty')
273
257
  echo "$NEW_CONTENT" | grep -qE '"briefConfirmed"\s*:\s*true' || exit 0
274
258
 
275
- if [ ! -f ".odd/.odd-flow-brief-stored" ] && [ ! -f ".odd/.odd-flow-state-ready" ]; then
259
+ if [ ! -f ".odd/.odd-flow-brief-stored" ]; then
276
260
  echo "ODD STUDIO [confirm-gate]: Brief not stored in odd-flow memory. Store it first." >&2
277
261
  exit 2
278
262
  fi
@@ -280,26 +264,12 @@ confirm-gate)
280
264
  ;;
281
265
 
282
266
  # ─────────────────────────────────────────────────────────────────────────────
283
- # PreToolUse: Bash blocks git commit without odd-flow state stored
267
+ # commit-gateREMOVED in v3.7.4
268
+ # The dirty/ready marker treadmill was creating more friction than value.
269
+ # State persistence to odd-flow is now the orchestrator's responsibility at
270
+ # genuine persistence points (session end, outcome verified) rather than a
271
+ # hard-block on every commit.
284
272
  # ─────────────────────────────────────────────────────────────────────────────
285
- commit-gate)
286
- [ "$TOOL_NAME" = "Bash" ] || exit 0
287
- COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
288
- echo "$COMMAND" | grep -qE 'git\s+commit' || exit 0
289
- [ "$CURRENT_PHASE" = "build" ] || exit 0
290
-
291
- if [ ! -f ".odd/.odd-flow-state-ready" ]; then
292
- echo "" >&2
293
- echo "ODD STUDIO [commit-gate]: Commit blocked — odd-flow state not stored." >&2
294
- echo "Call mcp__odd-flow__memory_store key=odd-project-state first." >&2
295
- echo "" >&2
296
- exit 2
297
- fi
298
-
299
- # Marker consumed — next commit requires a fresh store
300
- rm -f ".odd/.odd-flow-state-ready"
301
- exit 0
302
- ;;
303
273
 
304
274
  # ─────────────────────────────────────────────────────────────────────────────
305
275
  # UserPromptSubmit — warns every turn if build phase without swarm
@@ -307,24 +277,11 @@ commit-gate)
307
277
  swarm-guard)
308
278
  [ "$CURRENT_PHASE" = "build" ] || exit 0
309
279
 
310
- # Gate 1: Dirty state (commit without odd-flow store)
311
- if [ -f ".odd/.odd-flow-state-dirty" ]; then
312
- echo ""
313
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
314
- echo "ODD STUDIO — STATE NOT SAVED TO ODD-FLOW"
315
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
316
- echo ""
317
- echo " A git commit was made but .odd/state.json was NOT stored to odd-flow."
318
- echo " DO THIS NOW:"
319
- echo " 1. mcp__odd-flow__memory_store key=odd-project-state namespace=odd-project upsert=true value=<.odd/state.json>"
320
- echo " 2. Bash: rm -f .odd/.odd-flow-state-dirty"
321
- echo ""
322
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
323
- echo ""
324
- exit 0
325
- fi
280
+ # Suppress all warnings during active debug session — reduced ceremony is the point
281
+ DEBUG_SESSION=$(get_state_field "debugSession")
282
+ [ "$DEBUG_SESSION" = "true" ] && exit 0
326
283
 
327
- # Gate 2: Swarm not initialised
284
+ # Swarm not initialised
328
285
  if marker_valid ".odd/.odd-flow-swarm-active" 86400; then
329
286
  exit 0
330
287
  fi
@@ -369,28 +326,14 @@ session-save)
369
326
  } catch(e) {}
370
327
  " 2>/dev/null
371
328
 
372
- # Refresh sync marker + set dirty marker
329
+ # Refresh phase sync marker. Dirty-marker touching removed in v3.7.4.
373
330
  touch .odd/.odd-flow-phase-synced 2>/dev/null
374
- touch .odd/.odd-flow-state-dirty 2>/dev/null
375
331
  exit 0
376
332
  ;;
377
333
 
378
334
  # ─────────────────────────────────────────────────────────────────────────────
379
- # PostToolUse: Bash refresh checkpoint markers after a successful scan
335
+ # checkpoint-validateREMOVED in v3.7.3 (see checkpoint-gate note above)
380
336
  # ─────────────────────────────────────────────────────────────────────────────
381
- checkpoint-validate)
382
- [ "$TOOL_NAME" = "Bash" ] || exit 0
383
- [ "$CURRENT_PHASE" = "build" ] || exit 0
384
- COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
385
- echo "$COMMAND" | grep -qE '@darrenjcoxon/vibeguard|vibeguard' || exit 0
386
-
387
- EXIT_CODE=$(echo "$INPUT" | jq -r '.tool_response.exit_code // .tool_output.exit_code // .exitCode // empty' 2>/dev/null || true)
388
- if [ -z "$EXIT_CODE" ] || [ "$EXIT_CODE" = "0" ]; then
389
- touch .odd/.checkpoint-clear 2>/dev/null
390
- rm -f .odd/.checkpoint-dirty 2>/dev/null
391
- fi
392
- exit 0
393
- ;;
394
337
 
395
338
  # ─────────────────────────────────────────────────────────────────────────────
396
339
  # PostToolUse: Write|Edit state.json — blocks phase transition without Steps 9, 9b, 9d
@@ -434,23 +377,27 @@ plan-complete-gate)
434
377
  ;;
435
378
 
436
379
  # ─────────────────────────────────────────────────────────────────────────────
437
- # PostToolUse: mcp__odd-flow__memory_storecreates ready marker
380
+ # state-dirty-markREMOVED in v3.7.4 (dirty/ready treadmill eliminated)
381
+ # ─────────────────────────────────────────────────────────────────────────────
382
+
383
+ # ─────────────────────────────────────────────────────────────────────────────
384
+ # PostToolUse: mcp__odd-flow__memory_store — brief-stored marker only
438
385
  # ─────────────────────────────────────────────────────────────────────────────
386
+ # v3.7.4: the state-ready / dirty treadmill has been removed. This hook now
387
+ # only creates the brief-stored marker after a session brief is persisted.
388
+ # odd-project-state stores are logged but do not touch any marker — state
389
+ # persistence is no longer gated by a marker state machine.
439
390
  store-validate)
440
391
  [ "$TOOL_NAME" = "mcp__odd-flow__memory_store" ] || exit 0
441
392
  [ "$CURRENT_PHASE" = "build" ] || exit 0
442
393
 
443
394
  KEY=$(echo "$INPUT" | jq -r '.tool_input.key // empty')
444
395
 
445
- SUCCESS=$(echo "$INPUT" | jq -r '.tool_response.success // false' 2>/dev/null || echo "false")
446
- [ "$SUCCESS" = "true" ] || exit 0
396
+ if ! echo "$INPUT" | grep -qE '"success"[[:space:]]*:[[:space:]]*true'; then
397
+ exit 0
398
+ fi
447
399
 
448
- # Create the right marker based on what was stored
449
400
  case "$KEY" in
450
- odd-project-state)
451
- touch .odd/.odd-flow-state-ready 2>/dev/null
452
- rm -f .odd/.odd-flow-state-dirty 2>/dev/null
453
- ;;
454
401
  odd-session-brief-*)
455
402
  touch .odd/.odd-flow-brief-stored 2>/dev/null
456
403
  ;;
@@ -459,12 +406,22 @@ store-validate)
459
406
  ;;
460
407
 
461
408
  # ─────────────────────────────────────────────────────────────────────────────
462
- # PostToolUse: mcp__odd-flow__coordination_sync — creates agents-ready marker
409
+ # PostToolUse: mcp__odd-flow__coordination_sync — completes swarm init
463
410
  # ─────────────────────────────────────────────────────────────────────────────
411
+ # coordination_sync is the LAST step of the 9-step swarm init sequence.
412
+ # When it fires successfully in build phase, the swarm is initialised — so we
413
+ # create all three markers atomically rather than relying on the orchestrator
414
+ # to remember a stray Bash `touch` step buried in a numbered list.
415
+ #
416
+ # Markers created:
417
+ # .odd-flow-swarm-active — gates source writes (24h TTL)
418
+ # .odd-flow-agents-ready — unblocks build-gate for Task agents
419
+ # .odd-flow-phase-synced — confirms agents have phase context
464
420
  sync-validate)
465
421
  [ "$TOOL_NAME" = "mcp__odd-flow__coordination_sync" ] || exit 0
466
422
  [ "$CURRENT_PHASE" = "build" ] || exit 0
467
423
 
424
+ touch .odd/.odd-flow-swarm-active 2>/dev/null
468
425
  touch .odd/.odd-flow-agents-ready 2>/dev/null
469
426
  touch .odd/.odd-flow-phase-synced 2>/dev/null
470
427
  exit 0
@@ -531,7 +488,8 @@ code-quality)
531
488
  ;;
532
489
 
533
490
  # ─────────────────────────────────────────────────────────────────────────────
534
- # PostToolUse: Write|Edit — security baseline warnings + checkpoint dirty marker
491
+ # PostToolUse: Write|Edit — security baseline warnings (stderr, non-blocking)
492
+ # Checkpoint dirty-marking was removed in v3.7.3 along with checkpoint-gate.
535
493
  # ─────────────────────────────────────────────────────────────────────────────
536
494
  security-quality)
537
495
  [ "$TOOL_NAME" = "Write" ] || [ "$TOOL_NAME" = "Edit" ] || exit 0
@@ -540,11 +498,6 @@ security-quality)
540
498
  echo "$FILE_PATH" | grep -qiE '(\.config\.|\.d\.ts|node_modules|\.next|dist/|build/|\.test\.|\.spec\.|__tests__)' && exit 0
541
499
  [ -f "$FILE_PATH" ] || exit 0
542
500
 
543
- if [ "$CURRENT_PHASE" = "build" ]; then
544
- touch .odd/.checkpoint-dirty 2>/dev/null
545
- rm -f .odd/.checkpoint-clear 2>/dev/null
546
- fi
547
-
548
501
  ISSUES=""
549
502
 
550
503
  grep -qEi '\b(api[_-]?key|secret|token|password)\b[^=\n]{0,40}[:=][[:space:]]*["'\''][^"'\'']{8,}["'\'']' "$FILE_PATH" 2>/dev/null \
@@ -1,39 +1,11 @@
1
1
  #!/usr/bin/env bash
2
- # ODD Studio — git post-commit hook
2
+ # ODD Studio — git post-commit hook (no-op)
3
3
  #
4
- # Install to your project with:
5
- # cp .odd/post-commit-hook.sh .git/hooks/post-commit
6
- # chmod +x .git/hooks/post-commit
4
+ # This hook existed in earlier versions to set .odd-flow-state-dirty on every
5
+ # build-phase commit so the swarm-guard would nag until state was stored.
6
+ # In v3.7.4 the dirty/ready marker treadmill was removed because it created
7
+ # more friction than value, so this hook is now a no-op kept only for
8
+ # backwards compatibility with projects that have it installed in .git/hooks.
7
9
  #
8
- # Or run: npx odd-studio install-git-hooks
9
- #
10
- # Why this exists:
11
- # odd-session-save.sh (PostToolUse) covers commits made BY Claude.
12
- # This hook covers commits made by the developer directly in the terminal.
13
- # Together they ensure .odd-flow-state-dirty is always set after a build-phase commit,
14
- # regardless of who made it.
15
- #
16
- # The dirty marker is cleared only after:
17
- # 1. mcp__odd-flow__memory_store key=odd-project-state (saves state to odd-flow)
18
- # 2. rm -f .odd/.odd-flow-state-dirty
19
- #
20
- # odd-swarm-guard.sh (UserPromptSubmit) blocks EVERY Claude turn until cleared.
21
-
22
- STATE_FILE=".odd/state.json"
23
-
24
- if [ ! -f "$STATE_FILE" ]; then
25
- exit 0
26
- fi
27
-
28
- CURRENT_PHASE=$(ODD_STATE_FILE="$STATE_FILE" node -e "
29
- try {
30
- const s = JSON.parse(require('fs').readFileSync(process.env.ODD_STATE_FILE, 'utf8'));
31
- console.log(s.currentPhase || '');
32
- } catch(e) { console.log(''); }
33
- " 2>/dev/null)
34
-
35
- if [ "$CURRENT_PHASE" = "build" ]; then
36
- touch .odd/.odd-flow-state-dirty
37
- fi
38
-
10
+ # Safe to delete from .git/hooks/post-commit if you want.
39
11
  exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "odd-studio",
3
- "version": "3.6.0",
3
+ "version": "3.7.4",
4
4
  "description": "Outcome-Driven Development for AI coding agents — a planning and build harness for domain experts building serious software with AI. Works with Claude Code, OpenCode, and Codex.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -48,8 +48,6 @@ const GATES = [
48
48
  event: 'PreToolUse',
49
49
  matcher: 'Bash',
50
50
  gates: [
51
- { name: 'checkpoint-gate', timeout: 5, status: 'ODD checkpoint gate...' },
52
- { name: 'commit-gate', timeout: 5, status: 'ODD commit gate...' },
53
51
  ],
54
52
  },
55
53
  // ── UserPromptSubmit ────────────────────────────────────────────────────
@@ -79,7 +77,6 @@ const GATES = [
79
77
  event: 'PostToolUse',
80
78
  matcher: 'Bash',
81
79
  gates: [
82
- { name: 'checkpoint-validate', timeout: 10, status: 'ODD checkpoint validate...' },
83
80
  { name: 'session-save', timeout: 10, status: 'ODD session save...' },
84
81
  ],
85
82
  },
package/skill/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "odd"
3
- version: "3.6.0"
3
+ version: "3.7.4"
4
4
  description: "Outcome-Driven Development planning and build coach. Use /odd to start or resume an ODD project — building personas, writing outcomes, mapping contracts, creating a Master Implementation Plan, and directing a odd-flow-powered build. Designed for domain experts who are not developers. Works with Claude Code, OpenCode, and Codex."
5
5
  metadata:
6
6
  priority: 10
@@ -84,8 +84,15 @@ Before doing anything else, run this state check silently:
84
84
  2. Check whether `docs/plan.md` exists.
85
85
  3. Attempt to retrieve project state from odd-flow memory:
86
86
  - Call `mcp__odd-flow__memory_retrieve` with key `odd-project-state`, namespace `odd-project`
87
- - If successful, merge odd-flow state with any local state found in `.odd/state.json`, with odd-flow taking precedence for any field where it has richer data (more personas, outcomes, or a later phase)
88
- 4. **If odd-flow state is richer than local state** (odd-flow has personas/outcomes/approvals that local does not): write the merged state back to `.odd/state.json` immediately using the Write tool. This keeps local state in sync so the next session starts correctly without a mismatch.
87
+ 4. **Reconciliation — strict, no silent merging.** If both local and odd-flow state exist, compare them field-by-field. Specifically check `currentBuildPhase`, `currentPhase`, `briefConfirmed`, `sessionBriefCount`, `personas.length`, and `outcomes.length`. If ANY of these disagree:
88
+ - **STOP.** Do not display the welcome or status message yet.
89
+ - Show the user a side-by-side diff of the disagreeing fields (local value vs odd-flow value).
90
+ - Ask explicitly: "Local state and odd-flow state have drifted. Which should I trust as authoritative? Type `local`, `odd-flow`, or `inspect` to see the full diff."
91
+ - On `local`: store the full local `state.json` to odd-flow with `mcp__odd-flow__memory_store` and proceed.
92
+ - On `odd-flow`: write the odd-flow value to `.odd/state.json` and proceed.
93
+ - On `inspect`: print the full diff and ask again.
94
+ - Do NOT use heuristics like "richer wins" or "later phase wins" — they hide bugs. The user decides.
95
+ 5. If local exists and odd-flow does not: store local to odd-flow immediately. If odd-flow exists and local does not: write odd-flow to local immediately.
89
96
 
90
97
  **If this is a new project** (no state found anywhere), display the welcome message below.
91
98
 
@@ -99,7 +106,7 @@ Display this when no existing state is found:
99
106
 
100
107
  ---
101
108
 
102
- Welcome to ODD Studio v3.6.0.
109
+ Welcome to ODD Studio v3.7.4.
103
110
 
104
111
  You are about to plan and build something real — using a methodology called Outcome-Driven Development. Before we write a single line of code, we are going to get precise about three things:
105
112
 
@@ -123,7 +130,7 @@ Display this when existing state is found. Replace the bracketed values with act
123
130
 
124
131
  ---
125
132
 
126
- Welcome back to ODD Studio v3.6.0.
133
+ Welcome back to ODD Studio v3.7.4.
127
134
 
128
135
  **Project:** [project.name]
129
136
  **Current Phase:** [state.currentPhase]
@@ -260,11 +267,11 @@ Execute these steps in order:
260
267
 
261
268
  7. **INITIALISES THE ODD_FLOW SWARM — MANDATORY FIRST ACTION.**
262
269
 
263
- > **This step happens BEFORE loading any files, BEFORE reading source code, BEFORE planning any build work. Swarm init is not a step buried in a checklist — it is the gate that unlocks everything else. If you have not completed the swarm initialisation sequence (all 9 steps in the odd-flow Swarm Initialisation section below), STOP and do it NOW.**
270
+ > **This step happens BEFORE loading any files, BEFORE reading source code, BEFORE planning any build work. Swarm init is not a step buried in a checklist — it is the gate that unlocks everything else. If you have not completed the swarm initialisation sequence (all 8 steps in the odd-flow Swarm Initialisation section below), STOP and do it NOW.**
264
271
  >
265
272
  > The `odd-swarm-guard.sh` hook fires on every user message when in build phase without the swarm marker. If you are reading this and `.odd/.odd-flow-swarm-active` does not exist, the hook is injecting a warning into every response. Do not ignore it. Initialise the swarm now.
266
273
 
267
- See: **odd-flow Swarm Initialisation** section below. Execute all 9 steps, then proceed.
274
+ See: **odd-flow Swarm Initialisation** section below. Execute all 8 steps, then proceed.
268
275
 
269
276
  8. Loads `docs/build/build-protocol.md` and `docs/build/code-excellence.md` into context. The Code Excellence standard is mandatory — the build agent applies the Design-It-Twice protocol to every function, component, and module it writes.
270
277
  9. Confirms to the user which phase is being worked on and which outcomes are in scope.
@@ -391,33 +398,9 @@ The verification walkthrough MUST have been completed in the current session. Th
391
398
 
392
399
  Execute the following steps in order:
393
400
 
394
- **1. Run Checkpoint.**
401
+ **1. Commit the verified state** via git with message: `feat: verified [outcome name] — [phase]`
395
402
 
396
- Execute via Bash: `npx @darrenjcoxon/vibeguard --security-only -o json 2>/dev/null`
397
-
398
- Display to the domain expert: "Checkpoint running..."
399
-
400
- Parse the JSON output. Look for findings with severity `critical`, `high`, or `secret`.
401
-
402
- **If Checkpoint is not installed** (command fails or returns an error): skip silently and display "Checkpoint not installed — type `npx @darrenjcoxon/vibeguard --install-tools` in your terminal to enable security scanning." Then proceed to step 3.
403
-
404
- **2. If Checkpoint finds critical, high, or secret findings:**
405
-
406
- Do NOT advance to the next outcome.
407
-
408
- Translate each finding from technical language to a plain-language fix instruction. Do not show raw scanner output to the domain expert.
409
-
410
- Brief the build agent directly with the fix instructions. Do not ask the domain expert to review them.
411
-
412
- Display: "Checkpoint found [N] security issue(s) in this outcome. The build agent is fixing them now. This does not affect your verification — the outcome behaves correctly. Once the security fix is complete, Checkpoint will run again automatically."
413
-
414
- After the build agent applies fixes, re-run Checkpoint automatically (repeat step 1). Repeat until Checkpoint is clear. Then proceed to step 3.
415
-
416
- **3. If Checkpoint is clear:**
417
-
418
- Display: "Checkpoint clear."
419
-
420
- Commit the verified state via git with message: `feat: verified [outcome name] — [phase]`
403
+ > **Note:** Automated Checkpoint/vibeguard scanning was removed in v3.7.4. The scanner flagged dep-lockfile CVEs as code vulnerabilities and made every commit impossible. Security scanning is reintroduced only with a scanner that can distinguish code findings from lockfile findings. In the meantime, domain experts remain responsible for flagging anything suspicious during the verification walkthrough.
421
404
 
422
405
  Call `mcp__odd-flow__memory_store` key `odd-outcome-[name]` with status `verified`, namespace `odd-project`.
423
406
 
@@ -431,8 +414,6 @@ Display:
431
414
 
432
415
  **[Outcome name] — verified and committed.**
433
416
 
434
- Checkpoint: clear.
435
-
436
417
  **Next:** [next outcome name and one-sentence description]
437
418
 
438
419
  Type `*build` to begin, or `*status` to see the full phase progress.
@@ -700,29 +681,23 @@ Call `mcp__odd-flow__agent_spawn`:
700
681
  - Role: qa
701
682
  - Instructions: `"Read verification steps per outcome from odd-flow. Run all steps after each outcome completes. Report failures in domain language only. Flag as verified or failed."`
702
683
 
703
- ### 8. Activate the Swarm Write Gate
704
-
705
- Create the swarm marker file that unlocks source code writes:
684
+ ### 8. Sync All Agents — automatically activates the write gate
706
685
 
707
- ```bash
708
- touch .odd/.odd-flow-swarm-active
709
- ```
686
+ Call `mcp__odd-flow__coordination_sync`:
687
+ - Namespace: `odd-project`
688
+ - Message: "Phase [n] build started. All agents: retrieve your assignments from odd-flow memory key odd-project-state and begin execution according to the Build Protocol."
710
689
 
711
- **Why this matters:** The `odd-studio.sh` hook enforces a single-marker system during the build phase. The swarm-active marker must exist for source code writes to succeed:
690
+ **This step is the LAST init action.** When `coordination_sync` succeeds in build phase, the `sync-validate` hook automatically creates all three swarm markers:
712
691
 
713
- 1. **`.odd/.odd-flow-swarm-active`** — build session is active (24-hour TTL). Created here at step 8.
692
+ 1. **`.odd/.odd-flow-swarm-active`** — gates source writes (24-hour TTL)
693
+ 2. **`.odd/.odd-flow-agents-ready`** — unblocks build-gate for Task agents
694
+ 3. **`.odd/.odd-flow-phase-synced`** — confirms agents have phase context
714
695
 
715
- Both the main orchestrator AND Task agents can write source code when the swarm-active marker is valid. This removes the friction of the previous two-marker system while still ensuring the build session is properly initialised before any code is written.
696
+ You do NOT manually `touch` these markers. The hook handles it. Steps 1–7 store state and spawn agents in parallel; step 8 finalises and unlocks the build. If the marker is missing after coordination_sync succeeds, the hook is broken fix the hook, do not manually touch the marker.
716
697
 
717
698
  The marker TTL is 24 hours (86400 seconds) because build sessions can last many hours. If the marker expires, run `*build` again to refresh it.
718
699
 
719
- ### 9. Sync All Agents
720
-
721
- Call `mcp__odd-flow__coordination_sync`:
722
- - Namespace: `odd-project`
723
- - Message: "Phase [n] build started. All agents: retrieve your assignments from odd-flow memory key odd-project-state and begin execution according to the Build Protocol."
724
-
725
- ### 10. Confirm to User
700
+ ### 9. Confirm to User
726
701
 
727
702
  Display:
728
703
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: "odd-debug"
3
- version: "1.0.0"
4
- description: "ODD Studio debug command. Keeps debugging inside the active outcome, selects the correct debug strategy, and routes back to verification instead of drifting outside the ODD flow."
3
+ version: "2.0.0"
4
+ description: "ODD Studio debug command. Activates a lightweight debug session (no full swarm init required), selects the correct debug strategy, and routes back to verification instead of drifting outside the ODD flow."
5
5
  metadata:
6
6
  priority: 9
7
7
  pathPatterns:
@@ -43,18 +43,124 @@ retrieval:
43
43
 
44
44
  You are executing the ODD Studio `*debug` command.
45
45
 
46
- Read these two files now:
47
- 1. `.claude/skills/odd/SKILL.md` — the full ODD Studio coach and build protocol
48
- 2. `.claude/skills/odd/docs/build/debug-protocol.md` — the Debug Protocol detail
46
+ ## What this command does
49
47
 
50
- Then execute the `*debug` protocol exactly as documented in those files, starting from the state check and selecting the explicit debug strategy before any fix is attempted.
48
+ `*debug` activates a lightweight build session optimised for debugging, hotfixes, and security remediation work. It bypasses the full 9-step swarm init that `*build` requires — there is no agent dispatch, no task creation, no swarm spawn. The orchestrator writes code directly.
51
49
 
52
- You must classify the failure into exactly one debug strategy before reading implementation details:
53
- - `ui-behaviour`
54
- - `full-stack`
55
- - `auth-security`
56
- - `integration-contract`
57
- - `background-process`
58
- - `performance-state`
50
+ This is not a shortcut around ODD. The brief-gate, verify-gate, commit-gate, and outcome verification protocol are all still enforced. What is relaxed is the agent-token requirement in `swarm-write` the requirement that forces every source write through a background Task agent. That requirement exists to enable parallel multi-agent outcome builds. For a single targeted fix it is pure ceremony.
59
51
 
60
- If the correct strategy is not yet clear, gather evidence first. Never guess. Never jump straight to a fix.
52
+ **When to use `*debug` instead of `*build`:**
53
+ - Fixing a failing test suite
54
+ - Applying a security patch
55
+ - Investigating and resolving a verification failure
56
+ - Any single-file or few-file change that does not require parallel agent execution
57
+
58
+ **When to use `*build` instead:**
59
+ - Building a new outcome from scratch
60
+ - Work that benefits from parallel backend + UI + QA agents
61
+ - Phase transitions
62
+
63
+ ---
64
+
65
+ ## Session Activation
66
+
67
+ Execute these steps before any investigation or fix work. Do them in order.
68
+
69
+ ### Step 1 — State check
70
+
71
+ Read `.odd/state.json`. Confirm:
72
+ - `currentPhase` is `"build"` — if not, explain that `*debug` requires an active build phase
73
+ - `planApproved` is `true` — if not, route to `*plan`
74
+
75
+ If either check fails, stop here and explain what is needed.
76
+
77
+ ### Step 2 — Activate the debug session marker
78
+
79
+ ```bash
80
+ touch .odd/.odd-flow-swarm-active
81
+ ```
82
+
83
+ This creates or refreshes the 24-hour build session marker. The `swarm-write` gate will now allow direct orchestrator writes (because `debugSession: true` bypasses Gate 2).
84
+
85
+ ### Step 3 — Set debug session state
86
+
87
+ Update `.odd/state.json`:
88
+ - `debugSession: true`
89
+ - `buildMode: "debug"`
90
+ - `verificationConfirmed: false`
91
+ - `debugStartedAt: <current ISO timestamp>`
92
+ - `debugSummary: <one-sentence description of the issue — or "unknown" if not yet classified>`
93
+
94
+ ### Step 4 — Store state to odd-flow
95
+
96
+ Call `mcp__odd-flow__memory_store`:
97
+ - Key: `odd-project-state`
98
+ - Namespace: `odd-project`
99
+ - Value: full contents of `.odd/state.json`
100
+ - upsert: true
101
+
102
+ This single store call satisfies the `commit-gate` requirement (via `store-validate` hook) for subsequent commits in this session.
103
+
104
+ ### Step 5 — Confirm to user
105
+
106
+ Display:
107
+
108
+ ---
109
+
110
+ Debug session active.
111
+
112
+ Source writes are unlocked. No agent dispatch required.
113
+ Brief gate, verify gate, and commit gate remain enforced.
114
+
115
+ State stored to odd-flow. Ready to investigate.
116
+
117
+ ---
118
+
119
+ Then proceed immediately to Strategy Selection below.
120
+
121
+ ---
122
+
123
+ ## Strategy Selection
124
+
125
+ Read `.odd/state.json` to identify the active outcome and the latest failure. If the failure was described in the user's message, use that. If not yet clear, ask for a one-sentence description.
126
+
127
+ Choose exactly one debug strategy before inspecting code. State the chosen strategy and the reason.
128
+
129
+ - Choose `ui-behaviour` when the problem is visible in the interface and you do not yet have evidence of a backend or data fault
130
+ - Choose `full-stack` when the failure crosses a user action, server boundary, and persisted state
131
+ - Choose `auth-security` when access, identity, trust, or validation boundaries might be wrong
132
+ - Choose `integration-contract` when one part of the system expects data or sequencing another part does not produce
133
+ - Choose `background-process` when the failure depends on async handoff, jobs, retries, or event delivery
134
+ - Choose `performance-state` when the issue depends on timing, staleness, cache invalidation, or repeated actions
135
+
136
+ If more than one strategy seems plausible, do not fix anything yet. Gather one more piece of evidence, then choose the narrowest strategy that still explains the failure.
137
+
138
+ ---
139
+
140
+ ## Fix Protocol
141
+
142
+ After choosing the strategy, load `docs/build/debug-protocol.md` for the detailed investigation procedure for that strategy.
143
+
144
+ When the fix is complete:
145
+
146
+ 1. Run the relevant automated checks (tests, lint)
147
+ 2. Update `.odd/state.json`:
148
+ - `debugSession: false`
149
+ - `buildMode: "verify"`
150
+ - `debugStrategy: <chosen strategy>`
151
+ - `debugTarget: <affected file or surface>`
152
+ - `debugSummary: <resolved — one sentence>`
153
+ 3. Call `mcp__odd-flow__memory_store` with key `odd-project-state` to store final state
154
+ 4. Return to the verification walkthrough from step one
155
+
156
+ Setting `debugSession: false` re-enables Gate 2 for subsequent work, returning to full swarm protocol.
157
+
158
+ ---
159
+
160
+ ## Non-negotiable rules
161
+
162
+ - Never mark an outcome verified during a debug session
163
+ - Never change multiple layers at once before reproducing the fault
164
+ - Never skip the reproduction step
165
+ - Never broaden the strategy after starting unless new evidence proves the original classification wrong
166
+ - Always clear `debugSession: false` when the fix is complete