@thedecipherist/mdd 1.7.0 → 1.7.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.
@@ -1,21 +1,13 @@
1
- ## Phase Logging
2
-
3
- At the **start** of every phase (before any action) and the **end** of every phase (after all actions), run the command below. Substitute `PHASE` with the phase identifier (e.g., `Phase PI1`, `Phase PW3`, `Phase PE2`) and `EVENT` with `start` or `end`:
4
-
5
- ```bash
6
- bash -c 'D=$(date +%Y-%m-%d); T=$(date +%H:%M:%S); K=$(compressmcp --status 2>/dev/null | grep -oE "[0-9]+K/[0-9]+K" | head -1 || echo "-"); mkdir -p ~/.claude/mdd; printf "| %s | mdd-plan | PHASE | EVENT | %s | %s |\n" "$D" "$T" "$K" >> ~/.claude/mdd/log.md' 2>/dev/null || true
7
- ```
8
-
9
- Log file: `~/.claude/mdd/log.md`
10
-
11
- ---
12
-
13
1
  ## PLAN-INITIATIVE MODE — `/mdd plan-initiative`
14
2
 
15
3
  Triggered when arguments start with `plan-initiative`. Creates a new initiative doc.
16
4
 
17
5
  ### Phase PI0 — Branch Guard
18
6
 
7
+ ```bash
8
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PI0" start "$PLAN_TARGET"
9
+ ```
10
+
19
11
  Run before any file creation:
20
12
 
21
13
  ```bash
@@ -28,8 +20,16 @@ DIRTY=$(git status --porcelain)
28
20
  - **On a feature branch** → working dirty is fine. Proceed — initiative planning docs belong on whatever branch is current.
29
21
  - **Never proceed on main.** Hard block.
30
22
 
23
+
24
+ ```bash
25
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PI0" end "$PLAN_TARGET"
26
+ ```
31
27
  ### Phase PI1 — Mode choice
32
28
 
29
+ ```bash
30
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PI1" start "$PLAN_TARGET"
31
+ ```
32
+
33
33
  Ask the user:
34
34
  ```
35
35
  How do you want to create this initiative?
@@ -50,8 +50,16 @@ How do you want to create this initiative?
50
50
 
51
51
  **If (a) Guide me:** proceed to Phase PI2.
52
52
 
53
+
54
+ ```bash
55
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PI1" end "$PLAN_TARGET"
56
+ ```
53
57
  ### Phase PI2 — Questions
54
58
 
59
+ ```bash
60
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PI2" start "$PLAN_TARGET"
61
+ ```
62
+
55
63
  Ask all questions in a single interaction:
56
64
  1. "What is the title of this initiative?"
57
65
  2. "Describe it — what does it deliver and why does it exist?"
@@ -59,8 +67,16 @@ Ask all questions in a single interaction:
59
67
  4. For each wave: "Wave N — name and one-sentence demo-state (what can the user DO when this wave is done?)"
60
68
  5. "What's still undecided that could affect architecture?" → these become open product questions (unchecked `- [ ]` items)
61
69
 
70
+
71
+ ```bash
72
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PI2" end "$PLAN_TARGET"
73
+ ```
62
74
  ### Phase PI3 — Write initiative doc
63
75
 
76
+ ```bash
77
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PI3" start "$PLAN_TARGET"
78
+ ```
79
+
64
80
  **Slug format:** lowercase, hyphens, no special characters. "Auth System" → `auth-system`.
65
81
 
66
82
  **Collision check:** same as template mode above.
@@ -97,8 +113,16 @@ Compute and write `hash:` field after writing (hash of file content excluding th
97
113
 
98
114
  Rebuild `.mdd/.startup.md`.
99
115
 
116
+
117
+ ```bash
118
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PI3" end "$PLAN_TARGET"
119
+ ```
100
120
  ### Phase PI4 — Chain to plan-wave
101
121
 
122
+ ```bash
123
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PI4" start "$PLAN_TARGET"
124
+ ```
125
+
102
126
  Show the created doc to the user. Ask:
103
127
  *"Want to plan Wave 1 now? (yes / no — I'll run /mdd plan-wave <slug>-wave-1 later)"*
104
128
 
@@ -106,12 +130,24 @@ If yes → run Phase PW1 inline for `<slug>-wave-1`.
106
130
 
107
131
  ---
108
132
 
133
+
134
+ ```bash
135
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PI4" end "$PLAN_TARGET"
136
+ ```
137
+
138
+ ```bash
139
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "-" "complete" "$PLAN_TARGET"
140
+ ```
109
141
  ## PLAN-WAVE MODE — `/mdd plan-wave <wave-slug>`
110
142
 
111
143
  Triggered when arguments start with `plan-wave`. Takes a wave slug (e.g. `auth-system-wave-2`), resolves the parent initiative from it.
112
144
 
113
145
  ### Phase PW1 — Load and validate
114
146
 
147
+ ```bash
148
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PW1" start "$PLAN_TARGET"
149
+ ```
150
+
115
151
  **Step 0 — Branch guard:**
116
152
 
117
153
  ```bash
@@ -132,24 +168,48 @@ DIRTY=$(git status --porcelain)
132
168
  6. **Depends-on gate:** read existing wave docs for this initiative. If the new wave's `depends_on` wave exists and is not `complete` → hard stop.
133
169
  7. Surface context summary to user: initiative title, overview, wave count, which waves are done.
134
170
 
171
+
172
+ ```bash
173
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PW1" end "$PLAN_TARGET"
174
+ ```
135
175
  ### Phase PW2 — Mode choice
136
176
 
177
+ ```bash
178
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PW2" start "$PLAN_TARGET"
179
+ ```
180
+
137
181
  Same as PI1: ask "(a) Guide me / (b) Template".
138
182
 
139
183
  **If (b) Template:** create `waves/<wave-slug>.md` with blank template, tell user to fill it out and run `/mdd plan-sync` then `/mdd plan-execute <wave-slug>`.
140
184
 
141
185
  **If (a) Guide me:** proceed to Phase PW3.
142
186
 
187
+
188
+ ```bash
189
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PW2" end "$PLAN_TARGET"
190
+ ```
143
191
  ### Phase PW3 — Questions
144
192
 
193
+ ```bash
194
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PW3" start "$PLAN_TARGET"
195
+ ```
196
+
145
197
  Ask in a single interaction:
146
198
  1. "Here's the demo-state from the initiative: [X]. Does this need sharpening for this wave?"
147
199
  2. "List the features needed to reach that demo-state — name + one-line description each."
148
200
  3. "Do any features depend on other features within this wave?"
149
201
  4. "Any open research questions before building? Or none?"
150
202
 
203
+
204
+ ```bash
205
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PW3" end "$PLAN_TARGET"
206
+ ```
151
207
  ### Phase PW4 — Write wave doc
152
208
 
209
+ ```bash
210
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PW4" start "$PLAN_TARGET"
211
+ ```
212
+
153
213
  Create `waves/<wave-slug>.md`:
154
214
 
155
215
  ```markdown
@@ -185,19 +245,39 @@ Compute and write `hash:` field. Update the Waves table in `initiatives/<slug>.m
185
245
 
186
246
  Rebuild `.mdd/.startup.md`.
187
247
 
248
+
249
+ ```bash
250
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PW4" end "$PLAN_TARGET"
251
+ ```
188
252
  ### Phase PW5 — Chain
189
253
 
254
+ ```bash
255
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PW5" start "$PLAN_TARGET"
256
+ ```
257
+
190
258
  Ask: *"Want to plan Wave N+1 now? (yes / no)"*
191
259
  If yes → run Phase PW1 inline for the next wave slug.
192
260
 
193
261
  ---
194
262
 
263
+
264
+ ```bash
265
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PW5" end "$PLAN_TARGET"
266
+ ```
267
+
268
+ ```bash
269
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "-" "complete" "$PLAN_TARGET"
270
+ ```
195
271
  ## PLAN-EXECUTE MODE — `/mdd plan-execute <wave-slug>`
196
272
 
197
273
  Triggered when arguments start with `plan-execute`. Runs the full MDD build flow for each feature in the wave.
198
274
 
199
275
  ### Phase PE1 — Load and validate
200
276
 
277
+ ```bash
278
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PE1" start "$PLAN_TARGET"
279
+ ```
280
+
201
281
  **Step 0 — Branch guard (runs before everything else):**
202
282
 
203
283
  ```bash
@@ -243,8 +323,16 @@ DIRTY=$(git status --porcelain)
243
323
  - **Discard:** delete the `wave-<wave-slug>/` folder, proceed to PE2 normally.
244
324
  - If no stale job exists: proceed to PE2 normally.
245
325
 
326
+
327
+ ```bash
328
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PE1" end "$PLAN_TARGET"
329
+ ```
246
330
  ### Phase PE2 — Interaction mode + Job Setup
247
331
 
332
+ ```bash
333
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PE2" start "$PLAN_TARGET"
334
+ ```
335
+
248
336
  Ask:
249
337
  ```
250
338
  How do you want to run this wave?
@@ -280,8 +368,16 @@ Create `.mdd/jobs/wave-<wave-slug>/MANIFEST.md`:
280
368
 
281
369
  List every feature from the wave's Features table in order. Features already marked `complete` in the wave doc get `[x]` from the start.
282
370
 
371
+
372
+ ```bash
373
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PE2" end "$PLAN_TARGET"
374
+ ```
283
375
  ### Phase PE3 — Execute features
284
376
 
377
+ ```bash
378
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PE3" start "$PLAN_TARGET"
379
+ ```
380
+
285
381
  For each feature in the wave's feature table, in dependency order, skipping `complete` features:
286
382
 
287
383
  1. Tell user: *"Starting Feature N: <feature-slug>"*
@@ -308,8 +404,16 @@ For each feature in the wave's feature table, in dependency order, skipping `com
308
404
 
309
405
  **Resume behaviour:** if re-run on a partially complete wave, stale job detection in PE1 handles resume. MANIFEST is the authoritative progress record — it is always written before and after each feature so an interrupted session can pick up at the exact right point.
310
406
 
407
+
408
+ ```bash
409
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PE3" end "$PLAN_TARGET"
410
+ ```
311
411
  ### Phase PE4 — Wave completion
312
412
 
413
+ ```bash
414
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PE4" start "$PLAN_TARGET"
415
+ ```
416
+
313
417
  When all features are `complete`:
314
418
  1. Update `MANIFEST.md` — set `# Status: COMPLETE` in the header.
315
419
  2. Show the demo-state: *"Wave complete. Demo-state: '<demo-state>'. Have you verified this?"*
@@ -341,12 +445,24 @@ Read all `.mdd/docs/*.md` (excluding `archive/`) — frontmatter only (id, title
341
445
 
342
446
  ---
343
447
 
448
+
449
+ ```bash
450
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PE4" end "$PLAN_TARGET"
451
+ ```
452
+
453
+ ```bash
454
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "-" "complete" "$PLAN_TARGET"
455
+ ```
344
456
  ## PLAN-SYNC MODE — `/mdd plan-sync`
345
457
 
346
458
  Triggered when arguments start with `plan-sync`. Detects manual edits to initiative/wave files via hash comparison and reconciles them.
347
459
 
348
460
  ### Phase PS1 — Scan all files
349
461
 
462
+ ```bash
463
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PS1" start "$PLAN_TARGET"
464
+ ```
465
+
350
466
  Read every file in `.mdd/initiatives/` and `.mdd/waves/` (including `archive/`). For each, compute the hash of the file content (excluding the `hash:` line). Compare against stored `hash:` field.
351
467
 
352
468
  Build a change table:
@@ -357,8 +473,16 @@ auth-system-wave-1.md | def456 | abc999 | YES
357
473
  billing-module.md | (empty) | xyz111 | YES (new — no hash yet)
358
474
  ```
359
475
 
476
+
477
+ ```bash
478
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PS1" end "$PLAN_TARGET"
479
+ ```
360
480
  ### Phase PS2 — Present changes + confirm
361
481
 
482
+ ```bash
483
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PS2" start "$PLAN_TARGET"
484
+ ```
485
+
362
486
  Show the full change table. Tell the user what will happen:
363
487
 
364
488
  - **Initiative changed:** version incremented, hash updated, completed waves with old `initiative_version` flagged for review
@@ -367,8 +491,16 @@ Show the full change table. Tell the user what will happen:
367
491
 
368
492
  Ask: *"Apply these updates? (yes / review each / cancel)"*
369
493
 
494
+
495
+ ```bash
496
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PS2" end "$PLAN_TARGET"
497
+ ```
370
498
  ### Phase PS3 — Apply
371
499
 
500
+ ```bash
501
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PS3" start "$PLAN_TARGET"
502
+ ```
503
+
372
504
  For each changed file, in initiative-first order:
373
505
 
374
506
  **Initiative changed:**
@@ -401,19 +533,39 @@ Report:
401
533
 
402
534
  ---
403
535
 
536
+
537
+ ```bash
538
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PS3" end "$PLAN_TARGET"
539
+ ```
540
+
541
+ ```bash
542
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "-" "complete" "$PLAN_TARGET"
543
+ ```
404
544
  ## PLAN-REMOVE-FEATURE MODE — `/mdd plan-remove-feature <wave-slug> <feature-slug>`
405
545
 
406
546
  Triggered when arguments start with `plan-remove-feature`.
407
547
 
408
548
  ### Phase PRF1 — Load and validate
409
549
 
550
+ ```bash
551
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PRF1" start "$PLAN_TARGET"
552
+ ```
553
+
410
554
  1. Parse `<wave-slug>` and `<feature-slug>` from arguments.
411
555
  2. Read wave doc — hard stop *"Wave does not exist"* if not found.
412
556
  3. Find the feature row — hard stop *"Feature `<slug>` does not exist in wave `<wave-slug>`"* if not found.
413
557
  4. **Dependency guard:** check if any other feature in the wave lists `<feature-slug>` in its `Depends on` column. If so → hard stop: *"`<other-feature>` depends on `<feature-slug>`. Remove or reassign that dependency first."*
414
558
 
559
+
560
+ ```bash
561
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PRF1" end "$PLAN_TARGET"
562
+ ```
415
563
  ### Phase PRF2 — Confirm and remove
416
564
 
565
+ ```bash
566
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PRF2" start "$PLAN_TARGET"
567
+ ```
568
+
417
569
  Show summary:
418
570
  ```
419
571
  Remove feature from wave?
@@ -439,17 +591,37 @@ Rebuild `.mdd/.startup.md`.
439
591
 
440
592
  ---
441
593
 
594
+
595
+ ```bash
596
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PRF2" end "$PLAN_TARGET"
597
+ ```
598
+
599
+ ```bash
600
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "-" "complete" "$PLAN_TARGET"
601
+ ```
442
602
  ## PLAN-CANCEL-INITIATIVE MODE — `/mdd plan-cancel-initiative <slug>`
443
603
 
444
604
  Triggered when arguments start with `plan-cancel-initiative`.
445
605
 
446
606
  ### Phase PCI1 — Load
447
607
 
608
+ ```bash
609
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PCI1" start "$PLAN_TARGET"
610
+ ```
611
+
448
612
  1. Parse `<slug>` — hard stop *"Initiative does not exist"* if `initiatives/<slug>.md` not found.
449
613
  2. Read initiative doc. Count: waves, wave statuses, associated feature docs (those with `initiative: <slug>` frontmatter).
450
614
 
615
+
616
+ ```bash
617
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PCI1" end "$PLAN_TARGET"
618
+ ```
451
619
  ### Phase PCI2 — Confirm
452
620
 
621
+ ```bash
622
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PCI2" start "$PLAN_TARGET"
623
+ ```
624
+
453
625
  Show summary:
454
626
  ```
455
627
  Cancel initiative: Auth System
@@ -463,8 +635,16 @@ Cancel this initiative? (yes/no)
463
635
 
464
636
  If yes:
465
637
 
638
+
639
+ ```bash
640
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PCI2" end "$PLAN_TARGET"
641
+ ```
466
642
  ### Phase PCI3 — Cancel
467
643
 
644
+ ```bash
645
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PCI3" start "$PLAN_TARGET"
646
+ ```
647
+
468
648
  1. Set `status: cancelled` in initiative frontmatter. Recompute hash.
469
649
  2. Ask: *"Archive wave docs? (yes/no)"* — if yes, move all wave files to `.mdd/waves/archive/`
470
650
  3. Ask: *"Flag feature docs with a warning? (yes/no)"* — if yes, add to each associated feature doc's `known_issues`: `"Initiative <slug> was cancelled — review whether this feature is still needed."`
@@ -481,3 +661,12 @@ Report:
481
661
  ```
482
662
 
483
663
  ---
664
+
665
+
666
+ ```bash
667
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "Phase PCI3" end "$PLAN_TARGET"
668
+ ```
669
+
670
+ ```bash
671
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-plan" "-" "complete" "$PLAN_TARGET"
672
+ ```
package/commands/mdd.md CHANGED
@@ -140,6 +140,12 @@ Use whichever path contains `mdd-audit.md`. Store it as `$MDD_DIR` and use it fo
140
140
 
141
141
  - Otherwise → **Read `$MDD_DIR/mdd-build.md` then follow BUILD MODE instructions.**
142
142
 
143
+ After mode is determined and before reading the mode file, log the invocation. `$ARGUMENTS` is the full argument string the user typed (e.g., `build user-auth`, `audit 03`, `status`):
144
+
145
+ ```bash
146
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd" "-" "invoked" "$ARGUMENTS"
147
+ ```
148
+
143
149
  ---
144
150
 
145
151
  ## Branch Guard (All Modes)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thedecipherist/mdd",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "MDD — Manual-Driven Development workflow for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {