- Build:
bun run build - Test:
bun run testorbun test - Single Test:
bun test <filename-glob>(e.g.bun test agent-fallback.test.ts) - Watch Mode:
bun test --watch - Lint:
bun run lint(eslint) - Typecheck:
bun run typecheck(tsc --noEmit) - Fix Lint:
bun run lint:fix(eslint --fix) - Format:
bun run format(prettier) - E2E:
OMA_E2E=true bun test ./test/e2e/oma-workflow.e2e.ts - Web Server:
oma serve(starts web UI, default port 32023) - Web Server (custom):
oma serve --port 8080 --host 0.0.0.0 - Web Build:
cd packages/web && bun run build - Web Tests:
bun test test/web/
- Use ES6
import/exportsyntax (module: "ESNext", type: "module") - Group imports: external libraries first, then internal modules
- Use explicit file extensions (
.ts) for internal imports
- Single quotes (
singleQuote: true) - Line width: 100 characters
- Tab width: 2 spaces
- Trailing commas: ES5 (no trailing commas in function parameters)
- Semicolons: enabled
- NeverNesters: avoid deeply nested structures. Always exit early.
- Strict mode: enforced (
"strict": true) - Classes: PascalCase (e.g.,
BackgroundTask,BackgroundTaskManager) - Methods/properties: camelCase
- Status strings: use union types (e.g.,
'pending' | 'running' | 'completed' | 'failed' | 'cancelled') - Explicit types: prefer explicit type annotations over inference
- Return types: optional (not required but recommended for public methods)
- Check error type before accessing error properties:
error instanceof Error ? error.toString() : String(error) - Log errors with
[ERROR]prefix for consistency - Always provide error context when recording output
@typescript-eslint/no-explicit-any: warn (avoidanytype)no-console: error (minimize console logs)prettier/prettier: error (formatting violations are errors)
- Framework: vitest with
describe&itblocks - Style: Descriptive nested test cases with clear expectations
- Assertion library:
expect()(vitest)
- Type: ES Module package for Bun modules
- Target: Bun runtime, ES2021+
- Purpose: Independent agentic coding runtime
- Kernel:
packages/kernel/src/— all core infrastructure - Web:
packages/web/— Hono + React SPA web interface (server + client + shared contracts)- Server: Hono HTTP/WebSocket/SSE, JWT auth, RuntimeManager
- Client: React 19, Zustand, react-markdown, Shiki, Tailwind CSS
- Storage: repo-local
.oma/for project artifacts; XDG state for sessions/tasks/memory
OMA uses a three-layer primitive/lead/worker hierarchy. All agents are registered in src/agents/helper/catalog.ts and enforced by the RoutingService in the kernel.
Primitives are the entry points for user-facing commands and the top of the delegation chain.
| Agent | File | Description |
|---|---|---|
cto |
src/agents/primitive/executive.ts |
Strategic orchestrator. Routes commands to leads and workers. Owns background tasks and governance. |
brainstorm |
src/agents/primitive/brainstorm.ts |
Meta-prompt specialist. Surfaces contradictions, patterns, risks, and options before committing to implementation. |
Leads coordinate clusters of workers within a domain. They receive task bundles from cto and delegate to workers. Leads do not write code or mutate state directly.
| Agent | File | Domain |
|---|---|---|
planner |
src/agents/lead/catalog.ts |
Plan creation, validation, and advisory orchestration |
coder |
src/agents/lead/catalog.ts |
Code implementation coordination |
tester |
src/agents/lead/catalog.ts |
Test authoring and validation coordination |
advisor |
src/agents/lead/catalog.ts |
Architecture and review advisory |
qa |
src/agents/lead/catalog.ts |
Quality assurance coordination |
quick |
src/agents/lead/catalog.ts |
Fast, bounded single-task execution |
router |
src/agents/lead/catalog.ts |
Request routing and load balancing |
reliability |
src/agents/lead/catalog.ts |
End-to-end assurance and coverage |
Workers are execution units. They implement bounded tasks, produce artifacts, and report completion or blockers. Workers do not re-delegate.
| Agent | Description |
|---|---|
coder-backend |
Backend and infrastructure implementation |
coder-frontend |
Frontend and UI implementation |
coder-security |
Security-focused implementation |
coder-junior |
Junior-level or small scoped tasks |
coder-deepagent |
Deep reasoning and complex multi-file implementation |
coder-qa |
QA-focused implementation and test authoring |
| Agent | Description |
|---|---|
explorer |
Repo investigation and cross-file analysis |
librarian |
External research and documentation lookup |
| Agent | Description |
|---|---|
debugger |
Root-cause analysis and targeted bug fixes |
architect |
Architecture review and design guidance |
build-resolver |
Build failure diagnosis and resolution |
security-reviewer |
Security analysis and vulnerability assessment |
e2e-runner |
End-to-end test execution |
harness-optimizer |
Test harness improvement and optimization |
writer |
Documentation, roadmap, and artifact writing |
plan-advisor |
Plan quality review and improvement suggestions |
plan-validator |
Implementation readiness validation for plans |
reviewer |
Code and diff review |
validator |
Unit and integration test authoring |
gitmaster |
Git workflow, docs, release, and CI management |
The RoutingService in packages/kernel/src/routing-service.ts enforces delegation rules deterministically:
ctomay delegate to any lead or directly to selected workers.- Leads may delegate only to workers in their permission matrix.
- Workers may not delegate further.
- Cross-layer delegation that violates the permission matrix is rejected at runtime.
Each agent definition includes a permission.task map that declares which agent IDs it may invoke:
permission: {
task: {
'*': 'deny',
'plan-advisor': 'allow',
'plan-validator': 'allow',
}
}OMA uses a two-tier storage split:
The web UI accesses the same .oma/ project artifacts and XDG state paths via RuntimeManager.
Repo-local .oma/ — project artifacts:
.oma/oma.jsonc— project config.oma/plans/active.md,.oma/plans/active.json— active plan.oma/roadmap/roadmap.md,.oma/roadmap/roadmap.json— roadmap.oma/prompts/— prompt artifacts
XDG state — runtime/app-owned per-project state:
$XDG_STATE_HOME/oma/projects/<project-id>/sessions/<session-id>/$XDG_STATE_HOME/oma/projects/<project-id>/tasks/<id>.json$XDG_STATE_HOME/oma/projects/<project-id>/memory/
Fallback base: ~/.local/state/oma/projects/<project-id>/.
Path constants are exported from packages/kernel/src/paths.ts and re-exported from packages/kernel/src/index.ts.