agentic-looplisted
Install: claude install-skill metraton/gaia
# Agentic Loop
Iterative improvement through small, reversible changes evaluated against a single metric. Each iteration is one hypothesis, one edit, one eval, one decision. The metric decides -- not you.
## Parameters (from orchestrator prompt)
`goal`, `eval_command`, `metric`, `direction` (higher/lower), `threshold`, `max_iterations`, `files_in_scope`, `branch`
## Setup
1. Read every file in `files_in_scope` deeply -- understand before changing
2. `git checkout -b {branch}`
3. Run `eval_command` -- parse `METRIC {name}={number}` from stdout -- this is your baseline
4. Write `state.json` and `worklog.md` (schemas in `reference.md`)
5. `git commit -m "baseline: {metric} {value}"`
## Loop (repeat until threshold, max_iterations, or stop)
1. **HYPOTHESIZE** -- based on worklog insights and last failure. When stuck, re-read source files; thinking longer beats trying faster
2. **EDIT** -- one focused change. Smaller diffs are easier to evaluate and reverse
3. **EVALUATE** -- run `eval_command`, parse `METRIC {name}={number}`
4. **DECIDE** (mechanically, not judgment):
- Improved (or equal with less code) -- KEEP -- `git add -A` then `git commit -m "improve: {metric} {old}->{new}"`
- Same or worse -- DISCARD -- `git checkout -- .` then `git clean -fd`
5. **LOG** -- append to `worklog.md`: run number, what changed, result, insight, next idea
6. **UPDATE** -- write `state.json` with current values
7. **ESCALATE** if needed:
- 3 consecutive discards -- REFINE (adjust