## ๐Ÿ› ๏ธ Development Environment - **Language**: TypeScript (`^5.0.0`) - **Framework**: Next.js (App Router) - **Styling**: Tailwind CSS - **Component Library**: shadcn/ui - **Data Fetching**: React Query (TanStack) - **Testing**: Jest + React Testing Library - **Linting**: ESLint with `@typescript-eslint` - **Formatting**: Prettier - **Package Manager**: `pnpm` (through corepack preferred) - **backend** Strapi Cloud Community edition (headless CMS) ## ๐Ÿ“‚ Recommended Project Structure ```warp-runnable-command . โ”œโ”€โ”€ app/ # App Router structure โ”‚ โ”œโ”€โ”€ layout.tsx โ”‚ โ”œโ”€โ”€ page.tsx โ”‚ โ”œโ”€โ”€ api/ โ”œโ”€โ”€ components/ # UI components (shadcn or custom) โ”œโ”€โ”€ hooks/ # Custom React hooks โ”œโ”€โ”€ lib/ # Client helpers, API wrappers, etc. โ”œโ”€โ”€ styles/ # Tailwind customizations โ”œโ”€โ”€ tests/ # Unit and integration tests โ”œโ”€โ”€ public/ โ”œโ”€โ”€ .eslintrc.js โ”œโ”€โ”€ tailwind.config.ts โ”œโ”€โ”€ tsconfig.json โ”œโ”€โ”€ postcss.config.js โ”œโ”€โ”€ next.config.js โ”œโ”€โ”€ package.json โ””โ”€โ”€ README.md ``` ## ๐Ÿ“ฆ Installation Notes - Tailwind setup with `postcss` - shadcn/ui installed with `npx shadcn-ui@latest init` - React Query initialized with `` ## โš™๏ธ Dev Commands - **Dev server**: `pnpm dev` - **Build**: `pnpm build` - **Start**: `pnpm start` - **Lint**: `pnpm lint` - **Format**: `pnpm format` - **Test**: `pnpm test` ## ๐Ÿง  Claude Code Usage - Use `claude /init` to create this file - Run `claude` in the root of the repo - Prompt with: `think hard`, `ultrathink` for deep plans - Compact with `claude /compact` - Use `claude /permissions` to whitelist safe tools ## ๐Ÿ“Œ Prompt Examples ```warp-runnable-command Claude, refactor `useUser.ts` to use React Query. Claude, scaffold a new `Button.tsx` using shadcn/ui and Tailwind. Claude, generate the Tailwind styles for this mockup screenshot. Claude, build an API route handler for POST /api/user. Claude, create a test for `ProfileCard.tsx` using RTL. ``` ## ๐Ÿงช Testing Practices - **Testing Library**: `@testing-library/react` - **Mocking**: `msw`, `vi.mock()` - **Test command**: `pnpm test` - Organize tests in `/tests` or co-located with components ## ๐Ÿงฑ Component Guidelines - Use `shadcn/ui` components by default for form elements, cards, dialogs, etc. - Style components with Tailwind utility classes - Co-locate CSS modules or component-specific styling in the same directory ## โš›๏ธ React Query Patterns - Set up `QueryClient` in `app/layout.tsx` - Use `useQuery`, `useMutation`, `useInfiniteQuery` from `@tanstack/react-query` - Place API logic in `/lib/api/` and call via hooks - Use query keys prefixed by domain: `['user', id]` ## ๐Ÿ“ Code Style Standards - Prefer arrow functions - Annotate return types - Always destructure props - Avoid `any` type, use `unknown` or strict generics - Group imports: react โ†’ next โ†’ libraries โ†’ local ## ๐Ÿ” Documentation & Onboarding - Each component and hook should include a short comment on usage - Document top-level files (like `app/layout.tsx`) and configs - Keep `README.md` up to date with getting started, design tokens, and component usage notes ## ๐Ÿ” Security - Validate all server-side inputs (API routes) - Use HTTPS-only cookies and CSRF tokens when applicable - Protect sensitive routes with middleware or session logic