agentleFS
reddygopalkrishnareddygopalkrishna/developer-agent-skills/skills/design-systems/SKILL.md

design-systems

Skill8 starsChanged 9 days agoMITView on GitHub

Builds and maintains design systems and shared component libraries, covering design tokens, theming and dark mode, component API design, loading, empty, error and disabled states, built-in accessibility, documentation, visual regression tests and semver releases with deprecations. Use when creating or refactoring a UI component library, defining tokens or themes, reviewing a shared component's props, or planning a breaking change to shared UI. Not for styling a single page.

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ecosystem-reference, fractal-delegation and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • naman10parikhSkill

    ecosystem-reference

    Quick-access directory of Claude Code ecosystem repos, skills, plugins, MCPs, and patterns. Use when improving the harness.

    Also in 5 projects that use this

  • naman10parikhSkill

    fractal-delegation

    Also in 5 projects that use this

  • KirchliveSkill

    skill-routing

    Decides which of the installed skills a task needs and loads them before the work starts. This skill should be used at the beginning of any multi-step task — build, fix, refactor, migrate, review, plan, release, research, write, design, video — and again at every phase change, after context compaction, and when work moves into a different part of the codebase. Use it for requests like "let's build X", "fix this bug", "refactor Y", "plan the migration", "review this", and also when the user asks which skill applies, why a skill did not fire, or asks to check what is available.

    Also in 5 projects that use this

  • sublimotionSkill

    agent-runtime

    Launch and manage detached agent runs on EKS via the agent-runner CLI. Use when the user says "launch an agent run", "agent runtime", "agent-runner", "run this spec on the cluster", "check run status", "agent run logs", or "stop a run". Do NOT use for writing the agent-runner code itself (edit the sibling ../agent-runner repo), Terraform of the foundation (use terraform-automation), or GPU serving deployments (use infra-deployer).

    Also in 5 projects that use this

  • GoZippySkill

    repo-scout

    Also in 5 projects that use this

  • BenjaminGSkill

    harness-review

    Turn one PR's review comments into harness fixes — classify each cause by the most solid place it can live (codebase, lint, rules, skill), then draft the fixes in a separate PR.

    Also in 5 projects that use this

  • +6 more from naman10parikh

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 12 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 18 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Not for: one-off page styling.

    line 18
  2. Very specific:

    Use a predictable pattern such as category.property.variant.state (color.bg.surface.hover).

    line 50
  3. Distinctive:

    Read references/tokens.md when creating or restructuring tokens.

    line 54
  4. Distinctive:

    Every new prop is a support commitment: Ask for two real use cases before adding one.

    line 92
  5. Very specific:

    Every interactive component supports the keyboard, shows a visible focus indicator from a focus token, and respects prefers-reduced-motion.

    line 97
  6. Distinctive:

    Run automated accessibility checks (axe) on every story or component test, and do a keyboard pass on new components.

    line 99
  7. Distinctive:

    Every component that shows data or accepts input must define each state below explicitly: in the API, in the design, in a story, and in a …

    line 103
  8. Very specific:

    Never show loading, empty and error at the same time.

    line 116
  9. Distinctive:

    Keep partial data visible while refreshing, and show an inline error for a failed refresh instead of wiping the content.

    line 117
  10. Distinctive:

    Read references/component-states.md when building data-driven components (tables, lists, forms, async buttons).

    line 120
  11. Distinctive:

    Do / don't examples.

    line 130
  12. Distinctive:

    Follow semver. Breaking: removing or renaming a prop, component or token.

    line 146
  13. Very specific:

    Clickable divs: instead of buttons and links.

    line 163
  14. Distinctive:

    Forking the library per app: instead of contributing back.

    line 166
  15. Distinctive:

    Every theme passes contrast checks for all semantic text and border pairs.

    line 173
  16. Distinctive:

    Every data or input component defines default, loading, empty, error and disabled states with the visuals, ARIA, focus behavior and copy …

    line 175

“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “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 Systems

A design system is a product whose users are other developers and designers. Its job is to make the accessible, on-brand choice the easiest one. Encode decisions in tokens, keep component APIs small and consistent, and never break consumers without a deprecation path.

When to use

  • Starting a shared component library or extracting one from an app.
  • Defining or restructuring design tokens, themes, dark mode, or multiple brands.
  • Designing or reviewing the props of a shared component.
  • Planning a release with breaking changes, or migrating apps to a new version.

Not for: one-off page styling. For accessibility details use web-accessibility; for React specifics use react-patterns; for type design use typescript-patterns.

Is a full design system warranted?

SituationDo this
One app, one teamA shared components/ folder plus tokens as CSS custom properties. No separate package yet
Several apps or teams on one frameworkA versioned package with docs, tests and a release process
Several frameworks (React, Vue, native mobile)Shared tokens generated for every platform; components per framework, or Web Components where they fit

Promote a component into the system after the same need shows up in about three places. Earlier abstraction usually guesses the API wrong.

Workflow

  1. Inventory the existing UI: repeated components, every distinct color, font size, spacing value, radius and shadow. Duplicates and near-duplicates show where tokens are missing.
  2. Define tokens first (primitive, then semantic). Components come after.
  3. Build the most-used components first (button, input, select, checkbox, dialog, layout primitives). Each one gets an API review, accessibility checks, docs and tests before release.
  4. Release with semver and a changelog. Breaking changes ship with a migration guide and, for renames, a codemod where practical.
  5. Measure adoption and remove what nobody uses.

Tokens

TierExampleWho uses it
Primitivecolor.blue.600 = #2563eb, space.4 = 16pxOnly semantic tokens
Semanticcolor.text.primary, color.bg.danger, color.border.focus, space.inset.mdComponents and app code
Component (optional, sparingly)button.primary.bgOne component

Rules:

  • Components consume semantic tokens only. A theme is a different mapping from semantic to primitive tokens; if a component uses a primitive directly, theming breaks.
  • Name by purpose, not value: color.text.muted, never color.grey5 or blue-text.
  • Use a predictable pattern such as category.property.variant.state (color.bg.surface.hover).
  • Cover color, typography (family, size, line height, weight), spacing scale, radius, elevation/shadow, motion (duration, easing), z-index layers, and breakpoints.
  • Keep one source of truth (JSON) and generate platform outputs (CSS custom properties, JS, iOS, Android) with a build tool such as Style Dictionary. The W3C Design Tokens Community Group (DTCG) format, stable since version 2025.10, is the common interchange format; check which version your build tool supports.

Read references/tokens.md when creating or restructuring tokens; it has a naming scheme, a JSON example and a dark-theme mapping.

Theming and dark mode

:root {
  color-scheme: light;
  --color-bg-surface: #ffffff;
  --color-text-primary: #111827;
  --color-border-focus: #2563eb;
}
[data-theme="dark"] {
  color-scheme: dark;
  --color-bg-surface: #111827;
  --color-text-primary: #f9fafb;
  --color-border-focus: #60a5fa;
}
.card {
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}
  • Dark mode is a second palette, not inverted colors. Re-check contrast for every text/background pair in every theme (WCAG 2.2 AA: 4.5:1 for normal text, 3:1 for large text and UI component boundaries).
  • Respect the OS preference by default (prefers-color-scheme) and let users override it.
  • Prevent a flash of the wrong theme: set data-theme before first paint (server-rendered from a cookie, or a tiny inline script in <head>).
  • Multiple brands use the same semantic tokens with different primitive mappings.

Component API rules

  • Consistent names across components: size, variant, disabled, value / defaultValue / onChange, open / defaultOpen / onOpenChange.
  • Variants as one enum prop, not booleans: variant="primary" | "secondary" | "danger" instead of primary, secondary, danger flags that allow impossible combinations.
  • Composition over configuration: compound components or slots (<Card><Card.Header/><Card.Body/></Card>) instead of headerTitle, headerIcon, headerActions props.
  • Controlled and uncontrolled: accept value + onChange for control, and defaultValue for simple use.
  • Pass through native attributes to the root element (...rest), forward refs, and merge className/style instead of replacing them.
  • Polymorphism with care: an as prop is flexible but complicates types and invites broken semantics (<Button as="div"> loses keyboard behavior). Prefer an asChild/slot pattern or restrict the allowed elements.
  • No outer margins inside components. Spacing between components belongs to the parent; provide layout primitives (Stack, Inline, Grid) that use spacing tokens.
  • Name events by intent (onSelect, onDismiss), not by DOM detail.
  • Every new prop is a support commitment. Ask for two real use cases before adding one.

Accessibility built in

  • Build on the correct native elements (<button>, <input>, <dialog>), or on a headless accessible primitives library (for example React Aria, Radix UI, Headless UI) for complex widgets such as combobox, menu, tabs and date picker. Hand-rolled ARIA for these is where most bugs come from.
  • Every interactive component supports the keyboard, shows a visible focus indicator from a focus token, and respects prefers-reduced-motion.
  • Make the accessible name impossible to forget: an icon-only button's type requires aria-label (or a label prop).
  • Run automated accessibility checks (axe) on every story or component test, and do a keyboard pass on new components. See web-accessibility for the full checklist.

Component states

Every component that shows data or accepts input must define each state below explicitly: in the API, in the design, in a story, and in a test. Undefined states are where products look broken.

StateVisualsARIA and semanticsFocusCopy
DefaultUses semantic tokens onlyCorrect native element and accessible nameVisible focus indicator from the focus tokenClear label; no placeholder-as-label
LoadingSkeleton or spinner that keeps the final layout size (no layout shift); show it only after a short delay so fast responses don't flickeraria-busy="true" on the region being updated; skeleton shapes aria-hidden="true"; announce long operations through a polite live regionDo not move focus; a loading button keeps focus and its widthSay what is happening ("Saving...") when it takes more than a moment
EmptyDistinct design, not a blank areaPlain text content, reachable by screen readersFocus the primary action only if the user just triggered the empty resultSay why it is empty and what to do next; "no data yet" and "no results for these filters" are different messages
ErrorError token colors plus an icon or text (never color alone)Field errors: aria-invalid="true" and aria-describedby pointing to the message. Async or page errors: role="alert" or a live regionAfter a failed submit, move focus to the first invalid field or an error summarySay what went wrong and how to fix it; offer retry where it makes sense; no raw error codes alone
DisabledMuted tokens (inactive controls are exempt from WCAG contrast minimums, but must still look disabled)Native disabled removes the control from tab order and blocks events. Use aria-disabled="true" instead when users must still discover the control or a tooltip must explain why; then block activation in codedisabled: not focusable. aria-disabled: stays focusableExplain why it is unavailable when the reason is not obvious

Rules:

  • A button in a loading or submitting state blocks repeat activation (use aria-disabled="true" plus an early return, so focus is not lost).
  • Never show loading, empty and error at the same time; model the state as one value (status: "idle" | "loading" | "success" | "empty" | "error"), not separate booleans.
  • Keep partial data visible while refreshing, and show an inline error for a failed refresh instead of wiping the content.
  • Each state gets a story and a visual regression baseline, in every theme.

Read references/component-states.md when building data-driven components (tables, lists, forms, async buttons); it has per-component state checklists and markup examples.

Documentation

For each component:

  • Purpose, when to use it, and when to use something else.
  • Live examples of every variant and state (default, hover, focus, disabled, loading, error, empty, long text).
  • Props table generated from the types.
  • Keyboard interactions and accessibility notes.
  • Do / don't examples.

A workshop tool such as Storybook lets the same stories serve as documentation, interaction tests and visual regression fixtures.

Testing

TestWhat it catches
Interaction tests (Testing Library, queries by role)Broken behavior and semantics
Automated accessibility checks (axe) per storyMissing names, roles, contrast issues
Visual regression (screenshot comparison, for example Playwright toHaveScreenshot or a hosted service)Unintended visual changes; run on every PR and review diffs
Theme and direction matrixEach story in light, dark, and RTL
Type testsPublic prop types stay compatible

Versioning and deprecation

  • Follow semver. Breaking: removing or renaming a prop, component or token; changing a default; changing DOM structure or class names consumers can target; visual changes that alter size or layout.
  • Deprecate before removing: mark with @deprecated in types/JSDoc, log a development-only warning, keep it for at least one major version, and document the replacement.
  • Provide codemods for mechanical renames.
  • Generate changelogs from change descriptions (for example with Changesets).
  • Declare framework libraries as peerDependencies so apps do not end up with two copies of React.

Adoption and contribution

  • Publish a contribution path: proposal, design review, API review, build, docs, release.
  • Track adoption: imports of system components versus local look-alikes, and lint rules that flag raw hex colors or deprecated components (stylelint, ESLint custom rules).
  • Hold regular office hours and help teams migrate. A system that lags behind product needs gets bypassed.

Anti-patterns

  • Tokens named by value (blue500 used as "primary").
  • Components using primitive tokens or hard-coded colors, so themes do not apply.
  • Boolean prop explosion and props that conflict with each other.
  • Clickable divs instead of buttons and links.
  • Margins baked into components.
  • Breaking changes in a minor release, or removals without a deprecation period.
  • Forking the library per app instead of contributing back.
  • Shipping without docs and examples. Undocumented components get reimplemented.
  • Building the system before there are real, repeated use cases.

Done when

  • Tokens come from one source and generate every platform output; components use semantic tokens only.
  • Every theme passes contrast checks for all semantic text and border pairs.
  • Each released component has docs, stories for all states, interaction and axe tests, and a visual regression baseline.
  • Every data or input component defines default, loading, empty, error and disabled states with the visuals, ARIA, focus behavior and copy from the state table.
  • Releases follow semver with a changelog; every deprecation names its replacement and removal version.

References

  • references/tokens.md — read when defining, renaming or theming tokens.
  • references/component-states.md — read when building tables, lists, forms or async buttons, to cover every state.

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.