projx / vitejs
CLAUDE.md71 starsChanged 4 months agoMITView on GitHub
Stack-scoped notes. The root ../CLAUDE.md carries cross-cutting standards — read both, they compose. This directory is a projx template: a working SPA whose own suite must stay green on the projx repo (root §"Per-template gates") and the source the CLI copies into scaffolded projects. src/main.tsx nests: ThemeProvider → ToastProvider → ConfirmProvider. Order matters (toast needs theme; confirm needs toast). Auth is a module (src/auth.ts), not a provider. Add a provider? Slot it at the right depth.
In this repository15 other files it gives its agents.
- admin-panel/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- cli/CLAUDE.mdCLAUDE.md
- e2e/CLAUDE.mdCLAUDE.md
- express/CLAUDE.mdCLAUDE.md
- fastapi/CLAUDE.mdCLAUDE.md
- fastify/CLAUDE.mdCLAUDE.md
- go/CLAUDE.mdCLAUDE.md
- infra/CLAUDE.mdCLAUDE.md
- laravel/CLAUDE.mdCLAUDE.md
- mobile/CLAUDE.mdCLAUDE.md
- nextjs/CLAUDE.mdCLAUDE.md
- rust/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- projxSkill
The file
Files
frontend — React / Vite frontend (projx template)
Stack-scoped notes. The root
../CLAUDE.mdcarries cross-cutting standards — read both, they compose.This directory is a projx template: a working SPA whose own suite must stay green on the projx repo (root §"Per-template gates") and the source the CLI copies into scaffolded projects.
Stack
- Framework — React (function components + hooks), TypeScript strict
- Build — Vite (library mode, client-only SPA — no SSR/framework mode)
- Routing —
react-routerv8 (library mode:BrowserRouter/Routes/Route); imports come fromreact-router, not the retiredreact-router-dom - State — React Context (theme, toast, confirm); no Redux, no TanStack Query
- Data — one fetch wrapper in
src/api.ts— neverfetchdirect from components - Styling — Tailwind CSS v4 via
@tailwindcss/vite; design tokens in the@themeblock ofsrc/index.css, dark theme overrides the same custom properties under[data-theme='dark']. No bracket-arbitrary values, no raw hex/px (root §"CSS discipline") - Test — Vitest + React Testing Library + jsdom. Tests live in
tests/, notsrc/ - Package manager — pnpm
Layout
| Path | What it holds |
src/main.tsx | DOM mount + provider tree (below) |
src/App.tsx | Router / route definitions |
src/api.ts | The only place fetch is called — Bearer header, { detail, request_id } error normalization, 401 handling |
src/auth.ts | JWT decode / isAuthenticated (module, not a context provider) |
src/theme.tsx | ThemeProvider — data-theme on <html>, localStorage, prefers-color-scheme |
src/index.css | @import 'tailwindcss', @theme tokens (light) + [data-theme='dark'] overrides, @layer base/components |
src/components/ | Layout, Toast, ConfirmDialog, ErrorBoundary, ErrorScaffold |
src/pages/ | Dashboard, Login, NotFound |
tests/ | *.test.ts(x) + test-setup.ts — mirrors src/ |
nginx.conf, security-headers.inc, docker-entrypoint.sh | Prod container serving config |
scripts/check-bundle-size.sh | Bundle-size budget gate |
Provider tree — assembled at the mount (verified)
src/main.tsx nests: ThemeProvider → ToastProvider → ConfirmProvider. Order matters (toast needs theme; confirm needs toast). Auth is a module (src/auth.ts), not a provider. Add a provider? Slot it at the right depth.
Conventions
- API: pages/hooks call typed wrappers in
src/api.ts; new endpoints add a wrapper there, never an inlinefetch. Errors are the backend's{ detail, request_id }shape — surfacerequest_idin error UI for support. - CSS: component styles read tokens only (
var(--…)). Both themes, all breakpoints, zero raw values.scripts/style-check.py(repo rootscripts/) lints rawbackground/colorvalues + raw element selectors. - A11y: semantic HTML, visible focus rings, ARIA on icon buttons, WCAG AA contrast in both themes.
- Theme: switches by toggling
[data-theme]; dark is a distinct register, not inverted colors.
Testing — tests/, never src/
Co-located tests under src/ were migrated out to fix issue #12 — never re-introduce them. Query by role/label/text, not class or test-id. Unit + component here; goldens + E2E live in the sibling e2e/ (root §"Test pyramid").
Quality gates (root §"Per-template gates")
pnpm format (prettier) → pnpm lint (eslint) → pnpm typecheck (tsc --noEmit) → pnpm test (vitest, v8 ≥80%) → pnpm build → scripts/check-bundle-size.sh. Green or not done; no src/ excludes.
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.

