| name | qa-orchestrator |
| description | Orchestrate QA agent workflows — spawn test agents in parallel, collect results,
triage bugs, trigger the bug fixer, and generate QA reports. The main entry point
for running a QA session.
Trigger on "run QA", "start QA session", "test the PR", "orchestrate
QA agents", or when the user wants to run multiple QA agents together.
Also triggered by /qa-orchestrator. |
| user-invocable | true |
| argument-hint | [PR number or scope description] |
| allowed-tools | Read Glob Grep Agent Bash WebFetch |
| metadata | {"version":1,"category":"qa","tags":["qa","orchestration","testing","workflow","agents"],"status":"ready"} |
QA Orchestrator
You coordinate QA agent workflows — spawning specialized test agents, collecting their results, triaging bugs, and producing structured QA reports. You are the conductor, not the tester.
Mode Detection
| User intent | Mode |
|---|
| Run a full QA session (spawn agents, collect results, generate report) | A — Full Run |
| View or manage existing QA reports | B — View Reports |
| Re-run only the failing tests from a previous run | C — Re-test Failures |
If ambiguous, ask: "Are you looking to (A) run a full QA session, (B) view existing reports, or (C) re-test previous failures?"
CI vs Interactive
Detect non-interactive mode before executing any phase:
- Non-interactive if
--non-interactive flag is present OR the CI environment variable is set ($CI=true)
- Interactive otherwise (default — local Claude Code session)
Non-interactive mode changes two things:
- Phase 2 — skip confirmation, auto-select all available agents
- Phase 5 — skip triage prompt, auto-file HIGH+ bugs as GitHub issues assigned to the PR author, never spawn qa-bug-fixer
Shared Standards
| Rule | File | Impact |
|---|
| Agent spawn hierarchy | rules/orch-spawn.md | CRITICAL |
| Bug triage decisions | rules/orch-triage.md | HIGH |
| Report format | rules/orch-report.md | HIGH |
Configuration Files
| File | Purpose | Committed? |
|---|
.qa/config.yml | Agent config, issue tracker, personalities | Yes |
.qa/test-plan.md | Test scenarios and acceptance criteria | Yes |
.env.qa | App URLs, credentials, secrets | No (gitignored) |
.qa/reports/*.md | QA run reports | Yes |
Templates for these files are in references/.
Mode A — Full Run
Follow these phases IN SEQUENCE:
Phase 1: Gather Context
- Read
.qa/config.yml to determine active personalities, issue tracker, and Playwright availability
- Read
.qa/test-plan.md for test scenarios. If empty or only template scaffold, stop:
Your test plan at .qa/test-plan.md is empty. Define your test flows before running QA.
See references/test-plan.md for the template, or describe what to test and I'll help fill it in.
- Read
.env.qa for app URLs and credentials. Warn if QA_PORTAL_URL or QA_API_URL are missing.
- Determine scope — if a PR number/URL was provided:
- Fetch PR via
mcp__github__get_pull_request: extract author login, branch name, title, body
- Parse branch name and title for a ticket ID pattern (e.g.
MINT-1221, LINEAR-42, PROJ-99)
- If ticket ID found AND Linear MCP available: fetch the full ticket with
mcp__linear__get_issue and include its description as additional scope context for the agents
- Store the PR author login — used in Phase 5 to assign bug issues
- If no PR provided: ask what to test (interactive) or use full test plan (non-interactive)
Phase 2: Select Agents
Based on configuration and test plan content:
- qa-happy-path: include if Playwright available AND test plan has
## UI Flows with content
- qa-chaos-monkey: include if test plan has
## API Endpoints with content
- Custom personalities: include all from
.qa/config.yml → personalities.custom
Interactive: present selection and WAIT for confirmation:
QA agents for this run:
1. qa-happy-path (UI flows via Playwright)
2. qa-chaos-monkey (adversarial API testing)
3. [any custom personalities]
Scope: [PR #N / feature description / full test plan]
Proceed with all agents? (yes / remove N / add N)
Non-interactive: skip confirmation, proceed with all available agents. Print selection to log:
[CI] Auto-selected agents: qa-happy-path, qa-chaos-monkey
[CI] Scope: PR #N — <title>
Phase 3: Spawn QA Agents
Provide each agent with:
- Relevant section of
.qa/test-plan.md
- The
.env.qa values they need
- QA scope context (PR diff, ticket description if fetched)
- Instructions to produce structured output and file bugs per their rules
Parallelism strategy — use the best available option (see rules/orch-spawn.md):
- Forge MCP — if
mcp__forge__spawn_claude available: spawn each in a separate terminal
- Parallel Agent calls — spawn ALL agents as multiple Agent tool calls in a single message (default — native Claude Code capability, no deps)
- Sequential Agent calls — one at a time (last resort)
Do NOT spawn qa-bug-fixer in this phase.
Phase 4: Collect Results
- Collect all agent outputs
- Parse PASS/FAIL counts per agent
- Collect all bug reports (inline details + issue tracker ticket URLs)
- Partition bugs into two buckets:
- Blocking — BLOCKER severity that caused an agent to stop early (agent signals
STOPPED_EARLY)
- Non-blocking — HIGH/MEDIUM/LOW bugs found while testing continued
- Build summary:
═══════════════════════════════════════
QA Results Summary
═══════════════════════════════════════
qa-happy-path: N/M flows passed [STOPPED EARLY — 1 blocker]
qa-chaos-monkey: N/M tests passed [, K bugs]
[custom-agent]: N/M flows passed [, K bugs]
Total: X bugs (B BLOCKER, H HIGH, M MEDIUM, L LOW)
═══════════════════════════════════════
Phase 5: Bug Triage
Interactive mode
If blocking bugs exist, surface them first and WAIT:
BLOCKING BUG — stopped [agent-name] early
[BLOCKER] <description> — <N> flows/tests skipped
Fix this before QA can complete.
1. Spawn qa-bug-fixer now (fixes blocker, then QA resumes)
2. Abort — fix manually and re-run
────────────────────────────────────────
Non-blocking bugs also found (N):
[HIGH] ... [MEDIUM] ... [LOW] ...
Triaged after the blocker is resolved.
If option 1: spawn qa-bug-fixer with BLOCKER reports only, re-run failing scenarios, then continue to non-blocking triage.
If option 2: write report and stop.
If no blocking bugs, present standard triage and WAIT:
Options:
1. Spawn qa-bug-fixer for automated fixes (recommended for HIGH+)
2. Generate QA report only — fix bugs manually
3. Abort — discard results
If option 1:
- Collect HIGH and BLOCKER bug reports
- Create isolated branch if git worktree available
- Spawn
qa-bug-fixer with all bug reports, sorted by severity
- After fixes: re-run ONLY failing scenarios to verify
- If still broken: ask user for another iteration or proceed to report
Non-interactive mode (CI)
Never spawn qa-bug-fixer. Never prompt. For every HIGH or BLOCKER bug:
- File a GitHub issue via
mcp__github__create_issue:
- Title:
[QA] <severity>: <short description>
- Body: full reproduction details (input, response, steps, expected vs actual)
- Labels:
["bug", "qa"] + "security" for auth/injection bugs
- Assignees: PR author login fetched in Phase 1
- Add the issue URL to the report bugs table
- MEDIUM and LOW bugs are included in the report inline only — no issue created
For BLOCKER bugs that stopped an agent early, add a note to the report:
[CI] BLOCKER detected — testing incomplete. N scenarios skipped. See issue #N.
Phase 6: Generate Report
Write to .qa/reports/YYYY-MM-DD-HHmmss-qa-report.md (see rules/orch-report.md for format).
Present:
QA report saved to: .qa/reports/<timestamp>-qa-report.md
Verdict: PASS / FAIL
Mode B — View Reports
- List
.qa/reports/ sorted by date (newest first)
- If no reports: "No QA reports found. Run /qa-orchestrator to generate one."
- Show list with verdict and scope per report
- Read selected report and display
Mode C — Re-test Failures
- Read the most recent (or specified) QA report
- Extract all FAIL results
- Spawn only the agents that had failures, with only the failing scenarios
- Collect results and update the report
Issue Tracker Detection
Read .qa/config.yml → issue_tracker:
| Provider | Detection | Create Issue | Add Comment |
|---|
| Linear | detected: linear | mcp__linear__save_issue | mcp__linear__save_comment |
| GitHub | detected: github | mcp__github__create_issue | mcp__github__add_issue_comment |
| None | detected: none | Inline in report | Inline in report |
In non-interactive CI mode, GitHub issue creation is always attempted for HIGH+ bugs regardless of issue_tracker.detected, as long as mcp__github__create_issue is available.
Workflow
- Detect CI vs interactive — check
--non-interactive flag or $CI env var
- Detect mode — match to A/B/C; ask if ambiguous (interactive only)
- Execute mode — follow the phase sequence for the selected mode
- Generate output — report file for Mode A/C, inline display for Mode B
Examples
- Full run (interactive): "Run QA on PR #42" → fetches PR, extracts ticket context, selects agents, waits for confirmation, spawns in parallel, collects results, offers triage.
- Full run (CI):
--non-interactive --pr 42 → fetches PR author, extracts ticket, auto-selects agents, runs, files HIGH+ bugs as GitHub issues assigned to PR author, writes report.
- View reports: "Show me the last QA report" → Mode B lists and displays the most recent report.
- Re-test: "Re-run the failing tests from yesterday's QA" → Mode C extracts failures from the report and re-runs only those.
Positive Trigger
User: "Run QA agents against the test plan and generate a report"
Non-Trigger
User: "Write a unit test for the login function"
Troubleshooting
-
Error: No .qa/config.yml found
-
Cause: QA agents have not been installed in this project
-
Solution: Run the install script from the qa-orchestrator assets, or manually create .qa/config.yml from the template in references/config.md
-
Expected behavior: Configuration file exists with issue tracker and personality settings
-
Error: Test plan is empty
-
Cause: User has not defined test scenarios in .qa/test-plan.md
-
Solution: Fill in the test plan using the template in references/test-plan.md
-
Expected behavior: Agent reads flows and endpoints from the test plan
-
Error: No agents selected
-
Cause: Test plan has neither UI flows nor API endpoints, and no custom personalities configured
-
Solution: Add content to the test plan or register custom personalities in .qa/config.yml
-
Expected behavior: At least one agent is selected for the QA run
-
Error: Parallel agent spawning fails
-
Cause: Tool permissions may not allow multiple concurrent Agent calls
-
Solution: Fall back to sequential agent execution (Option 3 in spawn hierarchy)
-
Expected behavior: Agents run one at a time and results are collected after each completes
-
Error: Bug fixer cannot determine project tech stack
-
Cause: No CLAUDE.md or README.md in the project
-
Solution: Add project documentation or tell the bug fixer what tech stack to expect
-
Expected behavior: Bug fixer adapts its approach to the project's conventions
-
Error: GitHub issue creation fails in CI
-
Cause: mcp__github__create_issue not available or GITHUB_TOKEN not set
-
Solution: Ensure GitHub MCP is configured in the CI environment
-
Expected behavior: HIGH+ bugs filed as GitHub issues assigned to PR author