Prompt file imported from OthmanAdi/MDDesign (
.cursor/commands/harvest.md). Copyright stays with the author.
/mddesign:harvest
Generate DESIGN.md from an existing codebase.
What I do
-
Pre-flight: glob
DESIGN.mdat project root.- If exists and
--overwritenot passed: refuse. Point user at/mddesign:critique. - Confirm
npxis available viabash -c "command -v npx".
- If exists and
-
Dispatch design-archeologist: call the
Agenttool withsubagent_type: design-archeologistand a prompt that contains a PhaseSpec forharvest-<short-uuid>(see skills/design-harvest/SKILL.md for the exact PhaseSpec shape). -
HITL gate at write time: when the subagent returns
draft_design_md, print it to the user and wait for the PreToolUse hook (named checkpoint:before_design_md_write) to approve the write. -
Write:
Writethe draft toDESIGN.mdat project root. -
Lint and iterate:
Bash: npx --yes @google/design.md lint DESIGN.md- If exit 0, done.
- If non-zero, capture output, re-dispatch design-archeologist with
lint_errors: <output>. Loop up to 3 times. - After 3 failed iterations, print errors and stop.
-
Append to progress.md: under
### Phase harvest-<uuid> Result, note token counts, lint status, and next step (/mddesign:critique).
Arguments
--overwrite— replace existing DESIGN.md. Requires explicit intent because this is a destructive-ish action.
Boundaries
- Only writes DESIGN.md under the HITL gate.
- Never edits
task_plan.md. - Never reimplements Google's linter.
See skills/design-harvest/SKILL.md for full implementation details.