plugins/style-agent/skills/create-utilities/SKILL.md
Use when the developer wants to create utility classes from a plain-language visual description — turning intent like "centered flex row with padding" into a ready-to-use class string.
npx skillsauth add shawn-sandy/acss-plugins create-utilitiesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a utility class string from a plain-language description of visual intent. Detects which utility library the project uses (acss-kit, Tailwind, Bootstrap, or Tailwind-compatible fallback) and maps the description to specific class names via LLM reasoning. Outputs a class string and a one-line HTML example ready to use — chains naturally into /css-to-class when the user wants to consolidate into a named class.
| Form | Example |
|---|---|
| Plain description | "a card with white background, 1rem padding, subtle shadow, and rounded corners" |
| Component phrase | "primary button with hover state" |
| HTML element with intent | <div> <!-- make this a centered hero section --> |
Grep project files to identify which utility library is active:
utilities.css present in the project containing selectors like .bg-primary, .flex, .m-4tailwind.config.* file exists, or @tailwind base appears in any .css/.scss filebootstrap*.css present in the project, or Bootstrap-specific utility patterns (d-flex, btn, container) appear in HTML/template source filesflex, p-4, rounded, etc.) — the de-facto standard most developers recogniseWhen multiple frameworks are detected, use AskUserQuestion to confirm which vocabulary to use — never silently pick one.
Parse description. Extract the visual properties being described: layout, spacing, color, typography, borders, shadows, states. If the description is too vague to generate a confident class list (e.g., "make it look nice", "a styled button"), use AskUserQuestion with specific follow-up prompts before proceeding:
Detect framework. Run the framework detection above:
find . \( -name "utilities.css" -o -name "tailwind.config.*" -o -name "bootstrap*.css" \) \
-not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/dist/*" -not -path "*/build/*"
Also grep for @tailwind base in .css/.scss files. If a utilities.css file is found, confirm it is acss-kit by grepping for a distinctive selector before concluding:
grep -l "\.bg-primary" <path-to-utilities.css>
If the grep does not match, treat utilities.css as an unrecognised file and do not classify it as acss-kit.
If multiple frameworks are found, use AskUserQuestion to confirm which vocabulary to use — do not auto-fallback. Only fall back to Tailwind-compatible naming when no framework is detected, or when the user explicitly confirms no framework after clarification.
Map to classes. For each extracted visual property, use LLM reasoning to select the best class name from the detected framework's vocabulary. Apply framework-specific naming conventions:
bg-primary, p-4, flex, items-center, rounded, shadowbg-primary, p-4, flex, items-center, rounded, shadowbg-primary, p-3, d-flex, align-items-center, rounded, shadow-smOrder the final class list: layout → spacing → color → typography → border/radius → shadow → state.
When a description maps to multiple plausible scale values (e.g., "large padding" → p-6, p-8, or p-10?), use AskUserQuestion to confirm the intended value before emitting.
Apply accessibility defaults. If the description implies an interactive element (button, link, input, select, or similar), handle focus styling based on the detected framework:
focus-visible:ring to the class list.:focus-visible { outline: 2px solid var(--color-primary, currentColor); outline-offset: 2px; } to your project CSS, or use an acss-kit component class (e.g., .btn) that provides focus styling."focus-ring (Bootstrap 5.3+) or note that Bootstrap provides native focus styling.Always add a brief # a11y note in the summary explaining what was added (or why no class was added).
Emit output. Print two fenced code blocks:
Class string (Tailwind example):
flex items-center p-4 bg-primary rounded shadow focus-visible:ring
HTML example (one line, showing the class applied to the most appropriate element for the description):
<button class="flex items-center p-4 bg-primary rounded shadow focus-visible:ring">Label</button>
The focus class (focus-visible:ring, focus-ring, or none) varies by framework — see step 4.
Print summary. One concise block listing:
AskUserQuestionClose with: Run /css-to-class [name] to consolidate into a named class.
development
Internal orchestrator for /kit-create, /kit-list, /kit-sync, /kit-update and Form/HTML/Style-Tune modes. Per-component generation lives in component-<name> skills; do not auto-trigger for component requests.
data-ai
Use when the user asks to generate, create, or scaffold a Table — accessible data table with caption, scope headers, responsive scroll wrapper, and sortable column support.
tools
Use when the user asks to generate, create, or scaffold a Popover — accessible tooltip/popover using the Popover API with focus trap, aria-expanded, and light-dismiss.
tools
Use when the user asks to generate, create, or scaffold a Nav — accessible navigation landmark with aria-label, current-page link marking, and horizontal/vertical layout.