agentleFS
voly-codesvoly-codes/voly/.claude/skills/voly-backend/SKILL.md

voly-backend

Skill17 starsChanged 5 months agoApache-2.0View on GitHub

Guide for working on VOLY Python backend — pipeline, executors, AI gateway, DSPy, config, API routes. Use this skill for any backend changes.

The file

Files
SKILL.md

VOLY Backend Development Skill

Before writing any code — read

МеняешьПрочитай
Executor (claude-code, wrangler, zen, ...)docs/backend/executors.md
Pipeline стадии / PipelineResultdocs/backend/pipeline.md
AI Gateway / провайдеры / CFdocs/backend/ai-gateway.md
DSPy programs / runner / adapterdocs/backend/dspy.md
Config / env vars / voly.yamldocs/backend/config.md
API routes (/api/run, /api/tasks, ...)docs/backend/api.md
CF Worker (infer.ts, index.ts)docs/backend/ai-gateway.md + cf-workers/agent/src/

Architecture rules

  • AIGateway.chat() — единственный выход к моделям из Pipeline и DSPy
  • Executors могут bypass gateway (они запускают субпроцессы: claude CLI, wrangler dev, opencode)
  • Нет product-specific логики в voly/ — только через --cwd
  • billing_error=True на ExecutorResult → AgentRunner запускает fallback chain
  • DSPy импортируется только lazy (не на уровне модуля)

Billing fallback chain

claude-code  →  wrangler  →  zen

Только file-writing executors. Не добавлять text-only провайдеры в цепочку.

Code patterns

# Новый executor
class MyExecutor(Executor):
    def run(self, task, *, cwd, max_turns, timeout) -> ExecutorResult:
        try:
            ...
            return ExecutorResult(success=True, output=out)
        except SomeBillingError as e:
            return ExecutorResult(success=False, error=str(e), billing_error=True)

# Добавить в _build_executor() factory в agent_runner.py
# Добавить в EXECUTOR_NAMES frozenset
# Если file-capable + свой billing → добавить в BILLING_FALLBACK_CHAIN
# DSPy программа (lazy import dspy)
class MyProgram(BaseProgram):
    program_id = "my-program"
    agents = ("developer",)
    strategy = "chain_of_thought"

    def build(self):
        self.ensure_dspy()
        import dspy
        return dspy.ChainOfThought(MySignature())

register_program(MyProgram())  # в конце модуля

Testing

# Smoke test (всегда после изменений)
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 -q

# Весь тест-сюит
pytest tests/ -q

Documentation requirement (MANDATORY)

После любого изменения поведения обнови соответствующий файл в docs/backend/:

Что изменилОбнови
Executor (добавил/изменил)docs/backend/executors.md
Pipeline стадияdocs/backend/pipeline.md + docs/ARCHITECTURE.md
Gateway / провайдерdocs/backend/ai-gateway.md
DSPy программа / конфигdocs/backend/dspy.md
Config / env vardocs/backend/config.md
API endpointdocs/backend/api.md

Completion report

После завершения задачи создай отчёт: /voly-report

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.