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 | Folder tree, where code lives, feature boundaries, one-way imports and one @/* alias (no barrels, no ../ imports). | Always |
typescript | Strict TypeScript and Zod 4: schemas first, discriminated unions, no any, as or non-null assertions. | src/**/*.tssrc/**/*.tsx |
react | React 19 components and hooks: where state lives, derive instead of mirror, effects only for external systems, useEffectEvent, React Compiler, ref as a prop. | src/**/*.tsxsrc/hooks/**/*.tssrc/features/**/hooks/**/*.ts |
nextjs | App Router: Server Components, async params, Cache Components, Server Actions, updateTag, proxy.ts, next/image and next/font.Next.js projects only | src/app/**/*.tssrc/app/**/*.tsxsrc/proxy.tsnext.config.tssrc/features/**/actions/**/*.ts |
tanstack-start | File routes, loaders with queryClient.query, server functions with createServerFn and .validator, CSRF middleware, head().TanStack Start projects only | src/routes/**/*.tssrc/routes/**/*.tsxsrc/router.tsxsrc/start.tssrc/features/**/api/**/*.ts |
ui | shadcn/ui and Base UI patterns, the cn package, Tailwind CSS 4 tokens, loading, empty and error states, accessibility. | src/components/**/*.tsxsrc/features/**/components/**/*.tsxsrc/styles/**/*.css |
forms | React Hook Form with zodResolver, Controller and shadcn Field, schemas in schemas/, typed defaultValues, server errors with setError. | src/**/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, retries in one place. | src/features/**/api/**/*.tssrc/features/**/hooks/**/*.tssrc/hooks/**/*.tssrc/lib/query-client.tssrc/providers/**/*.tssrc/providers/**/*.tsx |
client-state | Zustand 5 stores: placement, actions, request-scoped stores and SSR-safe persistence. | src/stores/**/*.tssrc/features/**/stores/**/*.ts |
i18n | Messages in src/messages/, localization instead of word-for-word translation, no hardcoded strings, locale-aware text; next-intl and Paraglide specifics.Only with next-intl or Paraglide installed | src/messages/**/*.jsonsrc/i18n/**/*.tsproject.inlang/settings.jsonsrc/components/**/*.tsxsrc/features/**/components/**/*.tsxsrc/app/**/*.tsxsrc/routes/**/*.tsx |
testing | Vitest, Testing Library and MSW: behavior over implementation, role queries, HTTP mocked with MSW. | src/**/*.test.tssrc/**/*.test.tsxsrc/test/**/*.tssrc/test/**/*.tsxvitest.config.ts |
performance | LCP, INP and CLS budgets, measure before optimizing, images, font fallbacks and scripts. | src/app/**/*.tsxsrc/routes/**/*.tsxsrc/components/**/*.tsxsrc/features/**/components/**/*.tsx |
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.