@thedecipherist/mdd 1.6.12 โ†’ 1.7.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 CHANGED
@@ -7,11 +7,11 @@
7
7
  > **One command. Twenty-five modes. Complete feature lifecycle from documentation to verified deployment.**
8
8
 
9
9
  <p align="center">
10
- <a href="https://thedecipherist.github.io/mdd">
11
- <img src="https://img.shields.io/badge/๐Ÿ“–_Documentation-thedecipherist.github.io%2Fmdd-00e5cc?style=for-the-badge&labelColor=08090f" alt="Documentation Site" />
10
+ <a href="https://mddai.dev">
11
+ <img src="https://img.shields.io/badge/๐Ÿ“–_Documentation-mddai.dev-00e5cc?style=for-the-badge&labelColor=08090f" alt="Documentation Site" />
12
12
  </a>
13
13
  &nbsp;
14
- <a href="https://thedecipherist.github.io/mdd/user-guide.html">
14
+ <a href="https://mddai.dev/user-guide.html">
15
15
  <img src="https://img.shields.io/badge/๐Ÿ“š_User_Guide-Full_Reference-00ff88?style=for-the-badge&labelColor=08090f" alt="User Guide" />
16
16
  </a>
17
17
  </p>
@@ -32,7 +32,7 @@ Then in Claude Code:
32
32
  /mdd add user authentication with JWT tokens
33
33
  ```
34
34
 
35
- ๐Ÿ“– **[Full Documentation Site](https://thedecipherist.github.io/mdd)** ยท [User Guide](https://thedecipherist.github.io/mdd/user-guide.html) ยท [GitHub](https://github.com/TheDecipherist/mdd)
35
+ ๐Ÿ“– **[Full Documentation Site](https://mddai.dev)** ยท [User Guide](https://mddai.dev/user-guide.html) ยท [GitHub](https://github.com/TheDecipherist/mdd)
36
36
 
37
37
  ---
38
38
 
@@ -2,6 +2,18 @@
2
2
 
3
3
  Triggered when arguments start with `audit`.
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 A1`, `Phase A2`) 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-audit | 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
+
5
17
  ### Phase A1 โ€” Scope
6
18
 
7
19
  **Stale job detection (runs first):** Check `.mdd/jobs/` for any existing `audit-*/` folder.
@@ -158,6 +170,8 @@ Integration context: .mdd/jobs/audit-<date>/integration-context.md
158
170
  - "Immutable" rule arrays exported as plain mutable arrays โ€” not `Object.freeze()` + `readonly`
159
171
  - Untrusted MCP/API/CLI input used without validation or sanitization
160
172
  - Data cached or stored without masking applied first
173
+ - Local reimplementation of security logic โ€” any function named `isConfined`, `isAllowed`, `isSafe`, `isBlocked`, or similar that replicates what a documented security module already provides. Require replacement with the canonical security module function.
174
+ - Contract function undefined โ€” if `integration_contracts` specifies a function name, grep the entire package for that name as an export. If the function does not exist anywhere, flag P1 regardless of whether call sites are present.
161
175
 
162
176
  **Note:** `satisfies_contracts status: pending` is checked by main in Phase A1, not here โ€” agents cannot read feature docs.
163
177
 
@@ -168,7 +182,9 @@ Integration context: .mdd/jobs/audit-<date>/integration-context.md
168
182
  - File exceeds 300 lines
169
183
  - Function exceeds 50 lines
170
184
  - Transformation/substitution function handles some but not all AST/domain types (silent fallthrough for unhandled types)
185
+ - Switch on a string-union type or operation enum with no `default:` case, or where `default:` returns a value rather than throwing. Check all `switch` statements in execution, adapter, and transformation code. Approved pattern: `default: throw new Error(\`unhandled type: \${x satisfies never}\`)` โ€” the `satisfies never` check produces a compile error when a new variant is added without updating the switch.
171
186
  - MCP-exposed function accepts untrusted params with no explicit validation
187
+ - Security parameter never passed โ€” if a function accepts a policy param (allowedKeys, blockedDomains, securityConfig, etc.) that must come from a caller, verify the caller passes a non-empty, non-null value. If the parameter always arrives as `undefined`, `null`, or `[]`, the enforcement is a no-op.
172
188
 
173
189
  ### P3 Medium
174
190
  - TypeScript strict mode not enabled in tsconfig
@@ -176,6 +192,8 @@ Integration context: .mdd/jobs/audit-<date>/integration-context.md
176
192
  - Missing test cases for documented business rules
177
193
  - CLI command missing any of the universal flags (--env, --cwd, --verbose, --strict, --silent) โ€” check all commands against the CLI feature doc's universal flags requirement
178
194
  - `file.*` filesystem helpers or path-resolving functions accept arbitrary paths without confinement to a documented jailRoot
195
+ - Code that constructs a `SecurityConfig` or equivalent security object sets `jailRoot: null`. A null jailRoot disables filesystem confinement โ€” the default should be the document's directory (`dirname(resolvedPath)`), not `null`, unless the caller explicitly provides an override.
196
+ - `String.replace()` uses a captured group reference (`$1`, `$2`, etc.) in the replacement argument where the captured value originates from untrusted input. Values containing `$1`, `$&`, `$'`, etc. are silently mangled by JavaScript's substitution semantics. Sanitize with `.replace(/\$/g, '$$$$')` before interpolating into a replacement string.
179
197
  - Silent error swallow: catch block returns empty/undefined without pushing to warnings array
180
198
  - Template/substitution function matches `{{varname}}` without spaces but not `{{ varname }}` with spaces โ€” spec uses spaced form; use regex `\s*` not exact string
181
199
 
@@ -3,6 +3,16 @@
3
3
  **Trigger:** `/mdd bug <description>`
4
4
 
5
5
  The user is reporting a bug in an existing feature. Do NOT create a new feature doc.
6
+
7
+ ## Phase Logging
8
+
9
+ 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 B0`, `Phase B1`) and `EVENT` with `start` or `end`:
10
+
11
+ ```bash
12
+ 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-bug | PHASE | EVENT | %s | %s |\n" "$D" "$T" "$K" >> ~/.claude/mdd/log.md' 2>/dev/null || true
13
+ ```
14
+
15
+ Log file: `~/.claude/mdd/log.md`
6
16
  Instead: scan existing docs to identify which feature(s) own the broken behavior,
7
17
  document the bug in those docs, fix it, and mark it complete.
8
18
 
@@ -1,5 +1,17 @@
1
1
  ## BUILD MODE โ€” New Feature Development
2
2
 
3
+ ## Phase Logging
4
+
5
+ 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 0`, `Phase 1`) and `EVENT` with `start` or `end`:
6
+
7
+ ```bash
8
+ 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-build | PHASE | EVENT | %s | %s |\n" "$D" "$T" "$K" >> ~/.claude/mdd/log.md' 2>/dev/null || true
9
+ ```
10
+
11
+ Log file: `~/.claude/mdd/log.md`
12
+
13
+ ---
14
+
3
15
  ### Phase 0 โ€” Branch Safety Check
4
16
 
5
17
  Before gathering any context, verify the current branch is compatible with the requested feature.
@@ -262,11 +274,14 @@ satisfies_contracts:
262
274
  - from: <dependency-feature-id>
263
275
  function: <function-name>(<args>)
264
276
  when: <condition โ€” e.g. "before any file read in executeInclude">
265
- status: pending โ† change to "verified: <file>:<line>" during Phase 6
277
+ status: pending # change to done during Phase 6
278
+ verified_at: "" # set to "path/to/file.ts:lineN" when status is done
266
279
  ```
267
280
 
268
281
  **Leaving `satisfies_contracts` empty when a dependency has mandatory `integration_contracts` is a build error.** Do not proceed past Phase 3a until all applicable contracts are acknowledged.
269
282
 
283
+ **Before marking any `satisfies_contracts` entry `status: done`:** run `grep -rn '<function-name>'` across the entire package. Every call site must invoke the contract function โ€” not just the one currently in focus. If the function is only wired in one layer (e.g. dispatcher) but not another (e.g. executor), the contract is not satisfied. Set `verified_at` to the confirmed call site before updating status.
284
+
270
285
  **Cross-cutting concerns that always require contract resolution:**
271
286
  - Any dependency tagged with `security`, `auth`, `masking`, `filesystem`, `audit`, `immutable` โ€” its contracts are always mandatory
272
287
  - Any dependency that provides a "check before X" or "enforce Y" function โ€” that function must be in your `satisfies_contracts`
@@ -339,6 +354,8 @@ describe('<Feature Name>', () => {
339
354
  - If BOTH unit AND E2E tests are needed โ†’ launch 2 parallel `general-purpose` agents. Each receives: the full MDD doc content, the skeleton template above, project testing conventions, and the exact output file path. Agent A writes `tests/unit/<feature-name>.test.ts`, Agent B writes `tests/e2e/<feature-name>.spec.ts`. These are different files โ€” no write conflict is possible.
340
355
  - If only unit tests needed โ†’ generate directly in the main conversation (no agent overhead for a single file).
341
356
 
357
+ **CLI feature additional check:** If the feature adds or modifies CLI commands, add a skeleton that invokes each new command with `--help` and asserts all five universal flags (`--env`, `--cwd`, `--verbose`, `--strict`, `--silent`) appear in the output. This catches missing `universalOptions()` wiring before implementation begins.
358
+
342
359
  **E2E skeleton template (if applicable):**
343
360
  ```typescript
344
361
  import { test, expect } from '@playwright/test';
@@ -530,6 +547,8 @@ Execute blocks in dependency layer order (Layer 1 โ†’ 2 โ†’ 3 โ†’ 4). Within the
530
547
 
531
548
  **For sequential blocks:** read the MDD doc, read the relevant test skeletons, implement, run the Green Gate loop below.
532
549
 
550
+ **Directive/constant change ripple rule:** If this block changes any directive syntax, canonical header string, config key, or other string constant that other parts of the codebase may consume (e.g. language grammars, test fixtures, snippets, detection code), run `grep -rn 'old_string'` across the entire repo before marking the block complete. Update every consumer found โ€” tmLanguage files, E2E fixtures, snippets, and any hardcoded string comparisons โ€” in the same block, not as a follow-up.
551
+
533
552
  #### Step 6b โ€” Green Gate loop (per block)
534
553
 
535
554
  After each block's implementation (sequential or parallel), run the Green Gate:
@@ -678,7 +697,8 @@ where the agent patches the wrong thing because it accepted an external excuse t
678
697
 
679
698
  1. **Contract verification gate** โ€” before marking complete, check the feature doc's `satisfies_contracts`:
680
699
  - Any entry still `status: pending` means the integration was never wired
681
- - For each pending entry: locate the call site in the implementation, verify it exists, update to `verified: <file>:<line>`
700
+ - For each entry: run `grep -rn '<function-name>'` across the entire package. Every call site must invoke the contract function โ€” not just the one originally in scope. If a layer (e.g. executor vs dispatcher) is missing the call, the contract is not satisfied.
701
+ - Update each confirmed entry to `status: done` and `verified_at: "path/to/file.ts:lineN"` pointing to the confirmed call site.
682
702
  - If the call site is missing: implement it now (do not mark complete without it)
683
703
  - **A feature with any `pending` contract cannot be marked `status: complete`**
684
704
 
@@ -0,0 +1,215 @@
1
+ ## FRAMEWORK MODE
2
+
3
+ Routes to one of three sub-modes based on the command used.
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
+ ## `framework <feature>` โ€” Add a Module to mdd-ecommerce
18
+
19
+ **$ARGUMENTS** is the feature description.
20
+
21
+ ### Step 1 - Run normal BUILD MODE
22
+
23
+ Read `$MDD_DIR/mdd-build.md` and follow every phase (branch check, context gather, questions, doc, implementation, tests). All standard MDD rules apply.
24
+
25
+ Apply these additional constraints throughout:
26
+
27
+ **Placement:**
28
+ - New framework module (fills a slot) โ†’ `packages/modules/<name>/`
29
+ - New service package (no slot) โ†’ `packages/<name>/`
30
+
31
+ Confirm placement with the user during Phase 1 questions if unclear.
32
+
33
+ **MDD doc frontmatter additions:**
34
+ ```yaml
35
+ type: framework-module
36
+ slot: <slot-name-or-none>
37
+ ```
38
+
39
+ **Status values specific to framework modules:**
40
+ - `skeleton-ready` โ€” component exists, exports the correct interface, but returns stub/mock data
41
+ - `complete` โ€” wired end-to-end with real data flowing
42
+
43
+ Use `skeleton-ready` when the module compiles but is not yet connected to real data sources. Use `complete` only when the full data path works.
44
+
45
+ **After implementation:**
46
+
47
+ 1. Run the compile check:
48
+ ```bash
49
+ pnpm --filter app build
50
+ ```
51
+ Fix any TypeScript errors before marking the doc `complete`.
52
+
53
+ 2. If the module fills a slot, add it to the demo site config:
54
+ - Open `apps/demo/site.config.ts`
55
+ - Import the new module
56
+ - Wire it into the appropriate slot in `defineSiteConfig()`
57
+
58
+ 3. Update the doc status to `skeleton-ready` or `complete` based on the state above.
59
+
60
+ ---
61
+
62
+ ## `init-client <path-to-proposal.md>` โ€” Scaffold a Client Project
63
+
64
+ **$ARGUMENTS** is the path to a completed proposal markdown file.
65
+
66
+ ### Step 1 - Read the proposal
67
+
68
+ Read the file at `$ARGUMENTS`. If `$ARGUMENTS` is empty, ask: "What is the path to the proposal file?"
69
+
70
+ Stop if the file does not exist. Report the path and ask the user to check it.
71
+
72
+ ### Step 2 - Extract config values
73
+
74
+ Parse the proposal for these values:
75
+
76
+ | Config key | Where to find it |
77
+ |---|---|
78
+ | `config.name` | Business name heading or intro |
79
+ | `config.domain` | Domain / URL section |
80
+ | `config.theme.tokens.accent` | Theme colors section |
81
+ | `config.theme.tokens.warmBand` | Theme colors section |
82
+ | `config.theme.tokens.footerDark` | Theme colors section |
83
+ | `config.features.*` | Feature toggles section (yes/no flags) |
84
+ | `config.locales` | Language selector section |
85
+ | `config.defaultLocale` | Language selector section (first/primary listed) |
86
+ | `config.payments.currency` | Payments section |
87
+
88
+ If any required value is missing, list the gaps and ask the user to supply them before continuing.
89
+
90
+ ### Step 3 - Parse the product catalog
91
+
92
+ The proposal contains a markdown table with columns: `sku`, `mfr`, `name`, `description`, `brand`, `price`, `stock`.
93
+
94
+ Extract every row. Convert `price` to integers (cents/รถre - multiply by 100 and round). Build TypeScript seed data from this table.
95
+
96
+ 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
+
98
+ ### Step 4 - Determine module wiring
99
+
100
+ Based on the feature flags extracted in Step 2, decide which `@thedecipherist/mdd-ecommerce-*` packages to import and wire into `site.config.ts`:
101
+
102
+ - `newsletter: true` โ†’ include `@thedecipherist/mdd-ecommerce-newsletter`
103
+ - `trustBadges: true` โ†’ include `@thedecipherist/mdd-ecommerce-trust-badges`
104
+ - Add any other feature-to-package mappings that are evident from the proposal
105
+
106
+ Always include `@thedecipherist/mdd-ecommerce-core`.
107
+
108
+ ### Step 5 - Generate files
109
+
110
+ Write all files to the current working directory.
111
+
112
+ **`site.config.ts`:**
113
+ ```typescript
114
+ import { defineSiteConfig } from '@thedecipherist/mdd-ecommerce-core'
115
+ // import enabled modules
116
+ // (one import per enabled feature module)
117
+
118
+ export const siteConfig = defineSiteConfig({
119
+ name: '<extracted name>',
120
+ domain: '<extracted domain>',
121
+ locales: ['<locales array>'],
122
+ defaultLocale: '<default locale>',
123
+ theme: {
124
+ tokens: {
125
+ accent: '<extracted>',
126
+ warmBand: '<extracted>',
127
+ footerDark: '<extracted>',
128
+ },
129
+ },
130
+ features: {
131
+ // one key per extracted feature flag
132
+ },
133
+ payments: {
134
+ currency: '<extracted>',
135
+ },
136
+ slots: {
137
+ // wire enabled modules into their slots here
138
+ },
139
+ })
140
+ ```
141
+
142
+ **`scripts/seed.ts`:**
143
+
144
+ TypeScript file that:
145
+ 1. Connects to MongoDB using `process.env.MONGODB_URI`
146
+ 2. Seeds categories derived from the product catalog (`brand` or `mfr` as category)
147
+ 3. Seeds products using `@thedecipherist/mdd-ecommerce-cms` models
148
+ 4. For `LocaleString` fields (`name`, `description`): duplicate the value across all locales in `config.locales` - client fills in translations later
149
+ 5. Converts price integers back to the correct unit when displaying, but stores as integers (cents/รถre)
150
+ 6. Exits cleanly after seeding - no dangling connections
151
+
152
+ **`.env.example`:**
153
+
154
+ ```bash
155
+ # Client database: <business-name-in-snake_case>
156
+ # Copy this to .env and fill in values
157
+
158
+ MONGODB_URI=
159
+ NEXT_PUBLIC_SITE_URL=https://<domain>
160
+ NEXT_PUBLIC_RYBBIT_SITE_ID=
161
+ NEXT_PUBLIC_RYBBIT_URL=https://app.rybbit.io
162
+ # add any other vars from the main mdd-ecommerce .env.example
163
+ ```
164
+
165
+ ### Step 6 - Report
166
+
167
+ List every file written with its path. Then output:
168
+
169
+ ```
170
+ Next steps:
171
+ 1. Fill in .env from .env.example
172
+ 2. Run: pnpm install
173
+ 3. Run: npx tsx scripts/seed.ts
174
+ ```
175
+
176
+ ---
177
+
178
+ ## `client-status` โ€” Framework Install Report
179
+
180
+ Run this from the root of a client project directory.
181
+
182
+ ### Step 1 - Read package.json
183
+
184
+ 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
+
186
+ If no such dependencies exist, report: "No mdd-ecommerce packages found in package.json. Is this the right directory?"
187
+
188
+ ### Step 2 - Read site.config.ts
189
+
190
+ Read `site.config.ts`. Extract:
191
+ - Which slots have modules wired (non-null slot values)
192
+ - Which feature flags are `true`
193
+
194
+ ### Step 3 - Check MDD docs
195
+
196
+ Check if `.mdd/docs/` exists. If yes, count the `.md` files inside.
197
+
198
+ ### Step 4 - Output status table
199
+
200
+ ```
201
+ mdd-ecommerce Client Status
202
+ ============================
203
+
204
+ Packages installed:
205
+ @thedecipherist/mdd-ecommerce-core v<version>
206
+ @thedecipherist/mdd-ecommerce-<module> v<version>
207
+ (one line per installed package)
208
+
209
+ Slots wired: <list of wired slot names, or "none">
210
+ Features enabled: <list of true feature flags, or "none">
211
+
212
+ MDD docs: <N> files in .mdd/docs/ (or "directory not found")
213
+ ```
214
+
215
+ If `site.config.ts` does not exist, report that and skip slots/features rows.
@@ -2,6 +2,16 @@
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`:
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-import-spec | 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
+
5
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.
6
16
 
7
17
  ---
@@ -1,3 +1,15 @@
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
+
1
13
  ## REVERSE-ENGINEER MODE โ€” `/mdd reverse-engineer [path or feature-id]`
2
14
 
3
15
  Triggered when arguments start with `reverse-engineer` or `reverse`. Generates or regenerates MDD documentation from existing source code.
@@ -1,3 +1,15 @@
1
+ ## Phase Logging
2
+
3
+ At the **start** of every mode or phase (before any action) and the **end** (after all actions), run the command below. Substitute `PHASE` with the mode/phase identifier (e.g., `STATUS`, `Phase SC1`, `Phase U1`) 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-manage | 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
+
1
13
  ## STATUS MODE โ€” `/mdd status`
2
14
 
3
15
  Quick overview of MDD state for the project:
@@ -2,6 +2,16 @@
2
2
 
3
3
  Triggered when arguments start with `manual`.
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 M1`, `Phase M2`) 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-manual | 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
+
5
15
  Generates a comprehensive, print-ready user manual at `.mdd/manual/manual.md` from all
6
16
  MDD feature docs and ops runbooks. Uses content hashes to detect what changed since the
7
17
  last run - only stale sections are regenerated.
@@ -1,3 +1,15 @@
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
+
1
13
  ## OPS DOCUMENT MODE โ€” `/mdd ops <description>`
2
14
 
3
15
  Triggered when arguments start with `ops`. If arguments are exactly `ops list` โ†’ jump to **Ops List Mode** (Phase OL) instead.
@@ -1,3 +1,15 @@
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 PI1`, `Phase PW3`, `Phase PE2`) 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-plan | 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
+
1
13
  ## PLAN-INITIATIVE MODE โ€” `/mdd plan-initiative`
2
14
 
3
15
  Triggered when arguments start with `plan-initiative`. Creates a new initiative doc.
package/dist/cli.js CHANGED
@@ -75,5 +75,12 @@ program
75
75
  const selfImprovement = await promptSelfImprovement(settingsPath);
76
76
  install({ dir: effectiveDir, modesDir, force: true, local, claudeMdPath, settingsPath, selfImprovement });
77
77
  });
78
+ program
79
+ .command('update-ecommerce')
80
+ .description('Update @thedecipherist/mdd-ecommerce-* packages and report breaking changes')
81
+ .action(async () => {
82
+ const { updateEcommerce } = await import('./update-ecommerce.js');
83
+ updateEcommerce();
84
+ });
78
85
  program.parseAsync();
79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ce(): void;
2
+ //# sourceMappingURL=update-ecommerce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-ecommerce.d.ts","sourceRoot":"","sources":["../src/update-ecommerce.ts"],"names":[],"mappings":"AAuEA,wBAAgB,eAAe,IAAI,IAAI,CA6EtC"}
@@ -0,0 +1,114 @@
1
+ import { readFileSync, existsSync } from 'fs';
2
+ import { join } from 'path';
3
+ import { execSync } from 'child_process';
4
+ import { cwd } from 'process';
5
+ function detectPackageManager(dir) {
6
+ if (existsSync(join(dir, 'pnpm-lock.yaml')))
7
+ return 'pnpm';
8
+ if (existsSync(join(dir, 'yarn.lock')))
9
+ return 'yarn';
10
+ if (existsSync(join(dir, 'package-lock.json')))
11
+ return 'npm';
12
+ return 'npm';
13
+ }
14
+ function readEcommercePackages(dir) {
15
+ const pkgPath = join(dir, 'package.json');
16
+ if (!existsSync(pkgPath)) {
17
+ return {};
18
+ }
19
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
20
+ const all = {
21
+ ...(pkg.dependencies ?? {}),
22
+ ...(pkg.devDependencies ?? {}),
23
+ ...(pkg.peerDependencies ?? {}),
24
+ };
25
+ const result = {};
26
+ for (const [name, version] of Object.entries(all)) {
27
+ if (name.startsWith('@thedecipherist/mdd-ecommerce-')) {
28
+ result[name] = version;
29
+ }
30
+ }
31
+ return result;
32
+ }
33
+ function stripRange(version) {
34
+ // Strip leading semver range chars: ^, ~, >=, <=, >, <, =
35
+ return version.replace(/^[~^>=<]+/, '');
36
+ }
37
+ function parseMajor(version) {
38
+ const clean = stripRange(version);
39
+ const parts = clean.split('.');
40
+ const major = parseInt(parts[0] ?? '0', 10);
41
+ return isNaN(major) ? 0 : major;
42
+ }
43
+ function isMajorBump(from, to) {
44
+ return parseMajor(to) > parseMajor(from);
45
+ }
46
+ function hasDocsDirectory(packageName, dir) {
47
+ const docsPath = join(dir, 'node_modules', packageName, '.mdd', 'docs');
48
+ return existsSync(docsPath);
49
+ }
50
+ export function updateEcommerce() {
51
+ const dir = cwd();
52
+ const pkgPath = join(dir, 'package.json');
53
+ if (!existsSync(pkgPath)) {
54
+ console.log('No package.json found in current directory.');
55
+ process.exit(1);
56
+ }
57
+ const before = readEcommercePackages(dir);
58
+ if (Object.keys(before).length === 0) {
59
+ console.log('No @thedecipherist/mdd-ecommerce-* packages found in package.json.');
60
+ return;
61
+ }
62
+ const pm = detectPackageManager(dir);
63
+ const packageNames = Object.keys(before);
64
+ console.log(`\nUpdating ${packageNames.length} @thedecipherist/mdd-ecommerce-* package(s) with ${pm}...\n`);
65
+ const updateArgs = packageNames.join(' ');
66
+ const updateCmd = `${pm} update ${updateArgs}`;
67
+ try {
68
+ execSync(updateCmd, { cwd: dir, stdio: 'inherit' });
69
+ }
70
+ catch (err) {
71
+ console.log(`\nUpdate command failed: ${String(err)}`);
72
+ process.exit(1);
73
+ }
74
+ const after = readEcommercePackages(dir);
75
+ const changed = [];
76
+ for (const name of packageNames) {
77
+ const fromVersion = before[name] ?? 'unknown';
78
+ const toVersion = after[name] ?? fromVersion;
79
+ if (stripRange(fromVersion) !== stripRange(toVersion)) {
80
+ changed.push({ name, from: fromVersion, to: toVersion });
81
+ }
82
+ }
83
+ console.log('\n--- Update Summary ---\n');
84
+ if (changed.length === 0) {
85
+ console.log(' All packages already up to date. No changes applied.');
86
+ console.log('');
87
+ return;
88
+ }
89
+ const breakingChanges = [];
90
+ for (const result of changed) {
91
+ console.log(` โœ“ ${result.name} ${result.from} -> ${result.to}`);
92
+ if (isMajorBump(result.from, result.to)) {
93
+ breakingChanges.push(result);
94
+ }
95
+ }
96
+ console.log('');
97
+ if (breakingChanges.length > 0) {
98
+ console.log(' Warnings:');
99
+ for (const result of breakingChanges) {
100
+ const hasDocs = hasDocsDirectory(result.name, dir);
101
+ console.log(` ! Breaking change possible - check site.config.ts slot wiring for ${result.name}`);
102
+ if (hasDocs) {
103
+ const docsPath = join('node_modules', result.name, '.mdd', 'docs');
104
+ console.log(` Docs available: ${docsPath}`);
105
+ }
106
+ }
107
+ console.log('');
108
+ }
109
+ else {
110
+ console.log(' All updates applied. No breaking changes detected.');
111
+ console.log('');
112
+ }
113
+ }
114
+ //# sourceMappingURL=update-ecommerce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-ecommerce.js","sourceRoot":"","sources":["../src/update-ecommerce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAkB9B,SAAS,oBAAoB,CAAC,GAAW;IACvC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;QAAE,OAAO,MAAM,CAAC;IAC3D,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAAE,OAAO,MAAM,CAAC;IACtD,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7D,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,qBAAqB,CAAC,GAAW;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAC1C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAgB,CAAC;IACtE,MAAM,GAAG,GAA2B;QAClC,GAAG,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;QAC3B,GAAG,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;QAC9B,GAAG,CAAC,GAAG,CAAC,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uE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YAClG,IAAI,OAAO,EAAE,CAAC;gBACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;gBACnE,OAAO,CAAC,GAAG,CAAC,uBAAuB,QAAQ,EAAE,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;QACpE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thedecipherist/mdd",
3
- "version": "1.6.12",
3
+ "version": "1.7.0",
4
4
  "description": "MDD โ€” Manual-Driven Development workflow for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {