Skip to content
RulePaste

Web

Remix and React Router rules file

Remix's packages and React Router 7 are easy for an agent to mix up. This file tells it to use whichever one is already in package.json, and to keep data in loaders instead of effects.

Change this stack in the generator

The files

Same rules, wrapped for each tool. Use the file your editor lists. Legacy files are there for older builds.

CursorUse this.cursor/rules/project.mdc

.cursor/rules/project.mdc
---description: "Project rules for TypeScript, Remix / React Router, Tailwind CSS, Vitest, pnpm. Generated by RulePaste."alwaysApply: true--- # Project rules Stack: TypeScript, Remix / React Router, Tailwind CSS, Vitest, pnpm. Follow these rules on every task. If a rule disagrees with existing code, match the code and mention the difference. If a rule disagrees with a direct user instruction, follow the user. ## Working agreement - Read the files you will change before editing them. Do not invent the project layout from memory.- Change only what the task needs. No drive-by refactors, renames, or formatting of untouched lines.- Match the patterns already in the repo over a generic style guide.- Do not add dependencies, config files, or abstractions the task did not ask for.- Do not commit secrets, and do not paste `.env` values, tokens, or private keys into code or chat.- If a requirement is ambiguous, choose the smallest reading, state that assumption, and continue. ## Commands - JavaScript package manager is pnpm. The lockfile to commit is pnpm-lock.yaml. Do not add a second lockfile.- Install: `pnpm install`.- Dev server: `pnpm dev` when that script exists.- Lint: `pnpm lint` when that script exists. Typecheck with the project's typecheck script or `tsc --noEmit` if the repo uses it.- Build: `pnpm build` when you changed a build path.- Tests: `pnpm test`. Single pass, not watch mode: `pnpm exec vitest run`.- Run the narrowest command that checks the change. Do not loop install, build, or the full test suite. ## TypeScript - Leave `strict` on. Do not weaken `tsconfig` to make a build pass.- No new `any`, and no `// @ts-ignore`. Use `unknown` and narrow. `@ts-expect-error` needs a reason on that line.- Match the file's style for `type` versus `interface`. Prefer a string union over a new `enum` unless the file already uses enums.- Use `import type` for type-only imports. Await promises. Do not leave a promise floating.- Do not use a non-null assertion on a value that came from outside the function. Narrow it instead. ## Remix and React Router - Use the packages already in `package.json`. React Router 7 (`react-router`) and Remix v2 (`@remix-run/*`) are different. Do not install the other one.- Loaders return data. Actions handle writes. Do not refetch loader data in an effect.- Validate form data and URL params inside the loader or action before use.- Return the project's error shape with a real HTTP status. Do not swallow loader errors.- Use the router's `Link` and `Form`. Do not import server-only modules into a component that also runs on the client. ## Tailwind CSS - Style with Tailwind utilities. Do not add a CSS file or a CSS-in-JS library for a one-off.- Tailwind v4 is configured in CSS with `@theme` and usually has no `tailwind.config.js`. Tailwind v3 uses that config file. Do not add the other version's config.- Use the project's color, spacing, and radius tokens. Do not invent a second palette of arbitrary values.- Mobile-first breakpoints. Every control keeps a visible focus style. Icon-only buttons need an accessible name.- If `prettier-plugin-tailwindcss` is installed, let it order classes. Use `dark:` only when the project already has a dark theme. ## Vitest - Put tests next to the code as `*.test.ts`, or in the folder the repo already uses.- Use `describe`, `it`, and `expect`. A test name states the behavior.- Assert on values, text, or roles. Do not snapshot a whole component tree.- Mock only network, time, or the filesystem. Do not mock the function under test.- Run one pass with `vitest run` or the project's test script. Do not leave watch mode running. ## pnpm - pnpm is the package manager. The lockfile is `pnpm-lock.yaml`. Do not commit another JavaScript lockfile.- Add packages with `pnpm add <pkg>` and dev packages with `pnpm add -D <pkg>`. Run scripts with `pnpm <script>`. ## Testing expectations - When you fix a bug, add a test that fails before the fix and passes after, in the repo's current test style.- When you change behavior a caller can observe, update or add a test for that behavior.- Do not test private helpers, framework internals, or third-party libraries. ## Code style - Keep strict type and lint settings on. Do not weaken them to get a green build.- No new `any`, and no empty catch blocks. Prefer `unknown` and narrowing. Handle every fallible call.- Give exported functions an explicit type when the inferred type is not obvious.- Follow the repo formatter. Do not hand-format files the formatter owns.- Do not add comments that restate the code.- Comment only a constraint, invariant, or tradeoff the code itself cannot show.- No file-header banners and no changelog comments. ## Safety - Never commit `.env`, keystores, or credential files. When a new variable is required, add an empty placeholder to the example env file.- Do not disable authentication, authorization, or TLS checks to make a test pass.- Do not force-push, `reset --hard`, drop a database, or delete a directory tree unless the user asked for that exact action.- Do not edit vendored or generated output (`node_modules`, `dist`, `.next`, `vendor`, `Library`, `.godot`). Change the source and regenerate. ## Done when - The change does what was asked and nothing extra.- New or changed behavior is covered at the level in Testing expectations.- The commands in this file that apply to the touched files have been run, or you say which command you could not run.- The diff has no unrelated files, lockfile churn, or secrets. 

Install

  1. Create `.cursor/rules/` in the project root if it does not exist.
  2. Save this file as `.cursor/rules/project.mdc`. The `.mdc` extension and the frontmatter are required. A plain `.md` file in that folder is ignored.
  3. Commit it. Open a new Cursor chat. Check Settings, Rules, and confirm the rule is listed as Always Apply.
  4. Keep a single rule under a few hundred lines. Split later files by topic and set `alwaysApply: false` plus `globs` when a rule is only for some files.
Cursor (legacy)Legacy.cursorrules

.cursorrules
# Project rules Stack: TypeScript, Remix / React Router, Tailwind CSS, Vitest, pnpm. Follow these rules on every task. If a rule disagrees with existing code, match the code and mention the difference. If a rule disagrees with a direct user instruction, follow the user. ## Working agreement - Read the files you will change before editing them. Do not invent the project layout from memory.- Change only what the task needs. No drive-by refactors, renames, or formatting of untouched lines.- Match the patterns already in the repo over a generic style guide.- Do not add dependencies, config files, or abstractions the task did not ask for.- Do not commit secrets, and do not paste `.env` values, tokens, or private keys into code or chat.- If a requirement is ambiguous, choose the smallest reading, state that assumption, and continue. ## Commands - JavaScript package manager is pnpm. The lockfile to commit is pnpm-lock.yaml. Do not add a second lockfile.- Install: `pnpm install`.- Dev server: `pnpm dev` when that script exists.- Lint: `pnpm lint` when that script exists. Typecheck with the project's typecheck script or `tsc --noEmit` if the repo uses it.- Build: `pnpm build` when you changed a build path.- Tests: `pnpm test`. Single pass, not watch mode: `pnpm exec vitest run`.- Run the narrowest command that checks the change. Do not loop install, build, or the full test suite. ## TypeScript - Leave `strict` on. Do not weaken `tsconfig` to make a build pass.- No new `any`, and no `// @ts-ignore`. Use `unknown` and narrow. `@ts-expect-error` needs a reason on that line.- Match the file's style for `type` versus `interface`. Prefer a string union over a new `enum` unless the file already uses enums.- Use `import type` for type-only imports. Await promises. Do not leave a promise floating.- Do not use a non-null assertion on a value that came from outside the function. Narrow it instead. ## Remix and React Router - Use the packages already in `package.json`. React Router 7 (`react-router`) and Remix v2 (`@remix-run/*`) are different. Do not install the other one.- Loaders return data. Actions handle writes. Do not refetch loader data in an effect.- Validate form data and URL params inside the loader or action before use.- Return the project's error shape with a real HTTP status. Do not swallow loader errors.- Use the router's `Link` and `Form`. Do not import server-only modules into a component that also runs on the client. ## Tailwind CSS - Style with Tailwind utilities. Do not add a CSS file or a CSS-in-JS library for a one-off.- Tailwind v4 is configured in CSS with `@theme` and usually has no `tailwind.config.js`. Tailwind v3 uses that config file. Do not add the other version's config.- Use the project's color, spacing, and radius tokens. Do not invent a second palette of arbitrary values.- Mobile-first breakpoints. Every control keeps a visible focus style. Icon-only buttons need an accessible name.- If `prettier-plugin-tailwindcss` is installed, let it order classes. Use `dark:` only when the project already has a dark theme. ## Vitest - Put tests next to the code as `*.test.ts`, or in the folder the repo already uses.- Use `describe`, `it`, and `expect`. A test name states the behavior.- Assert on values, text, or roles. Do not snapshot a whole component tree.- Mock only network, time, or the filesystem. Do not mock the function under test.- Run one pass with `vitest run` or the project's test script. Do not leave watch mode running. ## pnpm - pnpm is the package manager. The lockfile is `pnpm-lock.yaml`. Do not commit another JavaScript lockfile.- Add packages with `pnpm add <pkg>` and dev packages with `pnpm add -D <pkg>`. Run scripts with `pnpm <script>`. ## Testing expectations - When you fix a bug, add a test that fails before the fix and passes after, in the repo's current test style.- When you change behavior a caller can observe, update or add a test for that behavior.- Do not test private helpers, framework internals, or third-party libraries. ## Code style - Keep strict type and lint settings on. Do not weaken them to get a green build.- No new `any`, and no empty catch blocks. Prefer `unknown` and narrowing. Handle every fallible call.- Give exported functions an explicit type when the inferred type is not obvious.- Follow the repo formatter. Do not hand-format files the formatter owns.- Do not add comments that restate the code.- Comment only a constraint, invariant, or tradeoff the code itself cannot show.- No file-header banners and no changelog comments. ## Safety - Never commit `.env`, keystores, or credential files. When a new variable is required, add an empty placeholder to the example env file.- Do not disable authentication, authorization, or TLS checks to make a test pass.- Do not force-push, `reset --hard`, drop a database, or delete a directory tree unless the user asked for that exact action.- Do not edit vendored or generated output (`node_modules`, `dist`, `.next`, `vendor`, `Library`, `.godot`). Change the source and regenerate. ## Done when - The change does what was asked and nothing extra.- New or changed behavior is covered at the level in Testing expectations.- The commands in this file that apply to the touched files have been run, or you say which command you could not run.- The diff has no unrelated files, lockfile churn, or secrets. 

Install

  1. Save as `.cursorrules` in the project root only if you are on an older Cursor build that still lists this file.
  2. Current Cursor uses `.cursor/rules/*.mdc`. If you keep both, they will drift unless you regenerate them together.
Claude CodeUse thisCLAUDE.md

CLAUDE.md
# Project rules Stack: TypeScript, Remix / React Router, Tailwind CSS, Vitest, pnpm. Follow these rules on every task. If a rule disagrees with existing code, match the code and mention the difference. If a rule disagrees with a direct user instruction, follow the user. ## Working agreement - Read the files you will change before editing them. Do not invent the project layout from memory.- Change only what the task needs. No drive-by refactors, renames, or formatting of untouched lines.- Match the patterns already in the repo over a generic style guide.- Do not add dependencies, config files, or abstractions the task did not ask for.- Do not commit secrets, and do not paste `.env` values, tokens, or private keys into code or chat.- If a requirement is ambiguous, choose the smallest reading, state that assumption, and continue. ## Commands - JavaScript package manager is pnpm. The lockfile to commit is pnpm-lock.yaml. Do not add a second lockfile.- Install: `pnpm install`.- Dev server: `pnpm dev` when that script exists.- Lint: `pnpm lint` when that script exists. Typecheck with the project's typecheck script or `tsc --noEmit` if the repo uses it.- Build: `pnpm build` when you changed a build path.- Tests: `pnpm test`. Single pass, not watch mode: `pnpm exec vitest run`.- Run the narrowest command that checks the change. Do not loop install, build, or the full test suite. ## TypeScript - Leave `strict` on. Do not weaken `tsconfig` to make a build pass.- No new `any`, and no `// @ts-ignore`. Use `unknown` and narrow. `@ts-expect-error` needs a reason on that line.- Match the file's style for `type` versus `interface`. Prefer a string union over a new `enum` unless the file already uses enums.- Use `import type` for type-only imports. Await promises. Do not leave a promise floating.- Do not use a non-null assertion on a value that came from outside the function. Narrow it instead. ## Remix and React Router - Use the packages already in `package.json`. React Router 7 (`react-router`) and Remix v2 (`@remix-run/*`) are different. Do not install the other one.- Loaders return data. Actions handle writes. Do not refetch loader data in an effect.- Validate form data and URL params inside the loader or action before use.- Return the project's error shape with a real HTTP status. Do not swallow loader errors.- Use the router's `Link` and `Form`. Do not import server-only modules into a component that also runs on the client. ## Tailwind CSS - Style with Tailwind utilities. Do not add a CSS file or a CSS-in-JS library for a one-off.- Tailwind v4 is configured in CSS with `@theme` and usually has no `tailwind.config.js`. Tailwind v3 uses that config file. Do not add the other version's config.- Use the project's color, spacing, and radius tokens. Do not invent a second palette of arbitrary values.- Mobile-first breakpoints. Every control keeps a visible focus style. Icon-only buttons need an accessible name.- If `prettier-plugin-tailwindcss` is installed, let it order classes. Use `dark:` only when the project already has a dark theme. ## Vitest - Put tests next to the code as `*.test.ts`, or in the folder the repo already uses.- Use `describe`, `it`, and `expect`. A test name states the behavior.- Assert on values, text, or roles. Do not snapshot a whole component tree.- Mock only network, time, or the filesystem. Do not mock the function under test.- Run one pass with `vitest run` or the project's test script. Do not leave watch mode running. ## pnpm - pnpm is the package manager. The lockfile is `pnpm-lock.yaml`. Do not commit another JavaScript lockfile.- Add packages with `pnpm add <pkg>` and dev packages with `pnpm add -D <pkg>`. Run scripts with `pnpm <script>`. ## Testing expectations - When you fix a bug, add a test that fails before the fix and passes after, in the repo's current test style.- When you change behavior a caller can observe, update or add a test for that behavior.- Do not test private helpers, framework internals, or third-party libraries. ## Code style - Keep strict type and lint settings on. Do not weaken them to get a green build.- No new `any`, and no empty catch blocks. Prefer `unknown` and narrowing. Handle every fallible call.- Give exported functions an explicit type when the inferred type is not obvious.- Follow the repo formatter. Do not hand-format files the formatter owns.- Do not add comments that restate the code.- Comment only a constraint, invariant, or tradeoff the code itself cannot show.- No file-header banners and no changelog comments. ## Safety - Never commit `.env`, keystores, or credential files. When a new variable is required, add an empty placeholder to the example env file.- Do not disable authentication, authorization, or TLS checks to make a test pass.- Do not force-push, `reset --hard`, drop a database, or delete a directory tree unless the user asked for that exact action.- Do not edit vendored or generated output (`node_modules`, `dist`, `.next`, `vendor`, `Library`, `.godot`). Change the source and regenerate. ## Done when - The change does what was asked and nothing extra.- New or changed behavior is covered at the level in Testing expectations.- The commands in this file that apply to the touched files have been run, or you say which command you could not run.- The diff has no unrelated files, lockfile churn, or secrets. 

Install

  1. Save as `CLAUDE.md` in the project root. `.claude/CLAUDE.md` also works if you want the root left clear.
  2. Commit it. Start a new Claude Code session. The file loads at session start, not in the middle of an old one.
  3. When the file gets long, move a topic into `.claude/rules/<topic>.md`. Add a `paths` list only if that topic should load for certain files.
Windsurf / DevinUse this.devin/rules/project.md

.devin/rules/project.md
---trigger: always_ondescription: "Project rules for TypeScript, Remix / React Router, Tailwind CSS, Vitest, pnpm. Generated by RulePaste."--- # Project rules Stack: TypeScript, Remix / React Router, Tailwind CSS, Vitest, pnpm. Follow these rules on every task. If a rule disagrees with existing code, match the code and mention the difference. If a rule disagrees with a direct user instruction, follow the user. ## Working agreement - Read the files you will change before editing them. Do not invent the project layout from memory.- Change only what the task needs. No drive-by refactors, renames, or formatting of untouched lines.- Match the patterns already in the repo over a generic style guide.- Do not add dependencies, config files, or abstractions the task did not ask for.- Do not commit secrets, and do not paste `.env` values, tokens, or private keys into code or chat.- If a requirement is ambiguous, choose the smallest reading, state that assumption, and continue. ## Commands - JavaScript package manager is pnpm. The lockfile to commit is pnpm-lock.yaml. Do not add a second lockfile.- Install: `pnpm install`.- Dev server: `pnpm dev` when that script exists.- Lint: `pnpm lint` when that script exists. Typecheck with the project's typecheck script or `tsc --noEmit` if the repo uses it.- Build: `pnpm build` when you changed a build path.- Tests: `pnpm test`. Single pass, not watch mode: `pnpm exec vitest run`.- Run the narrowest command that checks the change. Do not loop install, build, or the full test suite. ## TypeScript - Leave `strict` on. Do not weaken `tsconfig` to make a build pass.- No new `any`, and no `// @ts-ignore`. Use `unknown` and narrow. `@ts-expect-error` needs a reason on that line.- Match the file's style for `type` versus `interface`. Prefer a string union over a new `enum` unless the file already uses enums.- Use `import type` for type-only imports. Await promises. Do not leave a promise floating.- Do not use a non-null assertion on a value that came from outside the function. Narrow it instead. ## Remix and React Router - Use the packages already in `package.json`. React Router 7 (`react-router`) and Remix v2 (`@remix-run/*`) are different. Do not install the other one.- Loaders return data. Actions handle writes. Do not refetch loader data in an effect.- Validate form data and URL params inside the loader or action before use.- Return the project's error shape with a real HTTP status. Do not swallow loader errors.- Use the router's `Link` and `Form`. Do not import server-only modules into a component that also runs on the client. ## Tailwind CSS - Style with Tailwind utilities. Do not add a CSS file or a CSS-in-JS library for a one-off.- Tailwind v4 is configured in CSS with `@theme` and usually has no `tailwind.config.js`. Tailwind v3 uses that config file. Do not add the other version's config.- Use the project's color, spacing, and radius tokens. Do not invent a second palette of arbitrary values.- Mobile-first breakpoints. Every control keeps a visible focus style. Icon-only buttons need an accessible name.- If `prettier-plugin-tailwindcss` is installed, let it order classes. Use `dark:` only when the project already has a dark theme. ## Vitest - Put tests next to the code as `*.test.ts`, or in the folder the repo already uses.- Use `describe`, `it`, and `expect`. A test name states the behavior.- Assert on values, text, or roles. Do not snapshot a whole component tree.- Mock only network, time, or the filesystem. Do not mock the function under test.- Run one pass with `vitest run` or the project's test script. Do not leave watch mode running. ## pnpm - pnpm is the package manager. The lockfile is `pnpm-lock.yaml`. Do not commit another JavaScript lockfile.- Add packages with `pnpm add <pkg>` and dev packages with `pnpm add -D <pkg>`. Run scripts with `pnpm <script>`. ## Testing expectations - When you fix a bug, add a test that fails before the fix and passes after, in the repo's current test style.- When you change behavior a caller can observe, update or add a test for that behavior.- Do not test private helpers, framework internals, or third-party libraries. ## Code style - Keep strict type and lint settings on. Do not weaken them to get a green build.- No new `any`, and no empty catch blocks. Prefer `unknown` and narrowing. Handle every fallible call.- Give exported functions an explicit type when the inferred type is not obvious.- Follow the repo formatter. Do not hand-format files the formatter owns.- Do not add comments that restate the code.- Comment only a constraint, invariant, or tradeoff the code itself cannot show.- No file-header banners and no changelog comments. ## Safety - Never commit `.env`, keystores, or credential files. When a new variable is required, add an empty placeholder to the example env file.- Do not disable authentication, authorization, or TLS checks to make a test pass.- Do not force-push, `reset --hard`, drop a database, or delete a directory tree unless the user asked for that exact action.- Do not edit vendored or generated output (`node_modules`, `dist`, `.next`, `vendor`, `Library`, `.godot`). Change the source and regenerate. ## Done when - The change does what was asked and nothing extra.- New or changed behavior is covered at the level in Testing expectations.- The commands in this file that apply to the touched files have been run, or you say which command you could not run.- The diff has no unrelated files, lockfile churn, or secrets. 

Install

  1. Create `.devin/rules/` and save this file as `.devin/rules/project.md`. Devin Desktop (formerly Windsurf) prefers this path. `.windsurf/rules/` still works as a fallback.
  2. `trigger: always_on` loads it in every chat. Keep the file under 12,000 characters or it can be truncated with no error.
  3. Commit it and start a new chat. If you also keep `.windsurfrules`, make sure the two files do not disagree.
Windsurf (legacy)Legacy.windsurfrules

.windsurfrules
# Project rules Stack: TypeScript, Remix / React Router, Tailwind CSS, Vitest, pnpm. Follow these rules on every task. If a rule disagrees with existing code, match the code and mention the difference. If a rule disagrees with a direct user instruction, follow the user. ## Working agreement - Read the files you will change before editing them. Do not invent the project layout from memory.- Change only what the task needs. No drive-by refactors, renames, or formatting of untouched lines.- Match the patterns already in the repo over a generic style guide.- Do not add dependencies, config files, or abstractions the task did not ask for.- Do not commit secrets, and do not paste `.env` values, tokens, or private keys into code or chat.- If a requirement is ambiguous, choose the smallest reading, state that assumption, and continue. ## Commands - JavaScript package manager is pnpm. The lockfile to commit is pnpm-lock.yaml. Do not add a second lockfile.- Install: `pnpm install`.- Dev server: `pnpm dev` when that script exists.- Lint: `pnpm lint` when that script exists. Typecheck with the project's typecheck script or `tsc --noEmit` if the repo uses it.- Build: `pnpm build` when you changed a build path.- Tests: `pnpm test`. Single pass, not watch mode: `pnpm exec vitest run`.- Run the narrowest command that checks the change. Do not loop install, build, or the full test suite. ## TypeScript - Leave `strict` on. Do not weaken `tsconfig` to make a build pass.- No new `any`, and no `// @ts-ignore`. Use `unknown` and narrow. `@ts-expect-error` needs a reason on that line.- Match the file's style for `type` versus `interface`. Prefer a string union over a new `enum` unless the file already uses enums.- Use `import type` for type-only imports. Await promises. Do not leave a promise floating.- Do not use a non-null assertion on a value that came from outside the function. Narrow it instead. ## Remix and React Router - Use the packages already in `package.json`. React Router 7 (`react-router`) and Remix v2 (`@remix-run/*`) are different. Do not install the other one.- Loaders return data. Actions handle writes. Do not refetch loader data in an effect.- Validate form data and URL params inside the loader or action before use.- Return the project's error shape with a real HTTP status. Do not swallow loader errors.- Use the router's `Link` and `Form`. Do not import server-only modules into a component that also runs on the client. ## Tailwind CSS - Style with Tailwind utilities. Do not add a CSS file or a CSS-in-JS library for a one-off.- Tailwind v4 is configured in CSS with `@theme` and usually has no `tailwind.config.js`. Tailwind v3 uses that config file. Do not add the other version's config.- Use the project's color, spacing, and radius tokens. Do not invent a second palette of arbitrary values.- Mobile-first breakpoints. Every control keeps a visible focus style. Icon-only buttons need an accessible name.- If `prettier-plugin-tailwindcss` is installed, let it order classes. Use `dark:` only when the project already has a dark theme. ## Vitest - Put tests next to the code as `*.test.ts`, or in the folder the repo already uses.- Use `describe`, `it`, and `expect`. A test name states the behavior.- Assert on values, text, or roles. Do not snapshot a whole component tree.- Mock only network, time, or the filesystem. Do not mock the function under test.- Run one pass with `vitest run` or the project's test script. Do not leave watch mode running. ## pnpm - pnpm is the package manager. The lockfile is `pnpm-lock.yaml`. Do not commit another JavaScript lockfile.- Add packages with `pnpm add <pkg>` and dev packages with `pnpm add -D <pkg>`. Run scripts with `pnpm <script>`. ## Testing expectations - When you fix a bug, add a test that fails before the fix and passes after, in the repo's current test style.- When you change behavior a caller can observe, update or add a test for that behavior.- Do not test private helpers, framework internals, or third-party libraries. ## Code style - Keep strict type and lint settings on. Do not weaken them to get a green build.- No new `any`, and no empty catch blocks. Prefer `unknown` and narrowing. Handle every fallible call.- Give exported functions an explicit type when the inferred type is not obvious.- Follow the repo formatter. Do not hand-format files the formatter owns.- Do not add comments that restate the code.- Comment only a constraint, invariant, or tradeoff the code itself cannot show.- No file-header banners and no changelog comments. ## Safety - Never commit `.env`, keystores, or credential files. When a new variable is required, add an empty placeholder to the example env file.- Do not disable authentication, authorization, or TLS checks to make a test pass.- Do not force-push, `reset --hard`, drop a database, or delete a directory tree unless the user asked for that exact action.- Do not edit vendored or generated output (`node_modules`, `dist`, `.next`, `vendor`, `Library`, `.godot`). Change the source and regenerate. ## Done when - The change does what was asked and nothing extra.- New or changed behavior is covered at the level in Testing expectations.- The commands in this file that apply to the touched files have been run, or you say which command you could not run.- The diff has no unrelated files, lockfile churn, or secrets. 

Install

  1. Save as `.windsurfrules` in the project root if your build still asks for that filename.
  2. This file is always on and cannot be scoped. Prefer `.devin/rules/project.md` on current builds.
GitHub CopilotUse this.github/copilot-instructions.md

.github/copilot-instructions.md
# Project rules Stack: TypeScript, Remix / React Router, Tailwind CSS, Vitest, pnpm. Follow these rules on every task. If a rule disagrees with existing code, match the code and mention the difference. If a rule disagrees with a direct user instruction, follow the user. ## Working agreement - Read the files you will change before editing them. Do not invent the project layout from memory.- Change only what the task needs. No drive-by refactors, renames, or formatting of untouched lines.- Match the patterns already in the repo over a generic style guide.- Do not add dependencies, config files, or abstractions the task did not ask for.- Do not commit secrets, and do not paste `.env` values, tokens, or private keys into code or chat.- If a requirement is ambiguous, choose the smallest reading, state that assumption, and continue. ## Commands - JavaScript package manager is pnpm. The lockfile to commit is pnpm-lock.yaml. Do not add a second lockfile.- Install: `pnpm install`.- Dev server: `pnpm dev` when that script exists.- Lint: `pnpm lint` when that script exists. Typecheck with the project's typecheck script or `tsc --noEmit` if the repo uses it.- Build: `pnpm build` when you changed a build path.- Tests: `pnpm test`. Single pass, not watch mode: `pnpm exec vitest run`.- Run the narrowest command that checks the change. Do not loop install, build, or the full test suite. ## TypeScript - Leave `strict` on. Do not weaken `tsconfig` to make a build pass.- No new `any`, and no `// @ts-ignore`. Use `unknown` and narrow. `@ts-expect-error` needs a reason on that line.- Match the file's style for `type` versus `interface`. Prefer a string union over a new `enum` unless the file already uses enums.- Use `import type` for type-only imports. Await promises. Do not leave a promise floating.- Do not use a non-null assertion on a value that came from outside the function. Narrow it instead. ## Remix and React Router - Use the packages already in `package.json`. React Router 7 (`react-router`) and Remix v2 (`@remix-run/*`) are different. Do not install the other one.- Loaders return data. Actions handle writes. Do not refetch loader data in an effect.- Validate form data and URL params inside the loader or action before use.- Return the project's error shape with a real HTTP status. Do not swallow loader errors.- Use the router's `Link` and `Form`. Do not import server-only modules into a component that also runs on the client. ## Tailwind CSS - Style with Tailwind utilities. Do not add a CSS file or a CSS-in-JS library for a one-off.- Tailwind v4 is configured in CSS with `@theme` and usually has no `tailwind.config.js`. Tailwind v3 uses that config file. Do not add the other version's config.- Use the project's color, spacing, and radius tokens. Do not invent a second palette of arbitrary values.- Mobile-first breakpoints. Every control keeps a visible focus style. Icon-only buttons need an accessible name.- If `prettier-plugin-tailwindcss` is installed, let it order classes. Use `dark:` only when the project already has a dark theme. ## Vitest - Put tests next to the code as `*.test.ts`, or in the folder the repo already uses.- Use `describe`, `it`, and `expect`. A test name states the behavior.- Assert on values, text, or roles. Do not snapshot a whole component tree.- Mock only network, time, or the filesystem. Do not mock the function under test.- Run one pass with `vitest run` or the project's test script. Do not leave watch mode running. ## pnpm - pnpm is the package manager. The lockfile is `pnpm-lock.yaml`. Do not commit another JavaScript lockfile.- Add packages with `pnpm add <pkg>` and dev packages with `pnpm add -D <pkg>`. Run scripts with `pnpm <script>`. ## Testing expectations - When you fix a bug, add a test that fails before the fix and passes after, in the repo's current test style.- When you change behavior a caller can observe, update or add a test for that behavior.- Do not test private helpers, framework internals, or third-party libraries. ## Code style - Keep strict type and lint settings on. Do not weaken them to get a green build.- No new `any`, and no empty catch blocks. Prefer `unknown` and narrowing. Handle every fallible call.- Give exported functions an explicit type when the inferred type is not obvious.- Follow the repo formatter. Do not hand-format files the formatter owns.- Do not add comments that restate the code.- Comment only a constraint, invariant, or tradeoff the code itself cannot show.- No file-header banners and no changelog comments. ## Safety - Never commit `.env`, keystores, or credential files. When a new variable is required, add an empty placeholder to the example env file.- Do not disable authentication, authorization, or TLS checks to make a test pass.- Do not force-push, `reset --hard`, drop a database, or delete a directory tree unless the user asked for that exact action.- Do not edit vendored or generated output (`node_modules`, `dist`, `.next`, `vendor`, `Library`, `.godot`). Change the source and regenerate. ## Done when - The change does what was asked and nothing extra.- New or changed behavior is covered at the level in Testing expectations.- The commands in this file that apply to the touched files have been run, or you say which command you could not run.- The diff has no unrelated files, lockfile churn, or secrets. 

Install

  1. Create `.github/` if needed and save this file as `.github/copilot-instructions.md`.
  2. Commit it. Copilot picks up repository instructions for Chat and, on supported plans, code review and the cloud agent.
  3. For rules that should only affect some files, add `.github/instructions/<name>.instructions.md` with `applyTo` frontmatter instead of growing this file.
Codex + AGENTS.mdAGENTS.md

AGENTS.md
# Project rules Stack: TypeScript, Remix / React Router, Tailwind CSS, Vitest, pnpm. Follow these rules on every task. If a rule disagrees with existing code, match the code and mention the difference. If a rule disagrees with a direct user instruction, follow the user. ## Working agreement - Read the files you will change before editing them. Do not invent the project layout from memory.- Change only what the task needs. No drive-by refactors, renames, or formatting of untouched lines.- Match the patterns already in the repo over a generic style guide.- Do not add dependencies, config files, or abstractions the task did not ask for.- Do not commit secrets, and do not paste `.env` values, tokens, or private keys into code or chat.- If a requirement is ambiguous, choose the smallest reading, state that assumption, and continue. ## Commands - JavaScript package manager is pnpm. The lockfile to commit is pnpm-lock.yaml. Do not add a second lockfile.- Install: `pnpm install`.- Dev server: `pnpm dev` when that script exists.- Lint: `pnpm lint` when that script exists. Typecheck with the project's typecheck script or `tsc --noEmit` if the repo uses it.- Build: `pnpm build` when you changed a build path.- Tests: `pnpm test`. Single pass, not watch mode: `pnpm exec vitest run`.- Run the narrowest command that checks the change. Do not loop install, build, or the full test suite. ## TypeScript - Leave `strict` on. Do not weaken `tsconfig` to make a build pass.- No new `any`, and no `// @ts-ignore`. Use `unknown` and narrow. `@ts-expect-error` needs a reason on that line.- Match the file's style for `type` versus `interface`. Prefer a string union over a new `enum` unless the file already uses enums.- Use `import type` for type-only imports. Await promises. Do not leave a promise floating.- Do not use a non-null assertion on a value that came from outside the function. Narrow it instead. ## Remix and React Router - Use the packages already in `package.json`. React Router 7 (`react-router`) and Remix v2 (`@remix-run/*`) are different. Do not install the other one.- Loaders return data. Actions handle writes. Do not refetch loader data in an effect.- Validate form data and URL params inside the loader or action before use.- Return the project's error shape with a real HTTP status. Do not swallow loader errors.- Use the router's `Link` and `Form`. Do not import server-only modules into a component that also runs on the client. ## Tailwind CSS - Style with Tailwind utilities. Do not add a CSS file or a CSS-in-JS library for a one-off.- Tailwind v4 is configured in CSS with `@theme` and usually has no `tailwind.config.js`. Tailwind v3 uses that config file. Do not add the other version's config.- Use the project's color, spacing, and radius tokens. Do not invent a second palette of arbitrary values.- Mobile-first breakpoints. Every control keeps a visible focus style. Icon-only buttons need an accessible name.- If `prettier-plugin-tailwindcss` is installed, let it order classes. Use `dark:` only when the project already has a dark theme. ## Vitest - Put tests next to the code as `*.test.ts`, or in the folder the repo already uses.- Use `describe`, `it`, and `expect`. A test name states the behavior.- Assert on values, text, or roles. Do not snapshot a whole component tree.- Mock only network, time, or the filesystem. Do not mock the function under test.- Run one pass with `vitest run` or the project's test script. Do not leave watch mode running. ## pnpm - pnpm is the package manager. The lockfile is `pnpm-lock.yaml`. Do not commit another JavaScript lockfile.- Add packages with `pnpm add <pkg>` and dev packages with `pnpm add -D <pkg>`. Run scripts with `pnpm <script>`. ## Testing expectations - When you fix a bug, add a test that fails before the fix and passes after, in the repo's current test style.- When you change behavior a caller can observe, update or add a test for that behavior.- Do not test private helpers, framework internals, or third-party libraries. ## Code style - Keep strict type and lint settings on. Do not weaken them to get a green build.- No new `any`, and no empty catch blocks. Prefer `unknown` and narrowing. Handle every fallible call.- Give exported functions an explicit type when the inferred type is not obvious.- Follow the repo formatter. Do not hand-format files the formatter owns.- Do not add comments that restate the code.- Comment only a constraint, invariant, or tradeoff the code itself cannot show.- No file-header banners and no changelog comments. ## Safety - Never commit `.env`, keystores, or credential files. When a new variable is required, add an empty placeholder to the example env file.- Do not disable authentication, authorization, or TLS checks to make a test pass.- Do not force-push, `reset --hard`, drop a database, or delete a directory tree unless the user asked for that exact action.- Do not edit vendored or generated output (`node_modules`, `dist`, `.next`, `vendor`, `Library`, `.godot`). Change the source and regenerate. ## Done when - The change does what was asked and nothing extra.- New or changed behavior is covered at the level in Testing expectations.- The commands in this file that apply to the touched files have been run, or you say which command you could not run.- The diff has no unrelated files, lockfile churn, or secrets. 

Install

  1. Save as `AGENTS.md` in the project root. Codex, Cursor, Copilot CLI, Devin, and many other agents look for this name.
  2. The file is plain Markdown. Do not add frontmatter.
  3. In a monorepo, add a nested AGENTS.md next to a service that needs different commands. Do not leave an empty `AGENTS.override.md` beside it. Codex treats that empty file as the instructions for the folder.
  4. Commit it and start a new agent session.

What each section does

Working agreement

The habits that keep an agent from rewriting the repo while it solves a small task.

Commands

The install, dev, test, and lint commands for this stack, so the agent runs the project's tools instead of guessing.

TypeScript

Keeps the compiler strict and tells the agent how to type new code.

Remix and React Router

Prevents mixing Remix v2 packages with React Router 7, which replaced them.

Tailwind CSS

Uses utility classes and the Tailwind major version already installed, including the v4 CSS-first config.

Vitest

How to write a Vitest test when this stack asks for one.

pnpm

Locks the repo to pnpm so npm and yarn lockfiles do not appear.

Testing expectations

How much test coverage this project wants from the agent, separate from which test runner is installed.

Code style

How strict the types, lint, and comments should be. This is the knob most people actually want to change.

Safety

Hard stops: secrets, destructive git commands, and generated folders.

Done when

The checklist the agent should satisfy before it calls the task finished.

Questions

I use React Router 7, not Remix. Is this the right page?

Yes. The rule covers both and tells the agent not to install the package family you do not have.

Should loaders refetch in useEffect?

No. The rule says loader data is the source for that route and should not be fetched again in an effect.

Newsletter

Stack notes, occasionally

A short email when a tool changes its rules filename or a new stack page ships. No product drip. If this form is not connected yet, your address is not stored.