@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.
@@ -2,22 +2,12 @@
2
2
 
3
3
  Triggered when arguments start with `import-spec`.
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 IS1`, `Phase IS3`) and `EVENT` with `start` or `end`:
5
+ ### Phase IS1 — Read Spec Files
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-import-spec | 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-import-spec" "Phase IS1" start "$ARGUMENTS"
11
9
  ```
12
10
 
13
- Log file: `~/.claude/mdd/log.md`
14
-
15
- Reads one or more large spec or prompt documents — the kind produced by extended brainstorming sessions with Claude — and converts them into properly structured MDD initiatives, waves, and feature docs. Every decision in the spec is preserved. Duplicate or overlapping topics are merged intelligently. Features are numbered and waved in **build dependency order**, not spec-reading order.
16
-
17
- ---
18
-
19
- ### Phase IS1 — Read Spec Files
20
-
21
11
  **Stale job detection (runs first):** Check `.mdd/jobs/` for any existing `import-*/` folder.
22
12
  - If found: read its `MANIFEST.md` and count written vs total files. Present to user:
23
13
  ```
@@ -68,8 +58,16 @@ If multiple files are provided, merge all content into a single working document
68
58
 
69
59
  ---
70
60
 
61
+
62
+ ```bash
63
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "Phase IS1" end "$ARGUMENTS"
64
+ ```
71
65
  ### Phase IS2 — Feature Extraction, Classification + Path Grouping
72
66
 
67
+ ```bash
68
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "Phase IS2" start "$ARGUMENTS"
69
+ ```
70
+
73
71
  This phase runs in four steps. Build-order classification (IS2c) always precedes structure determination (IS2d) because the correct numbering depends on understanding what you build vs. what you reference.
74
72
 
75
73
  #### Step IS2a — Extract features + record source line ranges
@@ -237,8 +235,16 @@ These thresholds are guidelines — apply judgment.
237
235
 
238
236
  ---
239
237
 
238
+
239
+ ```bash
240
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "Phase IS2" end "$ARGUMENTS"
241
+ ```
240
242
  ### Phase IS2.5 — CLAUDE.md Check
241
243
 
244
+ ```bash
245
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "Phase IS2.5" start "$ARGUMENTS"
246
+ ```
247
+
242
248
  Before showing the dry-run preview, check the project's CLAUDE.md.
243
249
 
244
250
  Run: `[ -f CLAUDE.md ] && wc -l CLAUDE.md || echo "missing"`
@@ -294,8 +300,16 @@ This project uses MDD (Manual-Driven Development). The `.mdd/` directory contain
294
300
 
295
301
  ---
296
302
 
303
+
304
+ ```bash
305
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "Phase IS2.5" end "$ARGUMENTS"
306
+ ```
297
307
  ### Phase IS3 — Dry-Run Preview (mandatory gate)
298
308
 
309
+ ```bash
310
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "Phase IS3" start "$ARGUMENTS"
311
+ ```
312
+
299
313
  Before writing any files, display the complete proposed structure and wait for explicit user approval.
300
314
 
301
315
  ```
@@ -368,8 +382,16 @@ List every file that will be written in the order it will be written. Nothing pr
368
382
 
369
383
  ---
370
384
 
385
+
386
+ ```bash
387
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "Phase IS3" end "$ARGUMENTS"
388
+ ```
371
389
  ### Phase IS4 — Write Files
372
390
 
391
+ ```bash
392
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "Phase IS4" start "$ARGUMENTS"
393
+ ```
394
+
373
395
  **First — ensure the MDD directory structure exists.** Run these before writing any file:
374
396
 
375
397
  ```bash
@@ -585,8 +607,16 @@ Writing files...
585
607
 
586
608
  ---
587
609
 
610
+
611
+ ```bash
612
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "Phase IS4" end "$ARGUMENTS"
613
+ ```
588
614
  ### Phase IS5 — Rebuild .startup.md + Connections
589
615
 
616
+ ```bash
617
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "Phase IS5" start "$ARGUMENTS"
618
+ ```
619
+
590
620
  Rebuild `.mdd/.startup.md`:
591
621
  - Rebuild the auto-generated zone (Project Snapshot, Features Documented list with IDs, status, and tags; Ops Runbooks)
592
622
  - Add initiative and wave summary to the Features section: show initiative title, each wave with status, feature count
@@ -630,3 +660,12 @@ Next steps:
630
660
  /mdd audit — run a full audit across all imported docs
631
661
  /mdd <NN> — jump directly to any feature doc
632
662
  ```
663
+
664
+
665
+ ```bash
666
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "Phase IS5" end "$ARGUMENTS"
667
+ ```
668
+
669
+ ```bash
670
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-import-spec" "-" "complete" "$ARGUMENTS"
671
+ ```
@@ -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 R1`, `Phase G2`, `Phase UP3`) 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-lifecycle | 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
  ## REVERSE-ENGINEER MODE — `/mdd reverse-engineer [path or feature-id]`
14
2
 
15
3
  Triggered when arguments start with `reverse-engineer` or `reverse`. Generates or regenerates MDD documentation from existing source code.
16
4
 
17
5
  ### Phase R1 — Determine scope
18
6
 
7
+ ```bash
8
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase R1" start "$ARGUMENTS"
9
+ ```
10
+
19
11
  **If a path or feature-id is given:**
20
12
  - If it matches an existing `.mdd/docs/*.md` — load that doc as the "existing doc" for comparison (regenerate mode).
21
13
  - If it's a file path — read that file as the only source (new doc mode).
@@ -25,8 +17,16 @@ Triggered when arguments start with `reverse-engineer` or `reverse`. Generates o
25
17
  - Cross-reference against `source_files` fields in all `.mdd/docs/*.md`.
26
18
  - List files not registered in any doc. Ask the user which ones to document.
27
19
 
20
+
21
+ ```bash
22
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase R1" end "$ARGUMENTS"
23
+ ```
28
24
  ### Phase R2 — Read source files (parallelized for multi-file scope)
29
25
 
26
+ ```bash
27
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase R2" start "$ARGUMENTS"
28
+ ```
29
+
30
30
  **Threshold rule:**
31
31
  - ≤ 3 source files: read directly in the main conversation — no agent overhead
32
32
  - 4+ source files: batch into parallel Explore agents (max 3), each reading a subset
@@ -67,8 +67,16 @@ After all agents return, synthesize their output into Phase R3 (draft the doc).
67
67
 
68
68
  **Fallback:** If any agent fails, read that batch of files directly in the main conversation.
69
69
 
70
+
71
+ ```bash
72
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase R2" end "$ARGUMENTS"
73
+ ```
70
74
  ### Phase R3 — Draft the doc
71
75
 
76
+ ```bash
77
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase R3" start "$ARGUMENTS"
78
+ ```
79
+
72
80
  Draft a complete feature doc following the Phase 3 template. Set:
73
81
  - `last_synced: <today>`
74
82
  - `status: draft` (since business intent may be incomplete)
@@ -92,8 +100,16 @@ Ask: "Merge new draft into existing doc? (yes / keep existing / show full diff)"
92
100
 
93
101
  **In new doc mode:** Show the full draft and ask: "Does this accurately describe the feature? Anything to add or change?"
94
102
 
103
+
104
+ ```bash
105
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase R3" end "$ARGUMENTS"
106
+ ```
95
107
  ### Phase R4 — Save and optionally generate test skeletons
96
108
 
109
+ ```bash
110
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase R4" start "$ARGUMENTS"
111
+ ```
112
+
97
113
  After user confirmation, write the doc. Then ask:
98
114
  "Generate test skeletons from the inferred endpoints and business rules? (yes / no)"
99
115
 
@@ -109,20 +125,40 @@ If yes, follow Phase 4 logic using the newly written doc.
109
125
 
110
126
  ---
111
127
 
128
+
129
+ ```bash
130
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase R4" end "$ARGUMENTS"
131
+ ```
132
+
133
+ ```bash
134
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "-" "complete" "$ARGUMENTS"
135
+ ```
112
136
  ## GRAPH MODE — `/mdd graph`
113
137
 
114
138
  Triggered when arguments start with `graph`. Shows the cross-feature dependency map, plus initiative/wave structure if present.
115
139
 
116
140
  ### Phase G1 — Build dependency graph
117
141
 
142
+ ```bash
143
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase G1" start "$ARGUMENTS"
144
+ ```
145
+
118
146
  Read all `.mdd/docs/*.md` (including `archive/`). For each doc, extract `id`, `title`, `status`, and `depends_on`.
119
147
 
120
148
  Build a directed graph: edge A → B means "A depends on B" (B must exist for A to work).
121
149
 
122
150
  **Initiative/wave graph** (only shown if `.mdd/initiatives/` exists): Also read all initiative and wave files. Build a second graph showing the initiative → wave → feature doc hierarchy.
123
151
 
152
+
153
+ ```bash
154
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase G1" end "$ARGUMENTS"
155
+ ```
124
156
  ### Phase G2 — Detect issues
125
157
 
158
+ ```bash
159
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase G2" start "$ARGUMENTS"
160
+ ```
161
+
126
162
  **Broken dependency:** A doc lists a deprecated or archived feature in `depends_on`.
127
163
 
128
164
  **Risky dependency:** A `status: complete` feature depends on a `status: in_progress` or `status: draft` feature.
@@ -136,8 +172,16 @@ Build a directed graph: edge A → B means "A depends on B" (B must exist for A
136
172
  - A wave references a `dependsOn` wave that is not in the same initiative → invalid (cross-initiative deps not supported)
137
173
  - A feature doc whose slug appears in a wave but has no `docPath` set and status is `complete` → doc missing for completed feature
138
174
 
175
+
176
+ ```bash
177
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase G2" end "$ARGUMENTS"
178
+ ```
139
179
  ### Phase G3 — Render
140
180
 
181
+ ```bash
182
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase G3" start "$ARGUMENTS"
183
+ ```
184
+
141
185
  ```
142
186
  📊 MDD Dependency Graph
143
187
 
@@ -189,6 +233,14 @@ Save the graph to `.mdd/audits/graph-<date>.md`.
189
233
 
190
234
  ---
191
235
 
236
+
237
+ ```bash
238
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase G3" end "$ARGUMENTS"
239
+ ```
240
+
241
+ ```bash
242
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "-" "complete" "$ARGUMENTS"
243
+ ```
192
244
  ## UPGRADE MODE — `/mdd upgrade`
193
245
 
194
246
  Triggered when arguments start with `upgrade`.
@@ -201,6 +253,10 @@ Batch-patches missing frontmatter fields (`last_synced`, `status`, `phase`, `tag
201
253
 
202
254
  ### Phase UP1 — Inventory
203
255
 
256
+ ```bash
257
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase UP1" start "$ARGUMENTS"
258
+ ```
259
+
204
260
  1. Glob `.mdd/docs/*.md` (and `.mdd/docs/archive/*.md` if it exists). Collect all paths.
205
261
  2. For each doc, read its frontmatter only (up to the closing `---` line).
206
262
  3. Build an inventory table:
@@ -228,8 +284,16 @@ Fields to add:
228
284
 
229
285
  ---
230
286
 
287
+
288
+ ```bash
289
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase UP1" end "$ARGUMENTS"
290
+ ```
231
291
  ### Phase UP2 — Infer Defaults (per doc)
232
292
 
293
+ ```bash
294
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase UP2" start "$ARGUMENTS"
295
+ ```
296
+
233
297
  For each doc that needs patching, infer sensible defaults. **Do NOT ask the user for each doc** — infer silently, then show the plan for confirmation.
234
298
 
235
299
  **`last_synced` inference:**
@@ -273,8 +337,16 @@ For each doc missing `path`:
273
337
 
274
338
  ---
275
339
 
340
+
341
+ ```bash
342
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase UP2" end "$ARGUMENTS"
343
+ ```
276
344
  ### Phase UP3 — Show Plan + Confirm
277
345
 
346
+ ```bash
347
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase UP3" start "$ARGUMENTS"
348
+ ```
349
+
278
350
  Present the inferred patches to the user before writing anything:
279
351
 
280
352
  ```
@@ -308,8 +380,16 @@ If the user says **"yes"**: proceed to Phase UP4 with all inferred values.
308
380
 
309
381
  ---
310
382
 
383
+
384
+ ```bash
385
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase UP3" end "$ARGUMENTS"
386
+ ```
311
387
  ### Phase UP4 — Patch Docs
312
388
 
389
+ ```bash
390
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase UP4" start "$ARGUMENTS"
391
+ ```
392
+
313
393
  For each doc in the plan, patch the frontmatter block **non-destructively**:
314
394
 
315
395
  **Rules:**
@@ -354,8 +434,16 @@ Patching...
354
434
 
355
435
  ---
356
436
 
437
+
438
+ ```bash
439
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase UP4" end "$ARGUMENTS"
440
+ ```
357
441
  ### Phase UP5 — Verify + Rebuild Startup
358
442
 
443
+ ```bash
444
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase UP5" start "$ARGUMENTS"
445
+ ```
446
+
359
447
  After all patches are applied:
360
448
 
361
449
  1. Re-scan `.mdd/docs/*.md` — confirm 0 docs have missing `last_synced` or `path`
@@ -386,3 +474,12 @@ Run `/mdd scan` to see current drift status across all docs.
386
474
  ---
387
475
 
388
476
  ---
477
+
478
+
479
+ ```bash
480
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "Phase UP5" end "$ARGUMENTS"
481
+ ```
482
+
483
+ ```bash
484
+ bash ~/.claude/hooks/mdd-log-phase.sh "mdd-lifecycle" "-" "complete" "$ARGUMENTS"
485
+ ```