@thedecipherist/mdd 1.1.1 → 1.2.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 +102 -6
- package/commands/mdd-branch-guard.sh +38 -0
- package/commands/mdd-plan.md +50 -0
- package/commands/mdd.md +61 -9
- package/dist/cli.js +8 -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 +64 -3
- package/dist/install.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ MDD flips this. You write structured documentation first. Then Claude reads **on
|
|
|
86
86
|
MDD installs 7 Claude command files into `~/.claude/commands/`. The main router (`mdd.md`) reads your arguments and loads **only the mode file needed** - a `/mdd status` loads ~460 tokens instead of the full ~28,000.
|
|
87
87
|
|
|
88
88
|
```
|
|
89
|
-
mdd.md (~120 lines) Router - Steps 0/0a/0b, mode dispatch,
|
|
89
|
+
mdd.md (~120 lines) Router - Steps 0/0a/0b, mode dispatch, Branch Guard
|
|
90
90
|
mdd-build.md (~680 lines) BUILD MODE - Phases 0–7d
|
|
91
91
|
mdd-audit.md (~240 lines) AUDIT MODE - Phases A1–A7
|
|
92
92
|
mdd-manage.md (~340 lines) STATUS + NOTE + SCAN + UPDATE + DEPRECATE
|
|
@@ -108,8 +108,6 @@ 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
|
-
|
|
113
111
|
```bash
|
|
114
112
|
mdd update # update to latest installed version
|
|
115
113
|
mdd install --dir /custom/path # install to a custom directory (skips CLAUDE.md injection)
|
|
@@ -118,6 +116,54 @@ mdd install --install-local # install to .claude/commands/ + injects into
|
|
|
118
116
|
|
|
119
117
|
**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.
|
|
120
118
|
|
|
119
|
+
### What `mdd install` sets up
|
|
120
|
+
|
|
121
|
+
| What | Where | Purpose |
|
|
122
|
+
|------|-------|---------|
|
|
123
|
+
| 7 command `.md` files | `~/.claude/commands/` | The `/mdd` slash command and all its modes |
|
|
124
|
+
| Branch Guard hook | `~/.claude/hooks/mdd-branch-guard.sh` | Blocks file writes on `main` in any MDD project |
|
|
125
|
+
| Hook registration | `~/.claude/settings.json` | Wires the hook to Claude Code's PreToolUse event |
|
|
126
|
+
| Guidance block | `~/.claude/CLAUDE.md` | Teaches Claude to suggest MDD automatically |
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Branch Guard — Never Work on `main`
|
|
131
|
+
|
|
132
|
+
`mdd install` registers a **Claude Code `PreToolUse` hook** that fires before every file write (`Write`, `Edit`, `NotebookEdit`) in any project with a `.mdd/` directory. If the current branch is `main` or `master`, the hook blocks the operation:
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
⛔ MDD BRANCH GUARD
|
|
136
|
+
|
|
137
|
+
File modification is blocked on branch 'main'.
|
|
138
|
+
MDD never writes files directly on main or master.
|
|
139
|
+
|
|
140
|
+
Create a feature branch, then re-run your /mdd command:
|
|
141
|
+
|
|
142
|
+
git checkout -b feat/<feature-name>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Why a hook and not just instructions?**
|
|
146
|
+
|
|
147
|
+
Instruction-based branch checks can be lost through Claude's context compaction (when a conversation grows very long, earlier context is summarised). A `PreToolUse` hook fires at the OS level on every tool call — it cannot be compacted away, forgotten, or bypassed by stale context.
|
|
148
|
+
|
|
149
|
+
**How it works end-to-end:**
|
|
150
|
+
|
|
151
|
+
1. MDD instructions enforce branch hygiene in every command file (Branch Guard in `mdd.md`, Phase 0 in `mdd-build.md`, Phase PE1 in `mdd-plan.md`).
|
|
152
|
+
2. The hook acts as a permanent failsafe. If Claude is about to write a file on `main`, the hook fires before the write happens, exits with code `2`, and the operation is blocked.
|
|
153
|
+
3. The hook is a no-op outside `.mdd` projects and on any non-`main`/`master` branch.
|
|
154
|
+
|
|
155
|
+
**MDD branch naming conventions:**
|
|
156
|
+
|
|
157
|
+
| Mode | Auto-created branch |
|
|
158
|
+
|------|---------------------|
|
|
159
|
+
| `/mdd <feature>` | `feat/<feature-slug>` |
|
|
160
|
+
| `/mdd audit` | `fix/mdd-audit-<YYYY-MM-DD>` |
|
|
161
|
+
| `/mdd plan-initiative` | `feat/init-<initiative-slug>` |
|
|
162
|
+
| `/mdd plan-wave` | `feat/<wave-slug>` |
|
|
163
|
+
| `/mdd plan-execute` | `feat/<wave-slug>` |
|
|
164
|
+
|
|
165
|
+
When on a clean `main`, MDD creates the branch automatically. When on `main` with uncommitted changes, MDD stops and offers to commit or stash first.
|
|
166
|
+
|
|
121
167
|
---
|
|
122
168
|
|
|
123
169
|
## Quick Start
|
|
@@ -141,6 +187,52 @@ npm install -g @thedecipherist/mdd && mdd install
|
|
|
141
187
|
|
|
142
188
|
---
|
|
143
189
|
|
|
190
|
+
## Claude Automatically Suggests MDD
|
|
191
|
+
|
|
192
|
+
`mdd install` injects a small guidance block into your `~/.claude/CLAUDE.md` (or the project `CLAUDE.md` for `--install-local`). From that point on, whenever Claude detects a `.mdd/` directory in the current project it automatically evaluates every implementation or infrastructure request and suggests the right MDD workflow — even if you didn't type `/mdd`.
|
|
193
|
+
|
|
194
|
+
**What Claude checks, in order:**
|
|
195
|
+
|
|
196
|
+
**1. Does it already exist?**
|
|
197
|
+
Claude scans `.mdd/.startup.md` — which lists every documented feature and ops runbook with their tags. If your prompt overlaps with something already documented, Claude flags it before you duplicate work:
|
|
198
|
+
|
|
199
|
+
> *"This looks related to `02-user-auth` in your MDD docs. Want to use `/mdd update 02` to modify it, or `/mdd audit 02` to review it first?"*
|
|
200
|
+
|
|
201
|
+
**2. Is it ops/infrastructure?**
|
|
202
|
+
Deploy procedures, CI/CD pipelines, commit hooks, Docker builds, cron jobs, DNS changes — anything operational gets flagged for a runbook instead of ad-hoc implementation:
|
|
203
|
+
|
|
204
|
+
> *"This sounds like an ops procedure. Want to document it as a repeatable runbook with `/mdd ops deploy to production`?"*
|
|
205
|
+
|
|
206
|
+
**3. Is it initiative-scale?**
|
|
207
|
+
Large requests touching three or more independent concerns get routed to initiative/wave planning instead of a single feature doc:
|
|
208
|
+
|
|
209
|
+
> *"This looks initiative-scale. Want to plan it with `/mdd plan-initiative`?"*
|
|
210
|
+
|
|
211
|
+
**4. Is it a single new feature?**
|
|
212
|
+
Everything else gets the standard build mode prompt:
|
|
213
|
+
|
|
214
|
+
> *"Want me to use `/mdd add payment processing` to build this with documentation and tests first?"*
|
|
215
|
+
|
|
216
|
+
Claude always **asks** — it never auto-invokes `/mdd`. If you say no, it proceeds with direct implementation as normal. The detection is also intentionally narrow: bug fixes, typo corrections, config tweaks, and one-off shell commands are never flagged.
|
|
217
|
+
|
|
218
|
+
**How it detects overlap without loading full docs:**
|
|
219
|
+
|
|
220
|
+
Every feature doc and ops runbook has a `tags:` field (4–8 domain-concept keywords). These tags are surfaced in `.mdd/.startup.md` — a compact session-context file that's already injected into every Claude conversation. Claude scans the tag list in milliseconds, with no full-document loading and no context bloat.
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
## Features Documented
|
|
224
|
+
- 01-project-scaffolding (complete) [typescript, express, project-setup, scaffolding]
|
|
225
|
+
- 02-user-auth (in_progress) [auth, jwt, login, sessions, middleware]
|
|
226
|
+
- 03-payment-flow (draft) [stripe, payments, checkout, webhooks]
|
|
227
|
+
|
|
228
|
+
## Ops Runbooks
|
|
229
|
+
- prod-deploy [deploy, dokploy, docker, eu-west, canary, health-check]
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**The injection is idempotent.** Running `mdd install` or `mdd update` again never duplicates the block.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
144
236
|
## All 22 Modes at a Glance
|
|
145
237
|
|
|
146
238
|
```
|
|
@@ -239,6 +331,7 @@ last_synced: 2026-05-07
|
|
|
239
331
|
status: draft
|
|
240
332
|
phase: documentation
|
|
241
333
|
mdd_version: 8
|
|
334
|
+
tags: [auth, jwt, login, sessions, middleware]
|
|
242
335
|
known_issues: []
|
|
243
336
|
---
|
|
244
337
|
|
|
@@ -748,9 +841,12 @@ Generated: 2026-05-07 | Branch: feat/user-auth
|
|
|
748
841
|
Framework: Express + React | DB: PostgreSQL | Host: Dokploy
|
|
749
842
|
|
|
750
843
|
## Features Documented
|
|
751
|
-
01-project-scaffolding (complete)
|
|
752
|
-
02-user-auth (in_progress)
|
|
753
|
-
|
|
844
|
+
- 01-project-scaffolding (complete) [typescript, express, project-setup, scaffolding]
|
|
845
|
+
- 02-user-auth (in_progress) [auth, jwt, login, sessions, middleware]
|
|
846
|
+
- 03-payment-flow (draft) [stripe, payments, checkout, webhooks]
|
|
847
|
+
|
|
848
|
+
## Ops Runbooks
|
|
849
|
+
- prod-deploy [deploy, dokploy, docker, eu-west, canary, health-check]
|
|
754
850
|
|
|
755
851
|
## Last Audit
|
|
756
852
|
2026-05-01 - 20 findings, 17 fixed, 3 open
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# MDD Branch Guard
|
|
3
|
+
# PreToolUse hook — blocks Write/Edit/NotebookEdit on main/master in MDD projects.
|
|
4
|
+
# Installed by: mdd install (into .claude/hooks/ or ~/.claude/hooks/)
|
|
5
|
+
|
|
6
|
+
# Only active in MDD projects
|
|
7
|
+
[ -d ".mdd" ] || exit 0
|
|
8
|
+
|
|
9
|
+
# Check current branch
|
|
10
|
+
BRANCH=$(git branch --show-current 2>/dev/null)
|
|
11
|
+
[ -z "$BRANCH" ] && exit 0
|
|
12
|
+
|
|
13
|
+
# Only block on main/master
|
|
14
|
+
[[ "$BRANCH" == "main" || "$BRANCH" == "master" ]] || exit 0
|
|
15
|
+
|
|
16
|
+
# Count uncommitted changes for context
|
|
17
|
+
CHANGES=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
|
|
18
|
+
|
|
19
|
+
echo ""
|
|
20
|
+
echo "⛔ MDD BRANCH GUARD"
|
|
21
|
+
echo ""
|
|
22
|
+
echo " File modification is blocked on branch '${BRANCH}'."
|
|
23
|
+
echo " MDD never writes files directly on main or master."
|
|
24
|
+
echo ""
|
|
25
|
+
if [ "$CHANGES" -gt 0 ]; then
|
|
26
|
+
echo " You have ${CHANGES} uncommitted change(s). Commit or stash first:"
|
|
27
|
+
echo ""
|
|
28
|
+
echo " git add -A && git commit -m 'wip: ...' && git checkout -b feat/<name>"
|
|
29
|
+
echo " — or —"
|
|
30
|
+
echo " git stash && git checkout -b feat/<name>"
|
|
31
|
+
else
|
|
32
|
+
echo " Create a feature branch, then re-run your /mdd command:"
|
|
33
|
+
echo ""
|
|
34
|
+
echo " git checkout -b feat/<feature-name>"
|
|
35
|
+
fi
|
|
36
|
+
echo ""
|
|
37
|
+
|
|
38
|
+
exit 2
|
package/commands/mdd-plan.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Triggered when arguments start with `plan-initiative`. Creates a new initiative doc.
|
|
4
4
|
|
|
5
|
+
### Phase PI0 — Branch Guard
|
|
6
|
+
|
|
7
|
+
Run before any file creation:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
BRANCH=$(git branch --show-current)
|
|
11
|
+
DIRTY=$(git status --porcelain)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
- **On `main` or `master` with uncommitted changes** → STOP. Show the Scenario A prompt from mdd.md Branch Guard.
|
|
15
|
+
- **On `main` or `master`, clean** → auto-branch to `feat/init-<initiative-slug>`. If the slug is not yet known (title not asked), use `feat/mdd-initiative` as a temporary name and rename the branch after the title is collected.
|
|
16
|
+
- **On a feature branch** → working dirty is fine. Proceed — initiative planning docs belong on whatever branch is current.
|
|
17
|
+
- **Never proceed on main.** Hard block.
|
|
18
|
+
|
|
5
19
|
### Phase PI1 — Mode choice
|
|
6
20
|
|
|
7
21
|
Ask the user:
|
|
@@ -86,6 +100,18 @@ Triggered when arguments start with `plan-wave`. Takes a wave slug (e.g. `auth-s
|
|
|
86
100
|
|
|
87
101
|
### Phase PW1 — Load and validate
|
|
88
102
|
|
|
103
|
+
**Step 0 — Branch guard:**
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
BRANCH=$(git branch --show-current)
|
|
107
|
+
DIRTY=$(git status --porcelain)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
- **On `main` or `master` with uncommitted changes** → STOP. Show Scenario A from mdd.md Branch Guard.
|
|
111
|
+
- **On `main` or `master`, clean** → auto-branch to `feat/<wave-slug>`.
|
|
112
|
+
- **On a feature branch** → proceed (planning docs belong on this branch).
|
|
113
|
+
- **Never proceed on main.** Hard block.
|
|
114
|
+
|
|
89
115
|
1. Parse `<wave-slug>` from arguments — hard stop *"Wave slug required. Usage: /mdd plan-wave <wave-slug>"* if missing.
|
|
90
116
|
2. Derive initiative slug: everything before `-wave-N` (e.g. `auth-system-wave-2` → `auth-system`).
|
|
91
117
|
3. Read `initiatives/<initiative-slug>.md` fresh from disk — hard stop *"Initiative does not exist: `initiatives/<slug>.md`"* if not found.
|
|
@@ -160,6 +186,30 @@ Triggered when arguments start with `plan-execute`. Runs the full MDD build flow
|
|
|
160
186
|
|
|
161
187
|
### Phase PE1 — Load and validate
|
|
162
188
|
|
|
189
|
+
**Step 0 — Branch guard (runs before everything else):**
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
BRANCH=$(git branch --show-current)
|
|
193
|
+
DIRTY=$(git status --porcelain)
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
- **On `main` or `master` with uncommitted changes** → STOP. Show the Scenario A prompt from the Branch Guard in mdd.md. Do not proceed until resolved.
|
|
197
|
+
- **On `main` or `master`, clean** → auto-branch to `feat/<wave-slug>` immediately. Report: `✅ Branched to feat/<wave-slug>`.
|
|
198
|
+
- **On a feature branch that doesn't match `<wave-slug>`** → mismatch. Show:
|
|
199
|
+
```
|
|
200
|
+
⚠️ Branch mismatch for wave execution.
|
|
201
|
+
|
|
202
|
+
Current branch: <branch-name>
|
|
203
|
+
Expected: feat/<wave-slug>
|
|
204
|
+
|
|
205
|
+
MDD expects one wave per branch. What would you like to do?
|
|
206
|
+
(a) Commit, merge to main, and branch fresh to feat/<wave-slug>
|
|
207
|
+
(b) Continue on this branch (not recommended — mixes work)
|
|
208
|
+
(c) Abort
|
|
209
|
+
```
|
|
210
|
+
Follow the same (a)/(b)/(c) logic as mdd-build.md Phase 0.
|
|
211
|
+
- **Never proceed on main.** This is a hard block regardless of clean/dirty state.
|
|
212
|
+
|
|
163
213
|
1. Parse `<wave-slug>` — hard stop *"Wave does not exist"* if `waves/<wave-slug>.md` not found.
|
|
164
214
|
2. Read the wave doc.
|
|
165
215
|
3. Derive and read the parent initiative — hard stop if not found.
|
package/commands/mdd.md
CHANGED
|
@@ -131,21 +131,73 @@ Use whichever path contains `mdd-audit.md`. Store it as `$MDD_DIR` and use it fo
|
|
|
131
131
|
|
|
132
132
|
---
|
|
133
133
|
|
|
134
|
-
##
|
|
134
|
+
## Branch Guard (All Modes)
|
|
135
135
|
|
|
136
|
-
**
|
|
136
|
+
**This guard is mandatory. MDD never creates or modifies files directly on `main` or `master`. No exceptions — not even for documentation, planning, or ops files.**
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
**If the user already chose a worktree in Step 0, skip entirely** — the worktree has its own dedicated branch.
|
|
139
|
+
|
|
140
|
+
Otherwise, before creating or modifying any files, run:
|
|
139
141
|
|
|
140
142
|
```bash
|
|
141
|
-
git branch --show-current
|
|
143
|
+
BRANCH=$(git branch --show-current)
|
|
144
|
+
DIRTY=$(git status --porcelain)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### Scenario A — On `main` or `master`, working tree has uncommitted changes
|
|
150
|
+
|
|
151
|
+
**STOP. Do not create or modify any file.**
|
|
152
|
+
|
|
142
153
|
```
|
|
154
|
+
🚫 MDD Branch Guard — cannot proceed on main with uncommitted changes.
|
|
155
|
+
|
|
156
|
+
Branch: main
|
|
157
|
+
Dirty: <N> file(s) modified / untracked
|
|
158
|
+
|
|
159
|
+
MDD never works directly on main, and uncommitted changes must be
|
|
160
|
+
resolved before branching safely.
|
|
161
|
+
|
|
162
|
+
Choose:
|
|
163
|
+
(a) Commit now — stage all changes and commit, then MDD auto-branches
|
|
164
|
+
(b) Stash now — git stash, then MDD auto-branches
|
|
165
|
+
(c) Abort — handle git manually, then re-run /mdd
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
- **(a) Commit:** `git add -A`, generate a short conventional commit message from the changed files, commit, then proceed to Scenario B.
|
|
169
|
+
- **(b) Stash:** `git stash`, then proceed to Scenario B.
|
|
170
|
+
- **(c) Abort:** stop entirely — do not create any files.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### Scenario B — On `main` or `master`, clean working tree
|
|
175
|
+
|
|
176
|
+
Auto-branch immediately — no user prompt. Derive the branch name from the active mode:
|
|
177
|
+
|
|
178
|
+
| Mode | Branch name |
|
|
179
|
+
|------|-------------|
|
|
180
|
+
| Build (`/mdd <feature>`) | `feat/<feature-slug>` |
|
|
181
|
+
| Audit (`/mdd audit`) | `fix/mdd-audit-<YYYY-MM-DD>` |
|
|
182
|
+
| plan-initiative | `feat/init-<initiative-slug>` |
|
|
183
|
+
| plan-wave | `feat/<wave-slug>` |
|
|
184
|
+
| plan-execute | `feat/<wave-slug>` |
|
|
185
|
+
| Any other mode | `feat/<slug-from-arguments>` |
|
|
186
|
+
|
|
187
|
+
Run `git checkout -b <branch-name>` and report:
|
|
188
|
+
```
|
|
189
|
+
✅ Branched to <branch-name> — proceeding with MDD.
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### Scenario C — Already on a feature or fix branch
|
|
195
|
+
|
|
196
|
+
Working tree dirty (in-progress changes) is **expected and fine** — that work belongs on this branch.
|
|
197
|
+
|
|
198
|
+
Each mode's Phase 0 handles mismatch detection (does the new task belong on this branch?). See mdd-build.md Phase 0 and mdd-plan.md for details.
|
|
143
199
|
|
|
144
|
-
**
|
|
145
|
-
- If on `main` or `master`:
|
|
146
|
-
- Build mode: `git checkout -b feat/<feature-name>`
|
|
147
|
-
- Audit mode: `git checkout -b fix/mdd-audit-<date>`
|
|
148
|
-
- If already on a feature branch: proceed
|
|
200
|
+
**One hard rule:** A branch starting with `fix/mdd-audit-` is an audit branch. Build and plan modes must not reuse it — fall through to Scenario B naming instead.
|
|
149
201
|
|
|
150
202
|
---
|
|
151
203
|
|
package/dist/cli.js
CHANGED
|
@@ -27,7 +27,10 @@ program
|
|
|
27
27
|
const claudeMdPath = dirExplicit ? undefined
|
|
28
28
|
: local ? join(cwd(), 'CLAUDE.md')
|
|
29
29
|
: join(homedir(), '.claude', 'CLAUDE.md');
|
|
30
|
-
|
|
30
|
+
const settingsPath = dirExplicit ? undefined
|
|
31
|
+
: local ? join(cwd(), '.claude', 'settings.json')
|
|
32
|
+
: join(homedir(), '.claude', 'settings.json');
|
|
33
|
+
install({ dir: effectiveDir, force: options.force, local, claudeMdPath, settingsPath });
|
|
31
34
|
});
|
|
32
35
|
program
|
|
33
36
|
.command('update')
|
|
@@ -41,7 +44,10 @@ program
|
|
|
41
44
|
const claudeMdPath = dirExplicit ? undefined
|
|
42
45
|
: local ? join(cwd(), 'CLAUDE.md')
|
|
43
46
|
: join(homedir(), '.claude', 'CLAUDE.md');
|
|
44
|
-
|
|
47
|
+
const settingsPath = dirExplicit ? undefined
|
|
48
|
+
: local ? join(cwd(), '.claude', 'settings.json')
|
|
49
|
+
: join(homedir(), '.claude', 'settings.json');
|
|
50
|
+
install({ dir: effectiveDir, force: true, local, claudeMdPath, settingsPath });
|
|
45
51
|
});
|
|
46
52
|
program.parse();
|
|
47
53
|
//# 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;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,KAAK,CAAC;KACX,WAAW,CAAC,0DAA0D,CAAC;KACvE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAExB,OAAO;KACJ,OAAO,CAAC,SAAS,CAAC;KAClB,WAAW,CAAC,oDAAoD,CAAC;KACjE,MAAM,CAAC,cAAc,EAAE,wDAAwD,EAAE,oBAAoB,CAAC;KACtG,MAAM,CAAC,iBAAiB,EAAE,+DAA+D,EAAE,KAAK,CAAC;KACjG,MAAM,CAAC,SAAS,EAAE,qDAAqD,EAAE,KAAK,CAAC;KAC/E,MAAM,CAAC,UAAyB,OAAgE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EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;AACjF,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":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAQA,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;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAUD,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAkGrD"}
|
package/dist/install.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { copyFileSync, mkdirSync, existsSync, readdirSync, readFileSync, writeFileSync, appendFileSync } from 'fs';
|
|
2
|
-
import { join, resolve } from 'path';
|
|
1
|
+
import { copyFileSync, mkdirSync, existsSync, readdirSync, readFileSync, writeFileSync, appendFileSync, chmodSync } from 'fs';
|
|
2
|
+
import { join, resolve, dirname } from 'path';
|
|
3
3
|
import { homedir } from 'os';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
|
-
import { dirname } from 'path';
|
|
6
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
6
|
const __dirname = dirname(__filename);
|
|
8
7
|
export function install(options) {
|
|
@@ -82,6 +81,20 @@ export function install(options) {
|
|
|
82
81
|
console.log(` ${icon} CLAUDE.md — ${claudeResult.message}`);
|
|
83
82
|
console.log('');
|
|
84
83
|
}
|
|
84
|
+
if (options.settingsPath) {
|
|
85
|
+
const hookScriptSrc = join(srcDir, 'mdd-branch-guard.sh');
|
|
86
|
+
const hooksDir = join(resolve(options.settingsPath.replace('~', homedir()), '..'), 'hooks');
|
|
87
|
+
const hookScriptDest = join(hooksDir, 'mdd-branch-guard.sh');
|
|
88
|
+
const hookResult = installHook({
|
|
89
|
+
hookScriptSrc,
|
|
90
|
+
hookScriptDest,
|
|
91
|
+
settingsPath: resolve(options.settingsPath.replace('~', homedir())),
|
|
92
|
+
local: options.local ?? false,
|
|
93
|
+
});
|
|
94
|
+
const icon = hookResult.status === 'error' ? '✗' : hookResult.status === 'skipped' ? '·' : '✓';
|
|
95
|
+
console.log(` ${icon} Branch Guard hook — ${hookResult.message}`);
|
|
96
|
+
console.log('');
|
|
97
|
+
}
|
|
85
98
|
console.log('Open Claude Code and run /mdd to get started.\n');
|
|
86
99
|
}
|
|
87
100
|
function getMddVersion(content) {
|
|
@@ -131,6 +144,54 @@ Always ask — never auto-invoke. If the user says no, proceed as normal.
|
|
|
131
144
|
Skip entirely for: bug fixes, typos, config tweaks, single-line changes,
|
|
132
145
|
one-off shell commands.
|
|
133
146
|
`;
|
|
147
|
+
function installHook(opts) {
|
|
148
|
+
try {
|
|
149
|
+
// Install the hook script
|
|
150
|
+
mkdirSync(dirname(opts.hookScriptDest), { recursive: true });
|
|
151
|
+
copyFileSync(opts.hookScriptSrc, opts.hookScriptDest);
|
|
152
|
+
chmodSync(opts.hookScriptDest, 0o755);
|
|
153
|
+
// Derive hook command — local uses relative path, global uses $HOME
|
|
154
|
+
const hookCommand = opts.local
|
|
155
|
+
? 'bash .claude/hooks/mdd-branch-guard.sh'
|
|
156
|
+
: 'bash $HOME/.claude/hooks/mdd-branch-guard.sh';
|
|
157
|
+
const HOOK_MARKER = 'mdd-branch-guard';
|
|
158
|
+
// Read existing settings.json or start fresh
|
|
159
|
+
let settings = {};
|
|
160
|
+
if (existsSync(opts.settingsPath)) {
|
|
161
|
+
try {
|
|
162
|
+
settings = JSON.parse(readFileSync(opts.settingsPath, 'utf-8'));
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
// Unparseable settings — leave existing file alone to avoid corruption
|
|
166
|
+
return { status: 'error', message: `could not parse ${opts.settingsPath}` };
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Check if hook already registered
|
|
170
|
+
const hooksSection = settings['hooks'];
|
|
171
|
+
const preToolUse = (hooksSection?.['PreToolUse'] ?? []);
|
|
172
|
+
const alreadyInstalled = preToolUse.some(group => {
|
|
173
|
+
const hooks = group['hooks'];
|
|
174
|
+
return hooks?.some(h => String(h['command'] ?? '').includes(HOOK_MARKER));
|
|
175
|
+
});
|
|
176
|
+
if (alreadyInstalled) {
|
|
177
|
+
return { status: 'skipped', message: 'already registered in settings.json' };
|
|
178
|
+
}
|
|
179
|
+
// Merge hook entry into PreToolUse
|
|
180
|
+
const newEntry = {
|
|
181
|
+
matcher: 'Write|Edit|NotebookEdit',
|
|
182
|
+
hooks: [{ type: 'command', command: hookCommand }],
|
|
183
|
+
};
|
|
184
|
+
settings['hooks'] = {
|
|
185
|
+
...(hooksSection ?? {}),
|
|
186
|
+
PreToolUse: [...preToolUse, newEntry],
|
|
187
|
+
};
|
|
188
|
+
writeFileSync(opts.settingsPath, JSON.stringify(settings, null, 2) + '\n', 'utf-8');
|
|
189
|
+
return { status: 'installed', message: `hook registered in ${opts.settingsPath}` };
|
|
190
|
+
}
|
|
191
|
+
catch (err) {
|
|
192
|
+
return { status: 'error', message: String(err) };
|
|
193
|
+
}
|
|
194
|
+
}
|
|
134
195
|
function injectClaudeGuidance(claudeMdPath) {
|
|
135
196
|
try {
|
|
136
197
|
if (existsSync(claudeMdPath)) {
|
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,aAAa,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
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