agentleFS
KarmaBlackshawKarmaBlackshaw/claude-skills/skills/tailwind-color-token/SKILL.md

tailwind-color-token

Skill0 starsChanged 59 days agoMITView on GitHub

Converts arbitrary hex color values to named Tailwind design tokens. Invoke before writing any raw hex color in Vue, CSS, or JS/TS files.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Search tailwind.config.js (or tailwind.config.ts) at the repo root.

    line 14
  2. Distinctive:

    If found → use that token name.

    line 16
  3. Distinctive:

    If not found → continue to step 2.

    line 17
  4. Very specific:

    Use AskUserQuestion — one question per unique hex (batch if multiple new hexes in the same edit).

    line 21
  5. Very specific:

    Look up the hex on color-name.com (replace the hex in the URL) and use the exact color name it returns, camelCased.

    line 23
  6. Very specific:

    Add the new entry at the top level of theme.extend.colors (not inside custom), following the existing pattern:

    line 29
  7. Distinctive:

    Use the Write or Edit tool to insert it.

    line 36
  8. Distinctive:

    If the user rejects the suggested name, use whatever they provide verbatim.

    line 53
  9. Very specific:

    After editing tailwind.config.js, do not restart the dev server — Tailwind picks up config changes automatically in watch mode.

    line 54

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Tailwind Color Token

Invoke this skill whenever you are about to write a raw hex color value (#RRGGBB or #RGB) anywhere in code — Tailwind arbitrary values (bg-[#...]), inline styles, CSS, or JS/TS constants.

Steps

1. Check for existing token

Search tailwind.config.js (or tailwind.config.ts) at the repo root. Look in theme.extend.colors for the exact hex value (case-insensitive).

  • If found → use that token name. Stop here — do not ask the user.
  • If not found → continue to step 2.

2. Ask user to name the color

Use AskUserQuestion — one question per unique hex (batch if multiple new hexes in the same edit). Show the hex value and suggest a name.

Look up the hex on color-name.com (replace the hex in the URL) and use the exact color name it returns, camelCased. E.g. #1A73E8 → "Tampa" → tampa. Do not invent descriptive or semantic names (googleBlue, errorRed) — the token name is whatever color-name.com calls that hex.

Example prompt: "color-name.com calls #1A73E8 "Tampa" — register it as tampa?"

3. Add token to tailwind.config.js

Add the new entry at the top level of theme.extend.colors (not inside custom), following the existing pattern:

// theme.extend.colors
tampa: "#1A73E8",

Use the Write or Edit tool to insert it. Keep entries alphabetically sorted within their group if the existing list is sorted; otherwise append.

4. Replace hex in code

Swap the raw hex for the token:

BeforeAfter
bg-[#1A73E8]bg-tampa
text-[#1A73E8]text-tampa
border-[#1A73E8]border-tampa
color: '#1A73E8' (inline style)color: '#1A73E8' ← keep if Tailwind class isn't applicable, but token is still registered

Rules

  • Never skip step 1 — duplicate tokens cause confusion.
  • Never add to the custom nested object unless the user explicitly asks.
  • If the user rejects the suggested name, use whatever they provide verbatim.
  • After editing tailwind.config.js, do not restart the dev server — Tailwind picks up config changes automatically in watch mode.

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.