From mddesign
Harvests a DESIGN.md from an existing codebase, critiques it against the actual code, and applies safe quick-win fixes. Three modes harvest / critique / fix. Shells out to `npx @google/design.md lint` for structural validation; never reimplements Google's linter. The on-ramp that makes DESIGN.md adoptable for every existing repo, not just greenfield projects.
npx claudepluginhub othmanadi/mddesign --plugin mddesignThis skill is limited to using the following tools:
The on-ramp. Three modes.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
The on-ramp. Three modes.
/mddesign:harvest)Goal: produce a structurally valid DESIGN.md at project root from the existing codebase.
DESIGN.md at project root.--overwrite, refuse: print "DESIGN.md already exists. Use /mddesign:critique instead, or pass --overwrite to replace."npx is available (bash -c "command -v npx").Call the Agent tool with subagent_type: design-archeologist and a prompt containing this PhaseSpec:
phase_id: harvest-<short-uuid>
parent_plan_ref: ./task_plan.md
goal: Extract de-facto design tokens from this codebase and return a draft DESIGN.md body following the Google Labs spec.
done_when:
- draft_design_md is non-empty
- draft_design_md contains YAML frontmatter and 8 ordered markdown sections
- draft_design_md includes a section #9 "Agent Prompt Guide"
inputs:
files: [] # the subagent globs the project itself
tools_allowed: ["Read", "Glob", "Grep", "Bash"]
tools_denied: ["Write", "Edit", "WebFetch"]
budget:
max_tool_calls: 200
max_wall_seconds: 600
hitl_checkpoints:
- before_returning_draft
return_contract:
format: markdown+frontmatter
fields: [summary, draft_design_md, open_questions]
The subagent has its own dedicated SKILL/agent definition at agents/design-archeologist.md.
draft_design_md field from the subagent's return.Write it to <project_root>/DESIGN.md. This write goes through the PreToolUse HITL gate (named checkpoint: before_design_md_write).Run:
npx --yes @google/design.md lint DESIGN.md
If exit code is 0, you are done.
If non-zero, capture the linter output. Re-dispatch design-archeologist with an additional input field lint_errors: <output> and instruction "fix every reported error and return a new draft." Loop up to 3 times. After 3 failed iterations, surface the final lint errors to the user and stop.
Append under ### Phase harvest-<short-uuid> Result:
/mddesign:critique./mddesign:critique)Goal: write DESIGN.md.critique.md adjacent to DESIGN.md with five audit passes.
DESIGN.md exists. If not, refuse with "No DESIGN.md found. Run /mddesign:harvest first."npx --yes @google/design.md lint DESIGN.md --json
Capture findings. Severity comes from the linter.
DESIGN.md and parse the YAML frontmatter token table.**/*.{tsx,jsx,vue,svelte,html,css,scss} plus tailwind.config.*).*background* and one is a *text* token, compute WCAG AA contrast. Flag below 4.5:1 (normal text) or 3:1 (large text).colors.focus-ring exists. If not, finding: "Missing focus-ring token; users tabbing through cannot see focus."prefers-reduced-motion fallback section is present in DESIGN.md. If not, finding.hover, active, focus, disabled, and error variants are defined. Flag missing variants.colors-dark.* block or @media (prefers-color-scheme: dark) overrides).Write DESIGN.md.critique.md at project root, adjacent to DESIGN.md. Format:
# DESIGN.md Critique
> Generated by MDDesign on <ISO timestamp>. Five audit passes.
## Summary
<N findings: P0 P1 P2 P3 counts>
## Findings
### F1 [P0 / structural / google-lint] Missing primary color
DESIGN.md has no `colors.primary` token. Required by Google linter rule 2.
Fix: declare `colors.primary` in the YAML frontmatter.
`/mddesign:fix F1`
### F2 [P1 / drift / leak] Hex color #FF6B6B used 14 times in code, not declared
Locations: src/components/Alert.tsx:23, src/components/Toast.tsx:11, ...
Fix: add `colors.danger = #FF6B6B` to DESIGN.md and replace literal usage.
`/mddesign:fix F2`
<...>
Each finding has a stable F<N> id, a severity (P0 P1 P2 P3), a category, a one-line description, evidence, a proposed fix, and the /mddesign:fix <id> slash command.
Append a one-line summary and a pointer to the critique file.
/mddesign:fix <finding-id>)Goal: apply ONE finding's fix from the critique.
DESIGN.md.critique.md, find the finding by id.applied, refuse.before_design_md_fix) and require approval.DESIGN.md (or, when the fix touches code, the named source file).npx --yes @google/design.md lint DESIGN.md. If lint regresses, revert the edit and surface the error.status: applied in DESIGN.md.critique.md.progress.md: "Applied F. DESIGN.md still passes lint."DESIGN.md outside /mddesign:harvest and /mddesign:fix.DESIGN.md at project root, not anywhere else.npx @google/design.md lint does.task_plan.md. Append to progress.md only.@google/design.md (npm, Apache 2.0). Use npx --yes @google/design.md .... No global install required at consume time.