Install
$ agentstack add skill-proffesor-for-testing-agentic-qe-iterative-loop ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Iterative Loop
Overview
The Iterative Loop skill implements continuous AI-driven development loops that persist until completion criteria are met. Inspired by the Ralph Wiggum technique, this approach enables autonomous, self-correcting development cycles where the AI sees its previous work in files and git history, iteratively improving until success.
Core Philosophy
- Iteration > Perfection - Don't aim for perfect on first try; let the loop refine the work
- Failures Are Data - Each failure provides information to improve the next attempt
- Clear Criteria - Success must be objectively measurable (tests, metrics, validations)
- Persistence Wins - Keep trying until success; the loop handles retry logic automatically
Prerequisites
- Claude Code with session management
- Clear completion criteria (tests, linting, metrics)
- Version control (git) for tracking iterations
Quick Start
Basic Iterative Development Pattern
# Define task with clear completion criteria
TASK="Implement user authentication with JWT.
Success criteria:
- All unit tests pass
- Integration tests pass
- No TypeScript errors
- Security audit passes
Output COMPLETE when all criteria met."
# Execute iterative loop (conceptual)
while ! task_complete; do
claude_execute "$TASK"
check_completion_criteria
done
AQE v3 Integration Example
# Using claude-flow hooks for iterative task
npx --no-install ruflo hooks pre-task --description "Implement auth with iteration" --taskId "auth-impl"
# Store iteration state in memory
npx --no-install ruflo memory store \
--key "iteration-auth" \
--value '{"iteration": 1, "maxIterations": 20, "criteria": "all tests pass"}' \
--namespace iterations
Step-by-Step Guide
Step 1: Define Clear Success Criteria
Essential: Every iterative task MUST have objectively measurable completion criteria.
Good Criteria Examples:
✅ All unit tests pass (npm test returns exit code 0)
✅ Coverage > 80% (coverage report shows 80%+)
✅ No TypeScript errors (tsc --noEmit returns 0)
✅ Linting passes (eslint returns 0)
✅ Performance AUTH_COMPLETE when Phase 4 passes.
Step 3: Implement Safety Mechanisms
Always include escape conditions:
## Safety Rules
1. **Max Iterations**: Stop after 20 attempts
2. **Stuck Detection**: After 5 iterations without progress:
- Document what's blocking
- List attempted approaches
- Suggest alternative strategies
3. **Critical Errors**: Stop immediately if:
- Database corruption detected
- Security vulnerability introduced
- Breaking changes to existing features
Step 4: Execute with Verification
Each iteration should:
- Make targeted changes
- Run verification (tests, lint, build)
- Analyze results
- Plan next iteration based on feedback
# Iteration pattern
1. Read previous state (files, git log)
2. Identify remaining work
3. Implement specific change
4. Run verification suite
5. If all pass -> output completion promise
6. If failures -> analyze and continue iteration
Iterative Patterns
Pattern 1: Test-Driven Iteration
## TDD Iteration Task
1. Write failing test for [feature]
2. Implement minimal code to pass test
3. Run `npm test`
4. If test fails -> debug and fix implementation
5. If test passes -> check if more tests needed
6. Repeat until all acceptance tests pass
7. Refactor if needed
8. Output TDD_COMPLETE
Pattern 2: Bug Fix Iteration
## Bug Fix Task
1. Write failing test that reproduces bug
2. Implement fix
3. Run test suite
4. If reproduction test fails -> analyze why fix didn't work
5. If other tests fail -> fix regressions
6. If all tests pass -> output BUG_FIXED
Max iterations: 10
After 5 iterations without fix:
- Document root cause analysis
- Suggest alternative approaches
Pattern 3: Coverage Improvement Iteration
## Coverage Improvement Task
Target: 80% line coverage
1. Run coverage analysis
2. Identify uncovered code paths
3. Write test for highest-impact uncovered path
4. Run tests with coverage
5. If coverage >= 80% -> output COVERAGE_ACHIEVED
6. If coverage continue iteration
Max iterations: 30
Progress check: If coverage doesn't improve for 3 iterations -> analyze blockers
Pattern 4: Performance Optimization Iteration
## Performance Optimization Task
Target: Response time output PERF_TARGET_MET
6. If not improved -> try different approach
Max iterations: 15
Record metrics each iteration for trend analysis
Integration with Claude Flow
Memory-Enhanced Iteration
# Store iteration state
npx --no-install ruflo memory store \
--key "current-iteration" \
--value '{"task": "auth", "iteration": 5, "lastResult": "2 tests failing"}' \
--namespace iterations
# Search for similar past iterations
npx --no-install ruflo memory search \
--query "auth implementation" \
--namespace iterations
# Learn from successful completions
npx --no-install ruflo hooks post-task \
--taskId "auth-impl" \
--success true \
--quality 0.9
Swarm-Coordinated Iteration
For complex tasks, use multiple agents iterating in parallel:
# Initialize swarm for parallel iteration
npx --no-install ruflo swarm init --topology mesh --max-agents 5
# Spawn specialized iterators
Task("Iterate on unit tests", "Fix failing unit tests until all pass", "tester")
Task("Iterate on integration", "Fix integration tests until all pass", "tester")
Task("Iterate on performance", "Optimize until benchmarks pass", "performance-engineer")
Best Practices
Prompt Engineering for Iteration
Include:
- Explicit completion criteria with verification commands
- Phase-based breakdown for complex tasks
- Safety limits (max iterations)
- Progress tracking instructions
- Stuck detection and recovery procedures
Example Well-Structured Prompt:
## Task: Implement Feature X
### Success Criteria (ALL must pass):
1. `npm test` exits with code 0
2. `npm run lint` exits with code 0
3. `npm run typecheck` exits with code 0
4. No console.log statements in production code
### Phases:
1. Write failing tests
2. Implement feature
3. Fix any failures
4. Clean up and refactor
### Safety:
- Max iterations: 20
- After 10 iterations: summarize blockers
- Stop if security issues detected
### Completion:
When ALL success criteria pass, output:
FEATURE_X_COMPLETE
When to Use Iterative Loops
Ideal for:
- Well-defined tasks with measurable success
- Test-driven development
- Bug fixing with reproducible tests
- Coverage improvement
- Performance optimization
- Linting/formatting fixes
Not ideal for:
- Tasks requiring human judgment
- Design decisions
- Vague or subjective goals
- One-time operations
- Production debugging without tests
Troubleshooting
Issue: Infinite Loop / No Progress
Symptoms: Same errors repeat without improvement
Solutions:
- Increase specificity in completion criteria
- Add "stuck detection" with alternative approaches
- Lower max iterations
- Break task into smaller phases
Issue: False Completion
Symptoms: Loop ends but task not actually complete
Solutions:
- Add more verification commands
- Make completion criteria more explicit
- Add integration tests alongside unit tests
Issue: Regression in Later Iterations
Symptoms: Previously passing tests fail after new changes
Solutions:
- Add regression check step
- Use git to compare iterations
- Implement smaller, targeted changes
Related Skills
- [tdd-london-chicago](../tdd-london-chicago/) - TDD approaches for iterative development
- [qe-iterative-loop](../qe-iterative-loop/) - AQE v3 fleet-specific iteration patterns
- [hooks-automation](../hooks-automation/) - Claude Flow hooks for automation
Resources
- Ralph Wiggum Technique - Original methodology
- Ralph Orchestrator - Orchestration tools
- Claude Code Plugins - Official plugins
Origin: Based on Ralph Wiggum plugin from claude-code repository (anthropics/claude-code) Adapted for: Agentic QE v3 with Claude Flow integration
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: proffesor-for-testing
- Source: proffesor-for-testing/agentic-qe
- License: MIT
- Homepage: https://agentic-qe.dev/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.