agentleFS
zedarvateszedarvates/frugal-skills/skills/control-loop/SKILL.md

control-loop

Skill1 starsChanged 30 days agoMITView on GitHub

Instructions for upstream routing-outcome analysis and bounded threshold adaptation. Use to inspect local/cloud rates, escalation, verified success and measured usage before proposing updates or resets. Threshold policies are described here; improvement or savings require evidence from actual runs.

The file

Files
SKILL.md

control-loop — the router that learns

Package scope and prerequisites

This catalog ships instructions, not the executable runtime. Python modules, scripts, local services and optional tools named below must be installed separately from the upstream project. Check their availability before running commands; if they are missing, explain the prerequisite instead of claiming execution or results. The host agent may use model tokens while following these instructions.

Commands, APIs and runtime behavior described below are conditional examples for a compatible upstream installation; they are not evidence of execution in this package.

The final systemic loop: every routing decision + outcome is recorded, and the effort→tier thresholds (read live by [[auto-router]]) are nudged from the data — keep more work local when local is reliable, escalate sooner when it isn't.

python -m skills.control_loop.cli analyze            # local %, savings, escalation/success
python -m skills.control_loop.cli adapt              # proposed threshold change + why
python -m skills.control_loop.cli adapt --apply      # write it; the router uses it next time
python -m skills.control_loop.cli reset              # back to defaults

How the loop closes

  1. Measure — auto_router.run records each call to ~/.botte/control-ledger.jsonl (effort, tier, local/cloud, tokens saved, escalated, success).
  2. Analyze — aggregate: local %, escalation rate, success rate, tokens saved.
  3. Adapt — conservative rule, needs ≥10 samples, small steps, clamped:
    • local reliable (success ≥85%, escalation <15%) → raise the LOCAL boundary (consider more work for local execution).
    • local insufficient (escalation >30%) → lower it (escalate borderline sooner).
  4. Apply — write ~/.botte/routing-thresholds.json; auto_router.effort reads it live, so the next decisions reflect what actually worked.

This is an outcome-based routing adaptation pattern. A threshold change is a proposal, not proof of improved quality or savings; compare subsequent verified outcomes before retaining it. Exposed via [[llm-mcp]] as routing_stats. Related: [[auto-router]], [[conductor]], [[metrics]].

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.