Covel is a pnpm/Turborepo TypeScript modular monolith: plugins carry gameplay logic, while the kernel supplies primitives and orchestration. Deployable targets live in apps/: web is the React/Vite client, server is the Hono API, and desktop is the Electron shell. Shared framework code belongs in packages/. Each plugins/<name>/ package requires PLUGIN.md and package.json; optional capabilities live in prompts/, schemas/, server/, client/, ui/, or tests/. World content and shared prompts live in worlds/ and prompts/. Keep maintained documentation in docs/ and temporary plans, audits, or handoff notes in devs/docs/. Unit tests are colocated in workspace tests/ or __tests__/; browser flows live in tests/e2e/.
pnpm install --frozen-lockfileinstalls the Node 26+/pnpm 11.22 workspace.pnpm devstarts the Vite client and API server;pnpm buildbuilds all Turbo targets.pnpm lintruns workspace TypeScript checks;pnpm formatapplies Prettier.pnpm testruns all Vitest suites; target one package withpnpm --filter @covel/runtime test.pnpm e2eruns Playwright; usepnpm db:upbefore PostgreSQL-backed tests.
Use strict TypeScript and ESM. Follow Prettier output (two-space indentation, double quotes, semicolons) and include .js extensions in TypeScript relative imports for NodeNext resolution. Use camelCase for values/functions, PascalCase for types and React components, and kebab-case module names. Avoid bare any; validate external input with Zod. Aim for at most 400 lines per file; 800 is the hard limit.
Framework code in packages/, apps/server/src/, and apps/web/src/ must not branch on concrete plugin IDs. Discover behavior through manifest capabilities and outputKind. Update the matching docs/reference/ page whenever a framework-visible contract changes.
Name Vitest files *.test.ts or *.test.tsx and Playwright files *.spec.ts. Add focused regression tests for features and fixes. The coverage goal is at least 80% (pnpm test:coverage), but CI does not currently enforce it.
Use Conventional Commits, for example fix(web): stabilize session restore; common types include feat, fix, refactor, docs, test, and chore. Branch from and target main. Complete the PR template with rationale, verification, related context, and documentation updates. Run pnpm lint and pnpm test; include pnpm e2e for UI or end-to-end changes. Mark breaking changes with a BREAKING CHANGE: footer.
Copy .env.example, .env.llm.example, and llm.toml.example for local setup. Never commit provider keys, generated local data, or machine-specific configuration.