# Workshop / Skills
frontend-standards
Opinionated house rules for React, Next.js, TypeScript, and Tailwind code in a feature-based layout, covering what the Vercel skills leave out: colocation and extraction, the Tailwind cva ladder, comments and TSDoc, file order, magic literals and as const unions, conditional rendering, and per-request state. Use when writing or reviewing frontend components, hooks, feature folders, className props, comments, file layout, literals, conditional branches, or stores and providers.
npx skills add htetaunglin-coder/skills --skill frontend-standardsSKILL.md
Frontend Standards
House rules that complement the Vercel skills. Every reference to a Vercel rule or to another skill carries a one-line meaning, so the rules read without them installed.
Precedence, in order:
- The repository's own standards (
AGENTS.md,CLAUDE.md, and whatever they point at). These rules fill the room the repository leaves. On a conflict with the repository or with a Vercel rule, follow the higher item and say the conflict exists. - Vercel
react-best-practicesfor measured performance,composition-patternsfor component APIs, thenextjsskill for framework mechanics, theshadcnskill for component-library conventions. Matt Pocock'scodebase-designfor the shape of a hook, data module, or lib function interface (small interface, much behavior behind it, tested through it). Read the rule the task touches, not the whole skill. - These rules for default code shape and for where the result lives.
Rules
| Rule | One line |
|---|---|
| colocation | Narrowest scope that matches ownership today. Extract on a named problem, share on shared ownership. |
| tailwind | Classes stay on the element. Repetition is evidence, not a command. cn → map → cva by count. |
| comments | Code says the what and the how first. A comment is the residue: why, why-not, warning, contract, coupling, reference. |
| file-order | Newspaper order: imports, shared constants and types, main export, sub-components, helpers. A part's own constant sits above it. function declarations keep it top-down. |
| magic-literals | A literal stays inline when its meaning is on the line. It takes a name when a reader must decode it or a second reader appears. as const unions, no enum. |
| conditional-render | First row that holds the branch: early return → ternary → map → sub-component → variable before JSX → IIFE last. A ternary never nests. |
| state | Tool choice and store shape are the repository's. A store holding request data is created per request, inside its provider. |
Lint rule names and options per rule: TOOLING.md. Primary sources per rule: SOURCES.md.