ワンクリックで
goat-qa
Use when evaluating test coverage gaps, planning test strategy, or assessing testing risk for code changes.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when evaluating test coverage gaps, planning test strategy, or assessing testing risk for code changes.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when a decision or analysis needs multi-lens critique to surface blind spots before shipping.
Use when diagnosing a bug, unexpected behaviour, system failure, or unfamiliar code that needs structured investigation.
Use when starting a non-trivial implementation that needs structured task breakdown with progress tracking.
Use when reviewing a diff, PR, or set of code changes, or auditing a codebase area for quality issues. Triggers: 'review this', 'code review', 'audit X', 'look at these changes'.
Use when assessing security implications of code changes, architecture decisions, or new features.
Use when you describe an outcome and need the right goat-* workflow chosen for you.
| name | goat-qa |
| description | Use when evaluating test coverage gaps, planning test strategy, or assessing testing risk for code changes. |
| goat-flow-skill-version | 1.11.0 |
Read .goat-flow/skill-docs/skill-preamble.md before starting.
On full-depth, also read .goat-flow/skill-docs/skill-conventions.md.
goat-qa is a testing gap analyser: it maps changed code or a codebase area to coverage and outputs prioritized must/should/skip guidance. It does not write tests or run full test commands.
Invoke when:
NOT this skill: Run-test requests → run them directly. Test failures or fix verification → /goat-debug. Code quality → /goat-review. Milestones → /goat-plan. Feature briefs → dispatcher. Merge certification → /goat-review plus Proof Gate.
| Excuse | Reality |
|---|---|
| "CI is green so coverage is fine" | Scanner scored 100% while preflight failed with 8 errors. CI tests what was thought of; gap analysis looks for what wasn't. |
| "Unit tests cover it" | Structural tests that import and snapshot pass at high coverage but miss every behavioural edge. STRUCTURAL is not BEHAVIOURAL. |
| "Coverage report says 80%" | Coverage measures shape, not truth. 20+ content-accuracy failures survived a structural pass that reported high coverage. |
| "Doer ran the tests, so we're covered" | Doer-verifier is theater in single-agent context. The verifier must have a context boundary the doer did not cross. |
Canonical coverage vocabulary used in Standard, Audit, and cross-skill output.
| Level | Meaning |
|---|---|
| NONE | No matching test file or manual plan |
| STRUCTURAL | Imports, constructs, or snapshots only - no behaviour assertion |
| PARTIAL-BEHAVIOURAL | Happy path or narrow behaviour only; error/edge paths untested |
| BEHAVIOURAL | Meaningful output, side-effect, error-path, or invariant coverage |
Mode detection - confirm, don't silently decide:
Depth mapping: Standard = quick changed-file analysis. Audit = full codebase-area analysis. Dispatcher depth maps quick → Standard, full → Audit.
If mode and scope are clear, state "Running [mode] on [scope]." and proceed. Ask only on ambiguity.
Gather: changed scope, existing test plan (if any), audience. Check the instruction file's Essential Commands section or package.json scripts for test/lint commands.
Footgun check: Use the preamble's learning-loop retrieval on .goat-flow/learning-loop/footguns/, .goat-flow/learning-loop/lessons/, .goat-flow/learning-loop/patterns/, and .goat-flow/learning-loop/decisions/ for the target area. Surface matches or an explicit retrieval miss; do not broad-load any bucket.
PR / issue link (strongly encouraged): ask for PR/issue before Phase 1. Acceptance criteria are the benchmark. If gh is available, use gh pr view + gh pr diff; otherwise note no-intent-spec, which degrades safe to skip confidence.
If arriving from the dispatcher with context already gathered, confirm and proceed.
No existing tests: risk analysis still applies. Mark coverage NONE and state: "This project has no automated tests. Verification falls to human and AI reviewers."
CHECKPOINT: "Analysing [N] changed files against [existing test plan / no test plan]. Audience: [dev/tester/both]." Proceed unless scope, audience, or test plan is ambiguous.
Read every changed file. For each, understand WHAT changed and WHY it's risky.
Diff analysis - not just file names. Read the actual diff, not just --stat; one auth line can outrank 200 CSS lines.
Classify each change:
| Risk | What it means | Examples |
|---|---|---|
| CRITICAL | If this breaks, users are directly affected or security is compromised | Auth logic, payment flow, data mutation, permission checks, API contracts |
| HIGH | Business logic or integration that affects correctness | Calculations, state transitions, cross-service calls, database queries |
| MEDIUM | Internal logic with limited blast radius | Utilities, validators, formatters, isolated components |
| LOW | Cosmetic, config, or changes with no behavioural impact | Styling, copy, constants, type-only changes |
For each CRITICAL/HIGH change, trace the blast radius:
Output: Change Risk Map
| File | Lines Changed | What Changed (plain English) | Risk | Blast Radius | User-Visible Impact |
|---|
CHECKPOINT: "Risk map complete. [N] CRITICAL, [M] HIGH risk changes. Proceeding to gap analysis."
Compare risk vs coverage in both directions:
tests not read in Verification Integrity.For CRITICAL items with no coverage, annotate why: new path / missed coverage on existing path / hard-to-test.
Intent vs Reality Diff (when intent spec exists): If a PR, issue, test plan, or user-provided acceptance criteria is available, add:
| Expected Behaviour | Observed Code Behaviour | Gap | Risk |
Map each stated expectation to the code path that implements it. Gaps between intent and code are undertested-risk candidates.
Cross-agent verification: suggest a different agent/model for blind-spot checks.
BLOCKING GATE: Present gap analysis plus Verification Integrity and stop. Ask: "Continue to Phase 3, or adjust the analysis first?" For explicit "what should I test" or "test plan" intent, continue through Phase 3 in the same response. Reserve diagrams for Phase 3. After the plan, suggest /goat-plan for milestone tasks.
Based on the gaps, produce a focused plan and order by risk.
Must test (CRITICAL gaps): table with what breaks and grounded effort estimate; if effort is unknown, write unknown - needs harness/project context
Should test if time allows (MEDIUM gaps): same format, lower priority
Safe to skip this round: low-risk or adequately covered areas
Misaligned effort: deprioritise plan cases not mapped to current changes
CHECKPOINT: "Targeted testing plan ready. Want a flow diagram for any CRITICAL item?"
For flow diagrams, use Mermaid flowcharts with 8-15 nodes per diagram, happy path first, then branch points for error states and edge cases.
For a codebase area with no recent change. Audit mode analyses existing load-bearing files, coverage depth, and structural-vs-behavioural gaps. It does NOT read a diff; skip Phase 1.
Declare the audit boundary explicitly. Supported shapes:
src/cli/audit/) - every source file inside.src/cli/quality/) - the module's entry point and direct callees.If unsure, ask the user before A1.5.
Inventory approximate file count before deep analysis. If too large, present a ranked slice prioritising load-bearing and interface-boundary files. Proceed to A2 only after manageable scope is confirmed.
Without any diff, classify each in-scope file by its role, not its recency:
| Role | Examples |
|---|---|
| Load-bearing | auth, payments, permission checks, data mutation, migration |
| Interface boundary | API routes, CLI commands, public exports |
| Integration glue | config loaders, filesystem bridges, external clients |
| UI / presentation | views, templates, styling |
| Support | types, constants, pure helpers |
Load-bearing + Interface files get CRITICAL or HIGH risk ratings by default.
For each in-scope file:
NONE.Record coverage using the Coverage Depth vocabulary above.
Rank gaps by Risk × (1 - CoverageLevel) descending. Output:
BLOCKING GATE: Present gap report; wait for human decision before generating plan files.
Post-verification guard planning. Cite the prior fix verification source, define 1-2 invariants, assess coverage, then hand off guard tests. This mode does NOT verify the fix itself.
skill-preamble.md to every claim made in the gap analysis or testing planRUNTIME | CONTRACT-GREP | STATIC | NOT-REPRODUCEDOutput shape depends on the mode declared in Step 0. Pick the template that matches the mode you ran.
## TL;DR <!-- what changed, what's at risk, biggest testing gaps -->
## Change Risk Map
| File | Lines Changed | What Changed | Risk | Blast Radius | User-Visible Impact | Proof Class |
## Gap Analysis
### Undertested Risks <!-- CRITICAL/HIGH changes with no or partial test coverage -->
| Code Change | Risk | Coverage Depth | Covered By | Gap | Proof Class |
### Misaligned Effort <!-- test cases that don't match code changes in this branch -->
| Test Case | Maps to Change | Assessment | Proof Class |
## Verification Integrity
- Intent spec: [PR/issue/test plan URL or `no-intent-spec`]
- Tests read: [list]
- Tests not read / unavailable: [list or `none`]
- Commands discovered: [test/lint commands found]
- Commands run: `none` (goat-qa does not execute tests)
- Runtime execution by others: [who ran what, or `none observed`]
- Coverage claim basis: [OBSERVED | INFERRED | UNVERIFIED]
- Proof classes: <N> RUNTIME / <M> CONTRACT-GREP / <K> STATIC / <L> NOT-REPRODUCED
- Analysis confidence: [HIGH | MEDIUM | LOW] - [rationale]
- Evidence limit: [diff/files read and any unavailable runtime/tool context]
- Assessed by: [agent]
## Targeted Testing Plan
### Must test before shipping <!-- CRITICAL gaps with manual steps, failure symptoms, time, proof class -->
### Should test if time allows <!-- HIGH/MEDIUM gaps, proof class -->
### Safe to skip <!-- with rationale and proof class -->
## Verification Integrity
- Changes by: [agent/developer]
- Testing by: [who executes]
- Doer-verifier separation: [FULL / PARTIAL / NONE]
## Regression Guards <!-- post-verification only; cite prior fix-verification source -->
| Invariant | Current Coverage | Recommended Guard | Owner | Proof Class |
## Flow Diagram <!-- only on request -->
## TL;DR <!-- which files carry load-bearing behaviour, coverage shape, biggest gaps -->
## Scope
<!-- Declared boundary from A1: directory, module, or risk class. -->
## Inventory and Risk Ranking
| File | Role | Risk | Proof Class |
<!-- Roles: load-bearing / interface boundary / integration glue / UI / support -->
## Coverage Analysis
| File | Test file | Coverage | Notes | Proof Class |
<!-- Coverage: NONE | STRUCTURAL | PARTIAL-BEHAVIOURAL | BEHAVIOURAL -->
## Gap Report
### Blocking gaps <!-- CRITICAL-risk + NONE/STRUCTURAL coverage; each item includes proof class -->
### High-value additions <!-- HIGH-risk + PARTIAL coverage; each item includes proof class -->
### Defer <!-- LOW-risk or well-covered; each item includes proof class -->
## Verification Integrity
- Intent spec: [audit scope rationale or `no-intent-spec`]
- Tests read: [list]
- Tests not read / unavailable: [list or `none`]
- Commands discovered: [test/lint commands found]
- Commands run: `none` (goat-qa does not execute tests)
- Coverage claim basis: [OBSERVED | INFERRED | UNVERIFIED]
- Proof classes: <N> RUNTIME / <M> CONTRACT-GREP / <K> STATIC / <L> NOT-REPRODUCED
- Analysis confidence: [HIGH | MEDIUM | LOW] - [rationale]
- Assessed by: [agent]
- Would-be testers: [who executes once gaps are filled]
## Flow Diagram <!-- only on request -->