OmoiOS
CLAUDE.md79 starsChanged 10 months agoApache-2.0View on GitHub
OmoiOS is a spec-driven, multi-agent orchestration system that scales development without scaling headcount. It combines autonomous agent execution with structured workflows (Requirements → Design → Tasks → Execution) using the Claude Agent SDK and OpenHands SDK. Production URLs: - Frontend: https://omoios.dev - Backend API: https://api.omoios.dev Vercel Projects (org: automation-workz): Railway (project: aomoi-os-backend): Important notes: - .env files are gitignored and protected by detect-secrets pre-commit hook — never modify them for deployment config - Frontend env vars with NEXT_PUBLIC_ prefix are…
- Reads credentials
- Installs packages
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- backend/CLAUDE.mdCLAUDE.md
- .claude/skills/oip-proposal/CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- frontend/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- .cursor/rules/development.mdcCursor rule
- browser-useSkill
- agent-browserSkill
- billing-automationSkill
- canvas-designSkill
- claude-agent-sdk-pythonSkill
- doc-expanderSkill
- docxSkill
- frontend-designSkill
- internal-commsSkill
- litho-budgeted-analysisSkill
- mcp-builderSkill
- oip-proposalSkill
- paypal-integrationSkill
- pci-complianceSkill
- pdfSkill
- pptxSkill
- skill-creatorSkill
- spec-driven-devSkill
- stripe-integrationSkill
- template-skillSkill
- theme-factorySkill
- webapp-testingSkill
- web-artifacts-builderSkill
- xlsxSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
30 rules. About 0 are common, 12 are distinctive, and 18 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 185
Always use structured_output() for LLM responses needing structured data:
- Very specific: line 200
Always use omoi_os.utils.datetime.utc_now() - never datetime.utcnow().
- Very specific: line 217
Test configuration: backend/config/test.yaml (NOT .env)
- Distinctive: line 241
If something goes sideways, STOP and re-plan immediately - don't keep pushing
- Distinctive: line 242
Use plan mode for verification steps, not just building
- Distinctive: line 243
Write detailed specs upfront to reduce ambiguity
- Distinctive: line 246
Use subagents liberally to keep main context window clean
- Very specific: line 252
After ANY correction from the user: update tasks/lessons.md with the pattern
- Distinctive: line 253
Write rules for yourself that prevent the same mistake
- Distinctive: line 258
Never mark a task complete without proving it works
- Distinctive: line 260
Ask yourself: "Would a staff engineer approve this?"
- Distinctive: line 261
Run tests, check logs, demonstrate correctness
- Distinctive: line 265
If a fix feels hacky: "Knowing everything I know now, implement the elegant solution"
- Distinctive: line 270
When given a bug report: just fix it.
- Very specific: line 277
Plan First: Write plan to tasks/todo.md with checkable items
- Distinctive: line 278
Verify Plan: Check in before starting implementation
- Very specific: line 281
Document Results: Add review section to tasks/todo.md
- Very specific: line 282
Capture Lessons: Update tasks/lessons.md after corrections
- Very specific: line 298
WAL Protocol: When the user makes a correction, decision, or states a preference — write it to memory/working-buffer.md BEFORE continuing …
- Very specific: line 299
Track progress: Update tasks/todo.md as items complete
- Very specific: line 300
Capture lessons: When something fails unexpectedly, add the pattern to tasks/lessons.md
- Very specific: line 301
Daily log: Write significant actions to memory/YYYY-MM-DD.md
- Distinctive: line 305
Before ending a session:
- Very specific: line 306
Update memory/working-buffer.md with current state and next steps
- Very specific: line 308
If new lessons learned: update tasks/lessons.md
- Very specific: line 309
If architecture decisions were made: add to the ADL table in MEMORY.md
- Very specific: line 310
Write daily log entry to memory/YYYY-MM-DD.md
- Very specific: line 374
Use detect_changes for code review.
- Very specific: line 375
Use get_affected_flows to understand impact.
- Very specific: line 376
Use query_graph pattern="tests_for" to check coverage.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
OmoiOS is a spec-driven, multi-agent orchestration system that scales development without scaling headcount. It combines autonomous agent execution with structured workflows (Requirements → Design → Tasks → Execution) using the Claude Agent SDK and OpenHands SDK.
Production URLs:
- Frontend:
https://omoios.dev - Backend API:
https://api.omoios.dev
Deployment Infrastructure
Vercel Projects (org: automation-workz):
| Project | URL | Directory | Purpose |
omoios-frontend | https://www.omoios.dev | frontend/ | Main production frontend |
omoi-os | https://omoi-os.vercel.app | — | Legacy/alternate frontend |
landing-pages | https://landing-pages-automation-workz.vercel.app | landing-pages/ | Marketing landing pages |
omoi-prompt-frontend | https://prompt.omoios.dev | — | Prompt playground frontend |
# List all Vercel projects
vercel project ls
# Manage env vars for the main frontend (run from frontend/)
cd frontend && vercel env ls
vercel env add <NAME> production
vercel env rm <NAME> productionRailway (project: aomoi-os-backend):
| Service | Environment | Purpose |
omoi-api | production | FastAPI backend API |
# Link to the Railway project
railway link
# List env vars
railway variables
# Set an env var
railway variables set KEY=valueImportant notes:
.envfiles are gitignored and protected by detect-secrets pre-commit hook — never modify them for deployment config- Frontend env vars with
NEXT_PUBLIC_prefix are embedded in the client-side JS bundle - Production secrets (Sentry tokens, PostHog keys, etc.) live exclusively in Vercel/Railway env var storage
- The
omoios-frontendVercel project already has all production env vars configured
Monorepo Structure
This project uses uv workspaces for unified Python dependency management:
senior_sandbox/
├── pyproject.toml # Root workspace config
├── uv.lock # Single lock file for all packages
├── backend/ # FastAPI backend (omoi-os package)
│ ├── omoi_os/ # Main Python package
│ └── CLAUDE.md # Backend-specific guide (detailed)
├── frontend/ # Next.js 15 frontend
├── subsystems/
│ └── spec-sandbox/ # Spec execution runtime
├── docs/ # Documentation (30,000+ lines)
├── scripts/ # Development scripts
└── Justfile # Task runner (see `just --list`)Development Commands
Quick Start (Recommended: Use Justfile)
# Show all available commands
just --list
# Full stack development (Docker with hot-reload)
just watch # Backend services with hot-reload
just frontend-dev # Frontend dev server
just dev-all # Everything at once
# Testing
just test # Run affected tests only (testmon)
just test-all # Full test suite
just test-coverage # With HTML coverage report
# Code quality
just format # Format code
just lint # Lint check
just check # All quality checksManual Commands (Backend)
cd backend
# Dependencies (uv sync from root handles workspaces)
uv sync # Install all
uv sync --group test # Include test deps
# API server
uv run uvicorn omoi_os.api.main:app --host 0.0.0.0 --port 18000 --reload
# Database
uv run alembic upgrade head # Run migrations
uv run alembic revision -m "description" # Create migration
# Testing
uv run pytest # All tests
uv run pytest tests/path/test_file.py::TestClass::test_method -v # Single testManual Commands (Frontend)
cd frontend
pnpm install # Install dependencies
pnpm dev # Dev server (port 3000)
pnpm build # Production build
pnpm lint # Lint checkArchitecture Highlights
Backend Tech Stack
- Framework: FastAPI 0.104+ with async
- Database: PostgreSQL 16 + pgvector (SQLAlchemy 2.0+)
- Cache/Queue: Redis 7 + Taskiq
- LLM: Claude Agent SDK, Anthropic Claude
- Sandbox: Daytona for isolated workspace execution
- Auth: JWT (custom auth service)
- Observability: Sentry + OpenTelemetry + Logfire
Frontend Tech Stack
- Framework: Next.js 15 (App Router)
- UI: ShadCN UI (Radix + Tailwind)
- State: Zustand (client) + React Query (server)
- Graphs: React Flow v12, @xyflow/react
- Terminal: xterm.js
Core Services
- SpecStateMachine: Multi-phase spec workflow (EXPLORE → REQUIREMENTS → DESIGN → TASKS → SYNC)
- TaskQueueService: Priority-based task assignment with dependencies
- AgentHealthService: 30s heartbeats, 90s timeout
- EventBusService: Redis pub/sub for real-time state
- IntelligentGuardian: LLM-powered trajectory analysis
Port Configuration
| Service | Port | Note |
| PostgreSQL | 15432 | +10000 offset |
| Redis | 16379 | +10000 offset |
| Backend API | 18000 | +10000 offset |
| Frontend | 3000 | Standard |
Critical Rules
Full rules directory:
docs/rules/. Each file captures one class of recurring bug — the stack trace, why it happens in this codebase, and the pattern that prevents it. Check the index before writing dependencies, route handlers, or models.
SQLAlchemy Reserved Keywords (NEVER USE)
metadata- Usechange_metadata,item_metadata,config_dataregistry- Useagent_registry,service_registry- Full write-up:
docs/rules/sqlalchemy-reserved-keywords.md
SQLAlchemy Session Handling (DetachedInstanceError)
Any FastAPI dependency that loads an ORM object inside with db.get_session() and returns it must force-load lazy attributes, call session.refresh(obj), then session.expunge(obj) before returning. Skipping this produces DetachedInstanceError at the caller's access site, nowhere near the real bug.
- Full write-up:
docs/rules/sqlalchemy-session-handling.md
Feature-Flagged v1 API Surfaces
Agent-workspace v1 surfaces (sessions_api_v1, environments_v1, broker_enabled, egress_proxy_enabled, artifacts_unified_v1, webhooks_enabled) default to off and return 404. Enable via FEATURE_*=true in backend/.env, then restart uvicorn (--reload won't pick up env vars).
- Full write-up:
docs/rules/feature-flag-surfaces.md
LLM Service Usage
Always use structured_output() for LLM responses needing structured data:
from omoi_os.services.llm_service import get_llm_service
from pydantic import BaseModel
class AnalysisResult(BaseModel):
score: float
summary: str
llm = get_llm_service()
result = await llm.structured_output(prompt="...", output_type=AnalysisResult)
result_dict = result.model_dump(mode='json') # For JSONB storageDatetime Handling
Always use omoi_os.utils.datetime.utc_now() - never datetime.utcnow().
Configuration Pattern
- YAML: Application settings (version controlled in
config/*.yaml) - .env: Secrets only (DATABASE_URL, API keys) - never committed
Testing
Tests use pytest-testmon for smart execution (only affected tests):
just test # Fast: affected tests only (~10-30s)
just test-all # Full suite (~5-10 min)
just test-unit # Unit tests
just test-integration # Integration testsTest configuration: backend/config/test.yaml (NOT .env)
Documentation
Key docs for understanding the system:
backend/CLAUDE.md- Comprehensive backend guidedocs/product_vision.md- Complete product visiondocs/design/frontend/- Frontend architecturedocs/requirements/monitoring/- Monitoring architecture
Subsystems
spec-sandbox
Lightweight spec execution runtime used by backend:
from spec_sandbox import ... # Via workspace referenceCLI: spec-sandbox (see subsystems/spec-sandbox/)
Workflow Orchestration
1. Plan Mode Default
- Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions)
- If something goes sideways, STOP and re-plan immediately - don't keep pushing
- Use plan mode for verification steps, not just building
- Write detailed specs upfront to reduce ambiguity
2. Subagent Strategy
- Use subagents liberally to keep main context window clean
- Offload research, exploration, and parallel analysis to subagents
- For complex problems, throw more compute at it via subagents
- One task per subagent for focused execution
3. Self-Improvement Loop
- After ANY correction from the user: update
tasks/lessons.mdwith the pattern - Write rules for yourself that prevent the same mistake
- Ruthlessly iterate on these lessons until mistake rate drops
- Review lessons at session start for relevant project
4. Verification Before Done
- Never mark a task complete without proving it works
- Diff behavior between main and your changes when relevant
- Ask yourself: "Would a staff engineer approve this?"
- Run tests, check logs, demonstrate correctness
5. Demand Elegance (Balanced)
- For non-trivial changes: pause and ask "is there a more elegant way?"
- If a fix feels hacky: "Knowing everything I know now, implement the elegant solution"
- Skip this for simple, obvious fixes - don't over-engineer
- Challenge your own work before presenting it
6. Autonomous Bug Fixing
- When given a bug report: just fix it. Don't ask for hand-holding
- Point at logs, errors, failing tests - then resolve them
- Zero context switching required from the user
- Go fix failing CI tests without being told how
Task Management
- Plan First: Write plan to
tasks/todo.mdwith checkable items - Verify Plan: Check in before starting implementation
- Track Progress: Mark items complete as you go
- Explain Changes: High-level summary at each step
- Document Results: Add review section to
tasks/todo.md - Capture Lessons: Update
tasks/lessons.mdafter corrections
Proactive Memory System
This project uses a WAL (Write-Ahead Log) protocol for session continuity. Memory files persist context across sessions so agents don't start from zero.
Session Start Protocol
At the start of every session, read these files in order:
MEMORY.md— Project state, active workstreams, architecture decisionsmemory/working-buffer.md— What was happening most recently (WAL target)tasks/todo.md— Active work itemstasks/lessons.md— Patterns to avoid
During Session
- WAL Protocol: When the user makes a correction, decision, or states a preference — write it to
memory/working-buffer.mdBEFORE continuing work. Context vanishes. The buffer won't. - Track progress: Update
tasks/todo.mdas items complete - Capture lessons: When something fails unexpectedly, add the pattern to
tasks/lessons.md - Daily log: Write significant actions to
memory/YYYY-MM-DD.md
Session End Protocol
Before ending a session:
- Update
memory/working-buffer.mdwith current state and next steps - Mark completed items in
tasks/todo.md - If new lessons learned: update
tasks/lessons.md - If architecture decisions were made: add to the ADL table in
MEMORY.md - Write daily log entry to
memory/YYYY-MM-DD.md
Memory File Structure
MEMORY.md # Curated long-term project state
memory/
├── working-buffer.md # Active working memory (WAL target)
└── YYYY-MM-DD.md # Daily raw capture logs
tasks/
├── todo.md # Active work items
└── lessons.md # Patterns to avoidKey References
| What | Where |
| Architecture overview | ARCHITECTURE.md |
| Integration gaps | docs/architecture/14-integration-gaps.md |
| Live preview plan | docs/design/live-preview/prototype-plan.md |
| Backend guide | backend/CLAUDE.md |
Core Principles
- Simplicity First: Make every change as simple as possible. Impact minimal code.
- No Laziness: Find root causes. No temporary fixes. Senior developer standards.
- Minimal Impact: Changes should only touch what's necessary. Avoid introducing bugs.
<!-- code-review-graph MCP tools -->MCP Tools: code-review-graph
IMPORTANT: This project has a knowledge graph. ALWAYS use the code-review-graph MCP tools BEFORE using Grep/Glob/Read to explore the codebase. The graph is faster, cheaper (fewer tokens), and gives you structural context (callers, dependents, test coverage) that file scanning cannot.
When to use graph tools FIRST
- Exploring code:
semantic_search_nodesorquery_graphinstead of Grep - Understanding impact:
get_impact_radiusinstead of manually tracing imports - Code review:
detect_changes+get_review_contextinstead of reading entire files - Finding relationships:
query_graphwith callers_of/callees_of/imports_of/tests_for - Architecture questions:
get_architecture_overview+list_communities
Fall back to Grep/Glob/Read only when the graph doesn't cover what you need.
Key Tools
| Tool | Use when |
detect_changes | Reviewing code changes — gives risk-scored analysis |
get_review_context | Need source snippets for review — token-efficient |
get_impact_radius | Understanding blast radius of a change |
get_affected_flows | Finding which execution paths are impacted |
query_graph | Tracing callers, callees, imports, tests, dependencies |
semantic_search_nodes | Finding functions/classes by name or keyword |
get_architecture_overview | Understanding high-level codebase structure |
refactor_tool | Planning renames, finding dead code |
Workflow
- The graph auto-updates on file changes (via hooks).
- Use
detect_changesfor code review. - Use
get_affected_flowsto understand impact. - Use
query_graphpattern="tests_for" to check coverage.
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
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.

