ZeRo OS monorepo built with Bun + TypeScript.
- Deliver working, minimal, testable changes.
- Prefer small, behavior-safe diffs over broad refactors.
- Preserve runtime stability for server, websocket, session, tool, and chat flows.
- Default to completing the requested change end-to-end in one pass: explore, implement, verify, and summarize.
- Be autonomous, but not reckless: make reasonable assumptions and move forward unless truly blocked.
- Do the work, not just the plan. Avoid stopping after analysis when implementation is feasible.
- Prefer fixing root causes over patching symptoms.
- Stay scoped to the user's request. Do not opportunistically refactor unrelated areas.
- If you notice unexpected unrelated changes in files you need to touch, stop and ask before proceeding.
- Runtime/package manager: Bun
- Language: TypeScript (ESM)
- Monorepo: workspaces in
apps/*,packages/* - Web: Vite + React + Hono + Bun.serve
- E2E: Playwright
- Lint/format: Biome
apps/server: ZeRo OS bootstrap, CLI, runtime (src/cli.ts,src/main.ts)apps/web: UI and API/web server integration (src/server.ts)apps/supervisor: supervisor app entrypackages/core|model|memory|observe|secrets|channel|scheduler|supervisor|shared: domain modulese2e: end-to-end tests.zero: local runtime state (logs, memory, secrets, workspace) — treat as operational data, not product source
- Never print, paste, or commit secret values.
- Never modify
.zero/secrets.encby direct file editing. - Do not commit
.zero/*,dist,node_modules, ortest-results. - Avoid destructive actions unless explicitly requested.
- Never revert or overwrite user changes you did not make.
- Keep changes scoped to the requested task only.
- Prefer dedicated tools over raw shell when available.
- Prefer
rgfor text search andrg --filesfor file discovery. - Read enough surrounding context before editing; avoid repeated tiny blind edits.
- Batch related reads/searches when possible instead of exploring one file at a time.
- Use shell for tasks that truly require execution, repo-wide validation, or tooling not exposed elsewhere.
- Follow existing code patterns, naming, helpers, and package boundaries before introducing new abstractions.
- Reuse existing utilities when possible; do not duplicate logic without a good reason.
- Keep public exports and cross-package contracts stable unless the task explicitly requires breaking changes.
- Preserve behavior by default; if behavior changes intentionally, make it explicit in the summary and add/update tests when appropriate.
- Avoid broad catch-all error handling or silent fallbacks that hide failures.
- Prefer concise, maintainable diffs over cleverness.
- Follow existing style via Biome:
- 2 spaces
- single quotes
- no semicolons
- line width ~100
- Keep TypeScript type safety intact; avoid unnecessary casts such as
any. - Add comments only when they clarify non-obvious intent.
- Validate every code change with at least one relevant command.
- For TypeScript changes,
bun run checkis the default baseline. - Run the narrowest useful validation first, then broaden if risk is higher.
- Place new test files under a nearby
__tests__directory instead of alongside product code. Legacy colocated tests may remain unless the task explicitly calls for migration. - Preferred validation choices:
bun run checkfor TS/type-level changesbun run testfor logic changesbun run test:e2efor UI/API/session/websocket behavior- targeted test commands if a smaller relevant scope exists
- If you cannot run a needed validation, say so clearly and explain why.
- Install deps:
bun install - Type check:
bun run check - Lint:
bun run lint - Unit/integration tests:
bun run test - E2E:
bun run test:e2e - Start system:
bun zero start - Web dev/build:
bun run dev:webbun run build:web
- Identify the relevant files, then read/search broadly enough to understand current behavior.
- Implement the smallest coherent patch that solves the actual problem.
- Verify with at least one relevant command; use broader validation for higher-risk changes.
- Summarize clearly:
- files changed
- why the change was made
- verification commands and results
- any risks, assumptions, or follow-ups
- If touching session, tool, or memory flows (
apps/server,packages/core,packages/memory,packages/observe), prioritize regression safety and logging consistency. - If touching websocket or UI routing (
apps/web, relevante2e/*), run relevant e2e coverage when feasible. - If touching scheduler or channel integrations, preserve backward compatibility and graceful error surfacing.
- If touching secrets or operational state handling, be extra careful not to expose or mutate local runtime data unintentionally.
- Be concise and concrete.
- Lead with what changed and why.
- Do not dump large file contents unless explicitly requested.
- Mention blockers early if the task cannot be completed safely.