What is the Tailwind best practices skill?
Frontend Tailwind Best Practices is a skill in sergiodxa/agent-skills with 10 rules for Tailwind CSS in frontend apps. It steers the agent toward v-stack and h-stack utilities, gap over margins, a cn() className merge, class-based color schemes and responsive prefixes, with an anti-pattern table.
This is a short conventions file for Tailwind CSS work. It sits in sergiodxa/agent-skills alongside the React Router skill, and it tells an agent how the author styles components, layouts and className props.
There are ten rules in five groups: layout utilities, color schemes, className handling, affordances and responsive design. The description says to apply it when writing component styles, layouts or CSS classes.
What changes in your agent's output
- Rows and columns use v-stack and h-stack rather than flex flex-col or flex flex-row.
- Spacing between siblings comes from gap on the parent, not margins on each child.
- Components merge classes with cn(), with the external className always last.
- Dark mode uses class-based color schemes with a custom dark variant.
- Touch sizing uses pointer-coarse variants, so input capability drives size instead of device labels.
An important limit
Several rules rely on custom utilities such as v-stack, h-stack, z-stack, center and spacer, plus a cn helper in app/utils. If your project does not define them, the agent will emit classes that do nothing.
Who it is for
Best for
- Projects that already define the same stack utilities and cn helper, or that want to adopt them.
- Teams that want an agent to stop mixing margins and gaps in the same layout.
- Developers who want component className props typed with ClassName and ClassNameRecord.
Not for
- Plain Tailwind projects with no custom utilities, unless you add them first.
- Teams that prefer flex classes written out in markup.
- Design direction. It covers conventions, not visual style.
Use it with UiChemy
Tailwind classes live in your code. When a build needs to become a WordPress page, UiChemy AI to WordPress imports an AI build as an editable page. Click Get Started on uichemy.com.
How to install Tailwind Best Practices Skill: 10 Rules
bunx skills add sergiodxa/agent-skillsThe README does not name supported agents or install folders.Run the command
From your project, run
bunx skills add sergiodxa/agent-skills, as written in the repository README.Choose the skill
Select frontend-tailwind-best-practices from the list the command shows.
Add the utilities
Define v-stack, h-stack and the other utilities in your Tailwind CSS, and add a cn helper at app/utils/cn.ts.
Reload the agent
Open a new session, then ask for a component with a responsive layout.
Check that it loaded
Ask for a two column card layout. The result should use v-stack with lg:h-stack and gap, not flex flex-col with margins.
Key features
- Stack utilitiesDefines v-stack, h-stack, their reverse forms, z-stack for overlap, center, spacer and circle as the layout vocabulary.
- Gaps over marginsRule layout-prefer-gaps puts gap on the parent so children carry no spacing classes of their own.
- Responsive stacksDirection flips at breakpoints, for example v-stack lg:h-stack, with a shrinking aside on large screens.
- Class-based color schemesDark styling uses dark: variants on a class-driven scheme, with variables defined in app/styles/global.css.
- cn() mergingComponents pass base classes, variant objects and the external className through cn(), with the external value last.
- Typed className propsClassName for a single element and ClassNameRecord for several named elements, such as root, label and input.
- Affordance classesElement-agnostic patterns such as ui-button that compose with utilities, shown on a label styled like a button.
- Responsive textFont size and line height scale with breakpoint prefixes, for example text-2xl md:text-3xl lg:text-4xl.
- Capability sizingpointer-coarse variants enlarge touch targets, so sizing follows pointer type instead of a device guess.
- Anti-pattern tablePairs each avoided pattern with its replacement, such as bg-gray-100 with bg-neutral-100 and arbitrary hex with tokens.
Frequently asked questions
What is the Tailwind best practices skill?
It is frontend-tailwind-best-practices in sergiodxa/agent-skills. It holds 10 rules for Tailwind CSS in frontend apps, covering layout utilities, color schemes, className handling, affordances and responsive design, so an agent writes component styles the way the author expects.
How do I install the Tailwind skill?
Run bunx skills add sergiodxa/agent-skills and pick the skill, which is the command in the repository README. Then add the custom utilities the rules mention, because the skill expects v-stack, h-stack and a cn helper to exist in your project.
Do I need the custom v-stack utilities?
Yes, if you want the layout rules to work. The SKILL.md tells the agent to use v-stack, h-stack, z-stack, center, spacer and circle instead of flex classes. Without those utilities defined in your CSS, the generated classes have no effect.
What does the cn() rule do?
It tells the agent to merge classNames in components with cn(), listing base classes first, variant conditions next and the external className last. That order lets a parent override styles, and it avoids string concatenation of Tailwind classes.
How does it handle dark mode?
The color-schemes rule uses a class-based scheme with a custom dark variant, shown on a button that switches from dark gray to light gray. Variables for the schemes live in app/styles/global.css according to the key files table.
Is this the same as Tailwind documentation?
No. It does not teach Tailwind itself and has no installation guide for it. It is one author's convention set, with some project-specific parts. For broader utility guidance, see Tailwind CSS Patterns or Tailwind CSS Development.
Does it work with other frameworks?
The examples are React with className, and the SKILL.md does not mention other frameworks. The layout and spacing ideas apply anywhere, but the cn helper and ClassNameRecord types are written for TypeScript React components.
Can I use it to build WordPress pages?
The skill shapes front-end code, not WordPress output. To bring a finished AI build into WordPress, UiChemy AI to WordPress imports it as an editable page. Click Get Started on uichemy.com. For restyling, see UI Modernizer.


