frontend-conventions
Skill1 starsChanged 25 days agoMITView on GitHub
OpenTeams frontend conventions for React + TypeScript + Vite + shadcn/ui + Tailwind v4 projects. Use when writing, modifying, or reviewing frontend code — components, pages, hooks, state, data fetching, styling, or tests — in any project with a components.json or vite.config. Covers folder structure, component/test patterns, TanStack Query + Jotai, styling with semantic tokens + cn(), and Biome + Vitest quality gates.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- leroyguillaume/claudetheir own version, first seen Oct 30, 2026
- fpindej/netrocktheir own version, first seen Oct 8, 2026
- cloudflare/cloudflare-ostheir own version, first seen Sep 21, 2026
- aylinmarie/code-working-agentstheir own version, first seen Aug 19, 2026
- Benjaming61001/skillstheir own version, first seen Aug 10, 2026
- ryokkon624/scrum-agent-basetheir own version, first seen Jul 9, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- cloudflare/cloudflare-os★ 12ksame name
- fpindej/netrock★ 234same name
- mikemai2awesome/agent-skills★ 14same name
- leroyguillaume/claude★ 7same name
- Benjaming61001/skills★ 1same name
- kimzeze/frontend-conventions★ 1same name
- aylinmarie/code-working-agents★ 0same name
- ryokkon624/scrum-agent-base★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- a11y-auditSkill
- backend-conventionsSkill
- decision-deckSkill
- github-issueSkill
- k8s-conventionsSkill
- new-nebari-appSkill
- new-projectSkill
- pr-reviewSkill
- start-devSkill
- talk-deckSkill
- tool-evalSkill
- web-app-auditSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Before writing code, confirm what the project actually uses — conventions below are the org default, but a given repo may differ.
- Distinctive: line 40
Server state lives in TanStack Query, not Jotai: Never copy API data into an atom.
- Very specific: line 41
No
any: Use real types or unknown + narrowing. - Distinctive: line 92
Read the relevant reference before doing that kind of work — they contain the canonical code patterns:
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenTeams Frontend Development
Conventions and patterns for the OpenTeams frontend stack. Follow these when building or changing any React frontend in this org. To scaffold a brand-new project, use the new-project skill instead — this skill governs ongoing development.
The Stack
| Layer | Choice |
| Framework | React 19 + TypeScript + Vite |
| Styling | Tailwind CSS v4 (CSS-first) + shadcn/ui |
| Icons | lucide-react |
| Routing | React Router v6 |
| Server state | TanStack Query v5 |
| Client state | Jotai v2 |
| Tests | Vitest + Testing Library |
| Quality | Biome (format + lint + import sort) |
| Package manager | npm |
| Dev port | 5173 |
First Moves In Any Project
Before writing code, confirm what the project actually uses — conventions below are the org default, but a given repo may differ. Check, in order:
package.json— scripts, deps, package manager, React/Router/Tailwind versions.biome.json— formatter + lint settings. If absent, the repo may still be on ESLint (older projects); match what's there, don't force a migration unasked.components.json— shadcn style, baseColor, aliases, icon library.vite.config.ts—@tailwindcss/viteplugin ⇒ Tailwind v4;tailwind.config.ts+ postcss ⇒ Tailwind v3.src/index.css/globals.css— color tokens and theme.- The existing folder layout — mirror it. Match the surrounding code's idioms over these defaults when they conflict.
Non-Negotiables
- Semantic color tokens only.
bg-background text-foreground, neverbg-white text-gray-900. This is what makes dark mode work. - Never hand-edit
src/components/ui/. Those are shadcn-generated. Add vianpx shadcn@latest add <component>. To customize, wrap or extend — don't edit in place. - Server state lives in TanStack Query, not Jotai. Never copy API data into an atom.
- No
any. Use real types orunknown+ narrowing. - Co-locate tests next to the code (
Foo.tsx⇄Foo.test.tsx). - Run the quality gate before declaring done:
npm run build && npm run test -- --run && npm run check(Biomecheck= format + lint + import-organize).
Folder Structure
Components and pages each get a PascalCase directory with a barrel index.ts. Import from the folder, never the inner file.
src/
├── main.tsx
├── App.tsx
├── index.css # Tailwind v4 entry + @theme tokens
├── lib/
│ ├── utils.ts # cn()
│ └── api.ts # fetch wrapper
├── store/ # all Jotai atoms
│ └── appAtoms.ts
├── hooks/ # useThing.ts — TanStack Query wrappers + custom hooks
├── components/
│ ├── ui/ # shadcn (generated — don't edit)
│ └── UserCard/
│ ├── UserCard.tsx
│ ├── UserCard.test.tsx
│ └── index.ts
├── pages/
│ └── Home/
│ ├── Home.tsx
│ ├── Home.test.tsx
│ └── index.ts
└── providers/
└── ThemeProvider/import UserCard from "@/components/UserCard"; // ✅ from the folder
import UserCard from "@/components/UserCard/UserCard"; // ❌ inner fileNaming
| Thing | Convention | Example |
| Component / its directory | PascalCase | UserCard, UserCard/ |
| Component file | PascalCase | UserCard.tsx |
| Non-component file | camelCase | utils.ts, appAtoms.ts |
| Hook / its file | use + camelCase | useCurrentUser, useProducts.ts |
| Utility / function | camelCase | formatDate, cn |
Reference Files
Read the relevant reference before doing that kind of work — they contain the canonical code patterns:
references/styling.md— Tailwind v4 setup, semantic tokens,cn(), CVA component variants, dark mode, adding shadcn components.references/state-and-data.md— TanStack Query hook patterns, Jotai atoms, the server-vs-client-state decision table, theapi.tswrapper.references/components-and-testing.md— component file template, the barrel pattern, Vitest + Testing Library patterns (Router/Query wrappers), what to test.references/quality.md— Biome config + commands, the quality-gate workflow, TypeScript strictness, common Biome rule fixes.
What NOT To Do
| Don't | Do instead |
Hand-edit src/components/ui/ | npx shadcn@latest add <component>; wrap to customize |
| Build a custom primitive that shadcn already ships | Check src/components/ui/ first, then add it |
Use raw Tailwind colors (bg-white, text-gray-900) | Semantic tokens (bg-background, text-foreground) |
Fetch in a component with useEffect | A use* hook wrapping useQuery/useMutation |
| Store server/API data in a Jotai atom | TanStack Query owns server state |
| Scatter atoms across component files | All atoms in src/store/ |
Use any | Real types or unknown + narrowing |
| Flat component file | Own PascalCase dir with test + index.ts |
| Reach for ESLint/Prettier configs | Biome does format + lint + import sort |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

