AI-driven user story testing. Reads user story markdown files and executes acceptance criteria as intelligent browser tests using subagents. Use: /test-stories, /test-stories 02-feed, /test-stories FEED-05, /test-stories docs/user-stories/
Execute user story acceptance criteria as intelligent browser tests.
The user invokes this skill with an optional filter argument:
| Input | Behavior |
|---|---|
| (none) | Run all stories in docs/user-stories/ |
02-feed | Run docs/user-stories/02-feed.md |
FEED-05 | Run only story ID FEED-05 from its parent file |
docs/user-stories/ | Run all .md files in that folder |
docs/some-subfolder/ | Run all .md files in that folder |
Before running tests, verify dev servers are up:
http://ecomitram.localhost:1355 — if it fails, tell user: "Start web server: pnpm --filter @ecomitram/web dev"http://api.ecomitram.localhost:1355/health — if it fails, tell user: "Start API server: pnpm --filter @ecomitram/api dev"If either server is down, STOP and ask the user to start them. Do not proceed.
Parse the user's argument to determine which files to test:
docs/user-stories/*.md — collect all files, sort by filename02-feed, no uppercase, has digits): Try docs/user-stories/{arg}.md. If not found, try docs/user-stories/*{arg}*.mdFEED-05 — uppercase letters, hyphen, digits): Grep all files in docs/user-stories/ for ## {arg}:. Use the matching file, pass the story ID as filter./ or contains /): Glob {path}/*.mdStore:
storyFiles: list of absolute file pathsstoryIdFilter: specific story ID to test, or null for all stories in each fileRead the file ~/.claude/skills/test-stories/AGENT.md into a variable. This is the complete instruction set for each testing subagent.
Before dispatching subagents:
YYYY-MM-DD-HHmm (e.g., 2026-03-06-1430) using date +%Y-%m-%d-%H%Mmkdir -p test-results/stories/{timestamp}/runTimestamp: the timestamp stringscreenshotDir: absolute path to test-results/stories/{timestamp}/reportPath: test-results/stories/{timestamp}.mdFor each story file in storyFiles:
fileSlug from the filename (e.g., 01-auth from 01-auth.md)You are a QA testing agent. Follow the AGENT INSTRUCTIONS below exactly.
## AGENT INSTRUCTIONS
{contents of AGENT.md}
## STORY TO TEST
{contents of the story markdown file}
## CONFIGURATION
- Base URL: http://ecomitram.localhost:1355
- API URL: http://api.ecomitram.localhost:1355
- Story ID filter: {storyIdFilter or "ALL"}
- Screenshot dir: {absolute path to screenshotDir}
- File slug: {fileSlug}
- Run timestamp: {runTimestamp}
Execute the tests now and return your report.
Subagent settings:
subagent_type: general-purposemodel: sonnet (faster than opus for execution)description: Test {filename} (e.g., "Test 02-feed.md")If a subagent fails/crashes: Record "## {filename}: AGENT ERROR\n{error message}" and continue.
After all subagents complete:
Assemble a markdown report with this structure:
# Test Stories Report — {YYYY-MM-DD HH:mm}
**Scope:** {comma-separated list of story files tested}
**Summary:** X passed, Y failed, Z skipped
## {filename} (e.g., 01-auth.md)
### {STORY-ID}: {Title} {overall_icon}
{icon} {criterion text} — {evidence}
{icon} {criterion text} — {evidence}

### {STORY-ID}: {Title} {overall_icon}
{icon} {criterion text} — {evidence}

---
## Failures Summary
1. **{STORY-ID}**: {one-line description}
...
## Learnings
- {patterns or observations}
Count totals across all reports:
✓)✗)⊘)Analyze learnings by scanning all reports for patterns:
Use the Write tool to save the report to {reportPath} (i.e., test-results/stories/{runTimestamp}.md).
Print only a short summary to chat (not the full report):
Test report saved: test-results/stories/{runTimestamp}.md
Screenshots: test-results/stories/{runTimestamp}/
Summary: X passed, Y failed, Z skipped
If there are failures, list them briefly (one line each).