MDDesign composes planning-with-files, Google's DESIGN.md, memory routing,
agent-team dispatch, and session handoff into one plugin. Your agent sees the
right design tokens at the right moment. Sessions survive /clear.
Decisions persist forever. Five IDEs. One install.
Every command you need. Nothing you don't. Start with /mddesign:setup — it installs your missing dependencies so you don't have to guess.
| # | Command | What it does | Category |
|---|---|---|---|
| 01 | /mddesign:setup | Detect missing deps. Print exact install steps per platform. Idempotent. | Start |
| 02 | /mddesign:doctor | Six-probe diagnostic. Hooks firing? Lint reachable? Scratch writable? Fix-it for every failure. | Start |
| 03 | /mddesign:compose | Wiring check at project start. Prints a status table: planning / design / memory / scratch. | Start |
| 04 | /mddesign:harvest | Scan your codebase for de-facto tokens. Write a lint-valid DESIGN.md at project root. | Design |
| 05 | /mddesign:critique | Five-pass audit: structural / drift / a11y / completeness / consistency. Each finding gets a fix command. | Design |
| 06 | /mddesign:fix <id> | Apply one finding from the critique. HITL gated. Re-lints after every edit. Reverts if lint regresses. | Design |
| 07 | /mddesign:inject | Force-inject DESIGN.md tokens into findings.md. Use before a UI task the hook didn't auto-detect. | Design |
| 08 | /mddesign:handoff | Catchup (read-only) or promote (HITL). Survives /clear, reboots, and IDE switches. | Memory |
| 09 | /mddesign:memory | Three-tier: scratch (fast, session) / WHERE (QMD) / WHY (MemPalace, HITL gated). Routes by query prefix. | Memory |
| 10 | /mddesign:team | Dispatch a phase to a subagent via PhaseSpec v1. HITL before dispatch. Result logged to progress.md. | Teams |
Without MDDesign, your agent invents colors. With it, every UI prompt sees the token slice from DESIGN.md injected into findings.md before any code is written.
// Agent invents colors from training data - backgroundColor: '#4338ca' - color: '#fff' - borderRadius: '6px' - padding: '8px 16px' - fontFamily: 'Inter, sans-serif' - fontSize: '16px' - fontWeight: 600 // 14 files later: #4338ca, #4F46E5, #6366f1 // three different "primary" blues. drift.
The agent has no system context. Every session resets. Every component diverges silently.
// findings.md ## Design Context (auto-injected) // colors.primary = #4F46E5 // colors.primary-700 = #3730A3 (hover) // rounded.md = 6px // typography.button = Inter 16/600 + backgroundColor: tokens.colors.primary + color: tokens.colors['text-on-primary'] + borderRadius: tokens.rounded.md + padding: `${tokens.spacing.sm} ${tokens.spacing.md}` + font: tokens.typography.button
design-bridge injects the relevant token slice on every UI phase. The agent references declared tokens. Critique catches drift before it ships.
One orchestrator. Five arms. No replacements. Every tool does what it was built for; MDDesign is the missing layer between them.
The plugin installs in two commands. /mddesign:setup handles the rest — it detects every missing dependency and gives you the exact install command for your platform.
Two required, four optional. /mddesign:setup installs them interactively. /mddesign:doctor verifies they work.
@google/design.md lint on every harvest and critique. v18+.task_plan.md. It only appends to findings.md under ## Design Context and to progress.md under ### Phase Result and ### Handoff stamps. Memory routing goes through code-memory-router — never bypassed, never replaced. These are load-bearing rules in AGENTS.md.
.ps1 (PowerShell) and .sh (bash). The hooks.json tries PowerShell first and falls back to bash. tests/smoke.ps1 and tests/smoke.sh both run 20 probes on Windows. Git Bash on Windows is required for the bash fallback.
/mddesign:harvest. The design-archeologist subagent scans your existing code (colors, typography, spacing, border-radius, component patterns), clusters the most-used values, names them by role (not value), and produces a structurally valid DESIGN.md that passes Google's linter. Most repos get a usable DESIGN.md in under 60 seconds.
### Handoff <timestamp> entry in progress.md with the active phase, promoted decisions, and a resume hint. The SessionStart hook reads this stamp plus the most recent MemPalace WHY entries and synthesizes a one-paragraph preamble. The agent re-enters with full context on the first turn.
phase_id, goal, done_when (testable criteria), inputs.files, tools_allowed, tools_denied, budget (max tool calls + wall time), hitl_checkpoints, and a return_contract enforcing structured output. Without testable done_when, subagent completion is hallucinatable. PhaseSpec fixes that.