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-scenarios
3description: >
4 Generate test scenario coverage from a feature spec — happy paths, edge
5 cases, error handling, accessibility, security, and performance — with a
6 coverage analyzer that flags gaps. Use to define what to test before QA
7 writes the test plan.
8license: MIT + Commons Clause
9metadata:
10 version: 1.0.0
11 author: borghei
12 category: project-management
13 domain: execution
14 updated: 2026-05-27
15 python-tools: test_scenario_generator.py
16 tech-stack: test-scenarios, qa, edge-cases, acceptance-criteria
17---
1819# Test Scenarios
2021Generate complete scenario coverage from a feature spec before tests
22are written. Closes the gap between "we built it" and "it survives
23production."
2425## When to use this skill
2627- After **PRD approval** but before engineering implementation
28- During **sprint planning** to size testing effort
29- During **code review** to verify test coverage
30- During **QA planning** to scope test pass
31- During **bug-bash** prep
32- After a **production incident** to validate scenario gaps
3334## The 7 scenario categories
3536For every feature, generate scenarios across:
37381. **Happy paths** — primary user goals achieved cleanly
392. **Edge cases** — boundary conditions, unusual inputs
403. **Error handling** — what users see when things go wrong
414. **Empty states** — first-use, no data, after-delete
425. **Concurrent operations** — race conditions, optimistic locking
436. **Accessibility** — keyboard nav, screen reader, contrast, motion
447. **Security + privacy** — auth, permissions, PII, injection
4546Plus when applicable:
47- Performance scenarios (load, latency, throughput)
48- Localization (RTL, long-string, currency, date format)
49- Cross-platform (browsers, devices, OS versions)
5051## Clarify First
5253Before generating scenarios, confirm these inputs. If any is unknown or vague, ASK — do not assume:
5455- [ ] **Feature type** — form, browse/list, real-time/collab, file upload, payment, or bulk operation (drives the scenario count per category in the coverage rubric)
56- [ ] **Risk / sensitivity profile** — auth, payment, or PII involved (scales up security and concurrency coverage in the risk-weighted selection)
57- [ ] **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)
5859Stop 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.
6061## Workflow
6263### Step 1 — Spec read
64Read the PRD / user story / acceptance criteria. Identify:
65- User goals (what they want to do)
66- Inputs (what they provide)
67- Outputs (what they expect)
68- Side effects (what changes in the system)
6970### Step 2 — Happy path
71For each user goal, write the primary flow:
72- Preconditions
73- Steps
74- Expected result
7576Aim for 1-3 happy paths per feature.
7778### Step 3 — Edge cases
79For each input, ask:
80- What's the empty value?
81- What's the minimum?
82- What's the maximum?
83- What's just below min / just above max?
84- What's the wrong type?
85- What's the weird-but-valid (very long, special chars, Unicode, emoji)?
8687### Step 4 — Error handling
88For each failure mode:
89- Network failure
90- Server error (5xx)
91- Validation error (4xx)
92- Timeout
93- Concurrent modification
94- Auth expired / lost
9596For each: what does the user see? Recover-from / try-again UX?
9798### Step 5 — Empty / first-use / after-action states
99- First use (no data)
100- After delete (last item)
101- After error (partial state)
102- After timeout
103- After cancel
104105### Step 6 — Concurrent / race scenarios
106Two users simultaneously:
107- Editing same record
108- Triggering same action
109- Submitting same form
110- Reaching capacity limit
111112### Step 7 — Accessibility
113- Tab through with keyboard
114- Use with screen reader
115- High contrast / inverted colors
116- Reduced motion preference
117- Large text scaling
118- Voice control
119120### Step 8 — Security + privacy
121- Logged out user accesses
122- Unauthorized user accesses
123- Permission downgrade mid-action
124- PII handling
125- Injection attempts (XSS, SQLi)
126- Rate limiting
127128### Step 9 — Run `test_scenario_generator.py`
129Audit a candidate scenario list for category coverage; flag gaps.
130131```bash
132python3 project-management/execution/test-scenarios/scripts/test_scenario_generator.py \
133 --input feature_spec.json --format markdown
134```
135136## Decision frameworks
137138### How many scenarios per category?
139140| Feature type | Happy | Edge | Error | Empty | Concur | A11y | Security |
141|--------------|-------|------|-------|-------|--------|------|----------|
142| Form / submission | 1-3 | 4-8 | 4-6 | 2 | 1-2 | 4 | 3-5 |
143| Browse / list | 2-3 | 3-5 | 2-3 | 2-3 | 1 | 3 | 2 |
144| Real-time / collab | 3 | 4-6 | 4-6 | 2 | 4-6 (essential) | 3 | 3 |
145| File upload | 2 | 6-10 (sizes/types) | 4-6 | 1 | 1-2 | 2 | 5+ (file abuse) |
146| Payment / financial | 3 | 6-10 | 8+ (critical) | 2 | 4-6 (idempotency!) | 3 | 8+ |
147| Bulk operation | 2 | 4-6 (sizes) | 4-6 | 1 | 2-4 (partial fail) | 2 | 3 |
148149Adjust for risk profile of the specific feature.
150151### Risk-weighted scenario selection
152153Not all scenarios need full QA coverage. Apply:
154- **Happy path:** always test
155- **Edge cases:** test those that matter (likelihood × severity)
156- **Error handling:** test all paths that user can recover from
157- **Empty state:** always test (first impression!)
158- **Concurrent:** test for data-integrity-critical features
159- **Accessibility:** baseline coverage on all UI; full coverage on user-facing
160- **Security:** scale with sensitivity (full coverage on auth/payment)
161162### Manual vs automated
163164| Scenario type | Default |
165|----------------|---------|
166| Happy path | Automated (E2E or integration) |
167| Edge cases (input validation) | Unit tests |
168| Error handling | Mix (mocked errors in unit; real in integration) |
169| Empty state | Visual regression + manual |
170| Concurrent | Hard — usually manual + targeted integration |
171| Accessibility | Automated (axe-core) + manual screen-reader |
172| Security | SAST + DAST + manual review for critical paths |
173| Performance | Automated load tests |
174| Localization | Pseudo-localization + manual spot-check |
175176## Common engagements
177178### "Generate test scenarios for this new feature"
1791. Read the PRD / spec.
1802. Apply the 7 categories.
1813. Generate scenarios; estimate count per category.
1824. Run validator; address gaps.
1835. Hand to QA for implementation.
184185### "Audit our test plan for completeness"
1861. Categorize existing scenarios.
1872. Identify under-covered categories.
1883. Score by risk × likelihood.
1894. Recommend additions.
190191### "Post-incident scenario gap analysis"
1921. Pull the incident scenario.
1932. Map: which category was missed?
1943. Add scenario; verify regression coverage.
1954. Update default-coverage rubric for that feature type.
196197## Anti-patterns to avoid
198199- **Only happy paths.** Production fails on edges; you skipped them.
200- **No empty state.** First-use is broken.
201- **"QA will figure it out."** No, QA tests what's specified.
202- **Generic acceptance criteria.** "Should work" is not testable.
203- **No accessibility scenarios.** Excludes users; fails compliance.
204- **No security scenarios.** Vulnerable paths ship.
205- **No performance scenarios for performance-sensitive features.** Surprise at scale.
206- **Skipping concurrent for collaborative features.** Race conditions ship.
207208## References
209210- `references/scenario-categories.md` — deep on the 7+ categories with examples
211- `references/coverage-anti-patterns.md` — common gaps + fixes
212213## Related skills
214215- `project-management/execution/create-prd` — upstream spec
216- `project-management/execution/wwas` — acceptance criteria
217- `engineering/senior-qa` — implementation
218- `engineering/code-reviewer` — review coverage
219- `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. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. 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.