Rule catalog
Two rules always load. The others load when the agent works on matching files.
How rules load
coreandarchitectureare always loaded.- The others carry file patterns:
pathsin Claude Code,globsin Cursor. The tool loads a rule when the agent reads or edits a matching file. - Other agents follow the
AGENTS.mdmap, which gives each rule’s “Use when” line.
Catalog
| Rule | Covers | Loaded for |
|---|---|---|
core | Working agreement: read before changing, minimal diffs, naming, named exports, error handling, comments. | Always |
architecture | Stack table, folder tree, where code lives, feature boundaries and import rules (no ../ imports). | Always |
react | React 19 components and hooks: derive instead of mirror, effects only for external systems, React Compiler, ref as a prop. | src/**/*.tsxsrc/hooks/**/*.tssrc/features/**/hooks/**/*.ts |
typescript | Strict TypeScript and Zod 4: schemas first, discriminated unions, no any, as or non-null assertions. | src/**/*.{ts,tsx} |
ui | shadcn/ui on Base UI or Radix, Tailwind CSS 4 tokens, loading, empty and error states, accessibility. | src/components/**/*.tsxsrc/features/**/components/**/*.tsx |
forms | React Hook Form with zodResolver, schemas in schemas/, typed defaultValues, server errors with setError. | src/features/**/components/*Form*.tsxsrc/features/**/schemas/**/*.tssrc/schemas/**/*.ts |
api | HTTP calls in features/*/api through src/lib/api.ts, Zod-parsed responses, ApiError, paginated lists. | src/lib/api.tssrc/features/**/api/**/*.ts |
server-state | TanStack Query 5: key factories, one queryOptions per query, thin hooks, invalidation, optimistic updates. | src/features/**/api/**/*.tssrc/features/**/hooks/**/*.tssrc/hooks/**/*.tssrc/lib/query-client.tssrc/providers/**/*.{ts,tsx} |
client-state | Zustand 5 stores with selectors and useShallow, URL state with nuqs, SSR-safe persistence. | src/stores/**/*.tssrc/features/**/stores/**/*.ts |
i18n | Messages in messages/, no hardcoded strings, typed keys; next-intl and Paraglide specifics.Only with next-intl or Paraglide installed | messages/**/*.jsonsrc/i18n/**/*.tsproject.inlang/settings.jsonsrc/components/**/*.tsxsrc/features/**/components/**/*.tsx |
performance | LCP, INP and CLS budgets, measure before optimizing, images, fonts and scripts. | src/app/**/*.tsxsrc/routes/**/*.tsxsrc/components/**/*.tsxsrc/features/**/components/**/*.tsx |
testing | Vitest, Testing Library and MSW: behavior over implementation, role queries, HTTP mocked with MSW. | src/**/*.test.{ts,tsx}src/test/**/*.{ts,tsx}vitest.config.ts |
nextjs | App Router: Server Components, async params, Server Actions, "use cache", proxy.ts, next/image and next/font.Next.js projects only | src/app/**/*.{ts,tsx}src/proxy.tsnext.config.ts |
tanstack-start | File routes, loaders with ensureQueryData, server functions with createServerFn, middleware, head().TanStack Start projects only | src/routes/**/*.{ts,tsx}src/router.tsxsrc/start.ts |
What changes per project
nextjsis installed only in Next.js projects,tanstack-startonly in TanStack Start projects.i18nis installed only whennext-intlor@inlang/paraglide-jsis a dependency. Add the library later and runinitagain to get it.- Rules shared by both frameworks keep only the lines for yours, for example the
QueryProvidersetup inserver-state. - Commands inside the rules (
lint,typecheck,test,shadcn add) use your package manager.
