/test-analysis:generate-test-casesfrom test-analysis
Use to write detailed TC-ID test case specifications for a web app feature, not executable code. This shared skill consumes `docs/qa/exploration-report.md`, `docs/qa/coverage-plan.md`, and existing coverage artifacts to write structured specs under `docs/qa/test-cases/`. Use it after coverage planning or when asked for test cases or TC-IDs. It does not write framework-specific test code.
Ships in test-analysis. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate comprehensive, structured test case specifications from shared evidence and coverage plans.
Parse the target URL and user journey description from: $ARGUMENTS
Read and reconcile:
docs/qa/feature-map.md when presentdocs/qa/exploration-report.mddocs/qa/exploration/*.mddocs/qa/coverage-plan.mddocs/qa/test-cases/*.md specs for the featureIf the feature clearly needs real product evidence and docs/qa/exploration-report.md is missing,
stop and run capture-feature-evidence first.
Parse the journey description to identify:
Work from the exploration report first:
If feature-map.md exists and marks the feature as MULTI-SURFACE:
docs/qa/exploration/<subfeature>.md as the primary evidence source for that
fileWhen a specific detail remains unclear, you may run a bounded spot-check via a subagent with browser access. Ask it to verify only the uncertain claim and return structured evidence like:
Claim checked: <what needed confirmation>
Observed step: <what was done>
URL: <current URL after action>
Observed controls:
- Submit button: role=button, name=/submit/i
- Email field: label "Email"
Observed result: <what actually happened>
Apply standard techniques, choosing based on what each feature needs:
', ", \, emoji, RTL). Use on every input field found in the exploration report.Use the coverage plan to make sure you cover more than the happy path:
Validation & Error Handling:
Boundary Conditions:
State & Navigation:
UI & Interaction:
Access & Authorization (observe only):
After exploration, reason about scenarios that could not be directly triggered but may still need coverage:
For scenarios that were not directly observed:
See references/scenario-categories.md for detailed checklists within each category.
Write structured test cases to:
docs/qa/test-cases/<feature-name>.md for single-surface featuresdocs/qa/test-cases/<feature-name>/<subfeature-name>.md for mapped multi-surface featuresdocs/qa/test-cases/<feature-name>/integration.md for cross-subfeature journeys### TC-<FEATURE>-<NUMBER>: <Descriptive title>
**Priority:** Critical | High | Medium | Low
**Category:** Happy Path | Validation | Error Handling | Edge Case | Boundary | Security | Accessibility | Visual | Performance | Network Error | UX
**Preconditions:**
- <What must be true before this test>
**Steps:**
1. <Action the tester performs>
2. <Next action>
**Expected Result:**
- <What should happen>
**Observed controls / selector candidates:**
- <element>: `role=button`, name `/submit/i`
- <element>: label `Email`
- <element>: test id `checkout-submit`
- (Include the semantic evidence the execution layer will translate into framework-specific locators)
**Notes:**
- <Additional context discovered during exploration>
# Test Cases: <Feature Name>
**URL:** <base URL>
**Generated:** <date>
**Journey:** <brief description>
## Summary
- Total test cases: <count>
- Critical: <count> | High: <count> | Medium: <count> | Low: <count>
## Happy Path
## Validation & Error Handling
## Edge Cases
## Boundary Conditions
## Security & Access
## Network Error Scenarios
## Visual & Responsive
## Performance & Loading
## Accessibility & UX
## Deferred
Include a ## Deferred section only when one or more TCs cannot be automated this pass; each
entry follows the Deferred Items structure below and the ≤20% cap applies.
When generating specs that span multiple roles or test categories, recommend role-based file naming (*.admin.spec.ts, *.user.spec.ts) or Playwright tag annotations (@admin, @smoke) in the spec. This enables selective execution via --grep @admin or glob patterns instead of fragile testIgnore regex in playwright.config.ts. NEVER recommend a testIgnore regex that must be updated for every new test file.
TC-<FEATURE>-<NNN> where NNN is zero-padded to 3 digitscapture-feature-evidence rather than padding the spec with cosmetic or duplicate cases. The Gate 1 reviewer will reject specs under 15 with the feedback "exploration too shallow."toBeVisible() on an element the test never interacted with is a visibility check, not functional coverage. Gate 1 rejects specs where visibility exceeds 40%.feature-map.md already identified sub-features, treat a single oversized combined spec as a
design error unless the map explicitly justified SINGLE-SURFACE."Deferred" is a scope boundary, not an escape valve. If a TC cannot be automated in this pass, declare it in a dedicated ## Deferred section at the bottom of the spec with this structure per item:
### TC-<FEATURE>-<NUMBER>: <Title> (DEFERRED)
**Blocker:** <concrete reason automation is not possible now — e.g. "third-party iframe with no test hook", "requires seeded fixture not yet available", "production-only payment gateway">
**Un-defer plan:** <what would change to make this testable — e.g. "add fixture once APM-412 lands", "mock /api/payment response once mock infrastructure is set up">
**Scope:** this-sprint | out-of-scope
Cap: at most 20% of TCs in a spec may be deferred. Above that, the spec fails Gate 1 with "scope too narrow — revisit exploration"; the fix is richer evidence, not more deferrals. Deferred items still count toward the ≥15 TC floor only if they are genuinely this-sprint — out-of-scope items do not count toward the floor.
Report and work around:
Here's a compressed example showing evidence-to-spec flow for a simple contact form:
Exploration evidence (from docs/qa/exploration-report.md):
Visited the contact page. Found: name field (text, no visible limit), email field (validates format
client-side), message textarea (maxlength=500 in HTML), submit button, success toast, no CAPTCHA.
Network traffic shows POST to /api/contact returning 200 with {"status":"queued"}. Console
clean. Tried empty submit -> client-side validation fires on email only, name and message submit
empty.
Coverage plan (from docs/qa/coverage-plan.md):
| Area | Impact | Likelihood | Priority |
|---|---|---|---|
| Input validation (name, message) | Medium (junk submissions) | High (no validation observed) | P0 |
| Email validation | High (spam vector) | Medium (client-only check) | P0 |
| Input security (XSS) | High (security) | Medium | P0 |
| Message length limits | Low (truncation) | Medium (server limit unknown) | P1 |
| Rate limiting / abuse | Medium (abuse) | Unknown | P1 |
Generated test cases (written to docs/qa/test-cases/contact-form.md):
TC-CONTACT-001 — Submit with empty name and message (P0)
Category: Validation
Preconditions: On contact page
Steps: Clear all fields, enter valid email, click Submit
Expected: Validation error; form should not submit. (Currently fails — this is a bug.)
Observed controls: input[name="name"], input[name="email"], textarea[name="message"],
button[type="submit"]
TC-CONTACT-002 — Email validation bypass via direct API call (P0)
Category: Security
Preconditions: None
Steps: POST to /api/contact with body {"name":"test","email":"not-an-email","message":"hi"}
Expected: 400 error with validation message. If 200, server-side validation is missing.
TC-CONTACT-003 — XSS in name field (P0)
Category: Security
Preconditions: On contact page
Steps: Enter <script>alert(1)</script> in name, valid email, any message, submit
Expected: Input sanitized or escaped; no script execution anywhere the name is displayed.
Notice how every test traces to a specific observation and risk, and TC-IDs follow the
TC-<FEATURE>-<NNN> convention.
toBeVisible() assertions on elements the test never interacted with. These are render checks, not behavior checks./generate-test-cases https://example.com/login User logs in with email and password, sees dashboard
/generate-test-cases https://shop.example.com User searches for product, adds to cart, proceeds to checkout
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub lespaceman/athena-workflow-marketplace --plugin test-analysis3 skills in this plugin
/plan-test-coverageUse before writing specs or executable tests to decide what coverage is needed first. This shared planning skill consumes exploration evidence, existing tests, and related artifacts to produce `docs/qa/coverage-plan.md` with prioritized P0/P1/P2 coverage and TC-IDs. When `docs/qa/exploratory-charter.md` exists (produced by `exploratory-test-writer`), use it as optional risk-framing context; do not require it and do not let it replace grounded exploration evidence. Use it for requests like "what tests do I need", "coverage gaps", or "what TC-IDs are missing". It plans; it does not perform the canonical exploration step and it does not write executable tests.
/review-test-casesThis skill should be used when a quality review of TC-ID test case specifications is needed before any framework-specific implementation begins. It reviews the spec artifact only; it does not implement or rewrite tests. Triggers: "review test cases", "check test specs", "review TC-IDs", "audit test coverage", "are my test cases good", "validate test specs", "review docs/qa/test-cases/*.md", "check for gaps in test cases", "review before writing tests", and "quality check test specs". Inserted as the shared quality gate between `generate-test-cases` and execution-layer authoring — catches gaps, duplication, weak assertions, missing error paths, and invented scenarios before they get encoded into framework-specific code.
Other plugins' skills for the same job