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.
In this repository6 other files it gives its agents.
- figma-to-vueSkill
- plan-and-buildSkill
- resolving-merge-conflictsSkill
- setup-obsidian-memorySkill
- sprint-release-cherry-pickSkill
- sync-brainSkill
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
- Very specific: line 14
Search tailwind.config.js (or tailwind.config.ts) at the repo root.
- Distinctive: line 16
If found → use that token name.
- Distinctive: line 17
If not found → continue to step 2.
- Very specific: line 21
Use AskUserQuestion — one question per unique hex (batch if multiple new hexes in the same edit).
- Very specific: line 23
Look up the hex on color-name.com (replace the hex in the URL) and use the exact color name it returns, camelCased.
- Very specific: line 29
Add the new entry at the top level of theme.extend.colors (not inside custom), following the existing pattern:
- Distinctive: line 36
Use the Write or Edit tool to insert it.
- Distinctive: line 53
If the user rejects the suggested name, use whatever they provide verbatim.
- Very specific: line 54
After editing tailwind.config.js, do not restart the dev server — Tailwind picks up config changes automatically in watch mode.
≈ “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.
Files
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:
| Before | After |
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
customnested 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.
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.

