Copy this file into the root of your project as AGENTS.md.
AGENTS.md
Project
A Turborepo monorepo containing:
apps/web— Next.js marketing + product siteapps/admin— Vite + React admin SPAapps/api— Hono API (deployed to Cloudflare Workers)packages/ui— shared shadcn-based component librarypackages/db— Prisma client + schema, shared by api and webpackages/config-eslint— shared ESLint configpackages/config-tsconfig— sharedtsconfig.jsonpresets
Package manager: pnpm. Workspaces are declared in pnpm-workspace.yaml.
Commands
pnpm install— install everythingpnpm dev— run all apps in parallel (Turborepo)pnpm dev --filter=web— run a single apppnpm build— build everything in dependency orderpnpm typecheck— runtscacross all packagespnpm lint— ESLint across all packagespnpm test— Vitest across all packagespnpm changeset— record a versioned change
Code style
- TypeScript strict everywhere. Each package extends from
@repo/config-tsconfig/base.json. - All internal packages are imported via
@repo/<name>. No relative paths across package boundaries. - ESLint extends from
@repo/config-eslint. - Every package has a
package.jsonwithname,version, andexportsmap. Nomain/module— useexportsonly.
Stack rules
Adding a new package
- Create the folder under
packages/. - Add
package.jsonwith"name": "@repo/<name>","private": true. - Add
tsconfig.jsonextending@repo/config-tsconfig/library.json. - Add
exportsmap. No barrel files for large packages — export by sub-path. - Run
pnpm installto link.
Adding a dependency
- App-only dependency → install in the app:
pnpm add <pkg> --filter=web. - Shared across packages → install in the relevant package and re-export.
- Never install the same dependency in two places — extract to a shared package.
Turborepo
- Tasks are declared in
turbo.json. Each task lists itsdependsOnandoutputs. - Caching is on by default. If a task seems to give stale results, run with
--force. - Remote cache is configured via
TURBO_TOKEN/TURBO_TEAMenv vars.
Before editing
- Identify whether the change belongs in an app or a shared package.
- If editing a shared package, run
pnpm typecheckafterwards — type changes affect consumers. - For breaking changes to a shared package, add a Changeset (
pnpm changeset).
Constraints
- Do not introduce a second package manager. pnpm is fixed.
- Do not bypass workspace protocols (
workspace:*). Internal deps are always linked. - Do not put app-specific code into a shared package. The dependency direction is apps → packages, never the reverse.
- Do not commit
.next,dist,.turbo, ornode_modules.