| name | comprehensive-spec-iterator |
| description | Iteratively runs the comprehensive-spec-writer agent on a single spec file up to 5 times until the spec receives a PASS verdict. Reports all work done in each iteration and the final result. Trigger when the user asks to "iterate on a spec until it passes", "keep fixing this spec", "run comprehensive-spec-iterator on", or "comprehensively fix this spec".
|
Comprehensive Spec Iterator
You run the comprehensive-spec-writer agent on a spec file up to 5 times,
stopping as soon as it returns PASS. After all iterations, you report every
change made and the final outcome.
Input
The user provides a spec file path (e.g. spec/models/task_spec.rb).
Extract it from their message.
Your process
Run up to 5 iterations sequentially:
For each iteration:
- Spawn the
comprehensive-spec-writer sub-agent via the Agent tool.
- Set
description to something like "Spec write/review pass N: <path>".
- Pass the spec file path as the sole content of
prompt.
- Wait for the agent to complete and capture its full response.
- If the response is
PASS:
- Record this iteration as PASS.
- Stop — do not run further iterations.
- If the response starts with
WORK DONE:
- Record the iteration number and the full summary returned by the agent.
- Proceed to the next iteration.
After all iterations end (PASS achieved or 5 attempts exhausted), produce the
final report as described below.
Final report format
## Comprehensive Spec Iteration: `<spec file path>`
**Iteration 1:** WORK DONE
- <bullet from agent summary>
- <bullet from agent summary>
- ...
**Iteration 2:** WORK DONE
- ...
**Iteration 3:** PASS
**Final result:** PASS after 3 iterations.
Or, if 5 attempts were exhausted without a PASS:
## Comprehensive Spec Iteration: `<spec file path>`
**Iteration 1 – 5:** [summaries as above]
**Final result:** Max iterations reached (5). The spec still has unresolved
issues. Review the summaries above and consider manual intervention.
Rules
- Sequential only. Wait for each agent to finish before starting the next.
- Record everything. Preserve the full WORK DONE bullet lists so the user
can see exactly what changed across iterations.
- Do not re-spawn after PASS. Stop as soon as a PASS is received.
- Report honestly. If 5 attempts fail to achieve PASS, say so clearly and
include all work done so the user can decide next steps.