CLAUDE.md¶
to match your codebase. -->
Project¶
One-paragraph description of what this app does and who uses it.
- Framework: Vite 5 / Next.js 15 App Router
- Language: TypeScript (strict mode)
- Styling: Tailwind / CSS modules / styled-components
- State: Zustand / React Query / Context
- Tests: Vitest + React Testing Library
Commands¶
npm run dev— start dev servernpm test— run unit tests in watch modenpm run test:ci— run tests once, with coveragenpm run lint— ESLint + type-checknpm run build— production build
Always run npm run lint and npm run test:ci before opening a PR. CI blocks
on both.
Architecture¶
src/components/— reusable presentational components, no data fetching.src/features/<feature>/— feature slices: components + hooks + tests colocated. New features live here.src/lib/— framework-agnostic utilities. No React imports allowed.src/api/— thin client wrappers around fetch. Never call fetch from components directly.
Testing¶
- One test file per component, next to the component.
Foo.tsx→Foo.test.tsx. - Use React Testing Library queries in this order of preference:
getByRole>getByLabelText>getByText>getByTestId. - Never
act()manually — RTL handles it. If you reach foract, you're probably testing implementation instead of behavior. - Mock at the network boundary (MSW handlers in
src/test/msw/), never the component's hooks.
Conventions¶
- Prefer server components / RSC where the framework supports it. Mark client
components with
'use client'at the top of the file. - Props interfaces named
<ComponentName>Props, exported alongside the component. - No default exports except for pages/routes that the framework requires.
- Filenames: PascalCase for components, camelCase for everything else.
Do NOT¶
- Add dependencies without asking. The
package.jsonis audited. - Use
any. Useunknownand narrow, or define the type properly. - Add
// eslint-disable-next-linewithout a comment explaining the reason. - Commit generated files from
dist/,.next/, orcoverage/.
Available skills¶
/component-new— scaffold a component + test + stories with consistent structure./test-component— write tests for an existing component using the project's RTL conventions.
See also¶
- starters/index.md — how this kit was assembled and how to adapt it
- ../../guides/claude-md-guide.md — how to write a good CLAUDE.md