@thedecipherist/mdd 1.7.1 → 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.
- package/commands/mdd-audit.md +67 -10
- package/commands/mdd-bug.md +51 -12
- package/commands/mdd-build.md +75 -10
- 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.md +6 -0
- package/package.json +1 -1
package/commands/mdd-ops.md
CHANGED
|
@@ -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 OP1`, `Phase RO2`) 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-ops | 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
|
## OPS DOCUMENT MODE — `/mdd ops <description>`
|
|
14
2
|
|
|
15
3
|
Triggered when arguments start with `ops`. If arguments are exactly `ops list` → jump to **Ops List Mode** (Phase OL) instead.
|
|
16
4
|
|
|
17
5
|
### Phase OP1 — Scope, slug, and collision check
|
|
18
6
|
|
|
7
|
+
```bash
|
|
8
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase OP1" start "$RUNBOOK_SLUG"
|
|
9
|
+
```
|
|
10
|
+
|
|
19
11
|
**Step 1 — Ask scope first (before anything else):**
|
|
20
12
|
|
|
21
13
|
```
|
|
@@ -42,8 +34,16 @@ Derive a slug: lowercase, hyphens, drop filler words (e.g., "deploy swarmk to do
|
|
|
42
34
|
- **Does not exist** → proceed to Phase OP2 (create)
|
|
43
35
|
- **Exists** → tell the user: *"Runbook `<slug>` already exists. Use `/mdd update-op <slug>` to edit it or `/mdd runop <slug>` to execute it."* Stop.
|
|
44
36
|
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase OP1" end "$RUNBOOK_SLUG"
|
|
40
|
+
```
|
|
45
41
|
### Phase OP2 — Ask questions
|
|
46
42
|
|
|
43
|
+
```bash
|
|
44
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase OP2" start "$RUNBOOK_SLUG"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
47
|
Ask all questions in a single interaction:
|
|
48
48
|
|
|
49
49
|
1. "What is this deployment? (describe the target — e.g., swarmk API and dashboard to Dokploy US + EU)"
|
|
@@ -57,8 +57,16 @@ Ask all questions in a single interaction:
|
|
|
57
57
|
9. "Are any MCP servers required during deployment? (e.g., strictdb-mcp for post-deploy seeding)"
|
|
58
58
|
10. "What environments does this target? (staging / production / both)"
|
|
59
59
|
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase OP2" end "$RUNBOOK_SLUG"
|
|
63
|
+
```
|
|
60
64
|
### Phase OP3 — Write the runbook
|
|
61
65
|
|
|
66
|
+
```bash
|
|
67
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase OP3" start "$RUNBOOK_SLUG"
|
|
68
|
+
```
|
|
69
|
+
|
|
62
70
|
Create `.mdd/ops/<slug>.md` with full frontmatter and all 7 mandatory sections:
|
|
63
71
|
|
|
64
72
|
```markdown
|
|
@@ -137,8 +145,16 @@ Step 2 (Name):
|
|
|
137
145
|
<Specific steps to undo this deployment if it fails. Must be actionable, not "revert the commit".>
|
|
138
146
|
```
|
|
139
147
|
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase OP3" end "$RUNBOOK_SLUG"
|
|
151
|
+
```
|
|
140
152
|
### Phase OP4 — Offer next steps
|
|
141
153
|
|
|
154
|
+
```bash
|
|
155
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase OP4" start "$RUNBOOK_SLUG"
|
|
156
|
+
```
|
|
157
|
+
|
|
142
158
|
```
|
|
143
159
|
✅ Runbook created: .mdd/ops/<slug>.md
|
|
144
160
|
|
|
@@ -149,12 +165,24 @@ Next steps:
|
|
|
149
165
|
|
|
150
166
|
---
|
|
151
167
|
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase OP4" end "$RUNBOOK_SLUG"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "-" "complete" "$RUNBOOK_SLUG"
|
|
175
|
+
```
|
|
152
176
|
## OPS EXECUTE MODE — `/mdd runop <slug>`
|
|
153
177
|
|
|
154
178
|
Triggered when arguments start with `runop`. Executes an existing ops runbook with pre-flight health checks, canary-gated region deployment, and post-flight verification.
|
|
155
179
|
|
|
156
180
|
### Phase RO1 — Load runbook
|
|
157
181
|
|
|
182
|
+
```bash
|
|
183
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase RO1" start "$RUNBOOK_SLUG"
|
|
184
|
+
```
|
|
185
|
+
|
|
158
186
|
1. Parse `<slug>` from arguments — hard stop *"Slug required. Usage: /mdd runop <slug>"* if missing.
|
|
159
187
|
2. Locate the runbook (project-local first, then global):
|
|
160
188
|
- Check `.mdd/ops/<slug>.md` → found: announce *"Running project runbook: `<slug>`"*
|
|
@@ -162,8 +190,16 @@ Triggered when arguments start with `runop`. Executes an existing ops runbook wi
|
|
|
162
190
|
- Neither found → hard stop: *"No runbook found for `<slug>` (checked project and global). Run `/mdd ops <description>` to create one, or `/mdd ops list` to see all available runbooks."*
|
|
163
191
|
3. Parse all frontmatter fields: regions (sorted by `deploy_order`), services, `deployment_strategy`.
|
|
164
192
|
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase RO1" end "$RUNBOOK_SLUG"
|
|
196
|
+
```
|
|
165
197
|
### Phase RO2 — Pre-flight health check (all regions)
|
|
166
198
|
|
|
199
|
+
```bash
|
|
200
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase RO2" start "$RUNBOOK_SLUG"
|
|
201
|
+
```
|
|
202
|
+
|
|
167
203
|
Run each service's `health_check` for each of its declared regions. Display a status table:
|
|
168
204
|
|
|
169
205
|
```
|
|
@@ -187,8 +223,16 @@ For each service that is **not healthy**, ask per region:
|
|
|
187
223
|
(c) Abort — stop the entire runop
|
|
188
224
|
```
|
|
189
225
|
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase RO2" end "$RUNBOOK_SLUG"
|
|
229
|
+
```
|
|
190
230
|
### Phase RO3 — Deploy region by region (in deploy_order)
|
|
191
231
|
|
|
232
|
+
```bash
|
|
233
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase RO3" start "$RUNBOOK_SLUG"
|
|
234
|
+
```
|
|
235
|
+
|
|
192
236
|
For each region in `deploy_order` sequence:
|
|
193
237
|
|
|
194
238
|
**Step A — Deploy services in this region**
|
|
@@ -227,8 +271,16 @@ Write updated `status` and `last_checked` for all services in this region to fro
|
|
|
227
271
|
|
|
228
272
|
Gate passed → proceed to next region in `deploy_order`. Repeat Steps A–B.
|
|
229
273
|
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase RO3" end "$RUNBOOK_SLUG"
|
|
277
|
+
```
|
|
230
278
|
### Phase RO4 — Post-flight health check (all regions)
|
|
231
279
|
|
|
280
|
+
```bash
|
|
281
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase RO4" start "$RUNBOOK_SLUG"
|
|
282
|
+
```
|
|
283
|
+
|
|
232
284
|
Re-run all service health checks across all regions. Display full cross-region before → after table:
|
|
233
285
|
|
|
234
286
|
```
|
|
@@ -242,8 +294,16 @@ Post-flight Health Check — <slug>
|
|
|
242
294
|
Write final `status` and `last_checked` to all service region entries in frontmatter.
|
|
243
295
|
Any service still failing → append entry to `known_issues` in the doc.
|
|
244
296
|
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase RO4" end "$RUNBOOK_SLUG"
|
|
300
|
+
```
|
|
245
301
|
### Phase RO5 — Summary
|
|
246
302
|
|
|
303
|
+
```bash
|
|
304
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase RO5" start "$RUNBOOK_SLUG"
|
|
305
|
+
```
|
|
306
|
+
|
|
247
307
|
**Update the runbook frontmatter** — write this field before displaying the summary:
|
|
248
308
|
- `last_synced: <today>`
|
|
249
309
|
|
|
@@ -273,20 +333,40 @@ Fix: resolve <service> in <region-1>, then re-run /mdd runop <slug>
|
|
|
273
333
|
|
|
274
334
|
---
|
|
275
335
|
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase RO5" end "$RUNBOOK_SLUG"
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "-" "complete" "$RUNBOOK_SLUG"
|
|
343
|
+
```
|
|
276
344
|
## OPS UPDATE MODE — `/mdd update-op <slug>`
|
|
277
345
|
|
|
278
346
|
Triggered when arguments start with `update-op`. Updates an existing ops runbook.
|
|
279
347
|
|
|
280
348
|
### Phase UO1 — Load
|
|
281
349
|
|
|
350
|
+
```bash
|
|
351
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase UO1" start "$RUNBOOK_SLUG"
|
|
352
|
+
```
|
|
353
|
+
|
|
282
354
|
1. Parse `<slug>` — hard stop *"Slug required. Usage: /mdd update-op <slug>"* if missing.
|
|
283
355
|
2. Locate runbook (project-local first, then global):
|
|
284
356
|
- Check `.mdd/ops/<slug>.md` → found: load it, note scope = project
|
|
285
357
|
- Check `~/.claude/ops/<slug>.md` → found: load it, note scope = global
|
|
286
358
|
- Neither found → hard stop: *"No runbook found for `<slug>`. Run `/mdd ops list` to see all available runbooks."*
|
|
287
359
|
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase UO1" end "$RUNBOOK_SLUG"
|
|
363
|
+
```
|
|
288
364
|
### Phase UO2 — Re-ask with current values pre-filled
|
|
289
365
|
|
|
366
|
+
```bash
|
|
367
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase UO2" start "$RUNBOOK_SLUG"
|
|
368
|
+
```
|
|
369
|
+
|
|
290
370
|
Re-present the Phase OP2 questions with current values shown as defaults. User can accept (press enter) or type a new value. Only changed fields are rewritten.
|
|
291
371
|
|
|
292
372
|
Show a diff summary before writing:
|
|
@@ -299,8 +379,16 @@ Changes detected:
|
|
|
299
379
|
|
|
300
380
|
Ask: *"Apply these changes? (yes / cancel)"*
|
|
301
381
|
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase UO2" end "$RUNBOOK_SLUG"
|
|
385
|
+
```
|
|
302
386
|
### Phase UO3 — Rewrite and update
|
|
303
387
|
|
|
388
|
+
```bash
|
|
389
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase UO3" start "$RUNBOOK_SLUG"
|
|
390
|
+
```
|
|
391
|
+
|
|
304
392
|
Rewrite only changed sections. Preserve:
|
|
305
393
|
- `known_issues` (never remove existing entries without asking)
|
|
306
394
|
- Service `status` and `last_checked` values (these are live data, not config)
|
|
@@ -315,12 +403,24 @@ Update frontmatter: `last_synced: <today>`, `status: draft` if previously `compl
|
|
|
315
403
|
|
|
316
404
|
---
|
|
317
405
|
|
|
406
|
+
|
|
407
|
+
```bash
|
|
408
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase UO3" end "$RUNBOOK_SLUG"
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "-" "complete" "$RUNBOOK_SLUG"
|
|
413
|
+
```
|
|
318
414
|
## OPS LIST MODE — `/mdd ops list`
|
|
319
415
|
|
|
320
416
|
Triggered when arguments are exactly `ops list`. Lists all ops runbooks — global and project — in a single unified view.
|
|
321
417
|
|
|
322
418
|
### Phase OL — Scan and display
|
|
323
419
|
|
|
420
|
+
```bash
|
|
421
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase OL" start "$RUNBOOK_SLUG"
|
|
422
|
+
```
|
|
423
|
+
|
|
324
424
|
1. Glob `~/.claude/ops/*.md` — read each, extract `id`, `title`, `platform`, `status`, and the last `last_checked` value across all services.
|
|
325
425
|
2. Glob `.mdd/ops/*.md` (excluding `archive/`) — same fields.
|
|
326
426
|
3. Display unified list, grouped by scope:
|
|
@@ -349,12 +449,24 @@ No ops runbooks found.
|
|
|
349
449
|
|
|
350
450
|
---
|
|
351
451
|
|
|
452
|
+
|
|
453
|
+
```bash
|
|
454
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase OL" end "$RUNBOOK_SLUG"
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
```bash
|
|
458
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "-" "complete" "$RUNBOOK_SLUG"
|
|
459
|
+
```
|
|
352
460
|
## COMMANDS MODE — `/mdd commands`
|
|
353
461
|
|
|
354
462
|
Triggered when arguments start with `commands`. Outputs a reference table of every available MDD mode.
|
|
355
463
|
|
|
356
464
|
### Phase CM — Render Mode Reference
|
|
357
465
|
|
|
466
|
+
```bash
|
|
467
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase CM" start "$RUNBOOK_SLUG"
|
|
468
|
+
```
|
|
469
|
+
|
|
358
470
|
Read the **Step 0b — Detect Mode** block from this file (the loaded prompt). For every bullet point that maps an argument pattern to a mode, extract the trigger word(s) and the mode name. Then render the following table:
|
|
359
471
|
|
|
360
472
|
```
|
|
@@ -392,3 +504,12 @@ Run /mdd <feature description> to start building, /mdd ops <description> to crea
|
|
|
392
504
|
No files are created or modified by this mode.
|
|
393
505
|
|
|
394
506
|
---
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
```bash
|
|
510
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "Phase CM" end "$RUNBOOK_SLUG"
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
```bash
|
|
514
|
+
bash ~/.claude/hooks/mdd-log-phase.sh "mdd-ops" "-" "complete" "$RUNBOOK_SLUG"
|
|
515
|
+
```
|