Agent skill

Tailwind Best Practices Skill: 10 Rules

Frontend Tailwind Best Practices is a skill with 10 rules that make an AI coding agent use stack utilities, gap spacing, a cn helper and class-based dark mode.

Install
bunx skills add sergiodxa/agent-skills
View on GitHub

Stars, license and last push from GitHub. Install count as reported by the open skills directory.

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.