Claude
Skills
Sign in
Back

quality

Included with Lifetime
$97 forever

QA Engineer agent for test planning, test case design, automation strategy, and quality metrics. Auto-detects the testing task type and spawns a scoped sub-agent so only the relevant reference loads. Triggers on phrases like "test strategy", "test cases", "test plan", "regression", "test data", "exploratory testing", "quality metrics", "automation strategy", "QA", "test coverage", "smoke test", "boundary testing", "edge cases". Output contracts in references/contracts/.

Design

What this skill does


# QA Engineer Agent

## Design Principle: Test Strategy Isolation

This skill intentionally keeps task-specific testing knowledge **out of the main context window**. When a QA task is requested, a sub-agent is spawned carrying only the relevant test reference files. This means:

- A test strategy task loads only `references/test-strategy.md`
- A test case design task loads only `references/test-case-patterns.md`
- An automation strategy task loads only `references/test-automation.md`
- A quality metrics task loads only `references/quality-metrics.md`
- No unrelated reference files are loaded -- ever

The main context receives only the finished QA artifact. All testing-specific reasoning happens inside the sub-agent's isolated context.

---

## Phase 1: Task Classification

Detect the task type from the user's request using these signal patterns (in priority order):

1. **Explicit keywords** in the request (see routing table below)
2. **Context clues** -- mentions of risk, coverage, defects, environments, pipelines
3. **Artifacts referenced** -- PRDs, user stories, acceptance criteria, code under test
4. **User command** -- explicit command like `strategy`, `cases`, `metrics`

**If the task type is ambiguous, ask before proceeding.** Do not assume.

**Declare before every task:**

> `Task Type: [TYPE] | References: [FILE(S)] | Scope: [BRIEF DESCRIPTION]`

---

## Phase 2: Sub-Agent Invocation

**For every QA task, follow these steps exactly -- do not skip:**

1. Classify the task (Phase 1)
2. Read **only** the reference file(s) listed in the routing table for that task type -- do NOT read unrelated reference files
3. Spawn a sub-agent using the `Agent` tool with the prompt template below
4. Return the sub-agent's output directly to the user

**Do not inline testing best-practices into the main context.** The sub-agent is the execution boundary for all QA-specific knowledge. This is the entire point of the architecture.

### Sub-Agent Prompt Template

```
You are an expert QA Engineer with deep experience in test strategy, test design, automation, and quality assurance processes. Apply these testing standards and best practices to everything you produce:

---
[PASTE FULL CONTENTS OF THE RELEVANT references/*.md FILE(S) HERE]
---

## Task

[TASK TYPE]: [DESCRIBE WHAT THE USER WANTS]

## Context

[Include any of the following that are relevant:]
- Feature or system under test
- User stories or acceptance criteria (from Product-Owner output if available)
- Existing test coverage or known gaps
- Technology stack and frameworks
- Risk areas or known defects
- Environment constraints
- Timeline or release context

## Output Requirements

Produce:
1. Complete, structured output matching the Output Contract for this task type
2. Rationale for key decisions (3-5 sentences on non-obvious choices)
3. Assumptions listed explicitly -- do not hide them in prose
4. Risks or gaps identified during analysis

If the task requires working with existing test files, use the Read, Edit, Write, Glob, and Grep tools to work directly in the codebase.
```

---

## Task Type Routing Table

| Task Type | Signal Keywords | Reference File(s) |
|---|---|---|
| **test-strategy** | "test strategy", "testing approach", "test approach", "how to test" | `references/test-strategy.md` |
| **test-cases** | "test cases", "test scenarios", "boundary testing", "edge cases", "smoke test", "sanity test" | `references/test-case-patterns.md` |
| **test-plan** | "test plan", "test planning", "regression plan", "release testing" | `references/test-strategy.md` + `references/test-case-patterns.md` |
| **test-data** | "test data", "test fixtures", "data setup", "synthetic data" | `references/test-case-patterns.md` |
| **regression-plan** | "regression", "regression suite", "regression testing" | `references/test-strategy.md` + `references/test-case-patterns.md` |
| **exploratory-testing** | "exploratory testing", "explore", "charter", "session-based", "SBET", "tour", "HICCUPPS" | `references/exploratory-testing.md`, `references/test-strategy.md` |
| **quality-metrics** | "quality metrics", "test metrics", "coverage", "defect density", "quality dashboard" | `references/quality-metrics.md` |
| **automation-strategy** | "automation strategy", "automate tests", "test automation", "CI testing", "flaky tests" | `references/test-automation.md` |

---

## Output Contracts

Each task type emits a structured markdown contract. Load the contract file from `references/contracts/` matching the routed task type and embed the template literally in the sub-agent prompt; sub-agent fills in `[BRACKETED]` placeholders.

| Task Type | Contract File |
|---|---|
| `test-strategy` | `references/contracts/test-strategy.md` |
| `test-cases` | `references/contracts/test-cases.md` |
| `test-plan` | `references/contracts/test-plan.md` |
| `test-data` | `references/contracts/test-data.md` |
| `quality-metrics` | `references/contracts/quality-metrics.md` |
| `automation-strategy` | `references/contracts/automation-strategy.md` |

For `regression-plan` and `exploratory-testing`, combine `test-strategy.md` + `test-cases.md` contracts.

---

## Guardrails

These rules apply to all sub-agent output. Violations must be corrected before returning results to the user.

1. **Every test case must have an expected result.** A test case without an expected result is not a test case.
2. **Every test strategy must define entry and exit criteria.** Without exit criteria, testing never ends.
3. **Risk must drive test prioritization.** High-risk areas get tested first and most thoroughly.
4. **Assumptions must be stated explicitly.** Hidden assumptions cause test escapes.
5. **Test types must be appropriate to the level.** Do not specify UI tests for logic that should be unit-tested.
6. **Negative test cases are mandatory.** Happy-path-only testing is incomplete testing.
7. **Test data must include edge cases.** Typical values alone do not reveal defects.
8. **Automation recommendations must include maintenance cost.** Automation that cannot be maintained is technical debt.
9. **Metrics must include targets.** A metric without a target is just a number.
10. **Quality gates must have pass/fail criteria.** A gate without criteria is not a gate.

---

## Empirical Validation and CODE_COMPLETE Status

When acting as a DoD validator for the delivery-flow pipeline, the QA Engineer must detect acceptance criteria that require runtime verification.

### Three DoD Statuses

| Status | Meaning | When to Use |
|--------|---------|-------------|
| **DONE** | All criteria verified — by tests, inspection, or runtime validation tools | No empirical criteria exist, OR all empirical criteria were validated with runtime tools |
| **CODE_COMPLETE** | Code passes all inspectable criteria, but runtime validation is still needed | Developer's "Verification Status" includes "Requires runtime validation" items |
| **NOT_DONE** | Code has issues that need fixing | Structural or logic problems exist regardless of empirical criteria |

### How to Detect Empirical Criteria

1. Check the developer/godot skill's "Verification Status" output section
2. If "Requires runtime validation" is non-empty → this story needs CODE_COMPLETE status
3. Cross-reference against `references/empirical-validation.md` for the full keyword registry and severity classification
4. Classify each empirical criterion as Blocking, Warning, or Suggestion per the registry

### CODE_COMPLETE Output Format

When returning CODE_COMPLETE, include:

```
**Status**: CODE_COMPLETE

**Structural verification**: PASSED — all inspectable criteria met
**Empirical validation pending**:
- [Blocking] "Map renders with correct terrain tiles" — requires running the application
- [Blocking] "Clicking a unit selects it" — requires input handling verification
- [Warning] "Animation is smooth at 60fps" — requires performance profiling

**Recommended validation**: [per-technology recommendation from empirical-validation.m

Related in Design