Shell Tool · engineering · Sentinel

Iterate Until Green

Pin a goal + verifiable check; loop attempt → test → diagnose → fix until the check exits 0.

Updated today
View as MarkdownsentinelsonnetstandardMax 20 turns

Overview

Implements goal-driven-loop/SKILL.md. The user supplies a goal and a verifiable shell check (a one-liner that exits 0 on success, non-zero with diagnostic output on failure). The model runs an outer loop: attempt → run check → if fail, read failure output, propose surgical patch, apply, retry. Capped at 10 iterations to avoid runaway. Best for build/test/typecheck driven work.

When to use this

  • user wants something to 'just work' and has a clear pass/fail criterion
  • user says 'make tests pass' / 'get this building' / 'fix until typecheck is green'
  • open-ended task where the only spec is a runnable verification

When NOT to use this

  • no verifiable check exists → ask the user for one first
  • task is a single bug fix → use minimal-patch directly

Example prompts

make the tests pass
iterate until pnpm typecheck is green
get the build working — npm run build should exit 0

Inputs and output

Inputs

FieldDescription
goalwhat success looks like in one sentence
check_commandshell one-liner that exits 0 on success

Output

Iterations taken, final check output, list of files touched.

Runtime profile

What the engine commits when this skill runs.

PropertyValueMeaning
Model tiersonnetThe balanced default model class. Trades quality against cost for the vast majority of skill runs.
Cost classstandardThe balanced default model. Right for most skills.
Turn budget20Hard cap on tool-calling iterations before the engine forces a final answer.
ExecutionsynchronousRuns inside the live turn; result lands in the same response.

Under the hood

Tools the engine exposes to this skill and integrations it needs.

ResourceKind
shell_exectool
shell_readtool
shell_writetool

Tags: engineering, iterate, verify

Execution template

Shell tools dispatch via a command template. The model substitutes user inputs into the placeholders before firing the underlying tool.

shell_execbash
1follow goal-driven-loop/SKILL.md; loop attempt -> {{check_command}} -> diagnose -> fix (max 10 iters)

Invoking this from an agent

Three paths reach this skill. From the chat UI, a user can type the persona slash command followed by a natural request and the discovery step resolves to this skill automatically. From the MCP server, fetch the skill detail with get_skill({id: "iterate-until-green"}) and then invoke it through the agent runtime once the authenticated tier ships. From your own code, hit /docs/skills/iterate-until-green/llm.txt for the token-efficient markdown body and feed it to your model directly.

Note
Every skill page has a canonical permalink and a markdown alternate that LLM crawlers consume via Accept: text/markdown. The full machine-readable catalog lives at /.well-known/agent-skills/index.json.