optimize-skill-loop

A repeatable test loop for improving a skill against a fixed evaluation. It runs the skill in fresh, separate sessions across selected coding agents, measures quality, cost, and performance, and keeps the best trade-offs.

In plain words
What is it for?
Use it to test candidate skill versions across agents such as Claude, Codex, Cursor, or Gemini, then compare results and retain the best variant.
Why use it?
It makes versions easier to compare because each run starts without leftover conversation context. It also records which skill version and agent produced each result.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/astra-sh/qvr/optimize-skill-loop
Any agent
npx skills add astra-sh/qvr --skill optimize-skill-loop
Clone the repo
git clone --depth 1 https://github.com/astra-sh/qvr

Made for: Claude Code, Codex.

Per session 144 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,707 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00144 $0.05707
Opus 5 $0.00072 $0.02854
Sonnet 5 $0.00029 $0.01141
Haiku 4.5 $0.00014 $0.00571

Measured 3d ago against content hash ba42c9bb190d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

optimize-skill-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/grade-cohort.sh, scripts/report.py, scripts/run-cohort.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/optimize-skill-loop/SKILL.md · 396 lines

How it starts

The opening of the file, as written. The whole thing — 396 lines — stays where its author put it; the contents beside it link to each section on GitHub.

optimize-skill-loop

A deterministic harness for improving one inner skill on a feedback loop.

  • You (the agent) are the outer loop — the brain, the judge.
  • qvr is the ledger and the session bookkeeper — it spawns nothing, but as of 0.30.x it derives clean per-agent spans for every agent (claude, codex, …), so it captures every fresh headless run, owns its session id, attributes it to the skill content version (subtree_hash), records its cost, and buckets the cohorts. You no longer mint run-keys or correlate session ids — that whole layer is gone; a naked headless run is fully attributed by qvr.
  • The inner loop is fresh, no-leak headless agents (claude -p, codex, cursor, gemini, …) — each one a clean process running the inner skill on a fixed scenario, so no cross-run context bleeds the comparison.

What the loop still owns (qvr can't infer it): the version tag it ran (set via qvr switch before the cohort) — the candidate's identity, and the key quality joins on. That is all. The runner records no session id, no timing, no window: qvr stamps every session with the skill content version it ran (subtree_hash), so the grader attributes a cohort's ledger sessions by skill identity, not by a wall-clock window. The outer loop does only evals + candidate generation; every bit of session/cost/attribution bookkeeping is qvr's.

The whole point of this skill over an ad-hoc loop is determinism: the grader is frozen before the loop starts and never moves, so every cohort is judged by the identical yardstick. You only ever change the inner skill — never the rubric, never the evaluator, never the scenarios.

This skill sits downstream of an eval source, and is source-agnostic. It does not author the eval or define how a run is graded. The contract it consumes is one line: a run is a qvr session; an eval source is anything that turns each session into metrics ∈[0,1]. Any upstream source that (1) freezes an eval which rides the skill's qvr version and (2) maps each cohort run → metrics plugs in unchanged — the native one is create-skill-eval, but a foreign runner that already emits per-run scores conforms by normalizing them into the same rows. The loop consumes that normalized cohort, joins it to the ledger by the version it switched to, and owns only the outer machinery. The full seam — the qvr-ledger spine, the session → metrics row schema, and the adapter interface — is in references/eval-source-boundary.md.

Read the full file on GitHub · 396 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 396 lines · 144 tokens per session scan A ba42c9bb190d

Subscribe to this mod's changes

optimize-skill-loop is a skill published in the GitHub repository astra-sh/qvr (23 stars, last pushed 2mo ago), licensed MIT. It adds 144 tokens to every session and 5,707 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.