You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(ops-mode): add global scope, ops list, and collision guard to README and site
Adds the global ops scope (~/.claude/ops/), /mdd ops list command,
collision guard rule, and updated directory structure to both README.md
and docs/index.html. Keeps both doc surfaces in sync with the full
ops mode feature as implemented in mdd.md.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
> **The flaw MDD had:** Deployment and infrastructure tasks had no documentation home. Running `/mdd dokploy-deploy` defaulted to Build Mode and skipped the documentation phases — because deploying services isn't a feature to build. Ops Mode fixes this.
446
446
447
-
MDD now treats deployments as first-class citizens. Every deployment target gets a structured runbook in `.mdd/ops/`. Write it once — then `runop` executes it every time, with live health checks, verified steps, and canary-gated multi-region rollout.
447
+
MDD now treats deployments as first-class citizens. Every deployment target gets a structured runbook — either project-local or global. Write it once — then `runop` executes it every time, with live health checks, verified steps, and canary-gated multi-region rollout.
448
448
449
-
### The Three Commands
449
+
### Commands
450
450
451
451
| Command | What it does |
452
452
|---|---|
453
-
|`/mdd ops <description>`| Create a new deployment runbook — asks about services, regions, images, credentials, webhooks, and deployment strategy |
454
-
|`/mdd runop <slug>`| Execute the runbook — pre-flight health check → canary-gated region deploy → post-flight verify |
455
-
|`/mdd update-op <slug>`| Edit an existing runbook — re-asks questions with current values pre-filled, shows a diff before writing |
453
+
|`/mdd ops <description>`| Create a runbook — **first question is always: global or project?**|
454
+
|`/mdd ops list`| List all runbooks — global and project — with last-run health status |
455
+
|`/mdd runop <slug>`| Execute a runbook — checks project-local first, then global |
456
+
|`/mdd update-op <slug>`| Edit an existing runbook — same lookup order |
457
+
458
+
### Global vs Project Scope
459
+
460
+
The **first thing `/mdd ops` asks** is where the runbook should live:
461
+
462
+
| Scope | Location | Use for |
463
+
|---|---|---|
464
+
|**Project**|`.mdd/ops/<slug>.md`| This project only (e.g., deploy this specific app to Dokploy) |
465
+
|**Global**|`~/.claude/ops/<slug>.md`| Reusable across all projects (e.g., update Cloudflare DNS, renew SSL certs, Docker Hub login) |
466
+
467
+
> **Global ops cannot access project-local `.env` variables or project paths.** They use `~/.env` globals only — which is exactly right for infrastructure procedures that don't belong to any one project.
468
+
469
+
**Global is the authoritative namespace.** If a global runbook named `cloudflare-dns` exists, no project can create a local runbook with the same name. This prevents any ambiguity about which runbook `runop` will execute — you always know exactly what runs.
<strong>What Ops Mode fixes:</strong> MDD's original flaw — deployment and ops tasks had no documentation home. They fell into Build Mode or were skipped entirely. Ops Mode gives deployments the same document-first discipline as features. Write the runbook once; <code>/mdd runop</code> executes it every time.
<pclass="command-desc">Create a new deployment runbook in <code>.mdd/ops/</code>. Interviews you about services, regions, health checks, rollback criteria, and deployment strategy. Produces a structured YAML-frontmatter runbook that <code>runop</code> can execute.</p>
679
+
<pclass="command-desc">Create a new deployment runbook. First asks: global (<code>~/.claude/ops/</code>) or project-scoped (<code>.mdd/ops/</code>)? Interviews you about services, regions, health checks, rollback criteria, and deployment strategy. Produces a structured YAML-frontmatter runbook that <code>runop</code> can execute.</p>
680
680
</div>
681
681
<divclass="command-card">
682
682
<h3><code>/mdd runop <slug></code></h3>
683
-
<pclass="command-desc">Execute a runbook end-to-end: pre-flight health check → canary-gated region deploy → post-flight verify. Reads the ops doc as the source of truth. Executes step-by-step with verification at each step. If any gate fails, execution stops — the next region is never touched.</p>
683
+
<pclass="command-desc">Execute a runbook end-to-end: pre-flight health check → canary-gated region deploy → post-flight verify. Checks project-local first, then global. Reads the ops doc as the source of truth. If any gate fails, execution stops — the next region is never touched.</p>
684
684
</div>
685
685
<divclass="command-card">
686
686
<h3><code>/mdd update-op <slug></code></h3>
687
-
<pclass="command-desc">Edit an existing runbook. Updates services, regions, health endpoints, rollback criteria, or deployment strategy. Re-validates the runbook structure after editing so <code>runop</code> always has a consistent doc to execute from.</p>
687
+
<pclass="command-desc">Edit an existing runbook. Checks project-local first, then global. Updates services, regions, health endpoints, rollback criteria, or deployment strategy. Re-validates the runbook structure after editing.</p>
688
+
</div>
689
+
<divclass="command-card">
690
+
<h3><code>/mdd ops list</code></h3>
691
+
<pclass="command-desc">Show all runbooks — global and project-scoped — in a unified view. Displays slug, scope, platform, environments, and status so you can see everything available at a glance.</p>
688
692
</div>
689
693
</div>
690
694
695
+
<h3>Global vs Project Scope</h3>
696
+
<p><code>/mdd ops</code> asks scope as its very first question. The answer controls where the runbook is stored and how it is shared.</p>
<strong>Global scope note:</strong> Global ops cannot read project-local <code>.env</code> variables or project paths. They have access to <code>~/.env</code> globals only. If your runbook needs <code>DOCKER_HUB_TOKEN</code> or other global secrets, store them in <code>~/.env</code> and reference them there.
<strong>Collision guard:</strong> Global namespace is authoritative. If a global op named <code>docker-hub-push</code> already exists, you cannot create a project op with the same slug. This is a hard stop — no silent shadowing. Rename one of them to avoid ambiguity.
731
+
</div>
732
+
733
+
<h3>Listing All Runbooks</h3>
734
+
<p><code>/mdd ops list</code> shows all runbooks across both scopes in a unified view:</p>
Run /mdd runop <slug> to execute any runbook.</code></pre>
748
+
691
749
<h3>The Runbook Concept</h3>
692
750
<p>A runbook is a structured ops document in <code>.mdd/ops/</code> with YAML frontmatter declaring services, regions, deployment order, health check endpoints, and gate behaviour. It is the single source of truth for a deployment. <code>/mdd runop</code> reads it and executes it — you do not hand-craft the sequence each time.</p>
693
751
<p><strong>Write once, runs every time.</strong> Once a runbook exists, every future deployment of that service runs through the same documented sequence, with the same pre-flight checks, the same canary gate, and the same post-flight verification. Nothing falls through the cracks because someone forgot a step.</p>
@@ -768,18 +826,28 @@ <h3>Gate Behaviour</h3>
768
826
</div>
769
827
</div>
770
828
771
-
<h3>The <code>.mdd/ops/</code> Directory</h3>
772
-
<p>All ops runbooks live in <code>.mdd/ops/</code>, alongside feature docs and audit artifacts:</p>
773
-
<pre><codeclass="language-bash">.mdd/
829
+
<h3>Directory Structure</h3>
830
+
<p>Project runbooks live in <code>.mdd/ops/</code>. Global runbooks live in <code>~/.claude/ops/</code> alongside your other global Claude config:</p>
<p>Runbooks are gitignored by default alongside the rest of <code>.mdd/</code> — they contain environment-specific configuration (region URLs, health endpoints, image names) that belongs in your local workspace, not version control.</p>
│ └── dns-cloudflare.md # DNS update runbook (any project)
848
+
└── CLAUDE.md</code></pre>
849
+
850
+
<p>Project runbooks are gitignored by default alongside the rest of <code>.mdd/</code> — they contain environment-specific configuration (region URLs, health endpoints, image names) that belongs in your local workspace, not version control. Global runbooks persist in your home directory and are never project-specific.</p>
0 commit comments