Qa sweep

From ZaxbyHub/opencode-swarm · View interactive version

Qa sweep is an AI agent skill from the GitHub repository ZaxbyHub/opencode-swarm. Apply when implementing features, fixing bugs, debugging errors, investigating failures, tracing root causes, reviewing tech debt, tracing issues, planning fixes, or completing any task. Enforces parallel sub-agent implementation, independent adversarial review, and a 95% confidence gate before stop

How to use this skill

Skill file

QA & Independent Review Protocol

Follow this protocol on every implementation, fix, debugging, or review task.

Proportionality

Scale the depth of each phase to risk — never skip a gate for changed work,

but match its weight to the task:

question) with no worktree edit: Phases 2–3 are not required; verify claims

against the actual source before answering.

files): Phases 2 and 3 are mandatory. For a small, low-risk edit, one fresh

review agent covering both the adversarial and completeness checklists is

acceptable; for high-risk or cross-file work, keep them separate.

migrations, concurrency): full protocol, no consolidation.

This proportionality applies only to qa-sweep's own Phase 2/3 passes. When

swarm mode is enabled, the swarm-mode contract's separate independent

implementation reviewer and final critic gates apply unreduced to any

changed work — consolidation here never merges or replaces those gates.

For agent-type, model, and effort selection when spawning these sub-agents,

load the orchestrating-subagents skill: economize on explorers, never on

reviewers.

If no subagent tool is available

If this protocol executes in a context without a subagent tool (Agent or

Task) — check your actual tool list rather than assuming — perform the

Phase 2/3 checklists yourself as a clearly labeled fallback self-review

and disclose in your report that independent review was unavailable, so the

orchestrator can re-run the gate with a real fresh agent. Never present

self-review as independent review.

Phase 1 — Parallel Implementation

Pre-implementation static-gate baseline

Before the first coder dispatch in any phase, capture a static-gate baseline so findings are scoped to the phase, not to pre-existing code:

Acceptance tests first

Before running any broader test suite, run the smallest test set that covers the task's acceptance criteria. Full-suite passes can mask targeted failures when ordering or concurrency changes — exercise each FR's acceptance criterion explicitly first.

Phase 2 — Independent Adversarial Review (Mandatory)

After implementation, spawn a FRESH sub-agent that has not participated in any prior work. Give it this directive verbatim:

"Assume all work done by the implementing agent is incorrect until you can prove otherwise with

absolute evidence from the actual code. The implementing agent makes frequent mistakes and tends

to miss edge cases. Do not trust any claim without tracing it yourself. Review every change,

test, and edge case end-to-end through the real source."

The review agent must:

Timing requirement: Phase 2 must complete and all confirmed findings must be addressed before the commit you intend as the final substantive push. Do not defer this to "after CI passes" — CI passing on a buggy commit does not retroactively make the review optional. For high-risk work (security, isolation, IPC contracts, auth, payments), this is a hard gate with no exceptions.

Phase 3 — Completeness Verification

Spawn a SECOND independent agent to verify original planned work vs. delivered work:

"Assume nothing was completed correctly or fully. Map every originally planned item to actual

code changes and verify each one independently. Do not trust the implementing agent's report."

Stop Condition

Do NOT stop until ≥95% confident that:

If below 95%, state what remains and continue working.

User-controlled gates

When the user has explicitly declined or deferred an action that is theirs to take — such as choosing "Leave it for you" on a merge offer, or explicitly saying they will merge manually — that action is outside the agent's scope. The 95% confidence gate applies to technical work the agent controls. Publication by merge is a user-controlled gate: once the user has deliberately declined it, the agent's work is complete and the stop condition is satisfied. Do not loop on pending user-controlled actions.

Reviewer rejection loops

When a single file has gone through 2+ reviewer rejection cycles without

resolution, escalate to critic_sounding_board before the next re-dispatch.

The sounding board can identify whether the reviewer's bar is unreasonable,

the implementation is fundamentally wrong, or the rejection is structural

(e.g., skill-load failure masquerading as a content rejection). Do not

enter a third rejection cycle without sounding-board consultation.

Skill-load failures in reviewer delegation

If a reviewer returns a REJECT that explicitly cites SKILL_LOAD_FAILED,

treat the verdict as INCONCLUSIVE — not a content rejection. Re-dispatch the

reviewer with SKILLS: none (omitting the problematic file reference)

so the reviewer evaluates the actual code, not the skill-loading

infrastructure. This only applies when the rejection explicitly cites

a skill-loading failure — never use SKILLS: none to suppress a

legitimate content-based rejection.

Inline code fallback for restricted review contexts

When a reviewer cannot read files directly (read-restricted advisory

lanes, sandbox limitations), include the most relevant code snippets

inline in the delegation prompt with path:line anchors so citations

are independently verifiable. This is a fallback only — prefer

file-read access when available, and never inline entire files (large

inline prompts can produce malformed tool-call JSON). Keep inline

snippets to the specific functions or blocks under review.

One-shot docs review delegation

When a reviewer rejects a documentation file, do not send piecemeal

fix-one-issue delegations. Read the entire file yourself, list ALL

issues in a single comprehensive delegation, and have the coder fix

everything in one pass. Apply this per-file — do not batch fixes

across unrelated files (scope containment still applies).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.