This file provides guidance to AI agents working in this repository.
- name:
devagent - purpose: Bun/Turbo monorepo for the DevAgent CLI, shared runtime, machine executor, provider adapters, and tooling integrations.
- primary languages/platforms: TypeScript, Bun, Node.js 20+, Turbo
packages/
cli/ # Public `devagent` terminal entrypoint and prompt assembly
runtime/ # Shared core types/config, task loop, review pipeline, tools, skill loading
executor/ # `devagent execute` SDK request execution and artifact/event contract
providers/ # Provider adapters and API-specific request shaping
models/ # Provider model registry TOML files
prompts/ # Shared prompt templates
scripts/ # Repo checks such as OSS surface validation
.agents/skills/ # Repo-local Codex-compatible skills
.devagent/workspaces/ # Runner-managed worktrees and generated mirrors; not canonical docs
bun install
bun run build
bun run typecheck
bun run test
bun run check:oss
# package-focused work
cd packages/runtime && bun run test
cd packages/executor && bun run test
cd packages/cli && bun run test
cd packages/providers && bun run test
# install the local CLI
bun run install-cli- The supported machine orchestration entrypoint is
devagent execute --request <request.json> --artifact-dir <path>. Treat this as the only public executor contract. - The validated cross-repo flow is
devagent-hub -> devagent-runner -> devagent execute. Keep docs and behavior aligned with that path, and avoid reintroducing deprecated Hub or workflow-stage surfaces. packages/cliassembles prompts, repository context, and human-facing command behavior, then delegates into@devagent/runtime,@devagent/executor, and@devagent/providers.packages/runtimeis the shared platform layer. Itssrc/core,src/engine, andsrc/toolsdirectories are internal subdivisions of one package, not separate workspace packages.packages/executorvalidates SDK requests, builds task queries, resolves requested skills, runs the agent loop, and writes normalized artifacts and events. Contract drift here is high risk and should be test-backed inpackages/executor/src/index.test.ts.- Repo-local skills live under
.agents/skills/and are discovered by the runtime skill loader. The similarly namedpackages/runtime/src/core/skills/directory is product source code for skill loading, not a repo-maintenance skill directory. .devagent/workspaces/contains runner-managed worktrees and stale documentation mirrors. Do not update guidance there unless the task is specifically about the worktree generation flow.- Provider and TUI validation helpers live under
scripts/live-validation/and remain opt-in outside the defaultbun run testpath. - When adding or removing public commands or release-critical validation flows, update
.agents/skills/validate-user-surface/references/release-matrix.mdso the release checklist stays aligned with the supported user surface.
- Follow the fail-fast philosophy: surface errors explicitly, fix root causes, and avoid silent fallbacks or defensive guards that hide breakage.
- Keep static-analysis ignore lists clean and preferably empty. Do not add entries to
knip,eslint,dependency-cruiser, or similar ignore/exclude lists just to silence findings; fix the code, analysis graph, or dead code instead. If a tool-required baseline exclude ever needs to change, call out the justification explicitly in the task summary. - Public CLI
--resumeand--continuemust replay exact raw message history plus persisted session state. Outside that restore path, prefer LLM-based synthesis or deterministic structured extraction from persisted state, and do not add ad hoc phrase heuristics that guess user intent from prompts like "continue" or "what's next?". - Run
bun run typecheckandbun run testbefore and after meaningful code changes. Runbun run check:osswhen changing public docs, contributor workflow, or package metadata. - Keep changes small and test-backed. If behavior changes, start with a failing or expanded test near the affected code.
- Prefer updating existing docs over creating new Markdown files, unless the task explicitly requires new documentation. Package-level
AGENTS.mdfiles in this repo are maintained documentation and may be updated when the component reality changes. - Keep generated artifacts inside runner-managed artifact directories, not repo-tracked paths.
- Do not document unsupported executor parity, deprecated chat/TUI/plan surfaces, or any non-DevAgent executor story as production-ready.
- Treat
.agents/skills/as the only maintained repo-local skill tree.
.agents/skills/add-feature-e2e: use for end-to-end feature work spanning types, implementation, wiring, and verification..agents/skills/tdd-workflow: use when behavior changes should follow the repo’s strict tests-first loop..agents/skills/testing: use to choose the smallest relevant test updates and verification scope..agents/skills/review: use for code review passes focused on fail-fast behavior, module boundaries, tests, and contract drift..agents/skills/review-rule: use when authoring or updating rule files fordevagent review..agents/skills/debug-test-failure: use when diagnosing failing test suites in this monorepo..agents/skills/security-checklist: use when a change touches command execution, credentials, artifacts, or provider/auth flows..agents/skills/simplify: use when removing unnecessary abstraction or dead code..agents/skills/surface-change-e2e: use when the task says things like “update CLI behavior”, “fix help text drift”, or “keep runtime, docs, and validation aligned” for a user-visible change..agents/skills/provider-adapter-change: use when the task says things like “provider proxy”, “auth mismatch”, “model registry drift”, or “streaming regression”..agents/skills/ci-triage-devagent: use when the task says things like “CI failure”, “why did this check fail”, or “reproduce the failing job locally”..agents/skills/release-train: use when the task says things like “bundle smoke”, “release checks”, “verify packaging”, or “check install-flow drift”..agents/skills/execute-contract: use when touchingpackages/executor, executor-facing docs, or any behavior that affects artifact/event/result expectations..agents/skills/oss-surface-guard: use when editing public docs, contributor workflow, or package metadata that must stay within the supported OSS surface..agents/skills/verification-checklist: use before finalizing substantial changes to run the repo’s verification gate..agents/skills/commit: use only when the user explicitly asks for a commit or commit-message help.