agentleFS
voly-codesvoly-codes/voly/CLAUDE.md

voly

CLAUDE.md19 starsChanged 5 months agoApache-2.0View on GitHub

Project: VOLY — AI control plane for running agents, managing cost, routing tasks, and orchestration. OpenWiki: start at openwiki/quickstart.md, then follow its links. VOLY routes a developer's tasks to the right AI agent, manages the billing fallback chain, collects telemetry, and provides a web UI + REST API. Key components: - Billing fallback chain: claude-code → cursor → deepseek → wrangler → opencode → zen — on executor billing_error - Smart dispatch: Web UI with executor=pipeline + code task →…

  • Reads credentials
  • Installs packages

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Local context: before the executor, gathers relevant project files via grep

    line 16
  2. Very specific:

    After every functional fix commit, append an English entry to fix.md with the exact short commit hash and a concise description of what was …

    line 104
  3. Very specific:

    Run integration and end-to-end test tasks only in /home/lanies/git/codeops/TEST_VOLY_JOB_MA/, never in this repository.

    line 108
  4. Very specific:

    When removing a command: remove it from cli/main.py, cli/commands/__init__.py, tests, README, docs.

    line 206
  5. Distinctive:

    Treat source code and tests as authoritative.

    line 253
  6. Distinctive:

    Prefer the narrowest quiet validation that proves the changed behavior.

    line 254

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 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.

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

VOLY — Agent Instructions

Project: VOLY — AI control plane for running agents, managing cost, routing tasks, and orchestration.

OpenWiki: start at openwiki/quickstart.md, then follow its links.

Project goal

VOLY routes a developer's tasks to the right AI agent, manages the billing fallback chain, collects telemetry, and provides a web UI + REST API.

Key components:

  • Billing fallback chain: claude-code → cursor → deepseek → wrangler → opencode → zen — on executor billing_error
  • Smart dispatch: Web UI with executor=pipeline + code task → auto-promotes to claude-code
  • DSPy TaskPlanner: refines the task before the executor, collects (task, result) examples for optimization
  • CF AI Gateway route schema: /infer endpoint in the CF Worker routes via the CF Dashboard route schema
  • Local context: before the executor, gathers relevant project files via grep
  • Tech stack gate: pre-run framework version selection (registry + runtime preflight); empty cwd → category picker + greenfield scaffolding
  • Code reuse: voly reuse — GitHub search → pack → pick → apply; optional auto-search before each executor call (reuse.auto)
  • Repo intelligence: voly repo inspect|analyze|map|license — pre-run external repo analysis (admission, license, architecture, security)
  • Capability Registry: evidence-based executor routing via ExecutorMatcher; replaces static billing fallback chain with scored selection

VOLY is project-agnostic — no product-specific logic in voly/.


Strategic architecture — read FIRST

VOLY = two layers with different value:

  • Layer A — model gateway / routing / fallback across model providers. Competes with OmniRoute / LiteLLM / OpenRouter — a mature, crowded niche. Stabilize minimally and delegate to an external gateway (VOLY already supports OmniRoute as an upstream). NOT the source of revenue or uniqueness — do not chase provider breadth.
  • Layer B — orchestration over file-capable CLI agents. Executor chain (agents write files into the project), billing fallback between CLIs, multi-agent decomposition (model tier per role), project-agnostic executor path, task cost telemetry. This is product uniqueness + the foundation of monetization — put all development focus here.

Invariant #1: AIGateway.chat() is the only path out to models. Pipeline, DSPy, sub-agents, and runtimes all go through it — so cache, DLP, spend limits, fallback, and telemetry come free to every component. Never call a provider around the gateway (except executors — that is a separate path).

Do not do without an explicit request: a custom workflow engine, Temporal (if needed — DBOS/Restate), early marketplace, growing periphery before Layer B core is stable.


Skills — read BEFORE starting work

SkillWhen to use
/voly-planCreate a task plan, choose agents (zen vs claude-code), launch
/voly-backendWork on the Python backend: pipeline, executors, gateway, DSPy, API
/voly-frontendWork on the Svelte UI: components, API client
/voly-reportCreate a report after finishing a task

Documentation — read before making changes

docs/
  backend/
    pipeline.md      ← Pipeline stages, AgentRouter, smart dispatch, hybrid A2A
    a2a.md           ← A2A modules, auto-dispatch, federation, context handoff
    plan.md          ← Plan gates, verify, tester_command scoping
    workflows.md     ← Bounded review/repair workflows and stop semantics
    reuse.md         ← voly reuse: GitHub search → pack → pick → apply
    intelligence.md  ← Repository Intelligence: admission, license, architecture map
    capability.md    ← Capability Registry: evidence-based executor routing, matcher
    evidence.md      ← EvidenceRecord v2, repository baseline, root-cause attribution
    evaluation.md    ← EvalPolicy registry, deterministic post-run Eval Engine
    executors.md     ← All executors, billing fallback chain, WranglerExecutor
    ai-gateway.md    ← AIGateway, CF route schema, providers, env vars
    dspy.md          ← DSPy programs, TaskPlanner, shadow/active, adapter
    config.md        ← voly.yaml, env vars, VOLYConfig fields
    api.md           ← FastAPI endpoints, SSE events, CF Worker /infer
    spend-protocol.md ← Spend/limits contract between CLI, worker, and Cloud
  frontend/
    overview.md      ← Svelte 5 stack, ui/ structure, dev/build
    components.md    ← All components, their props/events
    api-client.md    ← SSE calls, event format, fallback handling
  ARCHITECTURE.md    ← High-level diagram + stage/executor tables

Documentation rule (MANDATORY)

Any change in code behavior = update the corresponding doc file.

What you changedUpdate
Executor (added/changed)docs/backend/executors.md
Pipeline stage / PipelineResultdocs/backend/pipeline.md + docs/ARCHITECTURE.md
Multi-agent / hybrid / cascadedocs/backend/pipeline.md + docs/backend/a2a.md
Plan gates / verifydocs/backend/plan.md
Bounded agent workflowdocs/backend/workflows.md + docs/ARCHITECTURE.md
AI Gateway / providerdocs/backend/ai-gateway.md
DSPy program / configdocs/backend/dspy.md
Config / env vardocs/backend/config.md
Code reuse (voly reuse)docs/backend/reuse.md + docs/backend/config.md
Repo intelligencedocs/backend/intelligence.md
Capability registrydocs/backend/capability.md
API endpointdocs/backend/api.md
Svelte componentdocs/frontend/components.md
API call from UIdocs/frontend/api-client.md

Fix log and local checklist (MANDATORY)

  • docs/problems-checklist.md is a local working document. Never stage, commit, or push changes to it.
  • After every functional fix commit, append an English entry to fix.md with the exact short commit hash and a concise description of what was fixed. The follow-up fix.md update may be included in the next documentation or batch commit; verify that all functional fix commits are listed before push.
  • Run integration and end-to-end test tasks only in /home/lanies/git/codeops/TEST_VOLY_JOB_MA/, never in this repository.

Choosing an agent for a task

TaskAgentWhy
Update documentationzensimple task, free
Add a label/hint in the UIzen1–2 files
Fix a typo/renamezenminimal risk
New executor / DSPy programclaude-codecomplex architecture
New pipeline stageclaude-codemultiple files + docs
Provider integrationclaude-codegateway + config + docs
Refactor 3+ filesclaude-codeneeds context
# Run via VOLY runner (this repository: /home/lanies/git/codeops/voly)
voly run "<task>" --executor zen --cwd /home/lanies/git/codeops/voly
voly run "<task>" --executor claude-code --cwd /home/lanies/git/codeops/voly

Scope rules

RuleMeaning
Project-agnostic coreNo hardcoded paths/product logic in voly/
Target project via --cwdExecutors work on external repos via --cwd
Generated state not sourceDo not commit .voly/events/, .voly/evidence/, DSPy datasets, compiled programs
Gateway firstModel calls go through AIGateway.chat() — except executors
Docs move with codeDocs are updated with the code, in the same commit

Quick start

python3 -m venv .venv
source .venv/bin/activate          # fish: source .venv/bin/activate.fish
pip install -e ".[dev]"
voly status

Optional: pip install -e ".[dspy,dev]" or pip install -e ".[cursor,dev]"

Smoke checks:

python -c "import voly.pipeline, voly.inference; from voly.config import VOLYConfig; assert VOLYConfig().dspy.enabled is False"
pytest tests/test_dspy_runtime_smoke.py

Repository structure

voly/
  cli/              pipeline/       inference/     dspy/
  ai_gateway/       executor/       catalog/       registry/
  memory/           rtk/            headroom/      telemetry.py
  a2a/              agui/           web/           reuse/
  runner/           plan/           pxpipe/        spend/
  config/           scanner/        workflow/      cloudflare/
  models/           runtime/        tools/         router.py
  intelligence/     capability/
ui/                 cf-workers/     docs/          tests/
CLAUDE.md           voly.yaml    README.md

CLI commands

voly run <task>    voly match <task>    voly compare <task>
voly quickstart [--check] [--cwd PATH]
voly savings       voly status          voly scan
voly registry agents        voly registry skills       voly skill list
voly model list             voly ai-gateway status     voly catalog sync
voly dspy status            voly memory search <query>  voly runs list
voly serve                  voly ui
voly a2a                    voly agui                 voly rtk
voly headroom               voly mcp                  voly runner
voly telemetry              voly balance              voly init
voly setup                  voly config               voly tunnel
voly spend status           voly cloud login          voly pxpipe
voly plan list|show
voly reuse search|pack|pick|apply|run
voly repo inspect|analyze|map|license
voly capability list|show|match|reset
voly evidence show|feedback
voly eval validate|run|calibrate
voly workflow review-until-clean <task> --cwd <project>

When removing a command: remove it from cli/main.py, cli/commands/__init__.py, tests, README, docs.


Testing

CI: smoke gate — base install, import without DSPy, import with DSPy, runtime smoke tests.

pytest tests/test_dspy_runtime_smoke.py   # required after any changes
pytest tests/ -q                          # full run

Do not commit

.env, .voly/events/, .voly/evidence/, .voly/dspy/datasets/, .voly/dspy/programs/, .voly/reports/, .voly/eval-runs/, .venv/, .pytest_cache/, .ruff_cache/, ui/node_modules/, voly/web/static/assets/


Troubleshooting

ProblemFirst check
DSPy is not installedpip install -e ".[dspy]" or dspy.enabled: false
Base install imports DSPyCheck for top-level import dspy outside lazy paths
Pipeline bypasses gatewayEnsure the runtime uses AIGateway.chat()
Executor does not write filesCheck --cwd and executor credentials
Billing fallback does not triggerDetection in voly/ai_gateway/error_classifier.py (_is_billing_error delegates there); rate-limit 429 is NOT treated as billing — only quota-exhausted/account
Smart dispatch does not triggerSet VOLY_PROJECT_CWD or default_cwd in voly.yaml
Wrangler executor unavailableRun cd cf-workers/agent && wrangler dev
CI fails with test collectionCheck pyproject.toml pytest config
Plan gate command: exit 4 on pytestPrefer .venv/bin/pytest — auto-fill when .venv/bin/pytest exists; or set plan.tester_command. Verify scopes bare pytest to touched test_*.py
Multi-agent only developer+tester≥2 capability flags auto-set requires_review (3 roles). Deploy/architecture keywords still needed for devops/architect
Hybrid roles stay chat / no filesPass --cwd (or VOLY_PROJECT_CWD). Defaults: developer/tester/devops = executor
Anthropic burns every role firstVOLY_A2A_EXCLUDE_PROVIDERS=anthropic (pre-marked unhealthy) or wait for credit/billing mark_unhealthy
Provider hang / slow fallbackrequest_timeout_seconds (15 stall) + request_total_timeout_seconds (60 full response); plan gates use plan.command_timeout_seconds: 120
<!-- OPENWIKI:START -->

OpenWiki

This repository has a generated openwiki/ evidence index. It is optional just-in-time context, not required startup reading.

  • Treat source code and tests as authoritative. A brief's unknowns and review items are verification gaps, not automatic requirements.
  • Prefer the narrowest quiet validation that proves the changed behavior. Preserve complete failure output.

The scheduled OpenWiki GitHub Actions workflow refreshes the repository wiki. Do not hand-edit generated OpenWiki pages unless explicitly asked; prefer updating source code/docs and letting OpenWiki regenerate.

<!-- OPENWIKI:END -->

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.