@thedecipherist/mdd 1.7.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,9 @@
1
- ## Phase Logging
2
-
3
- At the **start** of every mode or phase (before any action) and the **end** (after all actions), run the command below. Substitute `PHASE` with the mode/phase identifier (e.g., `STATUS`, `Phase SC1`, `Phase U1`) and `EVENT` with `start` or `end`:
1
+ ## STATUS MODE — `/mdd status`
4
2
 
5
3
  ```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-manage | PHASE | EVENT | %s | %s |\n" "$D" "$T" "$K" >> ~/.claude/mdd/log.md' 2>/dev/null || true
4
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "STATUS" start "$ARGUMENTS"
7
5
  ```
8
6
 
9
- Log file: `~/.claude/mdd/log.md`
10
-
11
- ---
12
-
13
- ## STATUS MODE — `/mdd status`
14
-
15
7
  Quick overview of MDD state for the project:
16
8
 
17
9
  1. **Scan `.mdd/docs/`** — count feature docs
@@ -93,8 +85,20 @@ After rebuilding `.startup.md`, check connections.md:
93
85
 
94
86
  ---
95
87
 
88
+
89
+ ```bash
90
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "STATUS" end "$ARGUMENTS"
91
+ ```
92
+
93
+ ```bash
94
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "-" "complete" "$ARGUMENTS"
95
+ ```
96
96
  ## NOTE MODE — `/mdd note`
97
97
 
98
+ ```bash
99
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "NOTE" start "$ARGUMENTS"
100
+ ```
101
+
98
102
  Triggered when arguments start with `note`. Three subcommands:
99
103
 
100
104
  ```
@@ -127,18 +131,38 @@ Triggered when arguments start with `note`. Three subcommands:
127
131
 
128
132
  ---
129
133
 
134
+
135
+ ```bash
136
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "NOTE" end "$ARGUMENTS"
137
+ ```
138
+
139
+ ```bash
140
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "-" "complete" "$ARGUMENTS"
141
+ ```
130
142
  ## SCAN MODE — `/mdd scan`
131
143
 
132
144
  Triggered when arguments start with `scan`. Detects features whose source files have changed since the last MDD session, and checks for initiative/wave drift.
133
145
 
134
146
  ### Phase SC1 — Read all feature docs, ops runbooks, and initiative/wave files
135
147
 
148
+ ```bash
149
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase SC1" start "$ARGUMENTS"
150
+ ```
151
+
136
152
  Read every `.mdd/docs/*.md` (excluding `archive/`) and every `.mdd/ops/*.md` (excluding `archive/`). For each, extract:
137
153
  - `last_synced` from frontmatter
138
154
  - `source_files` list from frontmatter (feature docs) or the ops doc slug for ops runbooks
139
155
 
156
+
157
+ ```bash
158
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase SC1" end "$ARGUMENTS"
159
+ ```
140
160
  ### Phase SC2 — Check each feature for drift (parallelized)
141
161
 
162
+ ```bash
163
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase SC2" start "$ARGUMENTS"
164
+ ```
165
+
142
166
  After Phase SC1 has the full feature list (IDs, `last_synced`, `source_files`), delegate all git log checks to a **single Explore agent** rather than running them sequentially in the main conversation.
143
167
 
144
168
  **Why a single agent (not multiple):** `git log` commands are individually fast — the bottleneck is issuing them one at a time in the main conversation. One agent can run all of them in quick succession and return a complete classification table.
@@ -185,8 +209,16 @@ After the agent returns its table, the main conversation writes the drift report
185
209
 
186
210
  **Fallback:** If the agent fails, run git checks sequentially in the main conversation using the same logic.
187
211
 
212
+
213
+ ```bash
214
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase SC2" end "$ARGUMENTS"
215
+ ```
188
216
  ### Phase SC3 — Present drift report
189
217
 
218
+ ```bash
219
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase SC3" start "$ARGUMENTS"
220
+ ```
221
+
190
222
  ```
191
223
  🔍 MDD Scan — Drift Report
192
224
  Generated: <YYYY-MM-DD>
@@ -243,22 +275,50 @@ Save the full report to `.mdd/audits/scan-<date>.md`.
243
275
 
244
276
  ---
245
277
 
278
+
279
+ ```bash
280
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase SC3" end "$ARGUMENTS"
281
+ ```
282
+
283
+ ```bash
284
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "-" "complete" "$ARGUMENTS"
285
+ ```
246
286
  ## UPDATE MODE — `/mdd update <feature-id>`
247
287
 
248
288
  Triggered when arguments start with `update`. Updates an existing feature doc to reflect code that has changed since the last MDD session.
249
289
 
250
290
  ### Phase U1 — Load the feature
251
291
 
292
+ ```bash
293
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U1" start "$ARGUMENTS"
294
+ ```
295
+
252
296
  Parse `<feature-id>` from arguments (e.g., `04` or `04-content-builder`). Find the matching `.mdd/docs/*.md` file. Read it fully.
253
297
 
254
298
  If the feature-id is not found, list all available docs and ask the user to pick one.
255
299
 
300
+
301
+ ```bash
302
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U1" end "$ARGUMENTS"
303
+ ```
256
304
  ### Phase U2 — Read current source files
257
305
 
306
+ ```bash
307
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U2" start "$ARGUMENTS"
308
+ ```
309
+
258
310
  Read every file listed in `source_files` frontmatter. If a file is missing, note it as a broken reference — ask the user for the new path before continuing.
259
311
 
312
+
313
+ ```bash
314
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U2" end "$ARGUMENTS"
315
+ ```
260
316
  ### Phase U3 — Diff doc vs code
261
317
 
318
+ ```bash
319
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U3" start "$ARGUMENTS"
320
+ ```
321
+
262
322
  Compare what the doc says against what the code actually does:
263
323
  - New functions, endpoints, or exports not in the doc
264
324
  - Removed or renamed functions that the doc still mentions
@@ -268,8 +328,16 @@ Compare what the doc says against what the code actually does:
268
328
 
269
329
  Write findings to `.mdd/audits/update-notes-<feature-id>-<date>.md`.
270
330
 
331
+
332
+ ```bash
333
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U3" end "$ARGUMENTS"
334
+ ```
271
335
  ### Phase U4 — Present changes
272
336
 
337
+ ```bash
338
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U4" start "$ARGUMENTS"
339
+ ```
340
+
273
341
  ```
274
342
  📝 Update Review: <NN>-<feature-name>
275
343
 
@@ -287,8 +355,16 @@ Proceed with doc update? (yes / review findings first / cancel)
287
355
 
288
356
  Wait for user confirmation.
289
357
 
358
+
359
+ ```bash
360
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U4" end "$ARGUMENTS"
361
+ ```
290
362
  ### Phase U5 — Rewrite affected sections
291
363
 
364
+ ```bash
365
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U5" start "$ARGUMENTS"
366
+ ```
367
+
292
368
  Rewrite ONLY the sections that changed. Preserve:
293
369
  - `known_issues` section (don't remove existing issues)
294
370
  - `depends_on` list (only add, never remove without asking)
@@ -300,8 +376,16 @@ After rewriting, update frontmatter:
300
376
  - `phase:` — update to reflect current state
301
377
  - `path:` — if the doc is missing a `path` field, offer to add it: "This doc is missing a `path` field. Where does this feature live in the product? (e.g. `Auth/Login`)" — if the user provides a value, write it between `tags` and `known_issues` in the frontmatter.
302
378
 
379
+
380
+ ```bash
381
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U5" end "$ARGUMENTS"
382
+ ```
303
383
  ### Phase U6 — Regenerate test skeletons for new behaviors
304
384
 
385
+ ```bash
386
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U6" start "$ARGUMENTS"
387
+ ```
388
+
305
389
  For any NEW documented behaviors (not previously in the doc), generate test skeleton entries and append them to the existing test file. Do NOT modify existing test implementations.
306
390
 
307
391
  Report:
@@ -328,16 +412,36 @@ Read all `.mdd/docs/*.md` (excluding `archive/`) — frontmatter only (id, title
328
412
 
329
413
  ---
330
414
 
415
+
416
+ ```bash
417
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase U6" end "$ARGUMENTS"
418
+ ```
419
+
420
+ ```bash
421
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "-" "complete" "$ARGUMENTS"
422
+ ```
331
423
  ## DEPRECATE MODE — `/mdd deprecate <feature-id>`
332
424
 
333
425
  Triggered when arguments start with `deprecate`. Archives a feature cleanly.
334
426
 
335
427
  ### Phase D1 — Load + impact check
336
428
 
429
+ ```bash
430
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase D1" start "$ARGUMENTS"
431
+ ```
432
+
337
433
  Find and read the target feature doc. Then scan all other `.mdd/docs/*.md` for any that list this feature in `depends_on`. Build the impact list.
338
434
 
435
+
436
+ ```bash
437
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase D1" end "$ARGUMENTS"
438
+ ```
339
439
  ### Phase D2 — Present impact
340
440
 
441
+ ```bash
442
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase D2" start "$ARGUMENTS"
443
+ ```
444
+
341
445
  ```
342
446
  🗑️ Deprecate: <NN>-<feature-name>
343
447
 
@@ -361,8 +465,16 @@ Deprecate? (yes / review dependents first / cancel)
361
465
 
362
466
  If user says yes:
363
467
 
468
+
469
+ ```bash
470
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase D2" end "$ARGUMENTS"
471
+ ```
364
472
  ### Phase D3 — Archive
365
473
 
474
+ ```bash
475
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase D3" start "$ARGUMENTS"
476
+ ```
477
+
366
478
  1. Set `status: deprecated` and `last_synced: <today>` in the doc frontmatter.
367
479
  2. Create `.mdd/docs/archive/` directory if it doesn't exist.
368
480
  3. Move the doc file to `.mdd/docs/archive/`.
@@ -392,6 +504,14 @@ Test files: <kept/deleted per user choice>
392
504
 
393
505
  ---
394
506
 
507
+
508
+ ```bash
509
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase D3" end "$ARGUMENTS"
510
+ ```
511
+
512
+ ```bash
513
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "-" "complete" "$ARGUMENTS"
514
+ ```
395
515
  ## REBUILD-TAGS MODE — `/mdd rebuild-tags [--force]`
396
516
 
397
517
  Triggered when arguments start with `rebuild-tags`. Scans all feature docs and ops runbooks, generates `tags:` for any doc missing the field, then rebuilds `.startup.md`.
@@ -400,6 +520,10 @@ Triggered when arguments start with `rebuild-tags`. Scans all feature docs and o
400
520
 
401
521
  ### Phase RT1 — Inventory
402
522
 
523
+ ```bash
524
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase RT1" start "$ARGUMENTS"
525
+ ```
526
+
403
527
  1. Glob `.mdd/docs/*.md` (excluding `archive/`) and `.mdd/ops/*.md` (excluding `archive/`).
404
528
  2. For each doc, check frontmatter for a `tags:` field.
405
529
  3. Build an inventory table:
@@ -419,8 +543,16 @@ Docs needing tags: <N> of <total>
419
543
 
420
544
  If 0 docs need tags (and `--force` not passed) → report "All docs already have tags. `.startup.md` will be rebuilt." and jump to Phase RT3.
421
545
 
546
+
547
+ ```bash
548
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase RT1" end "$ARGUMENTS"
549
+ ```
422
550
  ### Phase RT2 — Generate Tags
423
551
 
552
+ ```bash
553
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase RT2" start "$ARGUMENTS"
554
+ ```
555
+
424
556
  For each doc missing `tags:` (or all docs if `--force`):
425
557
 
426
558
  1. Read the doc's frontmatter and `## Purpose` section (first paragraph only).
@@ -434,8 +566,16 @@ For each doc missing `tags:` (or all docs if `--force`):
434
566
 
435
567
  **`--force` behaviour:** Regenerate and overwrite `tags:` even on docs that already have them. Show old → new for each.
436
568
 
569
+
570
+ ```bash
571
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase RT2" end "$ARGUMENTS"
572
+ ```
437
573
  ### Phase RT3 — Rebuild Startup
438
574
 
575
+ ```bash
576
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase RT3" start "$ARGUMENTS"
577
+ ```
578
+
439
579
  Trigger the `.mdd/.startup.md` rebuild (same logic as Status Mode — rebuild auto-generated zone, preserve Notes zone). The rebuilt startup now reflects tags on every feature and ops line.
440
580
 
441
581
  Then regenerate connections.md:
@@ -448,8 +588,16 @@ Read all `.mdd/docs/*.md` (excluding `archive/`) — frontmatter only (id, title
448
588
  4. **Warnings:** flag broken `depends_on` references (target does not exist), circular dependencies, docs missing `path` field.
449
589
  5. **Write** `.mdd/connections.md` with YAML frontmatter (`generated: <today>`, `doc_count: <N>`, `connection_count: <N edges>`, `overlap_count: <N overlap files>`) followed by four sections: Path Tree, Dependency Graph (Mermaid), Source File Overlap, Warnings.
450
590
 
591
+
592
+ ```bash
593
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase RT3" end "$ARGUMENTS"
594
+ ```
451
595
  ### Phase RT4 — Report
452
596
 
597
+ ```bash
598
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase RT4" start "$ARGUMENTS"
599
+ ```
600
+
453
601
  ```
454
602
  ✅ Rebuild Tags Complete
455
603
 
@@ -468,8 +616,20 @@ Run /mdd status to see the full updated startup snapshot.
468
616
 
469
617
  ---
470
618
 
619
+
620
+ ```bash
621
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "Phase RT4" end "$ARGUMENTS"
622
+ ```
623
+
624
+ ```bash
625
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "-" "complete" "$ARGUMENTS"
626
+ ```
471
627
  ## CONNECT MODE — `/mdd connect`
472
628
 
629
+ ```bash
630
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "CONNECT" start "$ARGUMENTS"
631
+ ```
632
+
473
633
  Triggered when arguments start with `connect`. Performs a full rebuild of `.mdd/connections.md` unconditionally — no staleness check, always regenerates from scratch.
474
634
 
475
635
  **Regenerate `.mdd/connections.md`:**
@@ -491,3 +651,12 @@ Report when done:
491
651
 
492
652
  ✅ .mdd/connections.md updated (<today>)
493
653
  ```
654
+
655
+
656
+ ```bash
657
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "CONNECT" end "$ARGUMENTS"
658
+ ```
659
+
660
+ ```bash
661
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manage" "-" "complete" "$ARGUMENTS"
662
+ ```
@@ -2,28 +2,12 @@
2
2
 
3
3
  Triggered when arguments start with `manual`.
4
4
 
5
- ## Phase Logging
6
-
7
- 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 M1`, `Phase M2`) and `EVENT` with `start` or `end`:
5
+ ### Phase M1 - Scope & Hash Check
8
6
 
9
7
  ```bash
10
- 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-manual | PHASE | EVENT | %s | %s |\n" "$D" "$T" "$K" >> ~/.claude/mdd/log.md' 2>/dev/null || true
8
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manual" "Phase M1" start "$ARGUMENTS"
11
9
  ```
12
10
 
13
- Log file: `~/.claude/mdd/log.md`
14
-
15
- Generates a comprehensive, print-ready user manual at `.mdd/manual/manual.md` from all
16
- MDD feature docs and ops runbooks. Uses content hashes to detect what changed since the
17
- last run - only stale sections are regenerated.
18
-
19
- Sections are written to disk **immediately after each generation batch completes** - never
20
- held in memory until the end. This means compaction mid-run loses at most one batch of
21
- sections, and the next run can resume from the saved state.
22
-
23
- ---
24
-
25
- ### Phase M1 - Scope & Hash Check
26
-
27
11
  **Step 1 - Guard against empty projects**
28
12
 
29
13
  Check `.mdd/docs/`. If it contains zero `.md` files:
@@ -88,8 +72,16 @@ Stop here.
88
72
 
89
73
  ---
90
74
 
75
+
76
+ ```bash
77
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manual" "Phase M1" end "$ARGUMENTS"
78
+ ```
91
79
  ### Phase M2 - Skeleton Init (before generating any sections)
92
80
 
81
+ ```bash
82
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manual" "Phase M2" start "$ARGUMENTS"
83
+ ```
84
+
93
85
  Before generating any sections, ensure `manual.md` is in a writable state on disk.
94
86
  This protects against compaction - each section written to disk is durable.
95
87
 
@@ -160,8 +152,16 @@ each removal.
160
152
 
161
153
  ---
162
154
 
155
+
156
+ ```bash
157
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manual" "Phase M2" end "$ARGUMENTS"
158
+ ```
163
159
  ### Phase M3 - Section Generation (incremental, batch-by-batch)
164
160
 
161
+ ```bash
162
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manual" "Phase M3" start "$ARGUMENTS"
163
+ ```
164
+
165
165
  For each `changed` or `new` doc, generate a user-friendly manual section. The section
166
166
  must be readable by someone who has never seen the source code - focus on WHAT the
167
167
  feature does and HOW to use it, not implementation details.
@@ -259,8 +259,16 @@ section header.
259
259
 
260
260
  ---
261
261
 
262
+
263
+ ```bash
264
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manual" "Phase M3" end "$ARGUMENTS"
265
+ ```
262
266
  ### Phase M4 - Final Assembly
263
267
 
268
+ ```bash
269
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manual" "Phase M4" start "$ARGUMENTS"
270
+ ```
271
+
264
272
  After all sections are on disk, perform final assembly passes on `manual.md`.
265
273
 
266
274
  **Step 1 - Rebuild aggregated reference sections**
@@ -373,8 +381,16 @@ Write the final assembled `manual.md` to disk.
373
381
 
374
382
  ---
375
383
 
384
+
385
+ ```bash
386
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manual" "Phase M4" end "$ARGUMENTS"
387
+ ```
376
388
  ### Phase M5 - Write Hashes & Report
377
389
 
390
+ ```bash
391
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manual" "Phase M5" start "$ARGUMENTS"
392
+ ```
393
+
378
394
  **Step 1 - Update hash store**
379
395
 
380
396
  Write `.mdd/manual/.hashes.json` with:
@@ -450,3 +466,12 @@ If `/mdd manual` was interrupted mid-generation (context compaction, session end
450
466
 
451
467
  To skip regenerating sections that look complete, a user can run `--force` after manually
452
468
  verifying the manual looks correct, then let Phase M5 write the hash file to seal the run.
469
+
470
+
471
+ ```bash
472
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manual" "Phase M5" end "$ARGUMENTS"
473
+ ```
474
+
475
+ ```bash
476
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-manual" "-" "complete" "$ARGUMENTS"
477
+ ```