@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.
- package/README.md +86 -0
- package/commands/mdd-audit.md +81 -6
- package/commands/mdd-bug.md +51 -12
- package/commands/mdd-build.md +88 -7
- package/commands/mdd-framework.md +101 -12
- package/commands/mdd-import-spec.md +51 -12
- package/commands/mdd-lifecycle.md +109 -12
- package/commands/mdd-manage.md +179 -10
- package/commands/mdd-manual.md +43 -18
- package/commands/mdd-ops.md +133 -12
- package/commands/mdd-plan.md +201 -14
- package/commands/mdd-rules-express.md +23 -0
- package/commands/mdd-rules-jwt.md +23 -0
- package/commands/mdd-rules-prisma.md +23 -0
- package/commands/mdd-rules-typescript.md +30 -0
- package/commands/mdd-security-rules.md +303 -0
- package/commands/mdd.md +88 -0
- package/package.json +1 -1
|
@@ -2,24 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Routes to one of three sub-modes based on the command used.
|
|
4
4
|
|
|
5
|
-
## Phase Logging
|
|
6
|
-
|
|
7
|
-
At the **start** of every step (before any action) and the **end** of every step (after all actions), run the command below. Substitute `PHASE` with the step identifier (e.g., `Step 1`, `Step 3`) and `EVENT` with `start` or `end`:
|
|
8
|
-
|
|
9
|
-
```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-framework | PHASE | EVENT | %s | %s |\n" "$D" "$T" "$K" >> ~/.claude/mdd/log.md' 2>/dev/null || true
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Log file: `~/.claude/mdd/log.md`
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
5
|
## `framework <feature>` — Add a Module to mdd-ecommerce
|
|
18
6
|
|
|
19
7
|
**$ARGUMENTS** is the feature description.
|
|
20
8
|
|
|
21
9
|
### Step 1 - Run normal BUILD MODE
|
|
22
10
|
|
|
11
|
+
```bash
|
|
12
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "fw-Step 1" start "$FEATURE_SLUG"
|
|
13
|
+
```
|
|
14
|
+
|
|
23
15
|
Read `$MDD_DIR/mdd-build.md` and follow every phase (branch check, context gather, questions, doc, implementation, tests). All standard MDD rules apply.
|
|
24
16
|
|
|
25
17
|
Apply these additional constraints throughout:
|
|
@@ -63,14 +55,34 @@ Use `skeleton-ready` when the module compiles but is not yet connected to real d
|
|
|
63
55
|
|
|
64
56
|
**$ARGUMENTS** is the path to a completed proposal markdown file.
|
|
65
57
|
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "fw-Step 1" end "$FEATURE_SLUG"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "-" "complete" "$FEATURE_SLUG"
|
|
65
|
+
```
|
|
66
66
|
### Step 1 - Read the proposal
|
|
67
67
|
|
|
68
|
+
```bash
|
|
69
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 1" start "$FEATURE_SLUG"
|
|
70
|
+
```
|
|
71
|
+
|
|
68
72
|
Read the file at `$ARGUMENTS`. If `$ARGUMENTS` is empty, ask: "What is the path to the proposal file?"
|
|
69
73
|
|
|
70
74
|
Stop if the file does not exist. Report the path and ask the user to check it.
|
|
71
75
|
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 1" end "$FEATURE_SLUG"
|
|
79
|
+
```
|
|
72
80
|
### Step 2 - Extract config values
|
|
73
81
|
|
|
82
|
+
```bash
|
|
83
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 2" start "$FEATURE_SLUG"
|
|
84
|
+
```
|
|
85
|
+
|
|
74
86
|
Parse the proposal for these values:
|
|
75
87
|
|
|
76
88
|
| Config key | Where to find it |
|
|
@@ -87,16 +99,32 @@ Parse the proposal for these values:
|
|
|
87
99
|
|
|
88
100
|
If any required value is missing, list the gaps and ask the user to supply them before continuing.
|
|
89
101
|
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 2" end "$FEATURE_SLUG"
|
|
105
|
+
```
|
|
90
106
|
### Step 3 - Parse the product catalog
|
|
91
107
|
|
|
108
|
+
```bash
|
|
109
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 3" start "$FEATURE_SLUG"
|
|
110
|
+
```
|
|
111
|
+
|
|
92
112
|
The proposal contains a markdown table with columns: `sku`, `mfr`, `name`, `description`, `brand`, `price`, `stock`.
|
|
93
113
|
|
|
94
114
|
Extract every row. Convert `price` to integers (cents/öre - multiply by 100 and round). Build TypeScript seed data from this table.
|
|
95
115
|
|
|
96
116
|
If the table is missing or empty, ask: "No products found in the catalog table. Add products to the proposal and re-run, or continue with an empty seed?"
|
|
97
117
|
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 3" end "$FEATURE_SLUG"
|
|
121
|
+
```
|
|
98
122
|
### Step 4 - Determine module wiring
|
|
99
123
|
|
|
124
|
+
```bash
|
|
125
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 4" start "$FEATURE_SLUG"
|
|
126
|
+
```
|
|
127
|
+
|
|
100
128
|
Based on the feature flags extracted in Step 2, decide which `@thedecipherist/mdd-ecommerce-*` packages to import and wire into `site.config.ts`:
|
|
101
129
|
|
|
102
130
|
- `newsletter: true` → include `@thedecipherist/mdd-ecommerce-newsletter`
|
|
@@ -105,8 +133,16 @@ Based on the feature flags extracted in Step 2, decide which `@thedecipherist/md
|
|
|
105
133
|
|
|
106
134
|
Always include `@thedecipherist/mdd-ecommerce-core`.
|
|
107
135
|
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 4" end "$FEATURE_SLUG"
|
|
139
|
+
```
|
|
108
140
|
### Step 5 - Generate files
|
|
109
141
|
|
|
142
|
+
```bash
|
|
143
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 5" start "$FEATURE_SLUG"
|
|
144
|
+
```
|
|
145
|
+
|
|
110
146
|
Write all files to the current working directory.
|
|
111
147
|
|
|
112
148
|
**`site.config.ts`:**
|
|
@@ -162,8 +198,16 @@ NEXT_PUBLIC_RYBBIT_URL=https://app.rybbit.io
|
|
|
162
198
|
# add any other vars from the main mdd-ecommerce .env.example
|
|
163
199
|
```
|
|
164
200
|
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 5" end "$FEATURE_SLUG"
|
|
204
|
+
```
|
|
165
205
|
### Step 6 - Report
|
|
166
206
|
|
|
207
|
+
```bash
|
|
208
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 6" start "$FEATURE_SLUG"
|
|
209
|
+
```
|
|
210
|
+
|
|
167
211
|
List every file written with its path. Then output:
|
|
168
212
|
|
|
169
213
|
```
|
|
@@ -179,24 +223,60 @@ Next steps:
|
|
|
179
223
|
|
|
180
224
|
Run this from the root of a client project directory.
|
|
181
225
|
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "ic-Step 6" end "$FEATURE_SLUG"
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "-" "complete" "$FEATURE_SLUG"
|
|
233
|
+
```
|
|
182
234
|
### Step 1 - Read package.json
|
|
183
235
|
|
|
236
|
+
```bash
|
|
237
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "cs-Step 1" start "$FEATURE_SLUG"
|
|
238
|
+
```
|
|
239
|
+
|
|
184
240
|
Read `package.json` in the current directory. Find all dependencies and devDependencies whose names start with `@thedecipherist/mdd-ecommerce-`. List each with its pinned version.
|
|
185
241
|
|
|
186
242
|
If no such dependencies exist, report: "No mdd-ecommerce packages found in package.json. Is this the right directory?"
|
|
187
243
|
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "cs-Step 1" end "$FEATURE_SLUG"
|
|
247
|
+
```
|
|
188
248
|
### Step 2 - Read site.config.ts
|
|
189
249
|
|
|
250
|
+
```bash
|
|
251
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "cs-Step 2" start "$FEATURE_SLUG"
|
|
252
|
+
```
|
|
253
|
+
|
|
190
254
|
Read `site.config.ts`. Extract:
|
|
191
255
|
- Which slots have modules wired (non-null slot values)
|
|
192
256
|
- Which feature flags are `true`
|
|
193
257
|
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "cs-Step 2" end "$FEATURE_SLUG"
|
|
261
|
+
```
|
|
194
262
|
### Step 3 - Check MDD docs
|
|
195
263
|
|
|
264
|
+
```bash
|
|
265
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "cs-Step 3" start "$FEATURE_SLUG"
|
|
266
|
+
```
|
|
267
|
+
|
|
196
268
|
Check if `.mdd/docs/` exists. If yes, count the `.md` files inside.
|
|
197
269
|
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "cs-Step 3" end "$FEATURE_SLUG"
|
|
273
|
+
```
|
|
198
274
|
### Step 4 - Output status table
|
|
199
275
|
|
|
276
|
+
```bash
|
|
277
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "cs-Step 4" start "$FEATURE_SLUG"
|
|
278
|
+
```
|
|
279
|
+
|
|
200
280
|
```
|
|
201
281
|
mdd-ecommerce Client Status
|
|
202
282
|
============================
|
|
@@ -213,3 +293,12 @@ MDD docs: <N> files in .mdd/docs/ (or "directory not found")
|
|
|
213
293
|
```
|
|
214
294
|
|
|
215
295
|
If `site.config.ts` does not exist, report that and skip slots/features rows.
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "cs-Step 4" end "$FEATURE_SLUG"
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-framework" "-" "complete" "$FEATURE_SLUG"
|
|
304
|
+
```
|
|
@@ -2,22 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Triggered when arguments start with `import-spec`.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
|
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
|
+
```
|