Skip to content
AliasCSS Logo
v1.5.6
Docs / AliasCSS for AI

AliasCSS for AI

Models already know CSS. AliasCSS adds one predictable rule on top, and ships a reference file and an agent skill so coding assistants write it correctly.

Why models write it well

Most styling systems ask a model to remember a vocabulary: which utility name maps to which value, in which version. AliasCSS asks it to write CSS, which it has read millions of times in specs, MDN and real code, in one fixed shape:

[@scope-][selector-]property-value

That has three practical effects:

  • Fewer invented classes. letter-spacing-0.02em is the declaration the model already meant, so there’s no lookup to get wrong.
  • Mistakes are visible. A wrong class either fails to compile (and the browser script says so) or reads as obviously wrong CSS when a person reviews it.
  • New CSS works immediately. Container queries, light-dark(), anchor positioning and @starting-style are written the same way as everything else, with no framework update.

What a model can’t know from CSS alone is the grammar around the declaration: the aliases, the scopes, how variables, groups and exports are written. That’s what the files below teach.

llms.txt

/llms.txt is the complete language reference in one Markdown file, written for models. Every example in it was compiled with AliasCSS 1.5.6. Point an assistant at it, or paste it into the conversation:

Read https://aliascss.com/llms.txt, then style this component with AliasCSS.

Agent skill

The AI kit adds AliasCSS to a project for every common coding agent. Copy it into the project root, hidden folders included:

unzip aliascss-ai-kit.zip -d aliascss-ai-kit
cp -R aliascss-ai-kit/. your-project/

Download the AI kit (62 KB)

Agent Reads
Claude Code CLAUDE.md and the skill in .claude/skills/aliascss/
Codex AGENTS.md and the skill in .codex/skills/aliascss/ or .agents/skills/aliascss/
Cursor .cursor/rules/aliascss.mdc and AGENTS.md
GitHub Copilot .github/copilot-instructions.md
Gemini CLI GEMINI.md
Others AGENTS.md

If the project already has one of these files, paste the kit’s version at the end of yours instead of overwriting it.

The skill has three files:

  • SKILL.md: the rules and the workflow (what the CLI can see, when to use String(), how to check the output).
  • reference.md: the full language, the same text as llms.txt.
  • patterns.md: tested recipes for interactive components: state on data attributes, exports, keyframes, popovers, dialogs, slide-in panels, React.

Claude apps

To use the skill in the Claude apps, upload the skill folder on its own: download the skill (18 KB) and add it from the skills section of the settings.

Tips for prompting

  • Name the version: “Use AliasCSS 1.5.6.” The grammar has changed between releases.
  • Say how the CSS is built: “The CLI compiles the CSS, so wrap classes in variables with String('…').” Without this, models often build class names at runtime, which the CLI can’t see.
  • Ask for exports when a class list repeats: “Use --as- exports for repeated class lists.”
  • Ask for theme tokens when the UI must support dark mode: “Use slateTheme* tokens and x-theme on <html>.”

Reviewing what a model wrote

  1. Open the page with the browser script and read the console: every class that doesn’t compile is listed.
  2. Check the CSS the CLI wrote for the parts that look wrong. AliasCSS doesn’t validate values, so bgc-notacolor compiles to CSS the browser ignores.
  3. Compare against common mistakes. Nearly every model error is on that list: a plain class next to a breakpoint class, calc() without spaces, md- without @.