agentleFS
kivo360kivo360/OmoiOS/AGENTS.md

OmoiOS

AGENTS.md79 starsChanged 10 months agoApache-2.0View on GitHub

This document helps AI coding agents (Claude Code, Cursor, Copilot Workspace, Windsurf, etc.) understand and contribute to OmoiOS efficiently. OmoiOS is a spec-driven, multi-agent orchestration system. Users describe a feature, OmoiOS plans it (requirements → design → tasks), executes it with autonomous AI agents in isolated sandboxes, and creates a PR. The core promise: "Start a feature before bed. Wake up to a PR." Production: Frontend at https://omoios.dev, API at https://api.omoios.dev These rules prevent common mistakes. Violating them causes build…

  • Reads credentials

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

15 rules. About 0 are common, 0 are distinctive, and 15 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 15

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always use omoi_os.utils.datetime.utc_now(): instead of datetime.utcnow().

    line 75
  2. Very specific:

    One hook per domain in hooks/: Follow the pattern in useProjects.ts or useSpecs.ts.

    line 92
  3. Very specific:

    API calls go through lib/api/client.ts: Add domain-specific files to lib/api/ (e.g., projects.ts, specs.ts).

    line 94
  4. Very specific:

    Create or edit a route file in backend/omoi_os/api/routes/

    line 102
  5. Very specific:

    Add the service method in backend/omoi_os/services/

    line 103
  6. Very specific:

    Add tests in backend/tests/

    line 105
  7. Very specific:

    Run just test to verify

    line 106
  8. Very specific:

    Create page.tsx in the correct frontend/app/ route group

    line 110
  9. Very specific:

    Add a sidebar panel in components/panels/ if needed, register in ContextualPanel.tsx

    line 111
  10. Very specific:

    Create domain hooks in hooks/ and API functions in lib/api/

    line 112
  11. Very specific:

    Use existing ShadCN components from components/ui/

    line 113
  12. Very specific:

    Create the model in backend/omoi_os/models/

    line 117
  13. Very specific:

    Create an Alembic migration: cd backend && uv run alembic revision -m "description"

    line 118
  14. Very specific:

    Never use metadata or registry as column names

    line 120
  15. Very specific:

    Write an OIP (OmoiOS Improvement Proposal) following the template in docs/proposals/TEMPLATE.md.

    line 124

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md — AI Coding Agent Guide for OmoiOS

This document helps AI coding agents (Claude Code, Cursor, Copilot Workspace, Windsurf, etc.) understand and contribute to OmoiOS efficiently.

What is OmoiOS?

OmoiOS is a spec-driven, multi-agent orchestration system. Users describe a feature, OmoiOS plans it (requirements → design → tasks), executes it with autonomous AI agents in isolated sandboxes, and creates a PR. The core promise: "Start a feature before bed. Wake up to a PR."

Production: Frontend at https://omoios.dev, API at https://api.omoios.dev

Read These First

DocumentPurposeWhen to read
ARCHITECTURE.mdSystem design, service map, data flowBefore any backend work
UI.mdFrontend routes, components, state, design systemBefore any frontend work
backend/CLAUDE.mdBackend conventions, patterns, anti-patternsBefore writing Python
CLAUDE.mdMonorepo structure, dev commands, portsAlways
CONTRIBUTING.mdBranch conventions, PR process, testingBefore submitting changes
docs/rules/Per-mistake rules — tripwires we've already hit (SQLAlchemy session handling, reserved column names, feature flag gotchas)Before editing dependencies, route handlers, or models

Repository Map

senior_sandbox/
├── backend/omoi_os/
│   ├── api/
│   │   ├── main.py              # FastAPI app + lifespan (25+ services initialized)
│   │   └── routes/              # 38 route files by domain
│   ├── services/                # Business logic (~40 service files)
│   │   ├── models/                  # SQLAlchemy 2.0 models (~77 model classes)
│   ├── workers/                 # Background workers (orchestrator, sandbox)
│   └── config.py                # OmoiBaseSettings (YAML + env)
│
├── backend/config/
│   ├── base.yaml                # Default application settings
│   └── test.yaml                # Test overrides
│
├── backend/tests/
│   ├── unit/                    # Fast isolated tests
│   ├── integration/             # Multi-component tests
│   └── e2e/                     # Full workflow tests
│
├── frontend/
│   ├── app/                     # Next.js 15 App Router
│   │   ├── (app)/               # Authenticated routes (command, projects, sandboxes, etc.)
│   │   ├── (auth)/              # Login, register, OAuth callback
│   │   └── (dashboard)/         # Root redirect to /command
│   ├── components/
│   │   ├── ui/                  # ShadCN primitives (40+) — do not modify
│   │   ├── layout/              # App shell (MainLayout, IconRail, ContextualPanel)
│   │   ├── panels/              # Sidebar panels (route-aware)
│   │   └── {domain}/            # Domain components (command, spec, sandbox, etc.)
│   │   ├── hooks/                   # 29 React Query + Zustand hooks (one per domain)
│   ├── lib/api/                 # HTTP client + domain-specific API functions
│   └── providers/               # Context providers (Query, Auth, Theme, PostHog)
│
├── subsystems/spec-sandbox/     # Spec execution runtime
├── docs/
│   ├── proposals/               # OmoiOS Improvement Proposals (OIPs)
│   │   ├── page_flows/              # 24 page-by-page UI flow docs
│   ├── user_journey/            # End-to-end user journey docs
│   │   └── architecture/            # 14 system deep-dive docs
└── Justfile                     # Task runner (just --list for all commands)

Critical Rules

These rules prevent common mistakes. Violating them causes build failures or runtime crashes.

Backend

  1. Never use metadata or registry as SQLAlchemy column names. They are reserved by SQLAlchemy's declarative API and cause InvalidRequestError on import. Use change_metadata, item_metadata, etc.
  2. Always use omoi_os.utils.datetime.utc_now() instead of datetime.utcnow(). The former returns timezone-aware datetimes compatible with the database.
  3. Use structured_output() for LLM calls that need structured data. Never manually parse JSON from LLM responses.
    from omoi_os.services.llm_service import get_llm_service
    llm = get_llm_service()
    result = await llm.structured_output(prompt="...", output_type=MyPydanticModel)
  4. Settings go in YAML, secrets go in .env. Application settings in config/base.yaml, secret keys/passwords in .env. Settings classes extend OmoiBaseSettings.
  5. Two separate service initialization points exist. api/main.py (API server) and workers/orchestrator_worker.py (background worker) initialize different service sets. They run as separate processes and do not share state. See the Service Availability Matrix in ARCHITECTURE.md.

Frontend

  1. Check components/ui/ before creating new primitives. 40+ ShadCN components are available. Don't reinvent Button, Card, Dialog, etc.
  2. One hook per domain in hooks/. Follow the pattern in useProjects.ts or useSpecs.ts. Use React Query for server state.
  3. API calls go through lib/api/client.ts. Add domain-specific files to lib/api/ (e.g., projects.ts, specs.ts). Never call fetch directly.
  4. Route groups: (app) for authenticated pages, (auth) for auth flows, root for public pages.

Common Tasks

Add a new API endpoint

  1. Create or edit a route file in backend/omoi_os/api/routes/
  2. Add the service method in backend/omoi_os/services/
  3. Register the route in backend/omoi_os/api/main.py if it's a new router
  4. Add tests in backend/tests/
  5. Run just test to verify

Add a new frontend page

  1. Create page.tsx in the correct frontend/app/ route group
  2. Add a sidebar panel in components/panels/ if needed, register in ContextualPanel.tsx
  3. Create domain hooks in hooks/ and API functions in lib/api/
  4. Use existing ShadCN components from components/ui/

Add a new database model

  1. Create the model in backend/omoi_os/models/
  2. Create an Alembic migration: cd backend && uv run alembic revision -m "description"
  3. Apply it: uv run alembic upgrade head
  4. Never use metadata or registry as column names

Propose a feature

Write an OIP (OmoiOS Improvement Proposal) following the template in docs/proposals/TEMPLATE.md. See docs/proposals/README.md for the process.

Development Commands

just --list          # All available commands
just dev-all         # Full stack with hot-reload
just test            # Affected tests only (via testmon)
just test-all        # Full test suite
just format          # Auto-format code
just check           # Lint + type checks

Ports: PostgreSQL 15432, Redis 16379, Backend API 18000, Frontend 3000

Finding Things

What you needWhere to look
API route for a featurebackend/omoi_os/api/routes/ — files named by domain
Business logicbackend/omoi_os/services/ — 40+ service files
Database schemabackend/omoi_os/models/ — SQLAlchemy models
Frontend pagefrontend/app/(app)/ — route structure matches URL
React componentfrontend/components/{domain}/ — grouped by domain
Data fetching hookfrontend/hooks/use{Domain}.ts
API client functionfrontend/lib/api/{domain}.ts
Type definitionsfrontend/lib/api/types.ts
Page flow documentationdocs/page_flows/ — 24 documented flows
User journey documentationdocs/user_journey/ — end-to-end journey docs
Architecture deep-divesdocs/architecture/01-*.md through 14-*.md
Improvement proposalsdocs/proposals/ — OIP system
Config settingsbackend/config/base.yaml
Test examplesbackend/tests/unit/, backend/tests/integration/

Architecture Summary

OmoiOS has four core systems:

  1. Planning — Spec State Machine converts feature ideas through EXPLORE → PRD → REQUIREMENTS → DESIGN → TASKS → SYNC → COMPLETE. Each phase has an LLM evaluator (quality gate).
  2. Execution — OrchestratorWorker dispatches tasks to Daytona sandboxes where ClaudeSandboxWorker runs using the Claude Agent SDK. Three modes: exploration, implementation, validation.
  3. Discovery — DiscoveryService enables adaptive branching when agents find new requirements during execution. A Phase 3 agent can spawn Phase 1 investigation tasks.
  4. Readjustment — MonitoringLoop runs Guardian (trajectory analysis, 60s), Conductor (coherence + duplicate detection, 5min), and Health Check (30s). Can redirect, refocus, or stop agents.

See ARCHITECTURE.md for the full diagram and deep-dive links.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.