Getting Started

AI Agents

ply ships with machine-readable reference files so AI coding agents can generate correct, accessible markup without reading documentation.

Markdown

PLY.md

A single Markdown file containing every ply class, usage rule, anti-pattern, and copy-paste snippet. Designed to fit in one context window. Add it to your project root or paste it into your prompt.

cp node_modules/ply-css/PLY.md ./PLY.md

Your agent reads this once and knows the full framework — grid classes, button variants, form patterns, dark mode, accessibility, and theming.

JSON

ply-classes.json

A structured JSON file with every class, CSS custom property, and auto-styled semantic element. Perfect for programmatic tool use, search indexing, and validation.

cp node_modules/ply-css/ply-classes.json ./ply-classes.json

The JSON contains three sections:

classes

458 classes with category, description, and usage examples.

customProperties

120+ CSS custom properties organized by category (backgrounds, text, interactive, navigation, color surfaces, palette).

semanticElements

13 HTML elements that ply auto-styles with no classes needed.

Discovery

llms.txt

ply publishes llms.txt and llms-full.txt — standard files that AI tools use to auto-discover documentation. llms.txt is a brief index; llms-full.txt is the complete reference in a single file.

Integration

CLAUDE.md / Cursor Rules

For the best results, reference PLY.md in your AI project configuration. This tells the agent to use ply's classes instead of inventing custom CSS.

Claude Code

# CLAUDE.md
See PLY.md for the ply CSS framework reference.
Use ply classes for all styling — do not use Tailwind, Bootstrap, or custom CSS
unless ply doesn't have what you need. Search ply-classes.json before writing
custom styles.

Cursor

# .cursorrules
Use the ply CSS framework (see PLY.md) for all UI styling.
Always use ply classes before writing custom CSS.
Reference ply-classes.json for the complete class list.

Tips

Best Practices

Search before you write

Tell your agent to check ply-classes.json before writing any custom CSS. Most common patterns already have a class.

Use semantic HTML first

ply auto-styles <nav>, <table>, <dialog>, and 10 other elements. Start there.

Use var(--ply-*) for colors

Never hard-code color values. All colors use CSS custom properties that adapt to light mode, dark mode, and custom themes.

Don't mix frameworks

ply is standalone. Remove Tailwind, Bootstrap, or other CSS frameworks before using ply — they will conflict.

By the Numbers

Token Efficiency

ply was designed for AI consumption from the start — small class vocabulary, semantic HTML auto-styling, and a single context file. A Replit-generated analysis compared ply against Bootstrap and Tailwind across three dimensions.

Upfront context cost

What it takes to give an AI agent complete framework knowledge.

Framework Total classes Context file Fits in one window? Tokens to full knowledge
ply 458 PLY.md — purpose-built for AI Yes (~8,700 tokens) ~8,700
Bootstrap 5 1,200+ None official No (500+ pages of HTML docs) ~15,000–25,000
Tailwind CSS 12,000+ (with variants) None official No (400+ pages of HTML docs) ~30,000–60,000+

Per-element output cost

A card with title, description, and button — the same component in each framework.

ply — 27 tokens

<div class="bg-surface border-radius padding">
  <h3>Title</h3>
  <p class="text-secondary">Description.</p>
  <button class="btn btn-primary">Action</button>
</div>

Bootstrap — 42 tokens

<div class="card">
  <div class="card-body">
    <h5 class="card-title">Title</h5>
    <p class="card-text text-muted">Description.</p>
    <a href="#" class="btn btn-primary">Action</a>
  </div>
</div>

Tailwind — 68 tokens

<div class="bg-white rounded-lg p-6 shadow-md
     dark:bg-gray-800">
  <h3 class="text-lg font-semibold
       text-gray-900 dark:text-white">Title</h3>
  <p class="mt-2 text-gray-600
      dark:text-gray-300">Description.</p>
  <button class="mt-4 rounded-lg bg-blue-600
      px-4 py-2 text-white hover:bg-blue-700">
    Action
  </button>
</div>

Hallucination risk

Framework Risk Why
ply Very low 458 obvious class names (unit-50, btn-blue). Full knowledge fits in context — no gaps for the agent to fill in.
Bootstrap Medium Component API has gotchas (card-body required inside card, navbar-expand-lg vs navbar-expand-md). Agents generate plausible-but-wrong combinations.
Tailwind High 12,000+ utilities with responsive/state prefixes. Agents frequently generate non-existent utilities, wrong prefix orders, or miss required dark: duplicates.

Analysis generated by Replit. Token counts are estimates based on representative component patterns.

Next

Next Steps

Explore semantic HTML to see what ply styles for free, or dive into the grid system to start building layouts.