# MSD Core Command Reference > Command reference for MSD Core — syntax, flags, options, and examples for every stable command. For feature details see [Feature Reference](FEATURES.md); for workflow walkthroughs see [User Guide](USER-GUIDE.md); for the docs index see [README](README.md). --- ## Command Syntax - **Claude Code / OpenCode:** `/msd-command-name [args]` (hyphen form) - **Codex:** `$msd-command-name [args]` Whichever runtime you're on, the installer writes the correct form into your runtime's command directory. ### Skill Runtime Behavior (Claude Code) Heavy workflow skills (`/msd-plan-phase`, `/msd-execute-phase`, `/msd-autonomous`) declare `effort: max`, signalling maximum token budget to the runtime. These skills are spawning orchestrators — they must run at top level so they retain the `Agent` tool needed to spawn subagents. They do **not** carry `context: fork` (see #921). Quick-status skills (`/msd-progress`, `/msd-stats`) declare `effort: low`, directing the runtime to use a minimal token budget for fast reads. These fields are Claude Code–specific frontmatter. On runtimes that do not recognise them (Antigravity, Codex, Cursor, etc.) the fields are silently ignored — existing behaviour is unchanged. --- ## Namespace Meta-Skills Six namespace routers ship as the first-stage entry points in v1.40. They keep the eager skill-listing token cost low (~120 tokens for 6 routers vs ~2,150 for a flat 86-skill listing) while the full surface remains directly invocable. The model selects a namespace, then routes to the concrete sub-skill. See [#2792](https://github.com/open-gsd/gsd-core/issues/2792). | Command | Routes to | |---------|-----------| | `/msd-workflow` | Phase pipeline — discuss / plan / execute / verify / phase / progress / next | | `/msd-project` | Project lifecycle — milestones, audits, summary | | `/msd-quality` | Quality gates — code review, debug, audit, security, eval, ui | | `/msd-context` | Codebase intelligence — map, graphify, docs, learnings | | `/msd-manage` | Management — config, workspace, workstreams, thread, update, ship, inbox | | `/msd-ideate` | Exploration & capture — explore, sketch, spike, spec, capture | The namespace skills are **additive** — every existing concrete command (e.g. `/msd-plan-phase`, `/msd-code-review --fix`) is still invocable directly. --- ## Core Workflow Commands ### `/msd-new-project` Initialize a new project with deep context gathering. | Flag | Description | |------|-------------| | `--auto @file.md` | Auto-extract from document, skip interactive questions | **Prerequisites:** No existing `.planning/PROJECT.md` **Produces:** `PROJECT.md`, `REQUIREMENTS.md`, `ROADMAP.md`, `STATE.md`, `config.json`, `research/`, `CLAUDE.md` ```bash /msd-new-project # Interactive mode /msd-new-project --auto @prd.md # Auto-extract from PRD ``` --- ### `/msd-onboard` Guide an existing codebase through first-time MSD onboarding. The command checks repo state, routes you through codebase mapping, optional docs ingest, project initialization, and creates an onboarding summary once planning exists. | Flag | Description | |------|-------------| | `--fast` | Prefer the lightweight `/msd-map-codebase --fast` mapping handoff; a complete map is still required before `/msd-new-project` | | `--text` | Use numbered plain-text gates instead of TUI menus | **Prerequisites:** Existing repo or planning docs. For empty greenfield projects, use `/msd-new-project`. **Produces:** `.planning/codebase/` via map-codebase, `.planning/` via new-project or ingest-docs, and `.planning/onboarding/SUMMARY.md` after project setup. ```bash /msd-onboard # Guided brownfield onboarding /msd-onboard --fast # Use lightweight codebase mapping first, then complete the map before project setup ``` --- ### `/msd-workspace` Manage MSD workspaces — create, list, or remove isolated workspace environments with repo copies and independent `.planning/` directories. | Flag | Description | |------|-------------| | `--new` | Create a new workspace (use with `--name`, `--repos`, etc.) | | `--list` | List active MSD workspaces and their status | | `--remove ` | Remove a workspace and clean up git worktrees | | `--name ` | Workspace name (used with `--new`) | | `--repos repo1,repo2` | Comma-separated repo paths or names (used with `--new`) | | `--path /target` | Target directory (default: `~/msd-workspaces/`) | | `--strategy worktree\|clone` | Copy strategy (default: `worktree`) | | `--branch ` | Branch to checkout (default: `workspace/`) | | `--auto` | Skip interactive questions | **Use cases:** - Multi-repo: work on a subset of repos with isolated MSD state - Feature isolation: `--repos .` creates a worktree of the current repo **Produces:** `WORKSPACE.md`, `.planning/`, repo copies (worktrees or clones) ```bash /msd-workspace --new --name feature-b --repos hr-ui,ZeymoAPI /msd-workspace --new --name feature-b --repos . --strategy worktree # Same-repo isolation /msd-workspace --list /msd-workspace --remove feature-b ``` --- ### `/msd-spec-phase` Clarify WHAT a phase delivers through Socratic questioning with quantitative ambiguity scoring, then probe for omitted edges. Produces `SPEC.md` before discuss-phase. | Argument | Required | Description | |----------|----------|-------------| | `N` | Yes | Phase number | | Flag | Description | |------|-------------| | `--auto` | Skip interactive questions; Claude selects recommended defaults and writes SPEC.md. An existing SPEC.md is **reused as-is**, never regenerated | | `--text` | Use plain-text numbered lists instead of TUI menus (required for `/rc` remote sessions) | **Position in workflow:** `spec-phase → discuss-phase → plan-phase → execute-phase → verify` **Edge Coverage (Step 5.5):** After the ambiguity gate passes, spec-phase runs an edge-completeness probe over each requirement. It raises only applicable categories from a closed 8-category taxonomy (boundary, adjacency, empty, encoding, ordering, precision, idempotency, concurrency), proposes one concrete candidate edge per category, and records each as `covered` / `dismissed` (reason required) / `backstop` / `unresolved` in a `## Edge Coverage` SPEC section. Unresolved applicable edges soft-gate the spec (Resolve / Write-anyway-flagged / Keep-probing); `covered` and `backstop` edges are later lifted into plan-phase `must_haves`. Under `--auto` the probe **never auto-dismisses** — it auto-covers where a defensible acceptance criterion exists, otherwise auto-backstops. **Prohibition Coverage (Step 5.6):** After the edge probe, spec-phase runs a prohibition-completeness probe — a two-stage prose pass (adversarial recall → precision classifier) that surfaces the unwritten *must-NOT* constraints (values/safety/ethics) the spec never forbids. Each is resolved to `resolved` (a NEGATIVE acceptance criterion, carrying a `test` or `judgment` verification tier) / `dismissed` (reason required) / `unresolved`, recorded in a `## Prohibitions (must-NOT)` SPEC section. Resolved prohibitions are lifted into plan-phase `must_haves.prohibitions`; judgment-tier items soft-gate at verify time (never silent, never hard-halt) and unwired test-tier items fail closed. Under `--auto` the probe **never auto-dismisses**; canon-bound concerns (OWASP / GDPR / fairness) are referred to `/msd-secure-phase`. **Prerequisites:** `.planning/ROADMAP.md` exists **Produces:** `{phase}-SPEC.md` (with a `## Edge Coverage` section) ```bash /msd-spec-phase 1 # Interactive spec + edge probe for phase 1 /msd-spec-phase 3 --auto # Auto-select defaults; never auto-dismisses an edge /msd-spec-phase 2 --text # Plain-text menus for remote sessions ``` --- ### `/msd-discuss-phase` Gather phase context through adaptive questioning before planning. | Argument | Required | Description | |----------|----------|-------------| | `N` | No | Phase number (defaults to current phase) | | Flag | Description | |------|-------------| | `--all` | Skip area selection — discuss all gray areas interactively (no auto-advance) | | `--auto` | Auto-select recommended defaults for all questions | | `--batch` | Group questions for batch intake instead of one-by-one | | `--analyze` | Add trade-off analysis during discussion | | `--power` | File-based bulk question answering from a prepared answers file | | `--assumptions` | Surface Claude's implementation assumptions about the phase without an interactive session | **Prerequisites:** `.planning/ROADMAP.md` exists **Produces:** `{phase}-CONTEXT.md`, `{phase}-DISCUSSION-LOG.md` (audit trail) ```bash /msd-discuss-phase 1 # Interactive discussion for phase 1 /msd-discuss-phase 1 --all # Discuss all gray areas without selection step /msd-discuss-phase 3 --auto # Auto-select defaults for phase 3 /msd-discuss-phase --batch # Batch mode for current phase /msd-discuss-phase 2 --analyze # Discussion with trade-off analysis /msd-discuss-phase 1 --power # Bulk answers from file /msd-discuss-phase 3 --assumptions # Surface Claude's assumptions before planning ``` --- ### `/msd-ui-phase` Generate UI design contract for frontend phases. | Argument | Required | Description | |----------|----------|-------------| | `N` | No | Phase number (defaults to current phase) | | Flag | Description | |------|-------------| | `--auto` | Skip interactive questions. An existing UI-SPEC.md is **reused as-is** and sent straight to the checker, never re-researched | | `--text` | Use plain-text numbered lists instead of TUI menus | **Prerequisites:** `.planning/ROADMAP.md` exists, phase has frontend/UI work **Produces:** `{phase}-UI-SPEC.md` ```bash /msd-ui-phase 2 # Design contract for phase 2 /msd-ui-phase 2 --auto # Non-interactive; reuses an existing UI-SPEC ``` --- ### `/msd-plan-phase` Research, plan, and verify a phase. | Argument | Required | Description | |----------|----------|-------------| | `N` | No | Phase number (if omitted, the orchestrating workflow reads ROADMAP.md and targets the next unplanned phase — not a `msd-tools.cjs` CLI feature) | | Flag | Description | |------|-------------| | `--auto` | Skip interactive confirmations | | `--research` | Force re-research even if RESEARCH.md exists | | `--skip-research` | Skip domain research step | | `--research-phase ` | Research-only mode: spawn researcher for phase ``, write RESEARCH.md, exit before planner. Supersedes the deleted standalone research command (#3042). | | `--view` | Research-only modifier: when used with `--research-phase`, print existing RESEARCH.md to stdout and exit (no spawn). | | `--gaps` | Gap closure mode (reads VERIFICATION.md, skips research) | | `--skip-verify` | Skip plan checker verification loop | | `--prd ` | Use a PRD file instead of discuss-phase for context | | `--ingest ` | Use ADR file(s) instead of discuss-phase for context synthesis | | `--ingest-format ` | Optional ADR parser format override for `--ingest` | | `--reviews` | Replan with cross-AI review feedback from REVIEWS.md | | `--bounce` | Run external plan bounce validation after planning (uses `workflow.plan_bounce_script`) | | `--skip-bounce` | Skip plan bounce even if enabled in config | | `--mvp` | MVP enrichment on top of the default tracer-first ordering — frames the phase goal as a user story and, on Phase 1 of a new project with no prior phase summaries, also emits `SKELETON.md` (Walking Skeleton). Vertical slicing is now the default (see `--no-tracer`); `--mvp` no longer turns it on. Can be persisted on a phase via `**Mode:** mvp` in ROADMAP.md, which applies `--mvp` automatically without the flag. | | `--no-tracer` | Opt out of the default **tracer-first** decomposition and plan horizontal layers (the legacy default). By default every plan leads with one production-quality end-to-end `tracer` slice that the executor verifies before any expansion task. | | `--no-reversibility-gates` | Suppress the human checkpoint that a **one-way-door** decision normally earns, for runs you intend to leave unattended. By default a decision rated `one-way` — undoing it needs a data migration, breaks a published contract, or is impossible — gets a `checkpoint:decision` inserted before the task that implements it. Ratings are still recorded on tasks and `costly` decisions are still flagged, so the flag changes what stops the run, not what the plan remembers. | | `--tdd` | TDD mode — planner applies `type: tdd` to eligible behavior-adding tasks so each begins with a failing test. Composable with `--mvp`: `--mvp --tdd` produces vertical slices where every behavior-adding task starts red-green. The leading `tracer` task also starts red under `--tdd`. | | `--granularity ` | Override the planning granularity for this invocation, ignoring config. Valid values: `coarse`, `standard`, `fine`. Takes precedence over `granularities.planning`, top-level `granularity`, and `planning.granularity` config. | **Smart-zone estimate report (#2631).** Every generated PLAN.md carries an optional `estimate` block (`{tokens, tasks, confidence}`). During the plan-check pass, `msd-plan-checker` runs each plan's `estimate.tokens` through `estimate-check` against the configurable `workflow.smart_zone_tokens` budget (default `100000`) and reports the result; a plan above budget gets a concrete split recommendation. The report is **advisory and never blocks planning**, and it is skipped with `--skip-verify` since it runs inside the verification pass. `confidence` is derived from how many completed phases carry recorded actuals — `low` means fewer than three, so the figure is not yet calibrated for your project. See [ADR-2629](adr/2629-phase-effort-estimation-calibration.md). **Prerequisites:** `.planning/ROADMAP.md` exists **Produces:** `{phase}-RESEARCH.md`, `{phase}-{N}-PLAN.md`, `{phase}-VALIDATION.md`; `{phase}/SKELETON.md` when Walking Skeleton mode fires **Research-only mode (`--research-phase `):** - No modifier: when RESEARCH.md already exists, auto-uses it — emits a one-line notice and exits, no prompt. - With `--research`: force-refresh — re-spawn researcher unconditionally, no prompt. - With `--view`: print existing RESEARCH.md to stdout, no spawn. Errors if RESEARCH.md missing. **Package Legitimacy Gate (v1.42.1):** When the researcher recommends external packages, it runs `msd-tools query package-legitimacy check --ecosystem ` on each one and writes a `## Package Legitimacy Audit` table to RESEARCH.md recording Registry, Age, Downloads, Source Repo, and legitimacy verdict. Verdicts are computed from live registry APIs (npm, PyPI, crates.io): - `[SLOP]` — package removed from RESEARCH.md entirely; never reaches the planner - `[SUS]` — package flagged; planner inserts `checkpoint:human-verify` before the install task - `[OK]` — package approved; no checkpoint added Packages sourced from WebSearch are tagged `[ASSUMED]` (not `[VERIFIED]`) and treated the same as `[SUS]` — they get a human checkpoint before install. A failed registry lookup degrades to `[SUS]` rather than throwing, so it is gated, not silently accepted. `slopcheck` is an optional escalate-only adapter that no shipped configuration wires; it is not required for the gate to function. See [Package Legitimacy Gate in the User Guide](USER-GUIDE.md#package-legitimacy-gate-v1421) for the full checkpoint format, verdict table, and troubleshooting. **In-repo value citation:** For any in-repo *discrete value* the researcher reports — an enum, a schema or type union, an error code, a status constant, or a filesystem path — a `[VERIFIED: …]` tag requires that it opened the source-of-truth file with `Read` during the run and cited the path **and line range** (`[VERIFIED: src/types/order.ts:14-22]`). The values are quoted verbatim in RESEARCH.md beside the claim, and any value used in a code example must also appear in that quote; anything else stays `[ASSUMED]`. A codebase `grep`, training memory, or a web search do not earn the tag on their own. This stops a plausible-but-drifted enum from reaching PLAN.md — where the planner lifts it into the plan's `` context block and the executor trusts it as ground truth — and surfacing only as a mid-execution deviation at typecheck. **Absent-evidence citation:** A compatibility claim the researcher reports — "this library does not support that runtime version" — earns a `[VERIFIED: …]` tag only from *positive* evidence. Metadata that is simply **missing** (no `python_requires`, no `engines` field, no per-version classifier, no changelog entry, no matching row in a support matrix) does not qualify, however authoritative the registry or documentation consulted: an absence says nothing about the version you are ruling out *and* nothing about the version you are standardizing on, so the same evidence would "prove" both. The rule keys on the evidence rather than the wording, so rephrasing the claim positively ("supports only up to 3.13") changes nothing, and an absence is equally not evidence that the version *is* supported. A **present** constraint is the opposite case and still earns the tag — `requires-python = ">=3.9,<3.12"` is a declared exclusion — as does documentation stating the incompatibility affirmatively, which is `[CITED: …]`. What separates the two is whether the declaration bounds every value or only the ones it names: an explicit range or upper bound speaks about all versions, while an enumerated allow-list that stops short of the target (classifiers running `:: 3.9` through `:: 3.13` with no `:: 3.14`) stays silent about the target and remains a governed absence unless the project says the list is exhaustive. See [How-to: verify a dependency-compatibility claim](how-to/verify-a-dependency-compatibility-claim.md). The one route from an absence to `[VERIFIED]` is a positive falsification attempt: run it against the real target and paste the failing output. Everything short of that stays `[ASSUMED]`, which routes the claim through the usual confirmation checkpoint before it can lock a decision in CONTEXT.md — so a probe you cannot run in this environment costs a checkpoint, not a blocked plan. ```bash /msd-plan-phase 1 # Research + plan + verify phase 1 /msd-plan-phase 3 --skip-research # Plan without research (familiar domain) /msd-plan-phase --auto # Non-interactive planning /msd-plan-phase 1 --bounce # Plan + external bounce validation /msd-plan-phase 2 --ingest docs/adr/0010.md # ADR express path for context synthesis /msd-plan-phase 2 --ingest 'docs/adr/00*.md' --ingest-format auto /msd-plan-phase --research-phase 4 # Research only on phase 4 (auto-uses existing RESEARCH.md, no prompt) /msd-plan-phase --research-phase 4 --view # Print existing RESEARCH.md, no spawn /msd-plan-phase --research-phase 4 --research # Force-refresh research, no prompt /msd-plan-phase 1 --mvp # Vertical-slice plan for phase 1 /msd-plan-phase 1 --mvp --tdd # Vertical slices + failing test per behavior-adding task ``` --- ### `/msd-plan-review-convergence` Cross-AI plan convergence loop — replan with review feedback until no HIGH concerns remain and no actionable MEDIUM/LOW findings remain outside `PLAN.md`. Runs `plan-phase → review → replan → re-review` cycles (max 3 cycles by default). Plan-phase runs inline (bare Skill at depth 0 so it can spawn msd-planner/msd-plan-checker at depth 1); only msd-review runs in an isolated Agent. Orchestrator handles loop control, unresolved review counting (HIGH + actionable non-HIGH), stall detection, and escalation. | Argument / Flag | Required | Description | |-----------------|----------|-------------| | `N` | **Yes** | Phase number to plan and review | | Reviewer flags | No | Pass through every reviewer lane flag: `--claude`, `--codex`, `--coderabbit`, `--opencode`, `--cursor`, `--agy` / `--antigravity`, `--ollama`, `--lm-studio`, `--llama-cpp` | | `--all` | No | Run every configured reviewer. Lanes are dispatched **sequentially by default**; set `review.parallel_lanes` to `true` to dispatch them concurrently within a single review pass | | `--max-cycles N` | No | Override cycle cap (default 3) | **Exit behavior:** Loop exits when `current_high` and `current_actionable` hit zero; open `## Plan-Revision Conflicts` entries in REVIEWS.md must also be zero. Stall detection warns when the total unresolved review count is not decreasing across cycles. At `--max-cycles`, the escalation gate offers proceed-or-review-manually for HIGH or actionable non-HIGH concerns, but only manual review when a plan-revision conflict is still open — "Proceed anyway" is never offered over an unresolved conflict. **Consensus gate (2+ reviewers only).** When two or more reviewers actually run in a cycle, a HIGH raised by exactly one of them is weighed by what the claim asserts before it counts toward `current_high`: | Lone reviewer's HIGH asserts | Counts toward `current_high` when | |---|---| | **Existence** — a symbol, file, flag, commit or ID exists, is absent, or says something specific | source-grounding confirms it, **or** another reviewer raised the same concern | | **Judgment** — a design or correctness property (missing idempotency, a race, an absent rate limit) | always, **unless** that reviewer's section opens with an evidence-quality discount marker (`[reviewed-without-source-citations]`, `[reviewed-without-repo-access]`, or a diff-only lane) | Judgment-class findings are deliberately exempt from corroboration: reviewers catch materially different classes of issue, so requiring two of them to independently raise the same architectural concern would suppress exactly what a multi-reviewer setup exists to surface. A suppressed HIGH is still reported, tagged `(single-reviewer, unconfirmed)` — never dropped. If **every** reviewer in a cycle carries a discount marker the gate disengages entirely, so a cycle in which nothing was verified can never be counted as converged. `current_actionable` is unaffected. With a single reviewer configured — the common case — behavior is unchanged. See [reviewer instances](../msd-core/references/reviewer-instances.md) for how this interacts with `review.reviewer_instances`. **What this gate does not do.** It weighs *evidence*, not correctness. A reviewer that cites source evidence anywhere in its review is never discount-marked, so a **judgment-class finding it invents still counts on its own** — the marker catches "cited nothing" and "had no repo access", not "drew the wrong conclusion from a real citation". That is the deliberate side of the trade: the alternative is requiring corroboration for design findings, which suppresses the genuine architectural concern only one reviewer noticed, and would make adding reviewers *weaken* the gate. Existence-class claims are the ones tightened here. ```bash /msd-plan-review-convergence 3 # Default reviewers, 3 cycles /msd-plan-review-convergence 3 --codex # Codex-only review /msd-plan-review-convergence 3 --all --max-cycles 5 ``` --- ### `/msd-ultraplan-phase` **[BETA]** Offload plan phase to Claude Code's ultraplan cloud; review in browser and import back. The plan drafts remotely so the terminal stays free; review inline comments in a browser, then import the finalized plan back into `.planning/` via `/msd-import`. | Flag | Required | Description | |------|----------|-------------| | `N` | **Yes** | Phase number to plan remotely | **Isolation:** Intentionally separate from `/msd-plan-phase` so upstream ultraplan changes cannot affect the core planning pipeline. ```bash /msd-ultraplan-phase 4 # Offload planning for phase 4 ``` --- ### `/msd-execute-phase` Execute all plans in a phase with wave-based parallelization, or run a specific wave. | Argument | Required | Description | |----------|----------|-------------| | `N` | **Yes** | Phase number to execute | | `--wave N` | No | Execute only Wave `N` in the phase | | `--cross-ai` | No | Delegate execution to an external AI CLI (uses `workflow.cross_ai_command`) | | `--no-cross-ai` | No | Force local execution even if cross-AI is enabled in config | **Prerequisites:** Phase has PLAN.md files **Produces:** per-plan `{phase}-{N}-SUMMARY.md`, git commits, and `{phase}-VERIFICATION.md` when the phase is fully complete **Package install failures (v1.42.1):** If a plan's install step fails, the executor surfaces a `checkpoint:human-verify` and stops. It does not auto-install a similarly-named alternative. This is intentional — silently substituting package names is how slopsquatting spreads. Respond to the checkpoint after verifying the package on its registry page. ```bash /msd-execute-phase 1 # Execute phase 1 /msd-execute-phase 1 --wave 2 # Execute only Wave 2 /msd-execute-phase 2 --cross-ai # Delegate phase 2 to external AI CLI ``` --- ### `/msd-verify-work` User acceptance testing with auto-diagnosis. | Argument | Required | Description | |----------|----------|-------------| | `N` | No | Phase number (defaults to last executed phase) | **Prerequisites:** Phase has been executed **Produces:** `{phase}-UAT.md`, fix plans if issues found For browser-backed UAT, use a configured browser MCP server. The current Open GSD companion is `msd-browser` (`msd-browser mcp`), which provides deterministic navigation, versioned refs, assertions, screenshots, visual diffs, recordings, and human takeover. Legacy Playwright MCP servers remain usable when already configured. ```bash /msd-verify-work 1 # UAT for phase 1 ``` **Coverage-aware UAT routing (#1602).** When a SUMMARY.md carries a `coverage:` frontmatter block, `verify-work` classifies each deliverable deterministically instead of prompting for every prose bullet: deliverables proven by passing tests are auto-passed (recorded with `source: automated`, no prompt) and only judgment-dependent deliverables are presented for human sign-off. SUMMARYs without a `coverage:` block fall back to the previous prose-based extraction unchanged. See the [`coverage:` block reference](#summary-coverage-block) below. **Honest verifier — `insufficient_spec` abstention (#1154).** A `must_haves.truths` item carrying the `verification: backstop` marker (a *non-inferable* check the edge-probe surfaced at spec time) is graded specially: if the verifier cannot confirm it with **explicit evidence** (a passing wired held-out/property-based test, or a directly-observed behavior), it **abstains** — the item is reported `unverified — held-out test recommended` and the phase verdict becomes `human_needed` (with reason `insufficient_spec`, distinct from ordinary manual-UAT `human_needed`), **never a silent `passed`**. Autonomous runs complete with "N unverified non-inferable checks" rather than hard-halting; interactive runs route the item to the end-of-phase human checkpoint. Abstention is exogenous (driven by the `backstop` tag, never a self-judged "abstain if unsure") and an inferable truth is never abstained. Reliable on capable verifier tiers (`sonnet`+); the budget `haiku` tier degrades toward current behavior. See [Honest Verifier](../msd-core/references/honest-verifier.md). #### SUMMARY `coverage:` block A SUMMARY.md may carry an optional `coverage:` frontmatter block — a list of per-deliverable entries that joins requirements → tests → verification status: | Field | Description | |-------|-------------| | `id` | Stable identifier (`D1`, `D2`…), unique within the SUMMARY | | `description` | The deliverable in human-readable form | | `requirement` | Optional REQ-ID linking to REQUIREMENTS.md | | `verification[].kind` | `unit` \| `integration` \| `e2e` \| `automated_ui` \| `manual_procedural` \| `other` | | `verification[].ref` | Test path + descriptor, screenshot ref, or command | | `verification[].status` | `pass` \| `fail` \| `unknown` | | `human_judgment` | Required boolean. `true` always routes to a human | | `rationale` | Required when `human_judgment: true` | A deliverable is auto-passed **only** when `human_judgment: false`, its `verification` list is non-empty, and every entry's `status` is `pass`. Anything else — `human_judgment: true`, an empty `verification`, a non-`pass` status, or a schema error — is presented to a human (fail-safe). Inspect the classification directly with: ```bash node msd-tools.cjs uat classify-coverage --summary .planning/phases/01-foundation/01-01-SUMMARY.md ``` --- --- ### `/msd-ship` Create PR from completed phase work with auto-generated body. | Argument | Required | Description | |----------|----------|-------------| | `N` | No | Phase number or milestone version (e.g., `4` or `v1.0`) | | `--draft` | No | Create as draft PR | **Prerequisites:** Phase verified (`/msd-verify-work` passed), `gh` CLI installed and authenticated **Produces:** GitHub PR with rich body from planning artifacts, STATE.md updated ```bash /msd-ship 4 # Ship phase 4 /msd-ship 4 --draft # Ship as draft PR ``` **PR body includes:** - Phase goal from ROADMAP.md - Changes summary from SUMMARY.md files - Requirements addressed (REQ-IDs) - Verification status - Key decisions - Optional configured PRD-style sections from `ship.pr_body_sections` **Ship gates (capability-driven):** `/msd-ship` runs every active `ship:pre` gate from the capability registry. Two are on by default: - **Security** (`security` capability): blocks while `SECURITY.md` reports `threats_open > 0`. Resolve via `/msd-secure-phase {n}`. - **Broken-windows ledger** (`broken-windows` capability, issue #1950): when `workflow.windows_enforce=true` is set, blocks while `.planning/WINDOWS.md` reports any `open` entry. The ledger accumulates stubs, TODOs, skipped tests, unrun verifies, and unmet truths across phases. Resolve an entry with `msd-tools windows fixed ` (defect resolved) or `msd-tools windows waive ""` (justified deferral — reason is required and recorded). Inspect via `msd-tools windows status`. Enforcement is **opt-in** (default `workflow.windows_enforce=false`): enable with `msd config-set workflow.windows_enforce true`; tracking continues regardless. See [Custom PR Body Sections](ship-pr-body-sections.md) for onboarding, examples, and validation rules. --- ### `/msd-ui-review` Retroactive 6-pillar visual audit of implemented frontend. | Argument | Required | Description | |----------|----------|-------------| | `N` | No | Phase number (defaults to last executed phase) | **Prerequisites:** Project has frontend code (works standalone, no MSD project needed) **Produces:** `{phase}-UI-REVIEW.md`, screenshots in `.planning/ui-reviews/` For richer visual evidence, pair this with `msd-browser` or another browser MCP server so the audit can capture screenshots, state, console/network context, and reproducible interaction steps. | Flag | Description | |------|-------------| | `--auto` | Skip interactive questions. An existing UI-REVIEW.md is **reused as-is**, never re-audited | ```bash /msd-ui-review # Audit current phase /msd-ui-review 3 # Audit phase 3 /msd-ui-review 3 --auto # Non-interactive; reuses an existing UI-REVIEW ``` --- ### `/msd-audit-uat` Cross-phase audit of all outstanding UAT and verification items. **Prerequisites:** At least one phase has been executed with UAT or verification **Produces:** Categorized audit report with human test plan ```bash /msd-audit-uat ``` --- ### `/msd-audit-milestone` Verify milestone met its definition of done. **Prerequisites:** All phases executed **Produces:** Audit report with gap analysis ```bash /msd-audit-milestone ``` --- ### `/msd-complete-milestone` Archive milestone, tag release. **Prerequisites:** Milestone audit complete (recommended) **Produces:** `MILESTONES.md` entry, git tag ```bash /msd-complete-milestone ``` **Pre-close artifact audit.** Before archiving, the workflow runs `msd-tools audit-open` and reports every unresolved item across nine categories: | Category | Source | Open when | |----------|--------|-----------| | Debug sessions | `.planning/debug/` | status not `resolved` / `complete` | | Quick tasks | `.planning/quick/` | SUMMARY missing or not `complete` | | Threads | `.planning/threads/` | status not terminal | | Pending todos | `.planning/todos/pending/` | present | | Seeds | `.planning/seeds/` | not yet implemented | | UAT gaps | `*-UAT.md` | scenarios still pending | | Verification gaps | `*-VERIFICATION.md` | verdict `gaps_found` / `human_needed` | | CONTEXT questions | `*-CONTEXT.md` | questions left open | | **Deferred items** | `deferred-items.md` | entry lacks `status: resolved` | The four phase-scoped categories above (UAT gaps, Verification gaps, CONTEXT questions, Deferred items) read phase directories from **both** the active `.planning/phases/` root and every archived `.planning/milestones/vX.Y-phases/` root (#3458) — an item still unresolved when its milestone closed and its phase directory archived stays visible in every later audit instead of silently disappearing. In `--json` output, an item sourced from an archived milestone carries an `archived_milestone` field (e.g. `"v1.0"`); active items omit the field entirely. The human-readable report labels an archived item's line with `(archived vX.Y)` so a phase number that repeats across milestones (numbering restarts at `01` after each archive) is not misread as one duplicate line. If any category is non-empty you are prompted with `[R] Resolve` / `[A] Acknowledge all` / `[C] Cancel`. `[A]` calls `msd-tools audit-open acknowledge` once per open item — the CLI writer that actually suppresses each item starting at the next `audit-open` scan — then records the same items to `STATE.md` under its own `## Deferred Items` heading (a disclosure record, not the suppression mechanism) and closes as `override_closeout`; an all-clear closes as `verified_closeout`. **`audit-open acknowledge` (#3458 follow-up).** Suppresses one open item by writing (or refreshing) a verdict-preserving `audit_acknowledged` marker in the artifact's own frontmatter: ```bash msd-tools audit-open acknowledge --category --milestone [--at ] ``` `--category` and `--milestone` are always required; `--at` defaults to today. The identifier flags depend on `--category`: | `--category` | Identifier flags | |---------------|-------------------| | `debug_sessions` | `--slug ` | | `threads` | `--slug ` | | `seeds` | `--seed-id ` | | `todos` | `--filename ` | | `quick_tasks` | `--dir ` (the `.planning/quick//` directory name — note this is the ORIGINAL directory name, not the date-stripped `slug` the audit JSON displays) | | `uat_gaps`, `verification_gaps`, `context_questions` | `--phase --file ` [`--archived-milestone `] | | `deferred_items` | `--phase --file --text ` [`--archived-milestone `] | The marker never overwrites the artifact's own `status:` field for the eight frontmatter-marker categories — only `deferred_items` is the deliberate exception, where the marker IS the entry's `status:` field (there is no other meaning for that field on a `deferred-items.md` bullet). The marker also self-invalidates: it snapshots the artifact's current observed state at acknowledgment time — its `status:` for most categories, a composite of `status:` plus its open-scenario count for `uat_gaps` (a status can stay the same while more scenarios go pending), and a content digest of the full question set (not just a count) for `context_questions` (so replacing every question's text while holding the count steady still invalidates the snapshot) — and the item resurfaces on its own the moment that snapshot no longer matches — an edited, reopened, or otherwise-changed artifact is never silently suppressed forever. `--json` output on `audit-open` (the `run` subcommand, default) now reports an `acknowledged` count per category alongside `counts`, plus an `acknowledged.total`, so a clean audit (`counts.total === 0`) can be told apart from one that is clean only because earlier items are still being suppressed (`acknowledged.total > 0`). > **Note:** the `deferred-items.md` category is the per-phase SCOPE BOUNDARY log a phase agent writes when it finds a defect it should not fix. It is a different artifact from the `## Deferred Items` section `[A]` writes into `STATE.md`, which records what you acknowledged at close. > **Truncated-window guard.** Archiving also refuses when the milestone's ROADMAP window is truncated — `Cannot mark milestone complete: the ROADMAP window for "" is truncated`. This is the case where the milestone's heading is found but its section closes before reaching the roadmap's `### Phase N:` region (typically a closed-milestone heading sitting in between), which previously degraded to an over-inclusive filter and archived *every* phase directory in the project rather than the milestone's own. An unreadable ROADMAP.md or a version with no matching section at all are pre-existing, legitimately-handled states and are not refused here. Same override as below: `msd-tools milestone complete --force --confirm` (#3726: `--confirm` is required for any mutating run; `--force` alone does not imply it). A window that is genuinely empty — a freshly-declared milestone with no phases yet — is *not* affected and still completes normally. > **Unstarted-phase guard.** Archiving refuses if the milestone's ROADMAP still lists a phase with no phase directory on disk — `Cannot mark milestone complete: ROADMAP lists N unstarted phase(s)`. If a phase was intentionally deferred or merged without a directory, run `msd-tools milestone complete --force --confirm` (the `/msd-complete-milestone` workflow runs the underlying command without `--force`, so use the CLI directly to override; `--confirm` is required for any mutating run — #3726). A `STATE.md` `milestone:` value that does not match `` prints a WARNING and still runs the guard (#2946). > **Sentinel directories stay put.** Moving phase directories into the archive (the default, unless `--no-archive-phases` is passed) now excludes `999.*` (backlog) and `0-*` (pre-milestone) directories via the same sentinel predicate the unstarted-phase guard already uses. Previously the archive move was scoped only by the milestone window, so a sentinel directory sitting inside that window could be archived along with the milestone's own phases. > **Quick-task archival (opt-in, default OFF, #2142).** Unlike phase archival above, quick-task archival does not run unless you say yes — doing nothing leaves `.planning/quick/` untouched. If `.planning/quick/` contains at least one directory, the workflow asks: `Archive completed quick tasks into this milestone too?` with options `Yes — archive quick tasks into v[X.Y]` / `Skip`. Choosing "Yes" passes `--archive-quick` to the underlying `msd-tools milestone complete` call, which moves every directory under `.planning/quick/` into `.planning/milestones/v[X.Y]-quick/`, (re)writes that directory's `README.md` index (built by scanning the archive directory, not STATE.md), and clears the data rows of STATE.md's `### Quick Tasks Completed` table while preserving its header and column variant. **Known limit:** there is no on-disk record of which milestone a quick task belongs to, so archival buckets **all** remaining `.planning/quick/*` into the one milestone being completed — a task predating an earlier, unarchived milestone lands in the current bucket regardless. See [Archiving quick tasks](how-to/handle-quick-and-fast-tasks.md#archiving-quick-tasks) for the full walkthrough, including the retroactive path. --- ### `/msd-milestone-summary` Generate comprehensive project summary from milestone artifacts for team onboarding and review. | Argument | Required | Description | |----------|----------|-------------| | `version` | No | Milestone version (defaults to current/latest milestone) | **Prerequisites:** At least one completed or in-progress milestone **Produces:** `.planning/reports/MILESTONE_SUMMARY-v{version}.md` **Summary includes:** - Overview, architecture decisions, phase-by-phase breakdown - Key decisions and trade-offs - Requirements coverage - Tech debt and deferred items - Getting started guide for new team members - Interactive Q&A offered after generation ```bash /msd-milestone-summary # Summarize current milestone /msd-milestone-summary v1.0 # Summarize specific milestone ``` --- ### `/msd-new-milestone` Start next version cycle. | Argument | Required | Description | |----------|----------|-------------| | `name` | No | Milestone name | | `--reset-phase-numbers` | No | Restart the new milestone at Phase 1 and archive old phase dirs before roadmapping | | `--ws ` | No | Scope the milestone to a workstream; skips the shared `PROJECT.md` write | **Prerequisites:** Previous milestone completed **Produces:** Updated `PROJECT.md`, new `REQUIREMENTS.md`, new `ROADMAP.md` ```bash /msd-new-milestone # Interactive /msd-new-milestone "v2.0 Mobile" # Named milestone /msd-new-milestone --reset-phase-numbers "v2.0 Mobile" # Restart milestone numbering at 1 /msd-new-milestone --ws search "v2.0 Search" # Scope to a workstream ``` --- ## Phase Management Commands ### `/msd-phase` CRUD for phases in ROADMAP.md — add, insert, remove, or edit phases with a single consolidated command. | Flag | Description | |------|-------------| | (none) | Append a new integer phase to the end of the current milestone | | `--insert ` | Insert urgent work as a decimal phase (e.g., 3.1) after phase N | | `--remove ` | Remove a future phase and renumber subsequent phases | | `--edit ` | Edit any field of an existing phase in place | | `--force` | Allow editing in-progress or completed phases (used with `--edit`) | **Prerequisites:** `.planning/ROADMAP.md` exists **Produces:** Updated ROADMAP.md ```bash /msd-phase "Add authentication system" # Append new phase with description /msd-phase --insert 3 "Fix auth race condition" # Insert between phase 3 and 4 → creates 3.1 /msd-phase --remove 7 # Remove phase 7, renumber 8→7, 9→8, etc. /msd-phase --edit 5 # Edit any field of phase 5 /msd-phase --edit 5 --force # Edit phase 5 even if in-progress or completed ``` --- ### `/msd-mvp-phase` Guided MVP planning for a phase — prompts for a user story, runs SPIDR splitting check, writes `**Mode:** mvp` to ROADMAP.md, then delegates to `/msd-plan-phase` (which auto-detects MVP mode via the roadmap field). | Argument | Required | Description | |----------|----------|-------------| | `N` | **Yes** | Phase number to convert to MVP mode (integer or decimal like `2.1`) | | Flag | Description | |------|-------------| | `--force` | Allow converting an `in_progress` or `completed` phase | **Prerequisites:** Phase must already exist in ROADMAP.md (created via `/msd-new-project`, `/msd-phase`, or `/msd-phase --insert`). The command does not create new phases — it converts an existing phase. **Behaviour:** Collects a structured user story, validates format, runs a SPIDR splitting check, writes `**Goal:**` and `**Mode:** mvp` to the phase's ROADMAP.md section, then delegates to `/msd-plan-phase `. See [How to plan an MVP phase](USER-GUIDE.md#mvp-phase-planning) for a walkthrough. **Walking Skeleton:** Auto-triggered when `--mvp` (or `mode: mvp`) is used on Phase 1 of a new project with no prior phase summaries. The planner produces `SKELETON.md` alongside `PLAN.md`. **Produces:** Updated ROADMAP.md, then all artifacts from `/msd-plan-phase`; `SKELETON.md` when Walking Skeleton mode fires. ```bash /msd-mvp-phase 1 # MVP planning for phase 1 /msd-mvp-phase 2.1 # MVP planning for a decimal phase /msd-mvp-phase 3 --force # Convert phase 3 even if in-progress ``` --- ### `/msd-validate-phase` Retroactively audit and fill Nyquist validation gaps. | Argument | Required | Description | |----------|----------|-------------| | `N` | No | Phase number | ```bash /msd-validate-phase 2 # Audit test coverage for phase 2 ``` --- ### `phase uat-passed [--require-verification]` Runtime-neutral predicate that evaluates HUMAN-UAT results for a phase and reports whether all required checks passed. Uses markdown-aware parsing that ignores false-positive contexts (YAML frontmatter, fenced code blocks, HTML comments, and blockquotes), so incomplete checkbox fragments in prose sections never trigger a false pass. | Argument | Required | Description | |----------|----------|-------------| | `N` | **Yes** | Phase number to evaluate | | `--require-verification` | No | Require at least one `*-VERIFICATION.md` file alongside UAT results; fails if none are found | **Output fields (JSON):** | Field | Type | Description | |-------|------|-------------| | `passed` | `boolean` | `true` only when at least one check exists AND all checks pass AND no blockers — fail-closed (no vacuous pass) | | `uat_files` | `string[]` | Filenames of `*-UAT.md` files evaluated | | `verification_files` | `string[]` | Filenames of `*-VERIFICATION.md` files evaluated | | `checks[]` | `{ file, test, name, result, passing }[]` | Per-item evaluation results parsed from heading blocks | | `blockers[]` | `string[]` | Human-readable reasons for failure (frontmatter issues, failing/missing test items, policy violations, malformed markdown) — NOT a subset of `checks[]` | | `no_uat_artifacts` | `boolean` | `true` when no real UAT test items were parsed (no `*-UAT.md` files, unreadable dir, or files with no test blocks); when `true`, `passed` is always `false` | | `policy.require_verification` | `boolean` | Whether `--require-verification` was active | **Programmatic access:** `node msd-tools.cjs phase uat-passed [--require-verification] [--raw]` — see [CLI Tools Reference](CLI-TOOLS.md) ```bash node msd-tools.cjs phase uat-passed 3 # Evaluate UAT for phase 3 node msd-tools.cjs phase uat-passed 3 --require-verification # Also require VERIFICATION.md node msd-tools.cjs phase uat-passed 3 --raw # Machine-readable JSON output ``` --- ### `planning inspect` Emit a read-only, schema-versioned JSON snapshot of the whole planning state — milestone identity, active phase/plan/status, per-phase verification, roadmap acceptance and UAT evidence (kept separate), requirement rows with mapped-phase traceability, plan and task rows with planned/changed file provenance, and independent `accepted_phases` / `completed_plans` fractions. For downstream tools that need planning state without re-parsing MSD's Markdown. Mutates nothing. Takes no arguments — a stray positional or unknown flag is a fail-loud usage error rather than a silently-ignored one. ```bash node msd-tools.cjs query planning inspect # schema-v1 snapshot node msd-tools.cjs query planning.inspect # dotted canonical form, identical node msd-tools.cjs query planning inspect --cwd /path/to/project ``` Check `schema_version` before reading any other field, and branch on each value's `scope` — `complete` with an empty value is a real answer, `unreadable` is not. Full field reference: [CLI Tools](CLI-TOOLS.md#planning-inspect). Integration walkthrough: [Consume the planning snapshot](how-to/consume-the-planning-snapshot.md). --- ### `task resolve-content --plan --task-id --raw` Resolves one task's content (`action`/`verify`/`acceptance_criteria`/`read_first`/`done`) from an external issue tracker instead of reading it inline from a task's `PLAN.md` body. Called by `execute-plan.md`'s per-task loop, once per task carrying a `tracker-id` attribute, before that task's read_first gate. See [ADR-3646](adr/3646-per-task-content-resolution-seam.md) and [Develop a task-content resolver capability](how-to/develop-a-task-content-resolver-capability.md). | Argument | Required | Description | |----------|----------|-------------| | `--plan` | **Yes** | Path to the `PLAN.md` the task belongs to | | `--task-id` | **Yes** | The task's `tracker-id` attribute value, e.g. `beads:MSD-42` | | `--raw` | No | Machine-readable JSON output | **Exit codes:** | Exit | Meaning | |------|---------| | `0` | Resolution attempted (or not needed) — see `resolved`/`reason` below | | non-zero | **Hard halt.** A resolver was found and invoked but failed (tracker unreachable, id not found, timeout, malformed JSON output). stderr names the tracker-id, the tracker prefix, and the resolver's error. Never fall back to inline `PLAN.md` content on this outcome. | **Output fields (JSON, exit 0 only):** | Field | Type | Description | |-------|------|-------------| | `resolved` | `boolean` | `true` only when a resolver was found, invoked, and returned non-empty content | | `reason` | `string` | Present when `resolved` is `false`: `"no-resolver"` (task has a `tracker-id` but no installed capability declares a matching `trackerPrefix`) or `"empty"` (the resolver ran successfully but returned empty/absent content — the one legitimate pre-migration fallback case) | | `content` | `object` | Present when `resolved` is `true`. Supersedes this task's inline ``/``/``/``/`` for every downstream gate in the execute step | ```bash node msd-tools.cjs task resolve-content --plan .planning/phases/03-name/03-1-PLAN.md --task-id beads:MSD-42 --raw ``` `execute-plan.md` only invokes this command when the task carries a `tracker-id` attribute; a task with no `tracker-id` is unaffected. --- ## Navigation Commands ### `/msd-next` Open the state-aware smart-entry launcher. It reads `.planning/STATE.md`, `ROADMAP.md`, verification artifacts, and git status, classifies the current situation, shows a short menu, then dispatches exactly one existing MSD command. This is a launcher/router only — it never performs project work directly. Detection is handled by `msd-tools smart-entry --json`; the markdown workflow presents the menu with `AskUserQuestion` or a numbered `--text` fallback. **Situations detected:** no project, paused work, blockers, failed verification, first-phase setup, planning, executing, pending verification, idle stranded work, complete milestone, or unknown state. ```bash /msd-next # Detect state and route to the best next action ``` ### `/msd-progress` Show status, next steps, and automatically advance to the next logical workflow step. Reads project state and determines the appropriate action. Use `/msd-next` when you want an interactive smart-entry menu before dispatch; use `/msd-progress --next` when you want MSD to advance directly. | Flag | Description | |------|-------------| | `--next` | Automatically advance to the next logical workflow step without manual route selection | | `--next --auto` | Like `--next`, but chains steps automatically until milestone completion or a blocking decision | | `--next --converge` | When the next action is planning, route it through `/msd-plan-review-convergence`; requires `workflow.plan_review_convergence=true` | | `--cross-ai` | Alias for `--converge` | | Reviewer flags | With `--converge`, pass through every reviewer lane flag: `--claude`, `--codex`, `--coderabbit`, `--opencode`, `--cursor`, `--agy` / `--antigravity`, `--ollama`, `--lm-studio`, `--llama-cpp`, `--all`, and `--max-cycles N` | | `--do "task description"` | Analyze freeform intent and dispatch to the most appropriate MSD command | | `--forensic` | Append a 6-check integrity audit after the standard report (STATE consistency, orphaned handoffs, deferred scope drift, memory-flagged pending work, blocking todos, uncommitted code) | > **Milestone name and version.** The milestone this report shows comes from one > implementation shared with `/msd-stats`, `/msd-manager` and `roadmap analyze`. > A name is no longer cut short at a parenthesis (`v3.3 — Portability (Windows)` > keeps its full name), a `### Phase N:` heading that mentions a version is never > mistaken for the milestone heading, and a milestone that cannot be identified is > shown as absent rather than as a plausible-looking `v1.0`/`milestone`. See > [CLI-TOOLS.md → Milestone identity](CLI-TOOLS.md#milestone-identity-which-milestone-and-what-it-is-called). **Auto-routing behavior (`--next`):** - No project → suggests `/msd-new-project` - Phase needs discussion → runs `/msd-discuss-phase` - Phase needs planning → runs `/msd-plan-phase` (or `/msd-plan-review-convergence` when `--converge` is set) - Phase needs execution → runs `/msd-execute-phase` - Phase needs verification → runs `/msd-verify-work` - All phases complete → suggests `/msd-complete-milestone` Status reporting is scoped to the current milestone's `ROADMAP.md` window and sentinel-filtered: `999.*` backlog directories and `0-*` pre-milestone directories are not counted as current-milestone phases, so the reported progress percentage no longer holds at `100` while phases in the active window are still outstanding. > **Nullable percentage.** The reported completion percentage is `null` — never a fabricated `0`, `100`, or stale value — when the current milestone's phase set is not fully readable/scoped. See [CLI-TOOLS.md → A non-COMPLETE scope withholds the percentage entirely](CLI-TOOLS.md#a-non-complete-scope-withholds-the-percentage-entirely-3217). ```bash /msd-progress # "Where am I? What's next?" with auto-routing /msd-progress --next # Advance to next step automatically /msd-progress --next --auto # Chain steps automatically until completion /msd-progress --next --auto --converge # Hands-free run with plan-review convergence /msd-progress --do "fix the auth bug" # Dispatch freeform intent to best MSD command /msd-progress --forensic # Standard report + integrity audit ``` ### `/msd-resume-work` Restore full context from last session. ```bash /msd-resume-work # After context reset or new session ``` ### `/msd-pause-work` Save context handoff when stopping mid-phase. | Flag | Description | |------|-------------| | `--report` | Generate a post-session summary in `.planning/reports/` capturing commits, file changes, and phase progress | ```bash /msd-pause-work # Creates continue-here.md /msd-pause-work --report # Creates continue-here.md + session report ``` ### `/msd-manager` Interactive command center for managing multiple phases from one terminal. **Prerequisites:** `.planning/ROADMAP.md` exists **Behavior:** - Dashboard of all phases with visual status indicators - Recommends optimal next actions based on dependencies and progress - Dispatches work: discuss runs inline; plan/execute run as background agents on runtimes that support nested background dispatch, or inline on Claude Code - Designed for power users parallelizing work across phases from one terminal - Supports per-step passthrough flags via `manager.flags` config (see [Configuration](CONFIGURATION.md#manager-passthrough-flags)) ```bash /msd-manager # Open command center dashboard /msd-manager --analyze-deps # Scan ROADMAP phases for dependency relationships before parallel execution ``` **Phase completion is disk-strict (ADR-3180 §7.4, issue #3186).** A phase's status here — and in `roadmap analyze`, `roadmap update-plan-progress`, and `phase complete` — is decided by one rule: a passing `*-VERIFICATION.md` on disk, checked unconditionally (plan count is never a precondition, so a zero-plan phase with a passing verification reports complete). A ticked `- [x]` checkbox in `ROADMAP.md` is a human annotation only; it carries no machine authority and is never consulted for these commands' completion verdicts. `roadmap update-plan-progress` additionally withholds writing the checkbox/completion date while any plan in the phase has no matching `*-SUMMARY.md`, mirroring `phase complete`'s own coverage gate. **Which phase comes *next* is a different question, and the roadmap answers it.** Disk-strictness governs whether a phase is *complete*; it does not decide the successor. `phase complete` resolves `next_phase` as the **lowest-numbered phase above the completed one that `ROADMAP.md` declares** for the current milestone, regardless of which phase directories happen to exist. Phase *numbers* decide the sequence — the order rows happen to appear in the file does not — a phase that has not been planned yet has no directory, and must still be selected ahead of a later phase that does. When the roadmap and the directories agree, the directory supplies the spelling (the zero-padded token and its on-disk slug). The directory scan is the fallback only when no readable roadmap phase list exists (#3701; the same rule #3581 established for `init.progress`). **Checkpoint Heartbeats (#2410):** Background `execute-phase` runs emit `[checkpoint]` markers at every wave and plan boundary so the Claude API SSE stream never idles long enough to trigger `Stream idle timeout - partial response received` on multi-plan phases. The format is: ``` [checkpoint] phase {N} wave {W}/{M} starting, {count} plan(s), {P}/{Q} plans done [checkpoint] phase {N} wave {W}/{M} plan {plan_id} starting ({P}/{Q} plans done) [checkpoint] phase {N} wave {W}/{M} plan {plan_id} complete ({P}/{Q} plans done) [checkpoint] phase {N} wave {W}/{M} complete, {P}/{Q} plans done ({ok}/{count} ok) ``` If a background phase fails partway through, grep the transcript for `[checkpoint]` to see the last confirmed boundary. The manager's background-completion handler uses these markers to report partial progress when an agent errors out. **Manager Passthrough Flags:** Configure per-step flags in `.planning/config.json` under `manager.flags`. These flags are appended to each dispatched command: ```json { "manager": { "flags": { "discuss": "--auto", "plan": "--skip-research", "execute": "--cross-ai" } } } ``` --- ### `/msd-help` Show MSD commands at the tier you ask for. Default fits one screen; `--full` is the complete reference; `` jumps directly to one section. ```bash /msd-help # One-page tour (default) /msd-help --brief # ~10-line one-liner refresher of top commands /msd-help --full # Complete reference (every command, every flag) /msd-help # One section only (e.g. /msd-help debug) /msd-help --brief # Compact scoped lookup — signature + one-line summary ``` See `msd-core/workflows/help/modes/topic.md` for the full alias table. Unknown topics print the recognized list. --- ## Utility Commands ### `/msd-explore` Socratic ideation session — guide an idea through probing questions, optionally spawn research, then route output to the right MSD artifact (notes, todos, seeds, research questions, requirements, or a new phase). | Argument | Required | Description | |----------|----------|-------------| | `topic` | No | Topic to explore (e.g., `/msd-explore authentication strategy`) | ```bash /msd-explore # Open-ended ideation session /msd-explore authentication strategy # Explore a specific topic ``` When the optional research pass runs, each surfaced claim is dispositioned three ways — **admit** (survives a prompted-to-refute pass and is grounded in a source, shown with the source), **refute** (a source *authoritative for that claim* contradicts it, dropped or corrected), or **abstain** (unverifiable, non-authoritative disagreement, or a source-vs-prior conflict). Abstained claims are listed in a separate **Unresolved** ledger rather than smoothed into the narrative. (Claims-side analogue of the honest verifier, #1154.) --- ### `/msd-undo` Safe git revert — roll back MSD phase or plan commits using the phase manifest with dependency checks and a confirmation gate. | Flag | Required | Description | |------|----------|-------------| | `--last N` | (one of three required) | Show recent MSD commits for interactive selection | | `--phase NN` | (one of three required) | Revert all commits for a phase | | `--plan NN-MM` | (one of three required) | Revert all commits for a specific plan | **Safety:** Checks dependent phases/plans before reverting; always shows a confirmation gate. ```bash /msd-undo --last 5 # Pick from the 5 most recent MSD commits /msd-undo --phase 03 # Revert all commits for phase 3 /msd-undo --plan 03-02 # Revert commits for plan 02 of phase 3 ``` --- ### `/msd-import` Ingest an external plan file into the MSD planning system with conflict detection against `PROJECT.md` decisions before writing anything. | Flag | Required | Description | |------|----------|--------------| | `--from ` | Yes (or `--from-gsd2`) | Path to the external plan file to import | | `--from-gsd2` | Yes (or `--from`) | Reverse-migrate a GSD-2 (`.gsd/`) project back to MSD v1 (`.planning/`) format | | `--path ` | No | With `--from-gsd2`: path to the GSD-2 project directory (defaults to current directory) | **Process:** Detects conflicts → prompts for resolution → writes as MSD PLAN.md → validates via `msd-plan-checker` ```bash /msd-import --from /tmp/team-plan.md # Import and validate an external plan /msd-import --from-gsd2 # Migrate from GSD-2 back to v1 (current dir) /msd-import --from-gsd2 --path ~/old-project # Migrate from a different path ``` --- ### `/msd-ingest-docs` Bootstrap or merge a .planning/ setup from existing ADRs, PRDs, SPECs, and docs in a repo. Runs parallel classification (`msd-doc-classifier`) plus synthesis with precedence rules and cycle detection (`msd-doc-synthesizer`). Produces a three-bucket conflicts report (`INGEST-CONFLICTS.md`: auto-resolved, competing-variants, unresolved-blockers) and hard-blocks on LOCKED-vs-LOCKED ADR contradictions. | Argument / Flag | Required | Description | |-----------------|----------|-------------| | `path` | No | Target directory to scan (defaults to repo root) | | `--mode new\|merge` | No | Override auto-detect (defaults: `new` if `.planning/` absent, `merge` if present) | | `--manifest ` | No | YAML file listing `{path, type, precedence?}` per doc; overrides heuristic classification | | `--resolve auto` | No | Conflict resolution mode (v1: only `auto`; `interactive` is reserved) | **Limits:** v1 caps at 50 docs per invocation. Extracts the shared conflict-detection contract into `references/doc-conflict-engine.md`, which `/msd-import` also consumes. ```bash /msd-ingest-docs # Scan repo root, auto-detect mode /msd-ingest-docs docs/ # Only ingest under docs/ /msd-ingest-docs --manifest ingest.yaml # Explicit precedence manifest ``` --- ### `/msd-quick` Execute ad-hoc task with MSD guarantees. | Flag | Description | |------|-------------| | `--full` | Enable the complete quality pipeline — discussion + research + plan-checking + verification | | `--validate` | Plan-checking (max 2 iterations) + post-execution verification only; no discussion or research | | `--discuss` | Lightweight pre-planning discussion | | `--research` | Spawn focused researcher before planning | Granular flags are composable: `--discuss --research --validate` is equivalent to `--full`. | Subcommand | Description | |------------|-------------| | `list` | List all quick tasks with status | | `status ` | Show status of a specific quick task | | `resume ` | Resume a specific quick task by slug | ```bash /msd-quick # Basic quick task /msd-quick --discuss --research # Discussion + research + planning /msd-quick --validate # Plan-checking + verification only /msd-quick --full # Complete quality pipeline /msd-quick list # List all quick tasks /msd-quick status my-task-slug # Show status of a quick task /msd-quick resume my-task-slug # Resume a quick task ``` ### `/msd-quick-batch` Batch several `/msd-quick`-shaped tasks together — one coordinator plans, dispatches, and merges them as one run (#3676, epic #3344, ADR-1239 "Quick-batch binding"). See [Batch quick tasks](how-to/batch-quick-tasks.md) for a walkthrough. | Argument | Description | |----------|-------------| | Inline task list | A bulleted or numbered list, ≥2 items, one per line | | `--file ` | Read the task list from a file instead of inline text | | Flag | Description | |------|-------------| | `--jobs auto\|N` | `auto` (default) uses the negotiated dispatch capacity as-is; `N` caps effective concurrency at `min(task count, N, capacity)` | | `--validate` | Per-item plan-checker loop (max 2 iterations) + post-merge verification | | `--research` | Per-item researcher dispatched before planning | | `--resume ` | Skip task-list parsing and batch creation; dispatch only the batch's still-eligible items | **Not supported in v1:** `--discuss` and `--full` are rejected with a usage error before any dispatch — run `/msd-quick --discuss`/`--full` per item instead. ```bash /msd-quick-batch "- fix the login timeout\n- add the retry banner" # inline list /msd-quick-batch --file .planning/my-tasks.md # from a file /msd-quick-batch --jobs 3 --validate "- item one\n- item two\n- item three" /msd-quick-batch --resume 260101-abc # resume an interrupted batch ``` ### `/msd-autonomous` Run all remaining phases autonomously. | Flag | Description | |------|-------------| | `--from N` | Start from a specific phase number | | `--to N` | Stop after completing a specific phase number | | `--only N` | Restrict execution to phase N; lifecycle step is skipped | | `--interactive` | Lean context with user input | | `--converge` | Route each planning step through `/msd-plan-review-convergence`; the explicit flag overrides the gate — works even when `workflow.plan_review_convergence` is `false` (the gate `workflow.plan_review_convergence=true` governs standalone `/msd-plan-review-convergence`); without it, planning runs `msd-plan-phase` | | `--cross-ai` | Alias for `--converge` | | Reviewer flags | With `--converge`, pass through every reviewer lane flag: `--claude`, `--codex`, `--coderabbit`, `--opencode`, `--cursor`, `--agy` / `--antigravity`, `--ollama`, `--lm-studio`, `--llama-cpp`, `--all`, and `--max-cycles N` | | `--text` | Replace `AskUserQuestion` prompts with plain numbered lists | ```bash /msd-autonomous # Run all remaining phases /msd-autonomous --from 3 # Start from phase 3 /msd-autonomous --to 5 # Run up to and including phase 5 /msd-autonomous --from 3 --to 5 # Run phases 3 through 5 /msd-autonomous --only 4 # Run only phase 4 /msd-autonomous --only 4 --converge # Run one phase with plan convergence /msd-autonomous --converge --all --max-cycles 5 /msd-autonomous --text # Run with text-mode prompts ``` ### `/msd-debug` Systematic debugging with persistent state. | Argument | Required | Description | |----------|----------|-------------| | `description` | No | Description of the bug | | Flag | Description | |------|-------------| | `--diagnose` | Diagnosis-only mode — investigate without attempting fixes | **Subcommands:** - `/msd-debug list` — List all active debug sessions with status, hypothesis, and next action - `/msd-debug status ` — Print full summary of a session (Evidence count, Eliminated count, Resolution, TDD checkpoint) without spawning an agent - `/msd-debug continue ` — Resume a specific session by slug (surfaces Current Focus then spawns continuation agent) - `/msd-debug [--diagnose] ` — Start new debug session (existing behavior; `--diagnose` stops at root cause without applying fix) **TDD mode:** When `tdd_mode: true` in `.planning/config.json`, debug sessions require a failing test to be written and verified before any fix is applied (red → green → done). ```bash /msd-debug "Login button not responding on mobile Safari" /msd-debug --diagnose "Intermittent 500 errors on /api/users" /msd-debug list /msd-debug status auth-token-null /msd-debug continue form-submit-500 ``` ### `/msd-add-tests` Generate tests for a completed phase. | Argument | Required | Description | |----------|----------|-------------| | `N` | No | Phase number | ```bash /msd-add-tests 2 # Generate tests for phase 2 ``` ### `/msd-stats` Display project statistics. ```bash /msd-stats # Project metrics dashboard ``` Scoped to the current milestone's `ROADMAP.md` window and sentinel-filtered: `999.*` backlog directories and `0-*` pre-milestone directories are not counted as current-milestone phases. > **Nullable percentage.** The reported completion percentage is `null` — never a fabricated `0`, `100`, or stale value — when the current milestone's phase set is not fully readable/scoped (e.g. a truncated or unresolvable milestone window, or an unreadable `.planning/phases` directory). See [CLI-TOOLS.md → A non-COMPLETE scope withholds the percentage entirely](CLI-TOOLS.md#a-non-complete-scope-withholds-the-percentage-entirely-3217). ### `/msd-profile-user` Generate a developer behavioral profile from Claude Code session analysis across 8 dimensions (communication style, decision patterns, debugging approach, UX preferences, vendor choices, frustration triggers, learning style, explanation depth). Produces artifacts that personalize Claude's responses. | Flag | Description | |------|-------------| | `--questionnaire` | Use interactive questionnaire instead of session analysis | | `--refresh` | Re-analyze sessions and regenerate profile | **Generated artifacts:** - `USER-PROFILE.md` — Full behavioral profile - `CLAUDE.md` profile section — Auto-discovered by Claude Code ```bash /msd-profile-user # Analyze sessions and build profile /msd-profile-user --questionnaire # Interactive questionnaire fallback /msd-profile-user --refresh # Re-generate from fresh analysis ``` ### `/msd-health` Validate `.planning/` directory integrity. With `--context`, probes the context-window utilization guard against the 60 % / 70 % thresholds (added v1.40.0, [#2792](https://github.com/open-gsd/gsd-core/issues/2792)). | Flag | Description | |------|-------------| | `--repair` | Auto-fix recoverable issues | | `--backfill` | Synthesize missing MILESTONES.md entries from `.planning/milestones/vX.Y-ROADMAP.md` snapshots | | `--context` | Probe context-window utilization; warns at 60 %, critical at 70 % | ```bash /msd-health # Check integrity /msd-health --repair # Check and fix /msd-health --backfill # Backfill missing MILESTONES.md entries /msd-health --context # Context-utilization triage ``` **STATE.md freshness (`W024`).** STATE.md records the commit it was last written against (`state_head` in its frontmatter). When the codebase has moved a long way since — 20 commits or more — health adds an advisory noting that STATE.md's contents should be treated as approximate. This is a *freshness proxy, not a drift measurement*: the count includes commits that never touched anything STATE.md describes, and the stamp is refreshed by any command that writes STATE.md, so a low count means STATE.md was written recently rather than that its contents are correct. The advisory never changes health's pass/fail status, and stays silent when the stamp is absent or the project isn't a git repo — "unknown" is reported as unknown, not as fresh. **Cross-scope install shadowing (`W028`).** When a runtime is installed at both `global` and `local` scope and the host's trigger-resolution rules make one scope's `/msd-*` surface unreachable — the Claude Code case: personal skill always beats project command — health adds a WARNING-severity advisory naming the shadowed triggers, the winning scope, and the losing scope. It never changes health's pass/fail status and is never auto-fixable (there is no single correct scope to remove), so `--repair` never touches it. Identical to the same advisory MSD Core prints at install time. See [Interpret install-shadow warnings](how-to/interpret-install-shadow-warnings.md). **`--repair` does not apply destructive fixes.** Resetting config.json (`resetConfig`) and regenerating STATE.md (`regenerateState`) are destructive — the former loses custom settings, the latter loses session history — so `--repair` reports these fixes as available but never applies them automatically; the suggested command must be run by hand (ADR-3180, [#3309](https://github.com/open-gsd/gsd-core/issues/3309)). The same migration split two previously-conflated diagnostic codes: `W021` now covers only the phase-id-convention mismatch, with the STATE-vs-ROADMAP milestone-complete mismatch it used to also report moving to the new `W026`; likewise `W017` now covers only orphan worktrees, with the stale-worktree case moving to the new `W027`. ### `/msd-cleanup` Archive accumulated phase directories from completed milestones, prune local branches whose upstream has been deleted, and — when applicable — retroactively archive quick tasks (#2142). **Behaviour:** Presents a dry-run summary of phase directories to archive (moved from `.planning/phases/` into `.planning/milestones/v{X.Y}-phases/`) and local branches whose upstream is gone (pruned via `git fetch --prune`). Requires confirmation before writing any changes. The currently checked-out branch is never pruned. **Retroactive quick-task archival (opt-in, #2142).** When `.planning/quick/` contains at least one directory, `/msd-cleanup` additionally offers to sweep it: `Archive ALL {N} quick-task directories into v{X.Y} — {Milestone Name}? This buckets every remaining quick task into this ONE milestone; there is no way to split them per-milestone.` with options `Yes — archive quick tasks into v{X.Y}` / `Skip`. The target is the single most recent completed milestone (from `MILESTONES.md`) that does not yet have a `v{X.Y}-quick` archive directory. If `.planning/quick/` is empty, this step is not offered at all. Confirming calls the narrower `msd-tools milestone archive-quick ` command — the same move/README-index/table-reset logic `/msd-complete-milestone`'s `--archive-quick` uses, but without touching `ROADMAP.md`, `REQUIREMENTS.md`, `MILESTONES.md`, or milestone-completion guards, since `/msd-cleanup` typically targets a milestone that is already closed. See [Archiving quick tasks](how-to/handle-quick-and-fast-tasks.md#archiving-quick-tasks) for the full walkthrough and the silent/failure cases. ```bash /msd-cleanup ``` --- ## Spiking & Sketching Commands ### `/msd-spike` Run 2–5 focused feasibility experiments before committing to an implementation approach. Each experiment uses Given/When/Then framing, produces executable code, and returns a VALIDATED / INVALIDATED / PARTIAL verdict. | Argument | Required | Description | |----------|----------|-------------| | `idea` | No | The technical question or approach to investigate | | `--quick` | No | Skip intake conversation; use `idea` text directly | | `--wrap-up` | No | Package completed spike findings into a reusable project-local skill | **Produces:** `.planning/spikes/NNN-experiment-name/` with code, results, and README; `.planning/spikes/MANIFEST.md` **`--wrap-up` produces:** `.claude/skills/spike-findings-[project]/` skill file ```bash /msd-spike # Interactive intake /msd-spike "can we stream LLM tokens through SSE" /msd-spike --quick websocket-vs-polling /msd-spike --wrap-up # Package findings into a reusable skill ``` --- ### `/msd-sketch` Explore design directions through throwaway HTML mockups before committing to implementation. Produces 2–3 variants per design question for direct browser comparison. | Argument | Required | Description | |----------|----------|-------------| | `idea` | No | The UI design question or direction to explore | | `--quick` | No | Skip mood intake; use `idea` text directly | | `--text` | No | Text-mode fallback — replace interactive prompts with numbered lists (for non-Claude runtimes) | | `--wrap-up` | No | Package winning sketch decisions into a reusable project-local skill | **Produces:** `.planning/sketches/NNN-descriptive-name/index.html` (2–3 interactive variants), `README.md`, shared `themes/default.css`; `.planning/sketches/MANIFEST.md` **`--wrap-up` produces:** `.claude/skills/sketch-findings-[project]/` skill file ```bash /msd-sketch # Interactive mood intake /msd-sketch "dashboard layout" /msd-sketch --quick "sidebar navigation" /msd-sketch --text "onboarding flow" # Non-Claude runtime /msd-sketch --wrap-up # Package winning sketch into a skill ``` --- ## Diagnostics Commands ### `/msd-forensics` Post-mortem investigation for failed MSD workflows — diagnoses what went wrong. | Argument | Required | Description | |----------|----------|-------------| | `description` | No | Problem description (prompted if omitted) | **Prerequisites:** `.planning/` directory exists **Produces:** `.planning/forensics/report-{timestamp}.md` **Investigation covers:** - Git history analysis (recent commits, stuck patterns, time gaps) - Artifact integrity (expected files for completed phases) - STATE.md anomalies and session history - Uncommitted work, conflicts, abandoned changes - At least 4 anomaly types checked (stuck loop, missing artifacts, abandoned work, crash/interruption) - GitHub issue creation offered if actionable findings exist ```bash /msd-forensics # Interactive — prompted for problem /msd-forensics "Phase 3 execution stalled" # With problem description ``` --- ### `/msd-extract-learnings` Extract reusable patterns, anti-patterns, and architectural decisions from completed phase work. | Argument | Required | Description | |----------|----------|-------------| | `N` | **Yes** | Phase number to extract learnings from | | Flag | Description | |------|-------------| | `--all` | Extract learnings from all completed phases | | `--format` | Output format: `markdown` (default), `json` | **Prerequisites:** Phase has been executed (SUMMARY.md files exist) **Produces:** `.planning/phases/{phase-dir}/{padded-phase}-LEARNINGS.md` **Extracts:** - Architectural decisions and their rationale - Patterns that worked well (reusable in future phases) - Anti-patterns encountered and how they were resolved - Technology-specific insights - Performance and testing observations ```bash /msd-extract-learnings 3 # Extract learnings from phase 3 /msd-extract-learnings --all # Extract from all completed phases ``` --- ### `msd-tools check verify-command-paths` Deterministic resolvability probe over a phase's `` verify commands (#2401). Run automatically by `/msd-plan-phase` before the plan-check pass and handed to `msd-plan-checker`; runnable by hand to see what the checker saw. | Argument | Required | Description | |----------|----------|-------------| | `N` | **Yes** | Phase number whose `-PLAN.md` files are probed | | Flag | Description | |------|-------------| | `--raw` | Emit the JSON payload with no surrounding prose | **Prerequisites:** none — an unresolvable phase degrades to a JSON payload with `readError` set rather than failing. **Produces:** JSON on stdout. Nothing is written to disk. **It never executes command text.** PLAN.md is LLM-authored, so the probe only resolves paths and stats directories; a `package.json` it finds is read for script *names* only. It grounds exactly two forms — a leading `cd ` chain and `npm --prefix ` — and refuses to guess at anything else. `pushd`, `make -C`, `yarn --cwd`, `pnpm -C`, and `cargo --manifest-path` are not recognized today and report `unresolvable`. Each row of `commands` carries `command`, `plan`, `task`, `status`, `severity`, `reason`, `form`, `rawTarget`, `target`, `manifest`, `script`, `sentinel`, and `base`. There is deliberately **no** `suggestion` field — the probe reports what failed to resolve and leaves the replacement to the planner. | `status` | Meaning | |---|---| | `ok` | Target resolved (a `reason` may still carry an advisory — see below) | | `broken` | Target does not resolve, or holds no required manifest — **blocker** | | `unresolvable` | The path could not be grounded (variable, glob, substitution, `~`) — warning | | `pending_creation` | An earlier task in this phase creates the target — not a finding | | `not_applicable` | No `cd`/`--prefix` to resolve, or a Nyquist `MISSING …` sentinel | | `reason` | `severity` | What it means | |---|---|---| | `missing_dir` | `blocker` | The resolved directory does not exist, or is not a directory | | `no_manifest` | `blocker` | The directory exists but holds no `package.json` / `Makefile` the command needs | | `dynamic_path` | `warning` | The path contains `$`, a backtick, `*`, `?`, or `~` — refused, not guessed | | `outside_root` | `warning` | A bare ancestor climb (`cd ../..`); the base differs under worktree execution | | `script_missing` | `warning` | `npm run