dev
Start, stop or troubleshoot the local development stack. Use when the user wants to run the app, see it in the browser, turn on optional services (AI and Director, file uploads), or when a local servi
SKILL.md.claude/skills/dev/SKILL.md
GitHubLocal development
bun devruns the core profile: Postgres (localhost:55432), Valkey (:56379) and Mailpit in Docker, plus web (http://localhost:3000), api (http://localhost:3001) and the worker (:3002), notifications (:3003) and webhooks (:3004) services, all in turbo's terminal UI.bun dev:fulladds every optional service: the Python AI service (:8000), S3 storage (RustFS on :59000, console http://localhost:59001), ClamAV (:53310) and the email previews (http://localhost:3030). Uploads stay off untilbun run env:set S3_BUCKET=uploads; Director needs them and a real Gemini and YouTube key (docs/director.md). Neitherbun devnorbun dev:fullstarts the mock Google (:12112): it's a test fixture only (bun run google:fakestarts it by hand).- Emails never leave the machine: open Mailpit at http://localhost:58025 to read sign-up codes and security alerts.
- Every port, the services' and the apps', comes from
.env(POSTGRES_PORT,WEB_PORT,API_PORT, …; the numbers above are.env.example's defaults); if one is taken, see the setup skill.
bun dev and bun dev:full are long-running terminal UIs: in an agent session, start
them with the Bash tool's run_in_background and read their output from there, never
in the foreground (the call would hang until its timeout). On a first dev:full, ClamAV
starts in the background while it downloads its virus signatures (several minutes):
uploads stay pending until then.
Several branches at once
wt switch --create <branch> (Worktrunk, .config/wt.toml) makes a worktree next to
this checkout, copies .env, installs and generates; wt switch <branch> moves between
them and wt list shows each one's state. They all use this machine's Docker services
(docker-compose.yml names the project), so tests and builds run side by side. To run
bun dev or bun run test:e2e in two at once, give one its own stack first:
bun run setup --stack 1 moves its services and apps 100 ports up (web on 3100, api on
3101, ...; docs/environment.md). wt remove
(which asks first) deletes a worktree and its merged branch. Without Worktrunk
(bun run doctor says so), brew install worktrunk && wt config shell install.
Troubleshooting
bun run doctor. It lists the exact fix for tools,.envdrift and services.- Service logs:
docker compose logs <postgres|valkey|mailpit|rustfs|clamav> --tail 100. - App logs are in the turbo UI. Every request has an
x-request-id; search logs by it (the debug skill has the rest). - After changing the Prisma schema, Pydantic models or the API contract, run
bun run gen. - Stale state:
bun run db:downthenbun dev(keeps data). Wiping data (bun run docker:clean, which deletes every container, volume and image this repo created) needs the user's confirmation: the Bash guard asks before it runs. - Uploads stay pending after the stack has run for hours: the local ClamAV stopped
answering (the worker logs
clamd timed out).docker compose restart clamav. - A port is taken:
lsof -nP -iTCP:<port> -sTCP:LISTEN, then the setup skill.