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-practicesHow to use tailwind-best-practices
- 1.Reference the critical patterns first: component usage and design tokens rules
- 2.Check the priority-ordered guidelines table to understand rule impact levels
- 3.Load the relevant rule file from references/rules/ when implementing a specific pattern
- 4.Use grep to search the rules directory for specific patterns (component, token, className)
- 5.Apply rules in priority order: Component Usage (Priority 1), Design Tokens (Priority 1), then ClassName Usage (Priority 2)
Use cases
- 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
- 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
No. You must use existing components from @playground-ui/ds/components/. Creating new components in the ds/ folder violates the component usage rule.
Only height (h-*) and width (w-*) arbitrary values are permitted. All other arbitrary Tailwind values are prohibited.
No. You must only use existing tokens from tailwind.config.ts in @playground-ui. Modifying design tokens or the config file is not allowed.
Avoid className prop on DS components except for h-* and w-* classes on DialogContent and Popover components.
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-uipackages/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:
| Priority | Category | Impact |
|---|---|---|
| 1 | Component Usage | CRITICAL |
| 2 | Design Tokens | CRITICAL |
| 3 | ClassName Usage | HIGH |
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.tsin@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
heightandwidth(classname-no-arbitrary) - No
classNameprop on DS components excepth-/w-onDialogContentandPopover(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 pathsreferences/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)
Related skills
More from mastra-ai/mastra and the wider catalog.

e2e-tests-studio
>

ralph-plan
Interactive planning assistant for creating focused, well-structured ralph-loop commands

react-best-practices
React performance optimization guidelines covering waterfalls, bundle size, data fetching, and re-renders.

smoke-test
Create a Mastra project using create-mastra and smoke test the studio in Chrome using Chrome MCP server

mastra
Comprehensive Mastra framework guide for building agents, workflows, tools, memory, and storage with current APIs.

api-gateway
|