PluginBench
Skill
Official
Review
Audit score 70

tailwind-best-practices

mastra-ai/mastra

Tailwind CSS styling guidelines ensuring design system consistency in Mastra Playground UI.

What is tailwind-best-practices?

This skill provides routing and priority guidance for Tailwind CSS styling in the Mastra Playground UI packages. Use it when writing, reviewing, or refactoring styled components to maintain design system consistency and prevent token drift.

  • Enforce component usage from @playground-ui/ds/components/ and prevent custom component creation
  • Ensure only design tokens from tailwind.config.ts are used in styling
  • Restrict arbitrary Tailwind values except for height and width properties
  • Prevent className prop overrides on design system components except for specific cases
  • Provide priority-ordered rules organized by impact (Critical vs High)

How to install tailwind-best-practices

npx skills add https://github.com/mastra-ai/mastra --skill tailwind-best-practices
Claude Code
Cursor
Windsurf
Cline

How to use tailwind-best-practices

  1. 1.Reference the critical patterns first: component usage and design tokens rules
  2. 2.Check the priority-ordered guidelines table to understand rule impact levels
  3. 3.Load the relevant rule file from references/rules/ when implementing a specific pattern
  4. 4.Use grep to search the rules directory for specific patterns (component, token, className)
  5. 5.Apply rules in priority order: Component Usage (Priority 1), Design Tokens (Priority 1), then ClassName Usage (Priority 2)

Use cases

Good for
  • Writing new React components with Tailwind styles in packages/playground-ui or packages/playground
  • Reviewing code for styling consistency before merging pull requests
  • Refactoring existing styled components to align with design tokens
  • Adding or modifying UI elements while maintaining design system integrity
  • Validating that arbitrary Tailwind values are only used for height and width
Who it's for
  • Frontend developers working on Mastra Playground UI
  • Code reviewers ensuring design system compliance
  • React component authors using Tailwind CSS
  • Design system maintainers

tailwind-best-practices FAQ

Can I create new components in the ds/ folder?

No. You must use existing components from @playground-ui/ds/components/. Creating new components in the ds/ folder violates the component usage rule.

What arbitrary Tailwind values are allowed?

Only height (h-*) and width (w-*) arbitrary values are permitted. All other arbitrary Tailwind values are prohibited.

Can I modify tailwind.config.ts?

No. You must only use existing tokens from tailwind.config.ts in @playground-ui. Modifying design tokens or the config file is not allowed.

When should I use className prop on design system components?

Avoid className prop on DS components except for h-* and w-* classes on DialogContent and Popover components.

Where are the detailed rule examples?

Rule files are in references/rules/ organized by category (component-*, tokens-*, classname-*). The references/tailwind-best-practices-reference.md file serves as the catalog.

Full instructions (SKILL.md)

Source of truth, from mastra-ai/mastra.


name: tailwind-best-practices description: Tailwind CSS styling guidelines for Mastra Playground UI. This skill should be used when writing, reviewing, or refactoring styling code in packages/playground-ui and packages/playground to ensure design system consistency. Triggers on tasks involving Tailwind classes, component styling, or design tokens.

Tailwind Best Practices

Overview

Routing and priority guide for Mastra Playground UI styling, containing 5 rules across 3 categories. Rule files hold the detailed explanations, examples, and review guidance that ensure design system consistency, prevent token drift, and maintain component library integrity.

Scope

  • packages/playground-ui
  • packages/playground

When to Apply

Reference these guidelines when:

  • Writing new React components with Tailwind styles
  • Reviewing code for styling consistency
  • Refactoring existing styled components
  • Adding or modifying UI elements

Priority-Ordered Guidelines

Rules are prioritized by impact:

PriorityCategoryImpact
1Component UsageCRITICAL
2Design TokensCRITICAL
3ClassName UsageHIGH

Quick Reference

Critical Patterns (Apply First)

Component Usage:

  • Use existing components from @playground-ui/ds/components/ (component-use-existing)
  • Never create new components in the ds/ folder

Design Tokens:

  • Only use tokens from tailwind.config.ts in @playground-ui (tokens-use-existing)
  • Never modify design tokens or tailwind.config.ts (tokens-no-modification)

High-Impact Patterns

ClassName Usage:

  • No arbitrary Tailwind values except height and width (classname-no-arbitrary)
  • No className prop on DS components except h-/w- on DialogContent and Popover (classname-no-ds-override)

References

Rule files are the canonical source for detailed guidance and examples:

  • references/tailwind-best-practices-reference.md - Rule catalog with category order and rule-file paths
  • references/rules/ - Canonical individual rule files organized by category

Load only the relevant rule file when implementing or reviewing a specific styling rule. Use the catalog to choose the right rule without loading every example.

To look up a specific pattern, grep the rules directory:

grep -l "component" references/rules/
grep -l "token" references/rules/
grep -l "className" references/rules/

Rule Categories in references/rules/

  • component-* - Component usage rules (1 rule)
  • tokens-* - Design token rules (2 rules)
  • classname-* - ClassName usage rules (2 rules)