This repository orchestrates multi-project agent workflows across CLI, server, database, adapter, landing, and web UI packages. Keep behavior project-agnostic and avoid coupling workflow logic to a single workspace.
Use this loop for every coding-agent session so work starts from repo truth, stays scoped, and ends with evidence the next session can trust.
- Start from current state:
- Confirm the working directory and read this root
AGENTS.md. - Check
git status --short --branch; identify unrelated dirty files and do not modify, stage, revert, or explain them away as part of your work. - Before implementation edits, sync
mainaccording to the Shared Must-Follow Rules below. If the sync cannot complete, stop and report the blocker instead of building on stale code. - Read the closest package-local
AGENTS.mdbefore changing package code. - Consult existing repo records when relevant:
docs/PLANS.mdfor active execution plans,docs/QUALITY_SCORE.mdfor quality posture, and nearby README or domain docs for package-specific behavior.
- Confirm the working directory and read this root
- Scope one change:
- Work on one user request, feature, or fix at a time.
- Before editing, state the goal, success criteria, and expected files or modules to change.
- Keep supporting fixes narrow and directly tied to the scoped goal; record adjacent cleanup or unrelated risk instead of silently expanding scope.
- Implement with verification in mind:
- Preserve public contracts, parser markers, package boundaries, and project-agnostic workflow behavior unless the request explicitly changes them.
- Add or update focused tests when behavior changes, and choose the smallest validation path that proves the scoped change before wider gates.
- Do not treat code edits as completion; completion requires evidence from checks, inspected output, or a clearly documented blocker.
- Close cleanly:
- Re-check
git status --short --branchand confirm the changed files match the scoped work plus any pre-existing unrelated changes. - Report verification commands run, commands skipped, failures, blockers, and residual risk.
- Leave enough context in the final response for the next session to continue without guessing.
- Re-check
- Before executing agent workflow work, pull the latest code from
mainso runs start from current repository state. Fetchorigin/main, update the localmainwith a fast-forward-only pull, and do not proceed from stale code. - Use Bun for all package management, scripts, workspace filters, and tests. Do not add npm, Yarn, or pnpm lockfiles or package-manager-specific config.
- Do not construct raw shell command strings in workflow logic; use helper modules that pass command arguments as structured arrays.
- Do not add forwarding or barrel export modules for codebase internals.
Avoid
export * from ...and pass-throughexport { ... } from ...files; import runtime code and types directly from the module that owns the behavior or contract. - Keep TypeScript files under 250 lines; split files before they grow beyond that limit.
- Keep TypeScript interfaces/type aliases separate from runtime implementation
when adding or changing contracts, and save all type-related files under a
types/folder.
- State assumptions and tradeoffs before coding when requirements or existing patterns are unclear.
- Prefer the simplest change that satisfies the scoped goal; do not add speculative configurability, abstractions, or adjacent cleanup.
- Keep edits surgical. Every changed line should trace to the request, and any unrelated dead code or risk should be mentioned instead of silently refactored.
- For complex functions, add one short comment that describes the function's purpose.
- Define success criteria and verification before or during implementation, then loop until the relevant checks pass or a blocker is explicit.
- Before implementation edits, re-state the scoped plan and confirm the files or modules expected to change.
- After implementation edits and before validation, summarize the code changes made and any tests added or updated.
- After testing or checks, report pass/fail/blocker status, including skipped commands and remaining risk.
A change is done only when:
- The requested behavior or documentation update is complete within the scoped files.
- Relevant package-level or repo-level checks have actually run, or any skipped checks are named with the reason.
- Evidence is summarized in the handoff: commands, inspected output, browser verification, or explicit blocker details.
- Parser contracts, package boundaries, TypeScript file-size/type-placement rules, and Bun-only tooling remain intact.
- The repository is left handoff-ready: no undocumented half-finished work, no accidental artifact churn, and unrelated dirty files preserved.
packages/cli/: CLI parsing, config resolution, workflow orchestration, run-state handling, daemon/server helpers, task intake, skills management, integrations, and interactions with Codex, Claude, Git, and workflow agents.packages/server/: API process responsibilities including HTTP routes, realtime/ws behavior, cron runtime, workflow-data boundaries, repositories, daemon bridge, health/readiness behavior, and server-specific tests.packages/web/: Next.js operator UI, client-side data access, providers, realtime state, components, styles, and frontend verification.packages/db/: Shared database schema, migrations, database helpers, scripts, and db package tests.packages/landing/: Public landing site pages, marketing components, and landing-specific styles.packages/agent-adapters/: Runtime adapters for external coding agents, provider registries, command argument construction, and normalized agent output contracts.
Package-local AGENTS.md files add instructions for each workspace. Follow the
root rules everywhere, then follow the closest package-specific file for the
code you are changing.
Run all checks before finalizing changes:
bun run checkbun run typecheckbun test
- Architecture details: ARCHITECTURE.md
- Execution and operating plans: docs/PLANS.md
- Reliability and run behavior: docs/RELIABILITY.md
- Security and secrets handling: docs/SECURITY.md
- Quality posture: docs/QUALITY_SCORE.md