coding-agents
Iterate Until Verified: A Loop for Agent Quality
Learn how the iterate-until-verified skill adds a verification loop to AI agents, preserving the original task while improving output quality.
Where this fits
You ask your coding agent to generate a comprehensive test suite. It returns a plausible set of tests, but you later find critical edge cases missing. The agent never checked its own work against the acceptance criteria. This is the classic single-pass failure. The iterate-until-verified skill fixes that by forcing an execution-and-verification loop around any substantial task, so the agent keeps working until explicit quality gates pass.
Why agents benefit
- Preserves the original task: The skill locks the task contract (outcome, constraints, definition of done) so the agent never drifts into a different interpretation.
- Applies prompt-agnostic verification: The loop works with any task, whether it's code, prose, or analysis, without rewriting the user's request.
- Uses subagents and reviewers: The agent can fan out work to independent reviewers or harsh critics, giving it multiple perspectives before finalizing.
- Enables blind comparison: Candidates are compared anonymously, reducing bias when selecting the best output.
- Explicit quality gates: The loop continues until measurable criteria pass, not just until the model "feels" done.
Practical scenarios
Benchmarking generated code against references
An agent is asked to implement a function matching a reference spec. Instead of stopping at the first passing run, the agent uses the skill to run hidden test cases, compare outputs against the reference, and iterate on failures until all benchmarks pass.
Prompt improvement with verification
A developer asks the agent to improve an existing prompt. Rather than rewriting the prompt and declaring success, the agent wraps the original task in a compose mode, runs candidate prompts through a test set, and chooses the best one based on measured outcomes.
Fanning out large review tasks
When reviewing a large codebase for security issues, the agent splits the work among subagents, collects their findings, and then has a harsh critic challenge each result. The loop continues until all findings are verified and prioritized.
Add it to your agent workflow
Install the skill with:
npx skills add MengTo/Skills --skill iterate-until-verified
Then use it by asking your agent to "iterate until verified" on a specific task. For example:
Use the iterate-until-verified skill to refactor the auth module while preserving its public API. Execute, verify against the existing test suite, and loop until all tests pass and no regressions are found.
Compare before adopting
Before you adopt this skill, consider a few things. First, are the quality signals meaningful? Verify that the skill's loop actually drives better outcomes with your typical tasks. Second, check maintenance freshness: the repo has a strong star count, but confirm recent commits and issue responses. Third, compare alternatives: other agentic loops exist, but this one is notable for preserving the original request and offering compose mode. Finally, evaluate workflow fit: do you need harsh critics and blind comparison, or would a simpler check suffice? This skill shines when quality is non-negotiable.
Why it is worth tracking
With over 5,600 stars on GitHub, iterate-until-verified has clear community momentum. It is also tracked on OpenAgentSkill, which is a useful signal for discoverability and validation. Keep an eye on this skill if you are building agents that must produce reliable, verifiable output in complex domains—it is a practical pattern that could become a standard part of agent workflows.
Featured Skill
iterate-until-verified
Skill by MengTo