{"_id":"@codefilabs/tailwind-for-agents","_rev":"8-064bb4c1f28201add58f75c3aaf74e40","name":"@codefilabs/tailwind-for-agents","dist-tags":{"latest":"0.1.7"},"versions":{"0.1.0":{"name":"@codefilabs/tailwind-for-agents","version":"0.1.0","keywords":["tailwindcss","design-tokens","ai","mcp","claude","cursor","copilot","windsurf","aider","coding-assistant"],"license":"MIT","_id":"@codefilabs/tailwind-for-agents@0.1.0","maintainers":[{"name":"kevnk","email":"kevin@truefrontierapps.com"}],"bin":{"tfa":"bin/cli.js","tailwind-for-agents":"bin/cli.js"},"dist":{"shasum":"1500c7df4bef96295bc90117c03e4059e9c0ddd0","tarball":"https://registry.npmjs.org/@codefilabs/tailwind-for-agents/-/tailwind-for-agents-0.1.0.tgz","fileCount":21,"integrity":"sha512-eUE+sF96my55m0COeZTt//C0SiC5gYDQndM6yFsAZvCaofLMOu101I8GzRtl/N2GrmwDm3oqSIWdYngcFhso8Q==","signatures":[{"sig":"MEUCICAMOni72tEIaMbJE51DKByNm8jR99MJF3NjSoQhMeIpAiEAoNOzYdObNbn5KTewP4b39lYBH9SrhA3KuLroMpBrXJs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79560},"main":"src/index.js","engines":{"node":">=18"},"exports":{".":"./src/index.js","./mcp":"./src/mcp/server.js"},"gitHead":"0a1924f830ef5682e7a6025f15f5add145083ba1","scripts":{"test":"node --test test/*.test.js test/**/*.test.js","test:integration":"node --test test/integration.test.js"},"_npmUser":{"name":"kevnk","email":"kevin@truefrontierapps.com"},"_npmVersion":"11.5.2","description":"Resolve your Tailwind CSS theme into AI-friendly token maps. CLI + API + MCP server.","directories":{},"_nodeVersion":"24.7.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tailwind-for-agents_0.1.0_1773067447829_0.9305286139694109","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@codefilabs/tailwind-for-agents","version":"0.1.1","keywords":["tailwindcss","design-tokens","ai","mcp","claude","cursor","copilot","windsurf","aider","coding-assistant"],"license":"MIT","_id":"@codefilabs/tailwind-for-agents@0.1.1","maintainers":[{"name":"kevnk","email":"kevin@truefrontierapps.com"}],"bin":{"tfa":"bin/cli.js","tailwind-for-agents":"bin/cli.js"},"dist":{"shasum":"4a2b7797192e2e88a1b8c10c6cd2622cc93d6149","tarball":"https://registry.npmjs.org/@codefilabs/tailwind-for-agents/-/tailwind-for-agents-0.1.1.tgz","fileCount":21,"integrity":"sha512-r7fdG+acuDDENjrsrv74istYGpT6XFOfimE+TsFLohPM7UQEl800cO8j4wspvmBhLE3GVKWg/e030A+bQqnyzw==","signatures":[{"sig":"MEUCIDWL51nah2qJO1PBLrQ6yCCRkh/hDBf7do4g2mTxYNBuAiEAnBmD0b3ITs5HuDk71vI6neGKbbfjCsYJb9ukackzQSE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79584},"main":"src/index.js","engines":{"node":">=18"},"exports":{".":"./src/index.js","./mcp":"./src/mcp/server.js"},"gitHead":"4ce39581318df55a4d000ab1b6fc331d274374c3","scripts":{"test":"node --test test/*.test.js test/**/*.test.js","test:integration":"node --test test/integration.test.js"},"_npmUser":{"name":"kevnk","email":"kevin@truefrontierapps.com"},"_npmVersion":"11.5.2","description":"Resolve your Tailwind CSS theme into AI-friendly token maps. CLI + API + MCP server.","directories":{},"_nodeVersion":"24.7.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tailwind-for-agents_0.1.1_1773067635701_0.3775191307673613","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@codefilabs/tailwind-for-agents","version":"0.1.2","keywords":["tailwindcss","design-tokens","ai","mcp","claude","cursor","copilot","windsurf","aider","coding-assistant"],"license":"MIT","_id":"@codefilabs/tailwind-for-agents@0.1.2","maintainers":[{"name":"kevnk","email":"kevin@truefrontierapps.com"}],"bin":{"tfa":"bin/cli.js","tailwind-for-agents":"bin/cli.js"},"dist":{"shasum":"7220a54cc3b722a62ad17aabf3e4a984ce185b44","tarball":"https://registry.npmjs.org/@codefilabs/tailwind-for-agents/-/tailwind-for-agents-0.1.2.tgz","fileCount":21,"integrity":"sha512-MsOwfB6xbh6GW0gsBi0hSB09oFkeajEq04fJZebxhxrJPaRtmh8k2y/XgQls15vKElgqPpa53EDiBRlXwX/QXg==","signatures":[{"sig":"MEUCIQCO0hqCIs/Y7mFoB40PU3gZGASJm8gnFeyJGcJdGUz5EQIgE+bXPlM04xytH53PPFT6AbVET4/LBIZnTmsSxajPlIM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83060},"main":"src/index.js","engines":{"node":">=18"},"exports":{".":"./src/index.js","./mcp":"./src/mcp/server.js"},"gitHead":"36a0a635a0327427211bfe1110f77d4d8c081525","scripts":{"test":"node --test test/*.test.js test/**/*.test.js","test:integration":"node --test test/integration.test.js"},"_npmUser":{"name":"kevnk","email":"kevin@truefrontierapps.com"},"_npmVersion":"11.5.2","description":"Resolve your Tailwind CSS theme into AI-friendly token maps. CLI + API + MCP server.","directories":{},"_nodeVersion":"24.7.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tailwind-for-agents_0.1.2_1773076086459_0.36884780771558545","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@codefilabs/tailwind-for-agents","version":"0.1.3","keywords":["tailwindcss","design-tokens","ai","mcp","claude","cursor","copilot","windsurf","aider","coding-assistant"],"license":"MIT","_id":"@codefilabs/tailwind-for-agents@0.1.3","maintainers":[{"name":"kevnk","email":"kevin@truefrontierapps.com"}],"bin":{"tfa":"bin/cli.js","tailwind-for-agents":"bin/cli.js"},"dist":{"shasum":"5a7373989c89ac002bfd9348be847367fcb89882","tarball":"https://registry.npmjs.org/@codefilabs/tailwind-for-agents/-/tailwind-for-agents-0.1.3.tgz","fileCount":21,"integrity":"sha512-UXGoba1O93NVcB83wq3j3hQH3XP6Ob85W0vvdqTaU7ek4JPG7A/rg1GpvvUa+IQJNeaF8I3MK/NKpythxCeSBQ==","signatures":[{"sig":"MEUCIAvgZxFmlD6IcUmBmnhPyfQhS9+/z8khJ9eHqt12ZPv1AiEAjN2Fnf6ASJqnjOtCTb5UQYvewWiARNu9zx+tVCvmG4M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83060},"main":"src/index.js","engines":{"node":">=18"},"exports":{".":"./src/index.js","./mcp":"./src/mcp/server.js"},"gitHead":"ba85b6d7c1d04590c350121fe6b97994f018fd99","scripts":{"test":"node --test test/*.test.js test/**/*.test.js","test:integration":"node --test test/integration.test.js"},"_npmUser":{"name":"kevnk","email":"kevin@truefrontierapps.com"},"_npmVersion":"11.5.2","description":"Resolve your Tailwind CSS theme into AI-friendly token maps. CLI + API + MCP server.","directories":{},"_nodeVersion":"24.7.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tailwind-for-agents_0.1.3_1773076777351_0.6935339985502897","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@codefilabs/tailwind-for-agents","version":"0.1.4","keywords":["tailwindcss","design-tokens","ai","mcp","claude","cursor","copilot","windsurf","aider","coding-assistant"],"license":"MIT","_id":"@codefilabs/tailwind-for-agents@0.1.4","maintainers":[{"name":"kevnk","email":"kevin@truefrontierapps.com"}],"bin":{"tfa":"bin/cli.js","tailwind-for-agents":"bin/cli.js"},"dist":{"shasum":"ddceb23630a5639677b66b3c84a0018cf5dc43de","tarball":"https://registry.npmjs.org/@codefilabs/tailwind-for-agents/-/tailwind-for-agents-0.1.4.tgz","fileCount":21,"integrity":"sha512-I3dXcpuv12jknFEmac0R5qhifVdAaKv0MHiwlg6v63PbGyBtmKud1+9nByRRNVroDVAPMRlTIfQudQPod7gsZA==","signatures":[{"sig":"MEUCIQCW6TapOpGXYIiFLVfkAmw4snEG86Q4NoQRbI0drHQlCQIgbiL95Ne7d6teyumEHq+6hSkj95VVZITZNnHikEJFGSI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83050},"main":"src/index.js","engines":{"node":">=18"},"exports":{".":"./src/index.js","./mcp":"./src/mcp/server.js"},"gitHead":"a211a335c5228415c26d264965cd5786fd553892","scripts":{"test":"node --test test/*.test.js test/**/*.test.js","test:integration":"node --test test/integration.test.js"},"_npmUser":{"name":"kevnk","email":"kevin@truefrontierapps.com"},"_npmVersion":"11.5.2","description":"Resolve your Tailwind CSS theme into AI-friendly token maps. CLI + API + MCP server.","directories":{},"_nodeVersion":"24.7.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tailwind-for-agents_0.1.4_1773077111080_0.022479407470707313","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@codefilabs/tailwind-for-agents","version":"0.1.5","keywords":["tailwindcss","design-tokens","ai","mcp","claude","cursor","copilot","windsurf","aider","coding-assistant"],"license":"MIT","_id":"@codefilabs/tailwind-for-agents@0.1.5","maintainers":[{"name":"kevnk","email":"kevin@truefrontierapps.com"}],"bin":{"tfa":"bin/cli.js","tailwind-for-agents":"bin/cli.js"},"dist":{"shasum":"dcf2cf1b939518cc4fc0c484b884304a034de01b","tarball":"https://registry.npmjs.org/@codefilabs/tailwind-for-agents/-/tailwind-for-agents-0.1.5.tgz","fileCount":21,"integrity":"sha512-Jubs7fSS/trSfnCH4r4EFTZW+rFEfFa2O6F4tnsvhEm2zR/jwAVdOXUksVn+TX2JZ7kqe2Fpn1qOdfAL3yzQqA==","signatures":[{"sig":"MEYCIQDy0ucZDUHNHvyrOtZv0p6LLEEjNiewN+lqo+x2ieVa0wIhAILCsB1qa9MvbsUBLEksEQDdiwDWteZURjKB1lW5as5P","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83050},"main":"src/index.js","engines":{"node":">=18"},"exports":{".":"./src/index.js","./mcp":"./src/mcp/server.js"},"gitHead":"11b61b9d48ddc5db6440d7d5d1d9ca05688ad08d","scripts":{"test":"node --test test/*.test.js test/**/*.test.js","test:integration":"node --test test/integration.test.js"},"_npmUser":{"name":"kevnk","email":"kevin@truefrontierapps.com"},"_npmVersion":"11.5.2","description":"Resolve your Tailwind CSS theme into AI-friendly token maps. CLI + API + MCP server.","directories":{},"_nodeVersion":"24.7.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tailwind-for-agents_0.1.5_1773077771505_0.8884897614246519","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@codefilabs/tailwind-for-agents","version":"0.1.6","keywords":["tailwindcss","design-tokens","ai","mcp","claude","cursor","copilot","windsurf","aider","coding-assistant"],"license":"MIT","_id":"@codefilabs/tailwind-for-agents@0.1.6","maintainers":[{"name":"kevnk","email":"kevin@truefrontierapps.com"}],"bin":{"tfa":"bin/cli.js","tailwind-for-agents":"bin/cli.js"},"dist":{"shasum":"51f2434968f329848b13e9100399e1adc1f740be","tarball":"https://registry.npmjs.org/@codefilabs/tailwind-for-agents/-/tailwind-for-agents-0.1.6.tgz","fileCount":21,"integrity":"sha512-6WzZ89UDigX3JqgkfwHgz5EK+74PKRbyJK+WL9bT8Aowuj5A+ELmFo6DMpyDbRTgEHsOUPpokyl9MQJX3X+Pxw==","signatures":[{"sig":"MEYCIQDJERBPy3DiN9uMU8/NR6g/ShJe2HZ452aUMW4JtMIUJgIhAIBLexbuWdW4nIcNN/P23U25qJl628u2NSEcYM1i7ory","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83107},"main":"src/index.js","engines":{"node":">=18"},"exports":{".":"./src/index.js","./mcp":"./src/mcp/server.js"},"gitHead":"5755d98cf5a35aa2463cb8e905b2b790836e808e","scripts":{"test":"node --test test/*.test.js test/**/*.test.js","postpublish":"node scripts/update-marketplace.js","test:integration":"node --test test/integration.test.js"},"_npmUser":{"name":"kevnk","email":"kevin@truefrontierapps.com"},"_npmVersion":"11.5.2","description":"Resolve your Tailwind CSS theme into AI-friendly token maps. CLI + API + MCP server.","directories":{},"_nodeVersion":"24.7.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tailwind-for-agents_0.1.6_1773080352138_0.11113172530666038","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@codefilabs/tailwind-for-agents","version":"0.1.7","description":"Resolve your Tailwind CSS theme into AI-friendly token maps. CLI + API + MCP server.","main":"src/index.js","exports":{".":"./src/index.js","./mcp":"./src/mcp/server.js"},"bin":{"tailwind-for-agents":"bin/cli.js","tfa":"bin/cli.js"},"keywords":["tailwindcss","design-tokens","ai","mcp","claude","cursor","copilot","windsurf","aider","coding-assistant"],"license":"MIT","engines":{"node":">=18"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"scripts":{"test":"node --test test/*.test.js test/**/*.test.js","test:integration":"node --test test/integration.test.js","postpublish":"node scripts/update-marketplace.js"},"_id":"@codefilabs/tailwind-for-agents@0.1.7","gitHead":"649ad0e80f9f6cf2be97cca84f497347f9bb52f2","_nodeVersion":"24.7.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-dd12uilthaL2Aqo1duKiNsbvFEjAppWs/0deiam7OFjTrez4OH0P2IOtoRK4S92ktq0eXdzbCpbT3BZ23EBbQw==","shasum":"31cfa311a0d574efd81aae3e8a4a96f5266f142d","tarball":"https://registry.npmjs.org/@codefilabs/tailwind-for-agents/-/tailwind-for-agents-0.1.7.tgz","fileCount":21,"unpackedSize":83107,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCIB9PNmxyiOyeCYSH6g2WIqKv5k4DvTHTI7Cf5XCs4pgIhAL5JVeRn5nkGtDkoaq17e+oPuTuuj/QkTN/ZpCHBwaqw"}]},"_npmUser":{"name":"kevnk","email":"kevin@truefrontierapps.com"},"directories":{},"maintainers":[{"name":"kevnk","email":"kevin@truefrontierapps.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tailwind-for-agents_0.1.7_1773253087691_0.1623848976092035"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-09T14:44:07.740Z","modified":"2026-03-11T18:18:07.991Z","0.1.0":"2026-03-09T14:44:07.972Z","0.1.1":"2026-03-09T14:47:15.870Z","0.1.2":"2026-03-09T17:08:06.605Z","0.1.3":"2026-03-09T17:19:37.516Z","0.1.4":"2026-03-09T17:25:11.217Z","0.1.5":"2026-03-09T17:36:11.656Z","0.1.6":"2026-03-09T18:19:12.300Z","0.1.7":"2026-03-11T18:18:07.838Z"},"license":"MIT","keywords":["tailwindcss","design-tokens","ai","mcp","claude","cursor","copilot","windsurf","aider","coding-assistant"],"description":"Resolve your Tailwind CSS theme into AI-friendly token maps. CLI + API + MCP server.","maintainers":[{"name":"kevnk","email":"kevin@truefrontierapps.com"}],"readme":"# @codefilabs/tailwind-for-agents\n\nResolve your Tailwind CSS theme into AI-friendly token maps.\n\n> Every AI coding assistant guesses your Tailwind theme from training data. `tailwind-for-agents` gives them the truth.\n\nYour Tailwind config defines custom spacing, colors, border radii, and fonts. But AI coding assistants -- Claude, Cursor, Copilot, Windsurf, Aider -- don't know about your theme. They hallucinate `rounded-lg` when your project uses `rounded-xl`. They suggest `text-blue-500` when your palette is entirely custom.\n\n`tailwind-for-agents` resolves your actual Tailwind theme into lookup tables that any AI assistant can read. Give it a project, get back the truth.\n\n## Claude Code Plugin\n\nInstall via the [codefilabs marketplace](https://github.com/codefilabs/marketplace):\n\n```bash\n/plugin marketplace add codefilabs/marketplace\n/plugin install tailwind-for-agents@codefilabs\n```\n\n## Quick Start\n\n```bash\nnpx @codefilabs/tailwind-for-agents --project .\n```\n\nThis produces two files in `.tailwind-for-agents/`:\n\n- **`tokens.md`** -- AI-readable lookup tables (give this to your assistant)\n- **`tokens.json`** -- Machine-readable structured data (for tooling)\n\n## How It Works\n\n1. **Auto-detects** your Tailwind version (v3 or v4) and setup type\n2. **Resolves** your full theme using the best available strategy\n3. **Scans** your project CSS for additional variables and utility classes\n4. **Produces** lookup tables mapping design values to Tailwind classes\n\nThree resolution strategies, selected automatically:\n\n| Strategy | When Used | How It Works |\n|----------|-----------|--------------|\n| `v3-node` | Tailwind v3 with `tailwind.config.js` | Calls `resolveConfig()` on your config |\n| `v4-node` | Tailwind v4 with `@theme` in CSS | Parses `theme.css` from node_modules |\n| `v4-cli` | Tailwind v4 with standalone CLI (e.g., Rails) | Runs the binary, parses `:root` output + utility classes |\n\n## CLI Usage\n\n```\ntailwind-for-agents -- Resolve your Tailwind theme for AI coding assistants\n\nUsage:\n  npx @codefilabs/tailwind-for-agents [options]\n  tfa [options]\n\nOptions:\n  --project <path>     Project root (default: current directory)\n  --output <path>      Output directory (default: <project>/.tailwind-for-agents)\n  --strategy <name>    Force strategy: v3-node, v4-node, v4-cli\n  --format <type>      Output format: json, markdown, both (default: both)\n  --mcp                Start as MCP server (stdio transport)\n  --help               Show this help message\n  --version            Show version\n```\n\n### Examples\n\n```bash\n# Resolve current directory\nnpx @codefilabs/tailwind-for-agents\n\n# Resolve a specific project\nnpx @codefilabs/tailwind-for-agents --project /path/to/my-app\n\n# Only generate markdown\nnpx @codefilabs/tailwind-for-agents --project . --format markdown\n\n# Force a specific strategy\nnpx @codefilabs/tailwind-for-agents --project . --strategy v4-cli\n\n# Custom output directory\nnpx @codefilabs/tailwind-for-agents --project . --output ./docs/tokens\n```\n\n## Programmatic API\n\n```js\nconst { resolve, lookup, formatJSON, formatMarkdown } = require('@codefilabs/tailwind-for-agents');\n\n// Resolve all tokens from a project\nconst { tokens, meta } = await resolve('/path/to/project');\n\n// Quick lookup: pixel value -> Tailwind class\nconst result = lookup(tokens, '16px');\n// { type: 'numeric', matches: [{ category: 'spacing', class: { padding: 'p-4', ... } }] }\n\n// Quick lookup: hex color -> Tailwind class\nconst color = lookup(tokens, '#3b82f6');\n// { type: 'color', matches: [{ category: 'colors', classes: ['blue-500'] }] }\n\n// Format as JSON string\nconst json = formatJSON({ tokens, meta });\n\n// Format as Markdown string\nconst md = formatMarkdown(tokens, meta);\n```\n\n### `resolve(projectRoot, options?)`\n\nResolves a project's full Tailwind theme into structured token data.\n\n**Parameters:**\n- `projectRoot` (string) -- Absolute path to project root\n- `options.strategy` (string, optional) -- Force a strategy: `'v3-node'`, `'v4-node'`, `'v4-cli'`\n- `options.silent` (boolean, optional) -- Suppress console output\n\n**Returns:** `Promise<{ tokens, meta }>`\n\n- `tokens` -- Structured token data with categories: `spacing`, `colors`, `borderRadius`, `fontSize`, `fontWeight`, `fontFamily`, `lineHeight`, `screens`, `cssVars`\n- `meta` -- Resolution metadata: `project`, `tailwindVersion`, `strategy`, `generatedAt`, `sourceFiles`\n\n### `lookup(tokens, value)`\n\nLook up a design value and find matching Tailwind classes.\n\n**Parameters:**\n- `tokens` (object) -- Resolved token data from `resolve()`\n- `value` (string) -- Value to look up: `'16px'`, `'16'`, `'#3b82f6'`, `'700'`\n\n**Returns:** `{ type: string, matches: object[] }`\n\n### `formatJSON({ tokens, meta })`\n\nFormat resolved data as a JSON string.\n\n### `formatMarkdown(tokens, meta)`\n\nFormat resolved data as Markdown lookup tables.\n\n## MCP Server\n\n`tailwind-for-agents` includes a built-in MCP (Model Context Protocol) server that exposes two tools:\n\n- **`get_tokens`** -- Resolve a project's full Tailwind theme into token lookup tables\n- **`lookup`** -- Look up a specific design value and find the matching Tailwind class(es)\n\n### Claude Code\n\nAdd to your project's `.claude/settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"tailwind-for-agents\": {\n      \"command\": \"npx\",\n      \"args\": [\"@codefilabs/tailwind-for-agents\", \"--mcp\"]\n    }\n  }\n}\n```\n\n### Cursor\n\nAdd to your Cursor MCP settings:\n\n```json\n{\n  \"mcpServers\": {\n    \"tailwind-for-agents\": {\n      \"command\": \"npx\",\n      \"args\": [\"@codefilabs/tailwind-for-agents\", \"--mcp\"]\n    }\n  }\n}\n```\n\n### Generic\n\nStart the MCP server directly:\n\n```bash\nnpx @codefilabs/tailwind-for-agents --mcp\n```\n\nThis starts a stdio-based MCP server. The server caches resolved tokens per project path -- subsequent `lookup` calls after the first `get_tokens` are instant.\n\n## AI Assistant Setup\n\nAfter generating tokens, tell your AI assistant to use them. Add one of these to your project:\n\n### Claude Code (CLAUDE.md)\n\n```markdown\nFor Tailwind classes, always check .tailwind-for-agents/tokens.md before guessing.\nUse the exact spacing, color, and border-radius classes defined in the token tables.\n```\n\n### Cursor (.cursorrules)\n\n```\nFor Tailwind classes, always check .tailwind-for-agents/tokens.md before guessing.\nUse the exact spacing, color, and border-radius classes defined in the token tables.\n```\n\n### GitHub Copilot (.github/copilot-instructions.md)\n\n```markdown\nFor Tailwind classes, always check .tailwind-for-agents/tokens.md before guessing.\nUse the exact spacing, color, and border-radius classes defined in the token tables.\n```\n\n## Auto-Regeneration with Claude Code Hooks\n\nKeep your token files fresh automatically. These Claude Code hooks regenerate `.tailwind-for-agents/` whenever Claude edits a Tailwind source file — so your AI assistant always has current data without manually re-running the CLI.\n\n**How it works:** A `PostToolUse` hook sets a flag file when Claude writes or edits a Tailwind source file. A `Stop` hook checks for that flag at end of session and runs `tailwind-for-agents` if needed. This avoids running the tool on every file change — it runs once, at the end.\n\n### 1. Create the hook scripts\n\n**`.claude/hooks/flag-css-changes.sh`** — sets the flag when a source file changes:\n\n```bash\n#!/usr/bin/env bash\n# PostToolUse hook: sets a flag when a Tailwind source file is written or edited.\n# This signals the Stop hook to regenerate .tailwind-for-agents/ via tailwind-for-agents.\n\nset -euo pipefail\n\ncommand -v jq >/dev/null 2>&1 || exit 0\n\nINPUT=$(cat)\n\nTOOL_NAME=$(echo \"$INPUT\" | jq -r '.tool_name // empty')\nif [[ \"$TOOL_NAME\" != \"Write\" && \"$TOOL_NAME\" != \"Edit\" ]]; then\n  exit 0\nfi\n\nFILE_PATH=$(echo \"$INPUT\" | jq -r '.tool_input.file_path // empty')\nif [[ -z \"$FILE_PATH\" ]]; then\n  exit 0\nfi\n\n# Adjust this pattern to match your project's Tailwind source files.\n# Examples:\n#   Rails:   'app/assets/(tailwind|stylesheets)/.*\\.css$'\n#   Node:    'src/.*\\.css$|tailwind\\.config\\.(js|ts|mjs|cjs)$'\nif echo \"$FILE_PATH\" | grep -qE '\\.(css|scss)$|tailwind\\.config\\.(js|ts|mjs|cjs)$'; then\n  PROJECT_DIR=\"${CLAUDE_PROJECT_DIR:-$(cd \"$(dirname \"$0\")/../..\" && pwd)}\"\n  touch \"$PROJECT_DIR/.claude/tailwind_tokens_needed\"\nfi\n\nexit 0\n```\n\n**`.claude/hooks/regenerate-tokens.sh`** — regenerates tokens at session end:\n\n```bash\n#!/usr/bin/env bash\n# Stop hook: regenerates .tailwind-for-agents/ if Tailwind source files changed this session.\n\nset -euo pipefail\n\nPROJECT_DIR=\"${CLAUDE_PROJECT_DIR:-$(cd \"$(dirname \"$0\")/../..\" && pwd)}\"\nFLAG=\"$PROJECT_DIR/.claude/tailwind_tokens_needed\"\n\nif [[ ! -f \"$FLAG\" ]]; then\n  exit 0\nfi\n\nrm -f \"$FLAG\"\n\necho \"[tailwind-for-agents] Tailwind source files changed — regenerating .tailwind-for-agents/...\"\ncd \"$PROJECT_DIR\"\nnpx @codefilabs/tailwind-for-agents --project . 2>&1\necho \"[tailwind-for-agents] Done.\"\n\nexit 0\n```\n\nMake both scripts executable:\n\n```bash\nchmod +x .claude/hooks/flag-css-changes.sh\nchmod +x .claude/hooks/regenerate-tokens.sh\n```\n\n### 2. Register the hooks in `.claude/settings.json`\n\n```json\n{\n  \"hooks\": {\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Write|Edit\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"\\\"$CLAUDE_PROJECT_DIR\\\"/.claude/hooks/flag-css-changes.sh\"\n          }\n        ]\n      }\n    ],\n    \"Stop\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"\\\"$CLAUDE_PROJECT_DIR\\\"/.claude/hooks/regenerate-tokens.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n> **Tip:** Narrow the file pattern in `flag-css-changes.sh` to your project's specific paths for better performance. For example, a Rails project with Tailwind source in `app/assets/tailwind/` would use `'app/assets/tailwind/.*\\.css$'` instead of the generic pattern.\n\n## Supported Setups\n\n| Setup | Detected By | Strategy |\n|-------|-------------|----------|\n| Tailwind v3 (npm) | `tailwind.config.js` + `tailwindcss` in node_modules | `v3-node` |\n| Tailwind v4 (npm) | `tailwindcss` v4+ in node_modules | `v4-node` |\n| Tailwind v4 (standalone CLI) | `tailwindcss` binary in project or `tailwindcss-rails` gem | `v4-cli` |\n| Rails with `tailwindcss-rails` | Gemfile with `tailwindcss-rails` | `v4-cli` |\n\n## Output Format\n\n### Markdown (tokens.md)\n\nThe markdown file contains lookup tables optimized for AI assistants:\n\n```markdown\n## Quick Reference Tables\n\n### Spacing\n\n| px | padding | px/py | margin | mx/my | gap | width | height |\n|----|---------|-------|--------|-------|-----|-------|--------|\n| **4px** | `p-1` | `px-1`/`py-1` | `m-1` | `mx-1`/`my-1` | `gap-1` | `w-1` | `h-1` |\n| **8px** | `p-2` | `px-2`/`py-2` | `m-2` | `mx-2`/`my-2` | `gap-2` | `w-2` | `h-2` |\n| **16px** | `p-4` | `px-4`/`py-4` | `m-4` | `mx-4`/`my-4` | `gap-4` | `w-4` | `h-4` |\n\n### Colors (hex -> utility name)\n\n| hex | name(s) |\n|-----|---------|\n| `#3b82f6` | blue-500 |\n| `#ef4444` | red-500 |\n| `#22c55e` | green-500 |\n\n### Border Radius\n\n| px | class |\n|----|-------|\n| **4px** | `rounded` |\n| **6px** | `rounded-md` |\n| **8px** | `rounded-lg` |\n```\n\n### JSON (tokens.json)\n\nStructured data with lookup maps:\n\n```json\n{\n  \"meta\": {\n    \"project\": \"/path/to/project\",\n    \"tailwindVersion\": \"4.0.0\",\n    \"strategy\": \"v4-node\",\n    \"generatedAt\": \"2026-02-20T12:00:00.000Z\"\n  },\n  \"spacing\": {\n    \"byPx\": {\n      \"4\": { \"padding\": \"p-1\", \"margin\": \"m-1\", \"gap\": \"gap-1\", ... },\n      \"8\": { \"padding\": \"p-2\", \"margin\": \"m-2\", \"gap\": \"gap-2\", ... }\n    }\n  },\n  \"colors\": {\n    \"byHex\": {\n      \"#3b82f6\": [\"blue-500\"],\n      \"#ef4444\": [\"red-500\"]\n    }\n  }\n}\n```\n\n## Add to .gitignore\n\nThe generated token files should be gitignored (they are derived from your theme and can be regenerated):\n\n```\n# tailwind-for-agents output\n.tailwind-for-agents/\n```\n\n## Requirements\n\n- Node.js >= 18\n- A project with Tailwind CSS installed (v3 or v4)\n\n## License\n\nMIT -- see [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}