بنقرة واحدة
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 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 starting a non-trivial implementation that needs structured task breakdown with progress tracking.
Use when you describe an outcome and need the right goat-* workflow chosen for you.
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.
| 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.14.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 for: changed-code testing focus, plan-to-code coverage checks, pre-release manual gaps, or a QA risk/handoff artifact.
/goat-debug, /goat-review, /goat-plan, or the dispatcher.| 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. |
| 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 |
Use this matrix in Standard and Audit modes so every risk/coverage pair lands in exactly one tier:
| Risk | NONE | STRUCTURAL | PARTIAL-BEHAVIOURAL | BEHAVIOURAL |
|---|---|---|---|---|
| CRITICAL | Blocking | Blocking | Blocking | Defer |
| HIGH | Blocking | Blocking | High-value | Defer |
| MEDIUM | High-value | High-value | High-value | Defer |
| LOW | Defer | Defer | Defer | Defer |
Standard maps Blocking to Must test, High-value to Should test, and Defer to Safe to skip. Audit uses the matrix labels directly.
Mode detection - scope wins over vocabulary:
Depth mapping: Standard reads changed files; Audit reads a no-diff area. Scope semantics outrank dispatcher depth; on conflict, state it and follow scope.
Gather: scope, existing test plan (if any), audience. Check instruction Essential Commands or package.json for test/lint commands.
Footgun check: Run the preamble's target-area learning-loop retrieval. Emit matches or an explicit miss; never broad-load a bucket.
PR / issue link: benchmark acceptance criteria. With gh, read the PR and diff; otherwise record no-intent-spec, lowering safe to skip confidence.
No existing tests: mark coverage NONE: "No automated tests; verification falls to human and AI reviewers."
CHECKPOINT: Standard: "Analysing [N] changed files against [existing test plan / no test plan]." Audit: "Auditing [scope] against [existing tests / no tests]." 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 callers, consumers, user-visible flows, downstream services, and matched footguns/lessons.
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 and coverage bidirectionally:
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.
BLOCKING GATE (auto-released on explicit test-plan intent): Present gap analysis plus Verification Integrity, then stop and ask "Continue to Phase 3, or adjust first?" - unless the invocation already gave explicit "what should I test" / "test plan" intent, in which case treat it as a CHECKPOINT and continue through Phase 3 without pausing. Reserve diagrams for Phase 3; then suggest /goat-plan.
Illustrative scenario - input/output shape only; never evidence.
Worked Standard example: A terminal-launch diff is HIGH risk. Read its smoke tests; safe to skip more PTY timing tests only when current target evidence proves timing code is unchanged.
Based on the gaps, produce a focused plan and order by risk.
Must test (matrix Blocking): table with what breaks and grounded effort estimate; if effort is unknown, write unknown - needs harness/project context
Should test if time allows (matrix High-value): same format, lower priority
Safe to skip this round (matrix Defer): name considered areas and why they can wait
Misaligned effort: deprioritise plan cases not mapped to current changes
CHECKPOINT: "Targeted testing plan ready. Want a flow diagram for any CRITICAL item?"
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/payments/) - every source file inside.src/reporting/) - the module's entry point and direct callees.If unsure, ask the user before A1.5.
Count files before deep analysis. If too large, rank a load-bearing/interface slice; proceed after scope confirmation.
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.A file summary cannot promote a row. BEHAVIOURAL applies only to the named behaviour/invariant actually asserted.
Misaligned effort is an observed test-to-risk mismatch. Evidence must show duplicate tests adding no distinct branch/invariant while higher-risk behaviour is uncovered; mock-heavy/structural tests displacing user-visible or error paths; or deeper LOW-risk coverage beside uncovered CRITICAL/HIGH paths. Do not infer misalignment from high coverage alone or recommend deleting safety coverage. If no item meets these evidence conditions, report none found and name the comparison.
Rank each behaviour row by Risk × uncovered fraction: CRITICAL=4, HIGH=3, MEDIUM=2, LOW=1; NONE=1.0, STRUCTURAL=0.66, PARTIAL-BEHAVIOURAL=0.33, BEHAVIOURAL=0. Output:
none found with named comparison.Illustrative scenario - input/output shape only; never evidence.
Worked Audit example: Read tests, not filenames: integration coverage can make a file PARTIAL-BEHAVIOURAL. Classify <target-project>/src/content-check.ts as NONE only after checking unit, integration, and exported-symbol references.
BLOCKING GATE: Present gap report; wait for human decision before generating a testing plan response. Create no plan file unless separately approved. After approval, preserve the A4 tiers in the Audit post-gate template below.
Use after a fix was already verified and the user asks how to keep it from regressing.
This mode does NOT verify the fix itself.
none found rather than inventing eitherskill-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 <!-- Matrix Blocking and High-value pairs -->
| 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 <!-- Matrix Blocking pairs; include manual steps, failure symptoms, time, proof class -->
### Should test if time allows <!-- Matrix High-value pairs; include proof class -->
### Safe to skip <!-- Matrix Defer pairs; include 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 | Behaviour / Invariant | Risk | Test file | Coverage | Notes | Proof Class |
<!-- Coverage: NONE | STRUCTURAL | PARTIAL-BEHAVIOURAL | BEHAVIOURAL -->
## Gap Report
### Blocking gaps <!-- Matrix Blocking pairs; each item includes proof class -->
### High-value additions <!-- Matrix High-value pairs; each item includes proof class -->
### Defer <!-- Matrix Defer pairs; each item includes proof class -->
### Misaligned effort <!-- Evidence-backed test-to-risk mismatches, or `none found` -->
## 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 -->
## Targeted Testing Plan
### Blocking gaps
### High-value additions
### Defer
### Misaligned effort
## Verification Integrity
<!-- Preserve A4 evidence limits; name test executors. -->