This document is for developers working on apps/server, apps/web, or the shared packages.
apps/server local API server, runner, policy, scheduler, Telegram
apps/web mobile-first browser UI with PWA foundation
packages/api-types shared domain types
packages/policy-engine rule evaluation only
docs/ product and operations documentation
examples/ policy and later integration examples
npm run setup:quickPreferred onboarding path on Windows:
- creates
.env.local.ps1 - installs dependencies
- installs Playwright Chromium
- builds the repo
On macOS/Linux, the same quick path works when pwsh is installed. Without a PowerShell runtime, use the manual path below.
Full manual path:
npm install
npx playwright install --with-deps chromium
npm run typecheck
npm run lint
npm run build
npm run test:runFor local feature work, stub mode is usually the fastest:
. .\.env.local.ps1
$env:CC_CODEX_RUNNER_MODE="stub"
$env:CC_API_TOKEN="replace-with-a-strong-token"
npm run start --workspace @codex-command-center/server- Identify the feature or bug in the correct layer.
- Update shared types first when API or domain types change.
- Update server logic and persistence.
- Change web app code only against the real API contract, not imagined data shapes.
- Extend regression or browser tests when runtime paths are affected.
- Run
typecheck,lint,build, andtest:runlocally to pass.
packages/api-types/src/index.ts- then align server persistence, HTTP routes, and web types
packages/policy-engine/src/index.tsfor pure rule evaluationapps/server/src/policy.tsfor persistence, approval creation, and expiry behavior- matching regression tests in
apps/server/test/regression.test.mjs
apps/server/src/runner.tsapps/server/src/http.ts- possibly
apps/server/src/automation.ts
apps/web/src/main.tsapps/web/src/api.tsapps/web/src/styles.css- for PWA behavior, also
apps/web/sw.jsandapps/web/e2e/pwa.spec.mjs
Server side:
- regression tests in
apps/server/test/regression.test.mjs - focus on real HTTP and runtime paths
Browser side:
- Playwright in
apps/web/e2e/pwa.spec.mjs - currently focused especially on service worker and PWA behavior
Required checks before review:
npm run typechecknpm run lintnpm run buildnpm run test:run
- Always test policy and approval paths as runtime behavior, not only static checks
- Model API errors explicitly as
400,401,404,409, or202 - with Telegram, distinguish hard secret errors from silently ignored unauthorized chats
- never deliver API data from the service worker as cache-first
- do not let desktop assumptions override mobile UX