agentic/code/addons/guided-implementation/skills/iteration-control/SKILL.md
Manage bounded iteration loops for autonomous implementation — track retries, synthesize failure feedback, and escalate when limits hit
npx skillsauth add jmagly/aiwg iteration-controlInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Skill access pattern (post-kernel-pivot, 2026.5+)
Skill names referenced in this document are AIWG skills, not slash commands. Most are not kernel-listed and cannot be invoked as
/skill-nameby the platform. Reach them via:aiwg discover "<capability>" aiwg show skill <name>Only kernel-listed skills (
aiwg-doctor,aiwg-refresh,aiwg-status,aiwg-help,use,steward) are directly invokable as slash commands. See skill-discovery rule.
Manages bounded iteration loops for autonomous implementation with escalation.
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
This skill provides iteration control logic for guided implementation workflows. It tracks retry attempts, synthesizes feedback from failures, and decides whether to retry autonomously or escalate to the user.
Based on MAGIS research finding: Developer-QA iteration loops with bounds improve code quality while preventing infinite loops.
When invoked during a validation loop:
Track iteration state:
Evaluate validation results:
Synthesize feedback (on failure):
Decide action:
proceed: Validation passed, continue to next taskretry: Validation failed, iteration < max, retry with feedbackescalate: Validation failed, iteration >= max, pause for userFormat escalation (when needed):
IF test_result == PASS AND review_result == APPROVE:
RETURN { action: "proceed" }
IF current_iteration >= max_iterations:
RETURN {
action: "escalate",
context: summarize_all_attempts(),
question: identify_blocking_issue()
}
IF test_result == FAIL:
RETURN {
action: "retry",
feedback: extract_test_feedback(),
iteration: current_iteration + 1
}
IF review_result == REJECT:
RETURN {
action: "retry",
feedback: extract_review_feedback(),
iteration: current_iteration + 1
}
iteration_check:
task_id: "task-003"
current_iteration: 2
max_iterations: 3
test_result:
status: "fail" # pass | fail
output: |
FAIL src/auth/login.test.ts
Expected: token to contain userId
Received: undefined
review_result:
status: "pending" # approve | reject | pending
feedback: ""
decision:
action: "proceed"
task_id: "task-003"
message: "Validation passed. Proceeding to next task."
decision:
action: "retry"
task_id: "task-003"
iteration: 3
feedback:
summary: "Test failed: token missing userId"
actionable_items:
- "Ensure jwt.sign includes userId in payload"
- "Check that user object is populated before token generation"
priority: "high"
decision:
action: "escalate"
task_id: "task-003"
iteration: 3
context:
attempts_summary: |
Iteration 1: Test failed - undefined token
Iteration 2: Test failed - token missing userId
Iteration 3: Test failed - userId present but wrong format
pattern_detected: "userId format mismatch between token and test expectation"
question: |
After 3 attempts, the test still fails due to userId format.
The token contains: { userId: "123" } (string)
The test expects: { userId: 123 } (number)
Which format should be used?
1. String (update test)
2. Number (update implementation)
Default settings (can be overridden per-flow):
iteration_control:
max_iterations: 3
auto_retry_on_test_fail: true
auto_retry_on_review_reject: true
escalation_includes_diff: true
feedback_max_length: 500
Used by flow-guided-implementation to wrap the validation loop:
FOR EACH task:
iteration = 0
LOOP:
generate_code()
run_tests() -> test_result
run_review() -> review_result
decision = iteration_control(task, iteration, test_result, review_result)
SWITCH decision.action:
"proceed": BREAK (next task)
"retry": apply_feedback(decision.feedback); iteration++; CONTINUE
"escalate": PAUSE; await_user_input(); CONTINUE or ABORT
data-ai
Report which research-corpus radar sidecars are overdue for refresh. Computes staleness (days since last refresh vs the cadence window) for every radar, sorted most-overdue-first. Runs via `aiwg corpus radar-status`.
data-ai
Aggregate research-corpus radar sidecars into a corpus or per-cluster freshness report — totals, overdue count, per-cluster / per-GRADE / per-trajectory breakdowns, an overdue table, and per-radar rationale snippets. Runs via `aiwg corpus radar-report`.
testing
Scaffold radar/freshness sidecars for research-corpus REFs. Pulls title/authors from the citation sidecar and GRADE from the analysis doc, defaults the refresh cadence from GRADE and the cluster from a corpus-local map, and stamps documentation/radar/REF-XXX-radar.md. Runs via `aiwg corpus radar-init`.
data-ai
Compute an entity's publication trajectory — per-year paper counts, topic drift, hot-streak detection (≥3 consecutive A-grade years), and career phase. Runs via `aiwg corpus profile-temporal`.