design-conventions
Skill4 starsChanged 2 months agoMITView on GitHub
Scan the current TS/React project's existing UI layer and write .claude/design-conventions.md — a project-specific visual design convention file that rules/typescript-frontend.md loads before UI work. Use when starting UI work in an existing project, when design conventions have drifted, or when --refresh is passed to merge in new patterns.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adrSkill
- dev-flowSkill
- go-conventionsSkill
- save-planSkill
- setupSkill
- telemetry-exportSkill
- tipsSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Verify you're in a TS/React project: check for package.json, a tsconfig.json, and the presence of .ts/.tsx files.
- Very specific: line 39
Check whether .claude/design-conventions.md already exists.
- Distinctive: line 45
Read these artifacts in priority order:
- Distinctive: line 62
Read 2-3 full page or feature components to observe:
- Very specific: line 76
Only document what you *actually observed* — don't invent from general knowledge.
- Very specific: line 77
If a section has no established pattern, omit it (leave a brief # TODO: note).
- Very specific: line 94
Write to .claude/design-conventions.md in the repo root (create .claude/ if needed).
- Very specific: line 97
With
--refresh: read the existing file first, merge new patterns in, keep existing content that is still valid. - Distinctive: line 116
Keep each section tight — 5-15 lines max.
- Distinctive: line 129
Do not commit the file unless the user asks.
- Distinctive: line 134
If the project uses a design token system (Style Dictionary, Theo, etc.), prefer reading the token source files directly over the compiled …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/design-conventions — generate per-project visual design conventions
Scans the current TypeScript/React project's UI layer and produces
.claude/design-conventions.md — a lightweight, project-specific visual design
convention reference. rules/typescript-frontend.md instructs loading this file first for
any UI work, so the design language loads cheaply without re-scanning each session.
Greenfield guard
This skill derives from what exists. If the project has no existing UI at all
(no Tailwind config, no token files, no components, no screens), stop and tell the
user to ask @frontend-architect first — creating a design language from a blank
slate is design work, not derivation. If only config exists (Tailwind config, a
chosen component lib, token file stubs) with no implemented screens, seed a minimal
stub from that and flag the rest for the architect.
When to run
- First time in a project with existing UI — before any substantial UI work.
--refresh— when the design system has evolved or a new visual pattern has been established. Merges new patterns into the existing file; preserves hand-edits.- Prompted by a gap — if you hit a pattern the file doesn't cover while coding, append the rule inline (don't re-run the full scan).
Procedure
1. Confirm context
Verify you're in a TS/React project: check for package.json, a tsconfig.json,
and the presence of .ts/.tsx files. If absent, stop and say so.
Check whether .claude/design-conventions.md already exists. If it does and
--refresh was not passed, report what's there and ask the user to pass --refresh
to merge new patterns.
2. Scan the project's UI layer
Read these artifacts in priority order:
a. Design token / config foundation
tailwind.config.{ts,js}— custom color palette, spacing scale, type scale, breakpoints, font families, border-radius tokens, shadow scaletokens/ordesign-tokens/directory — primitive and semantic token definitions- CSS custom-property files (
variables.css,globals.css,:rootblocks) theme.{ts,js}ortheme/— if using a component lib (MUI, Chakra, Mantine)
b. Component library / primitives
package.json— identify which component library is installed (Radix, Mantine, MUI, Chakra, shadcn/ui, etc.) and the styling solution (Tailwind, CSS Modules, styled-components, vanilla-extract)components/ui/orsrc/ui/orlib/components/— base primitive components (Button, Input, Card, Badge, etc.); read 3-4 to understand the token usage pattern
c. Representative screens / pages
- Read 2-3 full page or feature components to observe:
- Spacing rhythm (gap, padding, margin patterns — are they from a scale?)
- Layout structure (max-width containers, grid/flex patterns)
- Typography usage (which text sizes, weights, and colors appear most)
- Color usage (primary actions, secondary, destructive, surface, text)
- Component composition patterns (card structures, list items, form layouts)
d. State presentation patterns
- Find one loading state, one empty state, one error state — document how each is presented visually
3. Derive conventions
From what you read, identify the established patterns for each section below.
Only document what you actually observed — don't invent from general knowledge.
If a section has no established pattern, omit it (leave a brief # TODO: note).
Sections to cover:
- Stack — styling solution (Tailwind / CSS Modules / CSS-in-JS), component library, key UI deps
- Color tokens — primary, secondary, destructive, surface, border, and text token names/values
- Type scale — the sizes and weights in use (e.g.
text-sm/base/lg/xl,font-medium/semibold) - Spacing rhythm — the spacing values in use; whether a strict scale is followed
- Layout patterns — max-width container, column grid, common flex/grid structures
- Border & radius — border-radius values, shadow scale in use
- Breakpoints — the responsive breakpoints defined and their usage pattern
- Component primitives — which primitives exist and their expected usage pattern
- Empty / loading / error states — how each is presented (skeleton, spinner, illustration, etc.)
- Motion — whether animations/transitions are used;
prefers-reduced-motionhandling
4. Write the file
Write to .claude/design-conventions.md in the repo root (create .claude/ if
needed).
With --refresh: read the existing file first, merge new patterns in, keep
existing content that is still valid. Never overwrite hand-edits — look for
# NOTE: or # OVERRIDE: markers and preserve them.
File header:
# Design conventions — {project-name}
Derived from codebase scan on {date}. Maintained by `/design-conventions --refresh`.
> **Stack:** {styling solution} · {component library} · {key UI deps}Then one section per category found. Each section:
- States the rule plainly (imperative)
- Shows the token name or value where it isn't obvious
- Cites the file/pattern it was derived from (e.g.
// see tailwind.config.ts)
Keep each section tight — 5-15 lines max. This file is loaded before every UI session; brevity matters more than completeness.
5. Report
Tell the user:
- Path of the written file
- Number of sections covered
- Any areas where you couldn't find an established pattern (and what to do)
- How to view/edit it (it's plain markdown — open in any editor)
- Suggest adding
@.claude/design-conventions.mdto the project'sCLAUDE.mdfor automatic inclusion (optional;rules/typescript-frontend.mdreads it on demand without this)
Do not commit the file unless the user asks.
Notes
- This skill writes to the target project repo, not to the addit-harness repo.
- If the project uses a design token system (Style Dictionary, Theo, etc.), prefer reading the token source files directly over the compiled output.
- A file generated by
@frontend-architectfor a greenfield project is a valid starting point — run/design-conventions --refreshafter the first screens are built to extend it with observed patterns.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

