agentleFS
addit-digitaladdit-digital/addit-harness/skills/design-conventions/SKILL.md

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.

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
  1. Very specific:

    Verify you're in a TS/React project: check for package.json, a tsconfig.json, and the presence of .ts/.tsx files.

    line 36
  2. Very specific:

    Check whether .claude/design-conventions.md already exists.

    line 39
  3. Distinctive:

    Read these artifacts in priority order:

    line 45
  4. Distinctive:

    Read 2-3 full page or feature components to observe:

    line 62
  5. Very specific:

    Only document what you *actually observed* — don't invent from general knowledge.

    line 76
  6. Very specific:

    If a section has no established pattern, omit it (leave a brief # TODO: note).

    line 77
  7. Very specific:

    Write to .claude/design-conventions.md in the repo root (create .claude/ if needed).

    line 94
  8. Very specific:

    With --refresh: read the existing file first, merge new patterns in, keep existing content that is still valid.

    line 97
  9. Distinctive:

    Keep each section tight — 5-15 lines max.

    line 116
  10. Distinctive:

    Do not commit the file unless the user asks.

    line 129
  11. Distinctive:

    If the project uses a design token system (Style Dictionary, Theo, etc.), prefer reading the token source files directly over the compiled …

    line 134

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/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 scale
  • tokens/ or design-tokens/ directory — primitive and semantic token definitions
  • CSS custom-property files (variables.css, globals.css, :root blocks)
  • theme.{ts,js} or theme/ — 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/ or src/ui/ or lib/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:

  1. Stack — styling solution (Tailwind / CSS Modules / CSS-in-JS), component library, key UI deps
  2. Color tokens — primary, secondary, destructive, surface, border, and text token names/values
  3. Type scale — the sizes and weights in use (e.g. text-sm/base/lg/xl, font-medium/semibold)
  4. Spacing rhythm — the spacing values in use; whether a strict scale is followed
  5. Layout patterns — max-width container, column grid, common flex/grid structures
  6. Border & radius — border-radius values, shadow scale in use
  7. Breakpoints — the responsive breakpoints defined and their usage pattern
  8. Component primitives — which primitives exist and their expected usage pattern
  9. Empty / loading / error states — how each is presented (skeleton, spinner, illustration, etc.)
  10. Motion — whether animations/transitions are used; prefers-reduced-motion handling

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.md to the project's CLAUDE.md for automatic inclusion (optional; rules/typescript-frontend.md reads 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-architect for a greenfield project is a valid starting point — run /design-conventions --refresh after the first screens are built to extend it with observed patterns.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.