/qe-iterative-loop
Runs autonomous red-green-refactor loops to fix failing tests, reach coverage targets, and satisfy quality gates. Use when tests need to pass, coverage thresholds must be met, quality gates require compliance, or flaky tests need stabilization.
$ npx -y skills add proffesor-for-testing/agentic-qe --skill qe-iterative-loop --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/qe-iterative-loop
Context preview
The summary Claude sees to decide when to auto-load this skill.
Runs autonomous red-green-refactor loops to fix failing tests, reach coverage targets, and satisfy quality gates. Use when tests need to pass, coverage thresholds must be met, quality gates require compliance, or flaky tests need stabilization.
SKILL.md
qe-iterative-loop.SKILL.mdname: "qe-iterative-loop"
description: "Runs autonomous red-green-refactor loops to fix failing tests, reach coverage targets, and satisfy quality gates. Use when tests need to pass, coverage thresholds must be met, quality gates require compliance, or flaky tests need stabilization."
trust_tier: 2
validation:
schema_path: schemas/output.json
validator_path: scripts/validate-config.json
QE Iterative Loop
Overview
QE Iterative Loop is a specialized adaptation of the Ralph Wiggum technique for **Quality Engineering workflows**. It enables autonomous, self-correcting quality cycles where AI agents iterate until quality objectives are achieved - tests pass, coverage targets met, quality gates satisfied, or flaky tests stabilized.
Why QE Benefits from Iteration
Quality Engineering has **objective, measurable success criteria**:
- Tests either pass or fail (exit code 0 vs non-zero)
- Coverage is quantifiable (78.5% vs 80% target)
- Quality gates have binary outcomes (pass/fail)
- Contract validation has clear schemas
This makes QE ideal for iterative loops - we know exactly when we're done.
Prerequisites
- AQE v3 fleet initialized
- Test framework configured (Jest, Vitest, Pytest, etc.)
- Coverage tooling (c8, istanbul, coverage.py)
- Quality gate definitions
---
Quick Start
Pattern 1: Test Fix Iteration
# Task: Fix all failing tests
/qe-loop "Run npm test and fix all failing tests.
Success: npm test exits with code 0
Output <promise>TESTS_GREEN</promise> when all tests pass."
Pattern 2: Coverage Target Iteration
# Task: Achieve 80% coverage
/qe-loop "Increase test coverage to 80%.
Success: Coverage report shows >= 80%
Output <promise>COVERAGE_MET</promise> when target achieved."
Pattern 3: Quality Gate Iteration
# Task: Pass all quality gates
/qe-loop "Pass all quality gates for deployment.
Gates:
- Unit tests: pass
- Integration tests: pass
- Coverage: >= 80%
- No critical vulnerabilities
- Performance < 200ms P95
Output <promise>QUALITY_GATES_PASSED</promise> when all pass."
---
QE Iteration Patterns
Pattern 1: Test-Fix Iteration Loop
**Goal**: All tests pass
## QE Test-Fix Loop
### Success Criteria
- `npm test` (or test command) returns exit code 0
- No skipped tests (unless explicitly allowed)
- No pending tests
### Iteration Steps
1. Run full test suite
2. Parse output for failures
3. Analyze first failure:
- Identify failing test file
- Understand assertion that failed
- Check if production code or test is wrong
4. Fix the issue
5. Re-run failed test file only (faster feedback)
6. If file passes, run full suite
7. If all pass -> output <promise>TESTS_GREEN</promise>
8. If failures remain -> continue to next failure
### Safety
- Max iterations: 30
- After 10 iterations: report remaining failures
- Stop if same test fails 5 times (possible design issue)
Pattern 2: Coverage Improvement Loop
**Goal**: Achieve coverage target
## QE Coverage Loop
### Success Criteria
- Line coverage >= {target}%
- Branch coverage >= {target - 5}% (typically lower target)
- No critical paths uncovered
### Iteration Steps
1. Run tests with coverage: `npm test -- --coverage`
2. Parse coverage report
3. If target met -> output <promise>COVERAGE_MET</promise>
4. Identify uncovered files, sorted by:
- Critical business logic (highest priority)
- Lines uncovered (most impact)
- Complexity (McCabe score)
5. Generate test for highest-impact uncovered code
6. Run tests to verify new test passes
7. Check coverage improvement
8. Continue until target met
### Intelligence Integration
- Store successful test patterns in memory
- Learn from coverage achievements
- Predict best coverage strategies
### Commands
```bash
# Check coverage status (via AQE MCP)
aqe memory get --key "coverage-status" --namespace "coverage"
# Store coverage achievement pattern (via AQE MCP)
aqe memory store \
--key "coverage-pattern-auth" \
--value '{"approach": "mock external deps", "improvement": "12%"}' \
--namespace "coverage-patterns"
### Pattern 3: Quality Gate Compliance Loop
**Goal**: Pass all quality gates
```markdown
## QE Quality Gate Loop
### Gate Definitions
| Gate | Criteria | Priority |
|------|----------|----------|
| unit-tests | All pass | P0 |
| integration-tests | All pass | P0 |
| coverage | >= 80% | P1 |
| lint | No errors | P1 |
| typecheck | No errors | P1 |
| security | No critical/high CVEs | P0 |
| performance | P95 < 200ms | P2 |
### Iteration Strategy
1. Run all gate checks
2. Identify failing gates (sorted by priority)
3. Fix highest-priority failing gate
4. Re-run that gate to verify
5. When gate passes, move to next failing gate
6. When all pass -> output <promise>QUALITY_GATES_PASSED</promise>
### Gate Check Commands
```bash
# Check all gates
npm test && npm run lint && npm run typecheck && npm run coverage && npm audit
# Individual gate checks
npm test # unit-tests
npm run test:integration # integration-tests
npm run coverage # coverage
npm run lint # lint
npx tsc --noEmit # typecheck
npm audit --audit-level=high # security
npm run benchmark # performance
Integration with AQE v3
# Submit quality gate assessment task
aqe quality --runGate true
# Task orchestration for gate compliance
aqe task submit --task "Pass all quality gates" --strategy adaptive
### Pattern 4: Flaky Test Stabilization Loop
**Goal**: Eliminate test flakiness
```markdown
## QE Flaky Test Loop
### Flakiness Detection
1. Run test suite N times (e.g., 5 runs)
2. Identify tests that pass/fail inconsistently
3. Calculate flakiness score: (inconsistent runs / total runs)
### Iteration Steps
1. Run: `for i in {1..5}; do npm test; done`
2. Aggregate results per test
3. Identify flaky tests (passed some, failed some)
4. For each flaky test:
- Analyze faRead more
name: "qe-iterative-loop" description: "Runs autonomous red-green-refactor loops to fix failing tests, reach coverage targets, and satisfy quality gates. Use when tests need to pass, coverage thresholds must be met, quality gates require compliance, or flaky tests need stabilization." trust_tier: 2 validation: schema_path: schemas/output.json validator_path: scripts/validate-config.json
QE Iterative Loop
Overview
QE Iterative Loop is a specialized adaptation of the Ralph Wiggum technique for **Quality Engineering workflows**. It enables autonomous, self-correcting quality cycles where AI agents iterate until quality objectives are achieved - tests pass, coverage targets met, quality gates satisfied, or flaky tests stabilized.
Why QE Benefits from Iteration
Quality Engineering has **objective, measurable success criteria**:
- Tests either pass or fail (exit code 0 vs non-zero)
- Coverage is quantifiable (78.5% vs 80% target)
- Quality gates have binary outcomes (pass/fail)
- Contract validation has clear schemas
This makes QE ideal for iterative loops - we know exactly when we're done.
Prerequisites
- AQE v3 fleet initialized
- Test framework configured (Jest, Vitest, Pytest, etc.)
- Coverage tooling (c8, istanbul, coverage.py)
- Quality gate definitions
---
Quick Start
Pattern 1: Test Fix Iteration
# Task: Fix all failing tests /qe-loop "Run npm test and fix all failing tests. Success: npm test exits with code 0 Output <promise>TESTS_GREEN</promise> when all tests pass."
Pattern 2: Coverage Target Iteration
# Task: Achieve 80% coverage /qe-loop "Increase test coverage to 80%. Success: Coverage report shows >= 80% Output <promise>COVERAGE_MET</promise> when target achieved."
Pattern 3: Quality Gate Iteration
# Task: Pass all quality gates /qe-loop "Pass all quality gates for deployment. Gates: - Unit tests: pass - Integration tests: pass - Coverage: >= 80% - No critical vulnerabilities - Performance < 200ms P95 Output <promise>QUALITY_GATES_PASSED</promise> when all pass."
---
QE Iteration Patterns
Pattern 1: Test-Fix Iteration Loop
**Goal**: All tests pass
## QE Test-Fix Loop ### Success Criteria - `npm test` (or test command) returns exit code 0 - No skipped tests (unless explicitly allowed) - No pending tests ### Iteration Steps 1. Run full test suite 2. Parse output for failures 3. Analyze first failure: - Identify failing test file - Understand assertion that failed - Check if production code or test is wrong 4. Fix the issue 5. Re-run failed test file only (faster feedback) 6. If file passes, run full suite 7. If all pass -> output <promise>TESTS_GREEN</promise> 8. If failures remain -> continue to next failure ### Safety - Max iterations: 30 - After 10 iterations: report remaining failures - Stop if same test fails 5 times (possible design issue)
Pattern 2: Coverage Improvement Loop
**Goal**: Achieve coverage target
## QE Coverage Loop
### Success Criteria
- Line coverage >= {target}%
- Branch coverage >= {target - 5}% (typically lower target)
- No critical paths uncovered
### Iteration Steps
1. Run tests with coverage: `npm test -- --coverage`
2. Parse coverage report
3. If target met -> output <promise>COVERAGE_MET</promise>
4. Identify uncovered files, sorted by:
- Critical business logic (highest priority)
- Lines uncovered (most impact)
- Complexity (McCabe score)
5. Generate test for highest-impact uncovered code
6. Run tests to verify new test passes
7. Check coverage improvement
8. Continue until target met
### Intelligence Integration
- Store successful test patterns in memory
- Learn from coverage achievements
- Predict best coverage strategies
### Commands
```bash
# Check coverage status (via AQE MCP)
aqe memory get --key "coverage-status" --namespace "coverage"
# Store coverage achievement pattern (via AQE MCP)
aqe memory store \
--key "coverage-pattern-auth" \
--value '{"approach": "mock external deps", "improvement": "12%"}' \
--namespace "coverage-patterns"### Pattern 3: Quality Gate Compliance Loop **Goal**: Pass all quality gates ```markdown ## QE Quality Gate Loop ### Gate Definitions | Gate | Criteria | Priority | |------|----------|----------| | unit-tests | All pass | P0 | | integration-tests | All pass | P0 | | coverage | >= 80% | P1 | | lint | No errors | P1 | | typecheck | No errors | P1 | | security | No critical/high CVEs | P0 | | performance | P95 < 200ms | P2 | ### Iteration Strategy 1. Run all gate checks 2. Identify failing gates (sorted by priority) 3. Fix highest-priority failing gate 4. Re-run that gate to verify 5. When gate passes, move to next failing gate 6. When all pass -> output <promise>QUALITY_GATES_PASSED</promise> ### Gate Check Commands ```bash # Check all gates npm test && npm run lint && npm run typecheck && npm run coverage && npm audit # Individual gate checks npm test # unit-tests npm run test:integration # integration-tests npm run coverage # coverage npm run lint # lint npx tsc --noEmit # typecheck npm audit --audit-level=high # security npm run benchmark # performance
Integration with AQE v3
# Submit quality gate assessment task aqe quality --runGate true # Task orchestration for gate compliance aqe task submit --task "Pass all quality gates" --strategy adaptive
### Pattern 4: Flaky Test Stabilization Loop
**Goal**: Eliminate test flakiness
```markdown
## QE Flaky Test Loop
### Flakiness Detection
1. Run test suite N times (e.g., 5 runs)
2. Identify tests that pass/fail inconsistently
3. Calculate flakiness score: (inconsistent runs / total runs)
### Iteration Steps
1. Run: `for i in {1..5}; do npm test; done`
2. Aggregate results per test
3. Identify flaky tests (passed some, failed some)
4. For each flaky test:
- Analyze faAI-powered quality engineering agents that generate tests, find coverage gaps, detect flaky tests, and learn your codebase patterns — across 11 coding agent platforms.
Repo: proffesor-for-testing/agentic-qe
Other skills on agentic-qe.
- /a11y-ally
Use when running comprehensive WCAG accessibility audits with axe-core + pa11y + Lighthouse, generating context-aware remediation, or testing video accessibility. Supports 3-tier browser cascade with graceful degradation.
Open skill - /accessibility-testing
WCAG 2.2 compliance testing, screen reader validation, and inclusive design verification. Use when ensuring legal compliance (ADA, Section 508), testing for disabilities, or building accessible applications for 1 billion disabled users globally.
Open skill - /agentdb-advanced
Master advanced AgentDB features including QUIC synchronization, multi-database management, custom distance metrics, hybrid search, and distributed systems integration. Use when building distributed AI systems, multi-agent coordination, or advanced vector search applications.
Open skill - /agentdb-learning
Create and train AI learning plugins with AgentDB's 9 reinforcement learning algorithms. Includes Decision Transformer, Q-Learning, SARSA, Actor-Critic, and more. Use when building self-learning agents, implementing RL, or optimizing agent behavior through experience.
Open skill - /agentdb-memory-patterns
Implement persistent memory patterns for AI agents using AgentDB. Includes session memory, long-term storage, pattern learning, and context management. Use when building stateful agents, chat systems, or intelligent assistants.
Open skill - /agentdb-optimization
Optimize AgentDB performance with quantization (4-32x memory reduction), HNSW indexing (150x faster search), caching, and batch operations. Use when optimizing memory usage, improving search speed, or scaling to millions of vectors.
Open skill

