Generate test scenario coverage from a feature spec — happy paths, edge cases, error handling, accessibility, security, and performance — with a coverage analyzer that flags gaps. Use to define what to test before QA writes the test plan.
Localization (RTL, long-string, currency, date format)
Cross-platform (browsers, devices, OS versions)
Clarify First
Before generating scenarios, confirm these inputs. If any is unknown or vague, ASK — do not assume:
Feature type — form, browse/list, real-time/collab, file upload, payment, or bulk operation (drives the scenario count per category in the coverage rubric)
Risk / sensitivity profile — auth, payment, or PII involved (scales up security and concurrency coverage in the risk-weighted selection)
The spec's inputs, outputs, and side effects — what users provide, expect, and what changes in the system (drives edge cases in Step 3 and error handling in Step 4)
Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
Workflow
Step 1 — Spec read
Read the PRD / user story / acceptance criteria. Identify:
User goals (what they want to do)
Inputs (what they provide)
Outputs (what they expect)
Side effects (what changes in the system)
Step 2 — Happy path
For each user goal, write the primary flow:
Preconditions
Steps
Expected result
Aim for 1-3 happy paths per feature.
Step 3 — Edge cases
For each input, ask:
What's the empty value?
What's the minimum?
What's the maximum?
What's just below min / just above max?
What's the wrong type?
What's the weird-but-valid (very long, special chars, Unicode, emoji)?
Step 4 — Error handling
For each failure mode:
Network failure
Server error (5xx)
Validation error (4xx)
Timeout
Concurrent modification
Auth expired / lost
For each: what does the user see? Recover-from / try-again UX?
Step 5 — Empty / first-use / after-action states
First use (no data)
After delete (last item)
After error (partial state)
After timeout
After cancel
Step 6 — Concurrent / race scenarios
Two users simultaneously:
Editing same record
Triggering same action
Submitting same form
Reaching capacity limit
Step 7 — Accessibility
Tab through with keyboard
Use with screen reader
High contrast / inverted colors
Reduced motion preference
Large text scaling
Voice control
Step 8 — Security + privacy
Logged out user accesses
Unauthorized user accesses
Permission downgrade mid-action
PII handling
Injection attempts (XSS, SQLi)
Rate limiting
Step 9 — Run test_scenario_generator.py
Audit a candidate scenario list for category coverage; flag gaps.
product-team/spec-to-repo — translating spec to tickets
1---2name: test-scenarios3description: Generate test scenario coverage from a feature spec — happy paths, edge cases, error handling, accessibility, security, and performance — with a coverage analyzer that flags gaps. Use to define what to test before QA writes the test plan.4license: MIT + Commons Clause5---67# Test Scenarios
89Generate complete scenario coverage from a feature spec before tests
10are written. Closes the gap between "we built it" and "it survives
11production."
1213## When to use this skill
1415- After **PRD approval** but before engineering implementation
16- During **sprint planning** to size testing effort
17- During **code review** to verify test coverage
18- During **QA planning** to scope test pass
19- During **bug-bash** prep
20- After a **production incident** to validate scenario gaps
2122## The 7 scenario categories
2324For every feature, generate scenarios across:
25261. **Happy paths** — primary user goals achieved cleanly
272. **Edge cases** — boundary conditions, unusual inputs
283. **Error handling** — what users see when things go wrong
294. **Empty states** — first-use, no data, after-delete
305. **Concurrent operations** — race conditions, optimistic locking
316. **Accessibility** — keyboard nav, screen reader, contrast, motion
327. **Security + privacy** — auth, permissions, PII, injection
3334Plus when applicable:
35- Performance scenarios (load, latency, throughput)
36- Localization (RTL, long-string, currency, date format)
37- Cross-platform (browsers, devices, OS versions)
3839## Clarify First
4041Before generating scenarios, confirm these inputs. If any is unknown or vague, ASK — do not assume:
4243- [ ] **Feature type** — form, browse/list, real-time/collab, file upload, payment, or bulk operation (drives the scenario count per category in the coverage rubric)
44- [ ] **Risk / sensitivity profile** — auth, payment, or PII involved (scales up security and concurrency coverage in the risk-weighted selection)
45- [ ] **The spec's inputs, outputs, and side effects** — what users provide, expect, and what changes in the system (drives edge cases in Step 3 and error handling in Step 4)
4647Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
4849## Workflow
5051### Step 1 — Spec read
52Read the PRD / user story / acceptance criteria. Identify:
53- User goals (what they want to do)
54- Inputs (what they provide)
55- Outputs (what they expect)
56- Side effects (what changes in the system)
5758### Step 2 — Happy path
59For each user goal, write the primary flow:
60- Preconditions
61- Steps
62- Expected result
6364Aim for 1-3 happy paths per feature.
6566### Step 3 — Edge cases
67For each input, ask:
68- What's the empty value?
69- What's the minimum?
70- What's the maximum?
71- What's just below min / just above max?
72- What's the wrong type?
73- What's the weird-but-valid (very long, special chars, Unicode, emoji)?
7475### Step 4 — Error handling
76For each failure mode:
77- Network failure
78- Server error (5xx)
79- Validation error (4xx)
80- Timeout
81- Concurrent modification
82- Auth expired / lost
8384For each: what does the user see? Recover-from / try-again UX?
8586### Step 5 — Empty / first-use / after-action states
87- First use (no data)
88- After delete (last item)
89- After error (partial state)
90- After timeout
91- After cancel
9293### Step 6 — Concurrent / race scenarios
94Two users simultaneously:
95- Editing same record
96- Triggering same action
97- Submitting same form
98- Reaching capacity limit
99100### Step 7 — Accessibility
101- Tab through with keyboard
102- Use with screen reader
103- High contrast / inverted colors
104- Reduced motion preference
105- Large text scaling
106- Voice control
107108### Step 8 — Security + privacy
109- Logged out user accesses
110- Unauthorized user accesses
111- Permission downgrade mid-action
112- PII handling
113- Injection attempts (XSS, SQLi)
114- Rate limiting
115116### Step 9 — Run `test_scenario_generator.py`
117Audit a candidate scenario list for category coverage; flag gaps.
118119```bash
120python3 project-management/execution/test-scenarios/scripts/test_scenario_generator.py \
121 --input feature_spec.json --format markdown
122```
123124## Decision frameworks
125126### How many scenarios per category?
127128| Feature type | Happy | Edge | Error | Empty | Concur | A11y | Security |
129|--------------|-------|------|-------|-------|--------|------|----------|
130| Form / submission | 1-3 | 4-8 | 4-6 | 2 | 1-2 | 4 | 3-5 |
131| Browse / list | 2-3 | 3-5 | 2-3 | 2-3 | 1 | 3 | 2 |
132| Real-time / collab | 3 | 4-6 | 4-6 | 2 | 4-6 (essential) | 3 | 3 |
133| File upload | 2 | 6-10 (sizes/types) | 4-6 | 1 | 1-2 | 2 | 5+ (file abuse) |
134| Payment / financial | 3 | 6-10 | 8+ (critical) | 2 | 4-6 (idempotency!) | 3 | 8+ |
135| Bulk operation | 2 | 4-6 (sizes) | 4-6 | 1 | 2-4 (partial fail) | 2 | 3 |
136137Adjust for risk profile of the specific feature.
138139### Risk-weighted scenario selection
140141Not all scenarios need full QA coverage. Apply:
142- **Happy path:** always test
143- **Edge cases:** test those that matter (likelihood × severity)
144- **Error handling:** test all paths that user can recover from
145- **Empty state:** always test (first impression!)
146- **Concurrent:** test for data-integrity-critical features
147- **Accessibility:** baseline coverage on all UI; full coverage on user-facing
148- **Security:** scale with sensitivity (full coverage on auth/payment)
149150### Manual vs automated
151152| Scenario type | Default |
153|----------------|---------|
154| Happy path | Automated (E2E or integration) |
155| Edge cases (input validation) | Unit tests |
156| Error handling | Mix (mocked errors in unit; real in integration) |
157| Empty state | Visual regression + manual |
158| Concurrent | Hard — usually manual + targeted integration |
159| Accessibility | Automated (axe-core) + manual screen-reader |
160| Security | SAST + DAST + manual review for critical paths |
161| Performance | Automated load tests |
162| Localization | Pseudo-localization + manual spot-check |
163164## Common engagements
165166### "Generate test scenarios for this new feature"
1671. Read the PRD / spec.
1682. Apply the 7 categories.
1693. Generate scenarios; estimate count per category.
1704. Run validator; address gaps.
1715. Hand to QA for implementation.
172173### "Audit our test plan for completeness"
1741. Categorize existing scenarios.
1752. Identify under-covered categories.
1763. Score by risk × likelihood.
1774. Recommend additions.
178179### "Post-incident scenario gap analysis"
1801. Pull the incident scenario.
1812. Map: which category was missed?
1823. Add scenario; verify regression coverage.
1834. Update default-coverage rubric for that feature type.
184185## Anti-patterns to avoid
186187- **Only happy paths.** Production fails on edges; you skipped them.
188- **No empty state.** First-use is broken.
189- **"QA will figure it out."** No, QA tests what's specified.
190- **Generic acceptance criteria.** "Should work" is not testable.
191- **No accessibility scenarios.** Excludes users; fails compliance.
192- **No security scenarios.** Vulnerable paths ship.
193- **No performance scenarios for performance-sensitive features.** Surprise at scale.
194- **Skipping concurrent for collaborative features.** Race conditions ship.
195196## References
197198- `references/scenario-categories.md` — deep on the 7+ categories with examples
199- `references/coverage-anti-patterns.md` — common gaps + fixes
200201## Related skills
202203- `project-management/execution/create-prd` — upstream spec
204- `project-management/execution/wwas` — acceptance criteria
205- `engineering/senior-qa` — implementation
206- `engineering/code-reviewer` — review coverage
207- `product-team/spec-to-repo` — translating spec to tickets
Run npx skillmds@latest add borghei/test-scenarios in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Generate test scenario coverage from a feature spec — happy paths, edge cases, error handling, accessibility, security, and performance — with a coverage analyzer that flags gaps. Use to define what to test before QA writes the test plan. It is listed under Web & Frontend on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: executes scripts. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT + Commons Clause.
borghei (@borghei) published this skill. Their other Agent Skills are listed on their SkillMD profile.