@thedecipherist/mdd 1.0.2 → 1.1.1
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 +8 -3
- package/commands/mdd-audit.md +2 -2
- package/commands/mdd-build.md +1 -0
- package/commands/mdd-lifecycle.md +10 -6
- package/commands/mdd-manage.md +69 -3
- package/commands/mdd-ops.md +1 -0
- package/commands/mdd.md +17 -8
- package/dist/cli.js +9 -2
- package/dist/cli.js.map +1 -1
- package/dist/install.d.ts +1 -0
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +59 -1
- package/dist/install.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -108,9 +108,12 @@ mdd install # copies Claude commands to ~/.claude/commands/
|
|
|
108
108
|
|
|
109
109
|
After installation, `/mdd` is available in every Claude Code session globally - no per-project setup needed.
|
|
110
110
|
|
|
111
|
+
`mdd install` also injects a guidance block into `~/.claude/CLAUDE.md` so Claude automatically suggests the right MDD workflow whenever you make an implementation request without the `/mdd` flag.
|
|
112
|
+
|
|
111
113
|
```bash
|
|
112
|
-
mdd update
|
|
113
|
-
mdd install --dir /custom/path
|
|
114
|
+
mdd update # update to latest installed version
|
|
115
|
+
mdd install --dir /custom/path # install to a custom directory (skips CLAUDE.md injection)
|
|
116
|
+
mdd install --install-local # install to .claude/commands/ + injects into ./CLAUDE.md
|
|
114
117
|
```
|
|
115
118
|
|
|
116
119
|
**Version safety:** `mdd install` compares `mdd_version` between the installed and available versions before overwriting. If you have a newer version installed, it won't silently downgrade.
|
|
@@ -138,7 +141,7 @@ npm install -g @thedecipherist/mdd && mdd install
|
|
|
138
141
|
|
|
139
142
|
---
|
|
140
143
|
|
|
141
|
-
## All
|
|
144
|
+
## All 22 Modes at a Glance
|
|
142
145
|
|
|
143
146
|
```
|
|
144
147
|
/mdd <feature description> Build Mode - Document, plan, and implement
|
|
@@ -146,6 +149,7 @@ npm install -g @thedecipherist/mdd && mdd install
|
|
|
146
149
|
/mdd status Overview: docs, tests, audit state, initiatives
|
|
147
150
|
/mdd scan Detect features whose source files changed
|
|
148
151
|
/mdd update <feature-id> Re-sync a feature doc after code changes
|
|
152
|
+
/mdd rebuild-tags [--force] Generate tags for all docs and rebuild .startup.md
|
|
149
153
|
/mdd note "text" Append a timestamped note to .mdd/.startup.md
|
|
150
154
|
/mdd note list Print the Notes section
|
|
151
155
|
/mdd note clear Wipe all notes (asks for confirmation)
|
|
@@ -692,6 +696,7 @@ Every `.mdd/docs/<NN>-<feature-name>.md` file uses this YAML frontmatter:
|
|
|
692
696
|
| `status` | `draft` → `in_progress` → `complete` → `deprecated` |
|
|
693
697
|
| `phase` | Last completed phase name |
|
|
694
698
|
| `mdd_version` | Version of MDD that created/last updated this doc |
|
|
699
|
+
| `tags` | 4–8 domain-concept keywords surfaced in `.startup.md` so Claude can detect when a prompt relates to this feature (e.g. `[auth, jwt, login, sessions]`) |
|
|
695
700
|
| `known_issues` | Issues discovered during audits or implementation |
|
|
696
701
|
|
|
697
702
|
**`depends_on` rules:**
|
package/commands/mdd-audit.md
CHANGED
|
@@ -214,7 +214,7 @@ Estimated fix time: <N> hours (traditional) → <N> minutes (MDD)
|
|
|
214
214
|
Fix all now? (yes / review report first / fix only P1+P2)
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
**After the report is written**, trigger the `.mdd/.startup.md` rebuild (same logic as in Status Mode — rebuild auto-generated zone, preserve Notes zone) so the Last Audit block
|
|
217
|
+
**After the report is written**, run a tag pass before the startup rebuild: for any `.mdd/docs/*.md` or `.mdd/ops/*.md` file missing a `tags:` field, generate and write tags now (same logic as Phase RT2 in REBUILD-TAGS MODE). Docs that already have `tags:` are untouched. Then trigger the `.mdd/.startup.md` rebuild (same logic as in Status Mode — rebuild auto-generated zone, preserve Notes zone) so the Last Audit block and tag-enriched feature list are both current.
|
|
218
218
|
|
|
219
219
|
If user says yes (or selects a subset):
|
|
220
220
|
|
|
@@ -226,7 +226,7 @@ If user says yes (or selects a subset):
|
|
|
226
226
|
|
|
227
227
|
Report progress per finding. Update documentation `known_issues` to remove fixed items. Update `mdd_version` to current on every `.mdd/docs/*.md` file that is edited during fixes.
|
|
228
228
|
|
|
229
|
-
**After fixes are complete and results are written to `.mdd/audits/results-<date>.md`**, trigger the `.mdd/.startup.md` rebuild so the Last Audit block
|
|
229
|
+
**After fixes are complete and results are written to `.mdd/audits/results-<date>.md`**, run the same tag pass (generate missing tags for any doc still lacking them), then trigger the `.mdd/.startup.md` rebuild so the Last Audit block and tag list both reflect the final state.
|
|
230
230
|
|
|
231
231
|
---
|
|
232
232
|
|
package/commands/mdd-build.md
CHANGED
|
@@ -191,6 +191,7 @@ last_synced: <YYYY-MM-DD>
|
|
|
191
191
|
status: draft
|
|
192
192
|
phase: <last completed phase name, or "all" when fully built>
|
|
193
193
|
mdd_version: <read from mdd.md frontmatter mdd_version field>
|
|
194
|
+
tags: [<4-8 domain-concept keywords — systems touched, technology, feature names. NOT file paths>]
|
|
194
195
|
known_issues: []
|
|
195
196
|
---
|
|
196
197
|
|
|
@@ -61,6 +61,7 @@ Draft a complete feature doc following the Phase 3 template. Set:
|
|
|
61
61
|
- `last_synced: <today>`
|
|
62
62
|
- `status: draft` (since business intent may be incomplete)
|
|
63
63
|
- `phase: reverse-engineered`
|
|
64
|
+
- `tags: [...]` — infer 4–8 domain-concept keywords from the inferred purpose, routes, models, and source file names. NOT raw file paths — use the concept (e.g. `auth`, `api`, `stripe` not `src/handlers/stripe.ts`)
|
|
64
65
|
|
|
65
66
|
**In regenerate mode:** Show the existing doc alongside the new draft:
|
|
66
67
|
```
|
|
@@ -195,11 +196,11 @@ Batch-patches missing frontmatter fields (`last_synced`, `status`, `phase`) acro
|
|
|
195
196
|
```
|
|
196
197
|
📋 Upgrade Inventory
|
|
197
198
|
|
|
198
|
-
Doc | last_synced | status | phase
|
|
199
|
-
|
|
200
|
-
01-project-scaffolding | ❌ missing | ❌ | ❌
|
|
201
|
-
02-profile-system | ❌ missing | ✅ | ❌
|
|
202
|
-
03-database-layer | ✅ present | ✅ | ✅
|
|
199
|
+
Doc | last_synced | status | phase | tags
|
|
200
|
+
─────────────────────────────────|─────────────|────────|───────|──────
|
|
201
|
+
01-project-scaffolding | ❌ missing | ❌ | ❌ | ❌
|
|
202
|
+
02-profile-system | ❌ missing | ✅ | ❌ | ✅
|
|
203
|
+
03-database-layer | ✅ present | ✅ | ✅ | ❌
|
|
203
204
|
...
|
|
204
205
|
|
|
205
206
|
Docs needing upgrade: <N> of <total>
|
|
@@ -207,6 +208,7 @@ Fields to add:
|
|
|
207
208
|
last_synced — <N> docs
|
|
208
209
|
status — <N> docs
|
|
209
210
|
phase — <N> docs
|
|
211
|
+
tags — <N> docs (run /mdd rebuild-tags after upgrade to populate)
|
|
210
212
|
```
|
|
211
213
|
|
|
212
214
|
4. If 0 docs need upgrade → report "All docs are up to date. Nothing to patch." and stop.
|
|
@@ -307,11 +309,13 @@ data_flow: ...
|
|
|
307
309
|
last_synced: <new> ← insert here if missing
|
|
308
310
|
status: <new> ← insert here if missing
|
|
309
311
|
phase: <new> ← insert here if missing
|
|
312
|
+
mdd_version: <new> ← insert here if missing
|
|
313
|
+
tags: <new> ← insert here if missing (do not generate tags in upgrade — run /mdd rebuild-tags after)
|
|
310
314
|
known_issues: []
|
|
311
315
|
---
|
|
312
316
|
```
|
|
313
317
|
|
|
314
|
-
Insert new fields **before** `known_issues` to keep the canonical order.
|
|
318
|
+
Insert new fields **before** `known_issues` to keep the canonical order. **Do not attempt to generate tag values during upgrade** — tags require reading doc content to produce meaningful keywords. After running upgrade, run `/mdd rebuild-tags` to populate tags on any docs that need them.
|
|
315
319
|
|
|
316
320
|
Report progress as you go:
|
|
317
321
|
```
|
package/commands/mdd-manage.md
CHANGED
|
@@ -7,7 +7,7 @@ Quick overview of MDD state for the project:
|
|
|
7
7
|
3. **Scan `.mdd/jobs/`** — detect any active audit job (see below)
|
|
8
8
|
4. **Count tests** — `pnpm test:unit --reporter=json 2>/dev/null | jq '.numTotalTests'`
|
|
9
9
|
5. **Count known issues** — grep `known_issues` across all docs
|
|
10
|
-
6. **Read current mdd_version** — from `mdd.md` frontmatter (
|
|
10
|
+
6. **Read current mdd_version** — from `mdd.md` frontmatter. Check `.claude/commands/mdd.md` first (local install), then `~/.claude/commands/mdd.md` (global install). Use whichever exists.
|
|
11
11
|
7. **Scan all `.mdd/` files** — grep `mdd_version` from each, group by version number
|
|
12
12
|
8. **Scan `.mdd/initiatives/`** — count initiative files, group by status
|
|
13
13
|
9. **Scan `.mdd/waves/`** — count wave files, group by status; for each active wave count complete vs total features
|
|
@@ -63,8 +63,8 @@ After collecting status, rebuild the auto-generated zone of `.mdd/.startup.md`:
|
|
|
63
63
|
- `Generated: <YYYY-MM-DD>` (date only, no time)
|
|
64
64
|
- `Branch:` from `git branch --show-current`
|
|
65
65
|
- `Stack:` from `CLAUDE.md` or `claude-mastery-project.conf` if detectable, otherwise `(unknown)`
|
|
66
|
-
- `Features Documented:` sorted list of `.mdd/docs/*.md` filenames with status
|
|
67
|
-
- `Ops Runbooks:` sorted list of `.mdd/ops/*.md` filenames with
|
|
66
|
+
- `Features Documented:` sorted list of `.mdd/docs/*.md` filenames with status and tags — format: `- <id> (<status>) [tag1, tag2, ...]`. If `tags:` is missing from a doc, omit the bracket section for that entry.
|
|
67
|
+
- `Ops Runbooks:` sorted list of `.mdd/ops/*.md` filenames with tags — format: `- <slug> [tag1, tag2, ...]`. Omit section entirely if `.mdd/ops/` is empty.
|
|
68
68
|
- `Last Audit:` from the most recent `.mdd/audits/report-*.md` — extract findings/fixed/open counts
|
|
69
69
|
- `Rules Summary:` static block (does not change)
|
|
70
70
|
3. Write the rebuilt auto-generated section + `---` divider + preserved Notes section back to `.mdd/.startup.md`. Update `mdd_version` in the file's frontmatter to current.
|
|
@@ -338,3 +338,69 @@ Test files: <kept/deleted per user choice>
|
|
|
338
338
|
```
|
|
339
339
|
|
|
340
340
|
---
|
|
341
|
+
|
|
342
|
+
## REBUILD-TAGS MODE — `/mdd rebuild-tags [--force]`
|
|
343
|
+
|
|
344
|
+
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`.
|
|
345
|
+
|
|
346
|
+
**Use case:** Migrating existing projects to the tag system. Safe to run multiple times — docs that already have `tags:` are skipped unless `--force` is passed.
|
|
347
|
+
|
|
348
|
+
### Phase RT1 — Inventory
|
|
349
|
+
|
|
350
|
+
1. Glob `.mdd/docs/*.md` (excluding `archive/`) and `.mdd/ops/*.md` (excluding `archive/`).
|
|
351
|
+
2. For each doc, check frontmatter for a `tags:` field.
|
|
352
|
+
3. Build an inventory table:
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
🏷️ Rebuild Tags — Inventory
|
|
356
|
+
|
|
357
|
+
Doc | Has tags?
|
|
358
|
+
─────────────────────────────────|──────────
|
|
359
|
+
01-docs-site | ❌ missing
|
|
360
|
+
02-dashboards-showcase | ❌ missing
|
|
361
|
+
03-install-local-flag | ✅ present
|
|
362
|
+
swarmk-dokploy (ops) | ❌ missing
|
|
363
|
+
|
|
364
|
+
Docs needing tags: <N> of <total>
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
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.
|
|
368
|
+
|
|
369
|
+
### Phase RT2 — Generate Tags
|
|
370
|
+
|
|
371
|
+
For each doc missing `tags:` (or all docs if `--force`):
|
|
372
|
+
|
|
373
|
+
1. Read the doc's frontmatter and `## Purpose` section (first paragraph only).
|
|
374
|
+
2. Generate 4–8 domain-concept keywords that identify what the doc is about:
|
|
375
|
+
- Use: title words, purpose concepts, platform/technology names, key system names, operation types
|
|
376
|
+
- Do NOT use: raw file paths, generic words like "feature" or "system", version numbers
|
|
377
|
+
- For ops docs: emphasise platform, services, environments, operation type (e.g. `deploy`, `dokploy`, `docker`, `canary`)
|
|
378
|
+
- For feature docs: emphasise domain concepts, technology, feature names (e.g. `auth`, `cli`, `install`, `flags`)
|
|
379
|
+
3. Write `tags:` to the doc frontmatter, inserting it **before** `known_issues:`.
|
|
380
|
+
4. Report one line per doc: `✅ 01-docs-site — tags: [github-pages, documentation, landing-page, user-guide]`
|
|
381
|
+
|
|
382
|
+
**`--force` behaviour:** Regenerate and overwrite `tags:` even on docs that already have them. Show old → new for each.
|
|
383
|
+
|
|
384
|
+
### Phase RT3 — Rebuild Startup
|
|
385
|
+
|
|
386
|
+
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.
|
|
387
|
+
|
|
388
|
+
### Phase RT4 — Report
|
|
389
|
+
|
|
390
|
+
```
|
|
391
|
+
✅ Rebuild Tags Complete
|
|
392
|
+
|
|
393
|
+
Feature docs processed: <N>
|
|
394
|
+
Ops runbooks processed: <N>
|
|
395
|
+
Tags generated: <N> docs
|
|
396
|
+
Tags skipped (present): <N> docs
|
|
397
|
+
|
|
398
|
+
.startup.md rebuilt with tag format:
|
|
399
|
+
- 01-docs-site (complete) [github-pages, documentation, landing-page, user-guide]
|
|
400
|
+
- 03-install-local-flag (complete) [cli, install, local-install, flags]
|
|
401
|
+
...
|
|
402
|
+
|
|
403
|
+
Run /mdd status to see the full updated startup snapshot.
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
---
|
package/commands/mdd-ops.md
CHANGED
package/commands/mdd.md
CHANGED
|
@@ -53,6 +53,11 @@ Framework: (unknown) | DB: (unknown) | Host: (unknown)
|
|
|
53
53
|
|
|
54
54
|
## Features Documented
|
|
55
55
|
(none yet — run /mdd <feature> to create your first doc)
|
|
56
|
+
Format once populated: - <id> (<status>) [tag1, tag2, ...]
|
|
57
|
+
|
|
58
|
+
## Ops Runbooks
|
|
59
|
+
(none yet — run /mdd ops <description> to create one)
|
|
60
|
+
Format once populated: - <slug> [tag1, tag2, ...]
|
|
56
61
|
|
|
57
62
|
## Last Audit
|
|
58
63
|
(no audit run yet — run /mdd audit to generate findings)
|
|
@@ -99,26 +104,30 @@ The user's full arguments are: **$ARGUMENTS**
|
|
|
99
104
|
|
|
100
105
|
Parse these arguments to determine the mode. **Before doing anything else, read the appropriate mode file listed below.** The mode file contains the complete instructions for that mode. When mode file instructions reference `$ARGUMENTS`, treat it as the arguments stated above.
|
|
101
106
|
|
|
102
|
-
Find the MDD commands directory by checking
|
|
107
|
+
Find the MDD commands directory by checking in this order:
|
|
108
|
+
1. `.claude/commands/` in the current project (local install via `mdd install --install-local`)
|
|
109
|
+
2. `~/.claude/commands/` (global install via `npm install -g @thedecipherist/mdd && mdd install`)
|
|
110
|
+
|
|
111
|
+
Use whichever path contains `mdd-audit.md`. Store it as `$MDD_DIR` and use it for all mode file reads below.
|
|
103
112
|
|
|
104
113
|
- If arguments start with `audit` →
|
|
105
|
-
**Read
|
|
114
|
+
**Read `$MDD_DIR/mdd-audit.md` then follow its AUDIT MODE instructions.**
|
|
106
115
|
|
|
107
|
-
- If arguments start with `status`, `note`, `scan`, `update`, or `
|
|
108
|
-
**Read
|
|
116
|
+
- If arguments start with `status`, `note`, `scan`, `update`, `deprecate`, or `rebuild-tags` →
|
|
117
|
+
**Read `$MDD_DIR/mdd-manage.md` then follow the relevant mode instructions.**
|
|
109
118
|
|
|
110
119
|
- If arguments start with `reverse-engineer`, `reverse`, `graph`, or `upgrade` →
|
|
111
|
-
**Read
|
|
120
|
+
**Read `$MDD_DIR/mdd-lifecycle.md` then follow the relevant mode instructions.**
|
|
112
121
|
|
|
113
122
|
- If arguments start with `plan-` →
|
|
114
|
-
**Read
|
|
123
|
+
**Read `$MDD_DIR/mdd-plan.md` then follow the relevant PLAN mode instructions.**
|
|
115
124
|
|
|
116
125
|
- If arguments start with `ops`, `runop`, `update-op`, or `commands` →
|
|
117
|
-
**Read
|
|
126
|
+
**Read `$MDD_DIR/mdd-ops.md` then follow the relevant OPS/COMMANDS mode instructions.**
|
|
118
127
|
|
|
119
128
|
- If arguments are empty → ask the user what they want to do (build a feature, run an audit, check status, etc.)
|
|
120
129
|
|
|
121
|
-
- Otherwise → **Read
|
|
130
|
+
- Otherwise → **Read `$MDD_DIR/mdd-build.md` then follow BUILD MODE instructions.**
|
|
122
131
|
|
|
123
132
|
---
|
|
124
133
|
|
package/dist/cli.js
CHANGED
|
@@ -5,6 +5,7 @@ import { readFileSync } from 'fs';
|
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
import { join, dirname } from 'path';
|
|
7
7
|
import { cwd } from 'process';
|
|
8
|
+
import { homedir } from 'os';
|
|
8
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
10
|
const __dirname = dirname(__filename);
|
|
10
11
|
const pkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
|
|
@@ -23,7 +24,10 @@ program
|
|
|
23
24
|
const dirExplicit = this.getOptionValueSource('dir') === 'cli';
|
|
24
25
|
const local = options.installLocal && !dirExplicit;
|
|
25
26
|
const effectiveDir = local ? join(cwd(), '.claude/commands') : options.dir;
|
|
26
|
-
|
|
27
|
+
const claudeMdPath = dirExplicit ? undefined
|
|
28
|
+
: local ? join(cwd(), 'CLAUDE.md')
|
|
29
|
+
: join(homedir(), '.claude', 'CLAUDE.md');
|
|
30
|
+
install({ dir: effectiveDir, force: options.force, local, claudeMdPath });
|
|
27
31
|
});
|
|
28
32
|
program
|
|
29
33
|
.command('update')
|
|
@@ -34,7 +38,10 @@ program
|
|
|
34
38
|
const dirExplicit = this.getOptionValueSource('dir') === 'cli';
|
|
35
39
|
const local = options.installLocal && !dirExplicit;
|
|
36
40
|
const effectiveDir = local ? join(cwd(), '.claude/commands') : options.dir;
|
|
37
|
-
|
|
41
|
+
const claudeMdPath = dirExplicit ? undefined
|
|
42
|
+
: local ? join(cwd(), 'CLAUDE.md')
|
|
43
|
+
: join(homedir(), '.claude', 'CLAUDE.md');
|
|
44
|
+
install({ dir: effectiveDir, force: true, local, claudeMdPath });
|
|
38
45
|
});
|
|
39
46
|
program.parse();
|
|
40
47
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAAwB,CAAC;AAEzG,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC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AAC,UAAyB,OAA+C;IAC9E,MAAM,WAAW,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;IAC/D,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,IAAI,CAAC,WAAW,CAAC;IACnD,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;IAC3E,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,SAAS;QAC1C,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC;YAClC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/install.d.ts
CHANGED
package/dist/install.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AASA,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AASA,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAUD,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAmFrD"}
|
package/dist/install.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { copyFileSync, mkdirSync, existsSync, readdirSync, readFileSync } from 'fs';
|
|
1
|
+
import { copyFileSync, mkdirSync, existsSync, readdirSync, readFileSync, writeFileSync, appendFileSync } from 'fs';
|
|
2
2
|
import { join, resolve } from 'path';
|
|
3
3
|
import { homedir } from 'os';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
@@ -76,6 +76,12 @@ export function install(options) {
|
|
|
76
76
|
if (options.local) {
|
|
77
77
|
console.log(' Tip: add .claude/commands/ to your .gitignore to keep these files out of git.\n');
|
|
78
78
|
}
|
|
79
|
+
if (options.claudeMdPath) {
|
|
80
|
+
const claudeResult = injectClaudeGuidance(resolve(options.claudeMdPath.replace('~', homedir())));
|
|
81
|
+
const icon = claudeResult.status === 'error' ? '✗' : claudeResult.status === 'skipped' ? '·' : '✓';
|
|
82
|
+
console.log(` ${icon} CLAUDE.md — ${claudeResult.message}`);
|
|
83
|
+
console.log('');
|
|
84
|
+
}
|
|
79
85
|
console.log('Open Claude Code and run /mdd to get started.\n');
|
|
80
86
|
}
|
|
81
87
|
function getMddVersion(content) {
|
|
@@ -91,4 +97,56 @@ function getPackageVersion() {
|
|
|
91
97
|
return 'unknown';
|
|
92
98
|
}
|
|
93
99
|
}
|
|
100
|
+
const CLAUDE_GUIDANCE_MARKER = '## MDD — Manual-First Development';
|
|
101
|
+
const CLAUDE_GUIDANCE_BLOCK = `
|
|
102
|
+
## MDD — Manual-First Development
|
|
103
|
+
|
|
104
|
+
If a \`.mdd/\` directory exists in the current project, apply this logic whenever
|
|
105
|
+
the user asks you to implement, build, modify, deploy, or automate something —
|
|
106
|
+
and they have NOT used \`/mdd\` to initiate the request:
|
|
107
|
+
|
|
108
|
+
**Step 1 — Does it already exist?**
|
|
109
|
+
Scan \`.mdd/.startup.md\` (Features AND Ops Runbooks sections). Do any tags or
|
|
110
|
+
names match what the user is asking about?
|
|
111
|
+
→ Feature match: "This looks related to \`<NN>-<feature-name>\`. Want to use
|
|
112
|
+
\`/mdd update <NN>\` to modify it, or \`/mdd audit <NN>\` to review it first?"
|
|
113
|
+
→ Ops match: "You already have a \`<slug>\` runbook for this. Want to run it
|
|
114
|
+
with \`/mdd runop <slug>\` or update it with \`/mdd update-op <slug>\`?"
|
|
115
|
+
|
|
116
|
+
**Step 2 — What kind of request is it?**
|
|
117
|
+
|
|
118
|
+
Infrastructure or ops? (deploy, CI/CD, Docker, commit hooks, pipelines,
|
|
119
|
+
cron jobs, webhooks, DNS, SSL, rollback, health checks, server config)
|
|
120
|
+
→ "This sounds like an ops procedure. Want to document it as a repeatable
|
|
121
|
+
runbook with \`/mdd ops <description>\`?"
|
|
122
|
+
|
|
123
|
+
Feature work touching 3+ independent concerns?
|
|
124
|
+
→ "This looks initiative-scale. Want to plan it with \`/mdd plan-initiative\`?"
|
|
125
|
+
|
|
126
|
+
Single feature or bounded change?
|
|
127
|
+
→ "Want me to use \`/mdd <description>\` to build this with docs and tests first?"
|
|
128
|
+
|
|
129
|
+
Always ask — never auto-invoke. If the user says no, proceed as normal.
|
|
130
|
+
|
|
131
|
+
Skip entirely for: bug fixes, typos, config tweaks, single-line changes,
|
|
132
|
+
one-off shell commands.
|
|
133
|
+
`;
|
|
134
|
+
function injectClaudeGuidance(claudeMdPath) {
|
|
135
|
+
try {
|
|
136
|
+
if (existsSync(claudeMdPath)) {
|
|
137
|
+
const existing = readFileSync(claudeMdPath, 'utf-8');
|
|
138
|
+
if (existing.includes(CLAUDE_GUIDANCE_MARKER)) {
|
|
139
|
+
return { status: 'skipped', message: 'guidance already present' };
|
|
140
|
+
}
|
|
141
|
+
appendFileSync(claudeMdPath, CLAUDE_GUIDANCE_BLOCK, 'utf-8');
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
writeFileSync(claudeMdPath, CLAUDE_GUIDANCE_BLOCK.trimStart(), 'utf-8');
|
|
145
|
+
}
|
|
146
|
+
return { status: 'injected', message: 'guidance injected' };
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
return { status: 'error', message: String(err) };
|
|
150
|
+
}
|
|
151
|
+
}
|
|
94
152
|
//# sourceMappingURL=install.js.map
|
package/dist/install.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AACnH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAiBtC,MAAM,UAAU,OAAO,CAAC,OAAuB;IAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;IAEpC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAA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