Thanks for helping improve CorpSim. This file explains the expected workflow for changes, tests, and pull requests.
- Open a pull request for any change. Direct pushes to
mainare blocked. - Keep PRs small and focused.
- Don’t commit secrets (tokens, client secrets, passwords). Use environment variables.
- If you change gameplay/economy rules, add tests.
- Follow the repo golden rules in
docs/agents/AGENTS.md.
Prereqs:
- Node.js 20+
- pnpm
- Docker (for Postgres/Redis)
Install dependencies:
pnpm installStart infra:
docker compose up -d postgres redisApply migrations + seed (dev only):
pnpm -C packages/db prisma migrate dev
pnpm -C packages/db seedRun apps:
pnpm -C apps/api dev
pnpm -C apps/worker dev
pnpm -C apps/web devBefore any work that mutates the running game state (migrations, seed/reset, write scripts, or changes that require it), enable maintenance mode:
pnpm maintenance:on --reason "Short reason"When done:
pnpm maintenance:offIf no local services are running, the command will no-op and you can keep coding.
For any non-trivial change, add a file under .releases/unreleased/*.md with frontmatter:
---
type: patch
area: api
summary: One-line description of what changed.
---Notes:
- Don’t bump
package.jsonversions in normal commits. - A version bump happens only via the release cut process (
pnpm release:cut), typically by maintainers.
Run these before opening a PR:
pnpm typecheck
pnpm lint
pnpm testCI runs a Verify Gate check. Some documentation-only changes may skip heavier jobs, but you should still keep PRs clean and reviewable.
- TypeScript strict, avoid
any. - Keep business logic out of controllers/routes. Put it in services/modules.
- The simulation should remain deterministic: no random behavior without explicit, seeded inputs.
- Keep
packages/simfree of auth/session concerns.
- Use Prisma migrations (
packages/db/prisma/migrations). - Avoid manual SQL unless necessary; document it if you must.
- Treat migrations as production-impacting: coordinate and keep them small.
- Never commit secrets. If a secret is exposed, rotate it immediately.
- Avoid storing tokens in
localStoragein the web app; prefer secure cookies/sessions. - Report security issues privately if the repo has a security policy (
SECURITY.md).
- PR is small and focused
- Tests added/updated (if behavior changed)
-
.releases/unreleased/*.mdentry added (if applicable) -
pnpm typecheck && pnpm lint && pnpm testpass locally - No secrets in commits