This repository includes the source code for Remix 3, a web framework for building modern web applications using TypeScript/JavaScript and web standard APIs.
- Monorepo: pnpm workspace with most product code under
packages/ - Public API layout: every
exportsentry inpackage.jsonshould map to a dedicated top-levelsrc/*.tsfile - Implementation layout:
src/libis implementation-only; do not add barrel re-exports or thin pass-through wrappers insidesrc/lib - Cross-package boundaries: do not re-export APIs or types from another package; import from the owning package directly
- Platform stance: prefer Web APIs and standards-aligned primitives over Node-specific APIs whenever possible
- Fast local loop:
pnpm run lint,pnpm run test:changed,pnpm run typecheck:changed - Full CI-style validation:
pnpm testandpnpm run typecheck - When to use full runs locally: broad cross-workspace changes, shared root config changes, release/publish flow changes, or anything that could affect the whole repo
- Single package commands:
pnpm --filter @remix-run/<package> run test,pnpm --filter @remix-run/<package> run typecheck,pnpm --filter @remix-run/<package> run build - Single test file:
cd packages/<package> && pnpm test src/**/<filename>.test.ts - Lint:
pnpm run lintorpnpm run lint:fix - Format:
pnpm run formatorpnpm run format:check
The changed-workspace commands default to diffing against origin/main and include uncommitted working tree changes when head-ref is HEAD.
- Imports: use
import type { X }andexport type { X }; include.tsextensions - Variables: use
letfor locals,constfor module scope, nevervar - Functions: use regular functions by default; use arrow functions for callbacks; use concise arrow bodies when they only return an expression
- Object methods: use shorthand method syntax
- Classes: omit TS accessibility modifiers; use native fields and
#private - Generics: use descriptive lowercase names like
source,pattern, ormethod - Comments: add non-JSDoc comments only when behavior is surprising or non-obvious
- Formatting: Prettier with
printWidth: 100, no semicolons, single quotes, spaces not tabs
- Tests run from source: no build step required
- Test structure: do not generate tests inside
describe()with loops or conditionals; it breaks per-test IDE execution - Test guidance: use the
write-testsskill when adding, refactoring, or reviewing tests, fixtures, test scripts, or test-only dependencies - Docs and examples: if you change a public API, update the related docs, JSDoc, README examples, and tests in the same change
- README/install conventions: use
npm i remixin install snippets and import fromremix, not@remix-run/* - README link conventions: use full GitHub URLs for cross-file or cross-package repo links so copied docs render correctly; keep same-document anchors and README self-links relative
- If a change affects published packages, add or update the appropriate change file.
- Prerelease channels come from
packages/*/.changes/config.jsonand control the version suffix such asalphaorbeta; prerelease packages still publish to the npmnextdist-tag. - If you modify release or publish flow code, validate it with the preview or dry-run scripts before finishing.
For work on this repository itself, use the skills in .agents/skills/:
add-packageat.agents/skills/add-package/SKILL.md: Create or align a package underpackages/with repo conventions.author-ui-modulesat.agents/skills/author-ui-modules/SKILL.md: Build idiomaticpackages/uimodules, including first-party UI primitives, headless controls, and mixin-based modules.expert-typescript-programmerat.agents/skills/expert-typescript-programmer/SKILL.md: Write, refactor, or review TypeScript with strict, precise, maintainable types.fix-issueat.agents/skills/fix-issue/SKILL.md: Fix bugs reported in GitHub issues.write-testsat.agents/skills/write-tests/SKILL.md: Write, refactor, or review tests with repo runner, fixture, assertion, dependency, and validation conventions.make-change-fileat.agents/skills/make-change-file/SKILL.md: Create or update package change files underpackages/*/.changes.make-decision-docat.agents/skills/make-decision-doc/SKILL.md: Add a numbered decision document underdecisions/capturing a non-obvious architectural choice.make-demoat.agents/skills/make-demo/SKILL.md: Create or revise demos in this repository with production-quality Remix patterns.make-prat.agents/skills/make-pr/SKILL.md: Prepare and open clear, reviewer-friendly pull requests.publish-placeholder-packageat.agents/skills/publish-placeholder-package/SKILL.md: Publish a0.0.0placeholder package to reserve an npm name.review-prat.agents/skills/review-pr/SKILL.md: Review Remix pull requests from a local checkout.supersede-prat.agents/skills/supersede-pr/SKILL.md: Replace one pull request with another and close the superseded PR safely.update-prat.agents/skills/update-pr/SKILL.md: Rewrite an existing pull request title and body to match the current diff.write-api-docsat.agents/skills/write-api-docs/SKILL.md: Write or tighten JSDoc for exported public APIs.write-readmeat.agents/skills/write-readme/SKILL.md: Draft or revise package READMEs in the repo's style.write-ui-module-readmeat.agents/skills/write-ui-module-readme/SKILL.md: Write concise module README files forpackages/ui/src/lib/*primitives.
For working on Remix code in demos or writing Remix app code, use the skills in skills/:
remixatskills/remix/SKILL.md: Build, review, and refactor Remix apps end to end, including project layout, routes, controllers, middleware, validation, data access, auth, sessions, uploads, UI, hydration, navigation, animations, and tests.