Skip to content

UI & Design

Tailwind Discipline

Free

Use the existing Tailwind tokens and scale. No arbitrary values, no copied utility salads.

Difficulty foundational
Version v1.1

Purpose

Stop one-off classes that drift from the design system.

Procedure

--- name: tailwind-discipline description: Use the existing Tailwind tokens and scale. No arbitrary values, no copied utility salads. ---

Tailwind Discipline

Purpose

Stop one-off classes that drift from the design system.

Procedure

Read the project's Tailwind entry (v4 @theme or the existing config) before styling.

Allowed:

  • Color utilities that map to tokens (bg-bg, text-ink, border-line, or whatever the project named).
  • Spacing, type, and radius from the default scale or the project scale.
  • State variants: hover, focus-visible, disabled, aria-selected.

Forbidden unless the user explicitly asks and no token exists:

  • Arbitrary values such as p-[13px], text-[15px], or bg-[#abc].
  • Raw palette colors (bg-purple-500, text-white) when tokens exist.
  • @apply soup that hides a one-off design.
  • Important flags.

Group classes by layout, box, type, color so a reviewer can see intent. Extract a component when the same long class string appears three times. Do not extract on the first use.

Respect prefers-reduced-motion: do not add animate- classes that ignore it.

Example requests

1. Clean a card

Request: Rewrite this card's className with Tailwind Discipline. Keep the layout. Expected: Token colors, scale spacing, and no arbitrary brackets.

Dependencies

None. Work in the repository that is already open. Do not add packages unless the procedure names one.

Compatibility

This document follows the Agent Skills layout (a folder named tailwind-discipline containing SKILL.md). Claude Code, Cursor, Codex, and Gemini CLI can load that file from the paths in the Skilling installation guide. GitHub Copilot does not load SKILL.md. Use the Copilot instructions copy, and narrow applyTo before you commit it.

Example prompts

Clean a card

Rewrite this card's className with Tailwind Discipline. Keep the layout.

Expected: Token colors, scale spacing, and no arbitrary brackets.

Choose the agent

This skill is installed for one agent at a time. Pick the section you are using.

Related

  • Design Tokens

    Define color, type, radius, and spacing once, then ban raw values in components.

  • Component API

    Shape a React component's props around composition and a small variant set, not boolean soup.

  • Responsive Shell

    Build an application shell that works at 390px and on a laptop: navigation, scroll, and safe targets.

Reviews

No reviews yet.

    Sign in to review.

    Report a problem

    Inaccurate steps, an unsafe instruction, or a licensing concern.

    Sign in to report.