Design md

From ShuaiMXu/happyhands · View interactive version

Design md is an AI agent skill from the GitHub repository ShuaiMXu/happyhands. Create or update a repo's DESIGN.md — a living design-language contract for AI agents and humans — plus a portable frontend-design skill. Classifies the repo first (document an existing design language, merge with existing design docs, or propose a new direction with user approval) so it never overw

How to use this skill

Skill file

Design Language Doc (DESIGN.md)

You are creating this repository's design-language contract: a root DESIGN.md that tells agents and humans exactly how UI is built here, plus a portable frontend-design craft skill. The doc is downstream of the code — you describe the design language that exists, or propose one with user approval. You never invent a design language and present it as fact, and you never restyle existing UI to match a doc.

Goal

  1. Root DESIGN.md — the repo's design language, written from evidence, citing real files and tokens
  2. .agents/skills/frontend-design/SKILL.md — portable craft doctrine (typography, surfaces, motion) that applies to any repo
  3. A link from AGENTS.md so agents find the design language within one hop

Reference templates

| File | Used for |

|------|----------|

| references/design-md-template.md | DESIGN.md skeleton, filled from evidence |

| references/skill-frontend-design.md | .agents/skills/frontend-design/SKILL.md (create verbatim) |

Phase 0: Audit, then classify (before writing anything)

Gather evidence. Every claim in DESIGN.md must trace back to something you saw here:

Then classify the repo into exactly one mode:

Mode A — Document (established design language, no design doc)

The repo has consistent tokens, deliberate font choices, a component system, recurring motifs. Your job is extraction: write DESIGN.md describing what exists, citing the files that prove it. Nothing about the actual design changes. Where the codebase is internally inconsistent, document the dominant/most-recent pattern and note the deviation — do not resolve it by fiat.

Mode B — Merge (design docs already exist)

A DESIGN.md, brand guide, or design-related rules already exist. Merge, never regenerate: preserve every unique local rule, deduplicate against the template structure, keep one source of truth, and leave pointers behind if you consolidate scattered docs. If existing docs contradict the code, flag the contradiction to the user instead of silently picking a side.

Mode C — Propose (greenfield, no coherent design language)

No established language exists. Choosing an aesthetic direction is a user-owned decision, not an evidence question. Write a one-page proposal to docs/plans/design-language.md (or PLAN.md if the repo has no docs/plans/) covering: aesthetic direction and tone, font pairing (display + body), color approach and the accent budget, elevation strategy, motion approach. Offer 2–3 distinct directions if the product context supports them. Stop and get user approval before writing DESIGN.md. After approval, write the full doc from the approved proposal.

Deliverables

DESIGN.md                              # root design-language contract (living document)
.agents/
  skills/
    frontend-design/SKILL.md           # portable craft doctrine (references/skill-frontend-design.md)
docs/
  plans/
    design-language.md                 # Mode C only: the approved proposal

Plus one edit: add - [Design Language](DESIGN.md) to the Quick Links in AGENTS.md (create the section if the repo has an AGENTS.md without it; skip if there is no AGENTS.md).

Process (in order)

  1. Phase 0 audit and classification (checklist above)
  2. Mode C only: write the proposal, present it, and wait for approval
  3. Write DESIGN.md using references/design-md-template.md as structure — filled from evidence (Modes A/B) or the approved proposal (Mode C)
  4. Create .agents/skills/frontend-design/SKILL.md verbatim from references/skill-frontend-design.md (stripping the template preamble), unless the repo already has an equivalent craft skill — then skip it
  5. Link DESIGN.md from AGENTS.md Quick Links
  6. Run the verification pass below
  7. Report: mode chosen and why, files created, contradictions found between docs and code, rules preserved from pre-existing docs

Writing rules for DESIGN.md

Constraints

Verification pass (required before finishing)

Done when

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.