/selamy-skills:adaptive-loop-budgetingfrom selamy-skills
Use when an autonomous loop needs explicit limits on attempts, time, cost, tool calls, verification depth, or risk, and a clear stop, continue, yield, or escalate decision.
Ships in selamy-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this when a loop could keep consuming time, tokens, money, tool calls, or risk without a natural stopping point. The goal is to spend effort where it reduces uncertainty, stop when confidence is high enough, and escalate when the next iteration would be expensive or unsafe.
This skill applies to coding loops, research loops, product feedback loops, self-improving experiments, debugging sessions, and long-running verification.
Before starting or continuing the loop, name:
If the task already has an explicit user budget, honor it. If no budget exists, choose the smallest budget that can produce useful evidence and state it before looping.
Run the cheapest check that can reduce the current uncertainty:
| Uncertainty | Start with | Escalate to |
|---|---|---|
| Is the task understood? | Restate goal and acceptance criteria | Ask for a decision |
| Is the code shape plausible? | Static read, type check, unit test | Integration or browser check |
| Is the user path working? | Local browser/API check | Target-environment verification |
| Is feedback actionable? | Cluster and confidence score | Experiment, metric, or user research |
| Is a fix durable? | Regression test or fixture | Monitor, alert, or policy gate |
| Is a claim real? | Direct artifact check | Independent system-of-record check |
Do not jump to expensive verification because it feels thorough. Escalate when the cheaper layer cannot prove the claim or when the risk tier requires it.
At each iteration boundary, choose one:
Continuing requires a changed hypothesis. Repeating the same action because the last result was inconvenient is not iteration.
Tighten or stop the loop when:
Expand the budget only when:
Match confidence to risk:
Use [[process-aware-done]] for completion claims and [[verify-real-artifact]] when the result matters outside the local checkout.
When loops can run on models of different cost, spend most attempts on the cheapest model that passes the mechanical checks:
start rung + floor(real attempts / N), with a small fixed N
such as four.Objective: <what the loop is optimizing or proving>
Budget: <attempts/time/cost/tool calls/risk limit>
Evidence so far: <strongest signal>
Decision: <continue, succeeded, partial, yield, or escalate>
Reason: <why this is the right boundary decision>
Next step: <only if continuing or escalating>
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub selamy-labs/agent-skills --plugin selamy-skills111 skills in this plugin
/adaptive-estimationUse when tracking a slowly-varying latent quantity from noisy measurements with quantifiable uncertainty — a drifting metric, capacity, latency trend, or confidence. Prefer a Kalman-style adaptive estimator over fixed moving averages or static thresholds./adopt-and-deleteUse when adopting a shared module, library, chart, or service, or doing any consolidation, migration, or refactor that supersedes existing code. The change that adds the replacement must REMOVE what it replaced, in the same atomic change./adversarial-reviewUse before claiming a high-stakes artifact done, verified, or merged. Have an independent grader adversarially review it — prompted to refute and find reasons not to ship, not to bless — and iterate to an explicit ship-or-revise verdict.Other plugins' skills for the same job