iterative-refinement

iterative-refinement is a skill for Claude Code, Codex from sammcj/agentic-coding. It costs 100 tokens per session (2,795 once invoked), scanned A, original, Apache-2.0.

A method for improving scripts, prompts, documents, configurations, or datasets through repeated checks with explicit pass-or-fail conditions.

In plain words
What is it for?
Use it to define quality thresholds, run iterative refinement cycles, delegate parts of an investigation, and keep evidence of each result.
Why use it?
It turns vague judgments such as “is this good enough?” into repeatable checks and helps catch regressions introduced during changes.

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/sammcj/agentic-coding/iterative-refinement
Any agent
npx skills add sammcj/agentic-coding --skill iterative-refinement
Clone the repo
git clone --depth 1 https://github.com/sammcj/agentic-coding

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for iterative-refinement

README.md
[![agentmods](https://agentmods.dev/badge/skills/sammcj/agentic-coding/iterative-refinement.svg)](https://agentmods.dev/skills/sammcj/agentic-coding/iterative-refinement)
Your own site
<a href="https://agentmods.dev/skills/sammcj/agentic-coding/iterative-refinement"><img src="https://agentmods.dev/badge/skills/sammcj/agentic-coding/iterative-refinement.svg" alt="Measured on agentmods" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,795 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.00100 $0.02795
Opus 5 $0.00050 $0.01398
Sonnet 5 $0.00020 $0.00559
Haiku 4.5 $0.00010 $0.00280

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

Security

Grade A, and why

iterative-refinement 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 yesterday.

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_disabled/iterative-refinement/SKILL.md · 127 lines

How it starts

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

Iterative refinement with verifiable conditions

Improve any system (script, pipeline, prompt, doc, config, dataset) by looping against measurable pass/fail conditions while keeping the main thread's context lean. Task-agnostic. The aim is to make "is it good yet?" a single repeatable command, catch each regression at the edit that caused it, and keep load-bearing reasoning in cheap, auditable steps.

Use this as a toolkit, not a script. Each method below earns its place by what it prevents, and that reasoning is stated inline so you can judge when it applies. Reach for the methods the situation calls for, scale them to the stakes, and adapt or skip what doesn't fit; they compose well, but no fixed subset is mandatory and this skill can't anticipate every task you'll point it at. When a method clearly fits, lean into it fully rather than half-applying it. The judgement of which to use, and how hard, stays yours.

The loop

  1. Turn the goal into a pass/fail rubric with explicit thresholds. "Useful" isn't checkable; "contamination < 2%, both naive and effective ratios reported, every input row classified, prints Overall: PASS" is.
  2. Bake the rubric into the artifact as a self-check it prints. The artifact computes its own metrics and prints [PASS]/[FAIL] per condition, so the check can't drift out of sync with the code the way an external checklist does. Now any party (you, a subagent, the user) re-verifies with one command.
  3. Change one layer, re-run the check. Catch each regression at the edit that caused it, not three edits later.
  4. Loop on a fast slice, not the full dataset. Size the slice so a run takes seconds, not minutes. Run the full corpus only at checkpoints, when a layer is structurally complete and at sign-off, since that's where rare signals and period splits actually appear and the cost is justified.
  5. Keep a frozen held-out slice the loop never touches, and confirm against it before sign-off. Looping hard on one slice optimises the rubric for that slice (Goodhart on your own metric); the held-out slice is what proves the gain generalised rather than memorised.
  6. When all conditions pass but value remains, write a stricter rubric and loop again. Stop when a cycle yields nothing material.

Read the full file on GitHub · 127 lines

Files

What ships with it

2 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. yesterday First seen · 127 lines · 100 tokens per session scan A b10046efe8fb

Subscribe to this mod's changes

iterative-refinement is a skill published in the GitHub repository sammcj/agentic-coding (159 stars, last pushed yesterday), licensed Apache-2.0. It adds 100 tokens to every session and 2,795 once invoked, about $0.0005 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-09-03.

Related

Other skills, from other repositories

strands-review

Local preview of the strands-agents/devtools /strands review agent. Body is the upstream Task Reviewer SOP verbatim — do not paraphrase. Use when the user types /strands-review, asks for a "strands review" of a PR, or wants to anticipate what the remote /strands review GitHub Action will flag. Findings are close but…

strands-agents/harness-sdk · 125 tokens

pr-writer

Generates pull request titles and descriptions. Use when the user asks to create, open, write, draft, or generate a PR, pull request, or merge request description.

strands-agents/harness-sdk · 39 tokens

docs-writer

Draft or rewrite Strands Agents documentation pages. Use when writing new doc pages, rewriting pages that failed audit, drafting sections for existing pages, or writing blog posts and release notes about Strands. Also triggers on "write a doc", "draft a page", "rewrite the quickstart", "add a tutorial for X"…

strands-agents/harness-sdk · 74 tokens

pre-push

Runs the local equivalent of the CI merge gate before you push. Detects which areas (Python, TypeScript, docs) your changes touch, auto-fixes what it can, then runs only those checks. Use when the user asks to run pre-push checks, get push-ready, verify changes before pushing or opening a PR, "make sure CI will pass"…

strands-agents/harness-sdk · 85 tokens

docs-planner

Identify documentation gaps and prioritize the docs backlog. Use when planning a docs improvement sprint, after signals surface repeated friction, when new SDK features ship without docs, or for periodic health assessment. Also triggers on "plan docs work", "what docs need writing", "prioritize the backlog", "docs…

strands-agents/harness-sdk · 73 tokens

pr-feedback

Fetches PR review feedback and inline comments, categorizes them, and presents options to the user. Use when the user asks to get, read, address, or fix review comments on a pull request.

strands-agents/harness-sdk · 44 tokens