Skill: test-plan
When to Use
Use this skill before merging a feature branch, after completing implementation, or when you need a QA checklist. Invoke with /test-plan to generate from the current branch, /test-plan main...HEAD for a specific git range, or /test-plan execute to run an existing plan.
Use $ARGUMENTS to determine the mode:
- Empty or git range (default): Generate mode -create a test plan from code changes
- "execute" or a file path: Execute mode -run an existing test plan via Playwright
Generate Mode
Procedure
- Identify changes. Detect the default branch (
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@', falling back to main if that fails). Run git diff <default-branch>...HEAD --stat to list changed files. If $ARGUMENTS contains a git range, use that instead.
- Understand each change. Read each changed file to understand what was modified and why.
- Create test scenarios. For each user-visible change, generate a test scenario:
- Scenario name: What the user does (e.g., "Submit the contact form with valid data")
- Steps: Numbered, specific enough for someone unfamiliar with the app
- Expected result: What should happen after completing the steps
- Edge cases: What could go wrong (empty fields, duplicate submissions, slow network, etc.)
- Group by feature area. Organise scenarios under feature headings.
- Write the plan. Save to
docs/test-plans/YYYY-MM-DD-<branch-name>.md.
Output Format
## Test Plan: <branch name>
Generated: <date>
### <Feature Area>
#### Scenario: <name>
- [ ] Step 1: ...
- [ ] Step 2: ...
- [ ] Step 3: ...
- Expected: ...
- Edge cases: ...
Execute Mode
Procedure
- Find the plan. If
$ARGUMENTS is a file path, use it. If $ARGUMENTS is "execute", find the most recent test plan in docs/test-plans/. If none exists, tell the user to generate one first.
- Read the plan. Parse each scenario and its steps.
- Run each scenario. For each scenario, use Playwright MCP to:
- Navigate to the relevant page
- Follow the steps exactly as written
- Use
browser_snapshot to verify page state after each action
- Verify the expected result
- Record results. For each scenario, record one of:
- PASS -all steps completed and expected result verified
- FAIL -a step didn't produce the expected result (include
browser_take_screenshot as evidence)
- BLOCKED -couldn't reach the step (prerequisite failed, page unreachable, login required)
- Update the plan. Append results to the test plan file:
### Execution Results - <date>
| Scenario | Result | Notes |
|---|---|---|
| <name> | PASS/FAIL/BLOCKED | <details> |
Rules
- Test scenarios describe what a user does, not what the code does. Write "Click the submit button and verify the success message appears" not "POST /api/form returns 200."
- Steps must be reproducible by someone who has never seen the codebase. No references to file names, function names, or implementation details.
- One scenario per user action. Don't combine "create an account" and "update profile" into one scenario.
- Include the unhappy path. For every form, test with empty fields, invalid data, and duplicate submissions. For every action, test what happens when it fails.
- In execute mode, follow steps literally. Do not improvise or skip steps. If a step is ambiguous, record it as BLOCKED with a note about what was unclear.
- Use
browser_snapshot first to understand page structure before interacting. Use browser_take_screenshot to capture evidence of failures.
- Limit file reads to 15 files. If the diff touches more than 15 files, group by feature area and generate scenarios from the diff summary and the 15 most relevant files. Tell the user which files were skipped.
1---2name: test-plan3description: Skill: test-plan4---56# Skill: test-plan78## When to Use910Use this skill before merging a feature branch, after completing implementation, or when you need a QA checklist. Invoke with `/test-plan` to generate from the current branch, `/test-plan main...HEAD` for a specific git range, or `/test-plan execute` to run an existing plan.1112Use `$ARGUMENTS` to determine the mode:13- **Empty or git range** (default): Generate mode -create a test plan from code changes14- **"execute" or a file path**: Execute mode -run an existing test plan via Playwright1516## Generate Mode1718### Procedure19201. **Identify changes.** Detect the default branch (`git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'`, falling back to `main` if that fails). Run `git diff <default-branch>...HEAD --stat` to list changed files. If `$ARGUMENTS` contains a git range, use that instead.212. **Understand each change.** Read each changed file to understand what was modified and why.223. **Create test scenarios.** For each user-visible change, generate a test scenario:23 - **Scenario name:** What the user does (e.g., "Submit the contact form with valid data")24 - **Steps:** Numbered, specific enough for someone unfamiliar with the app25 - **Expected result:** What should happen after completing the steps26 - **Edge cases:** What could go wrong (empty fields, duplicate submissions, slow network, etc.)274. **Group by feature area.** Organise scenarios under feature headings.285. **Write the plan.** Save to `docs/test-plans/YYYY-MM-DD-<branch-name>.md`.2930### Output Format3132```33## Test Plan: <branch name>34Generated: <date>3536### <Feature Area>3738#### Scenario: <name>39- [ ] Step 1: ...40- [ ] Step 2: ...41- [ ] Step 3: ...42- Expected: ...43- Edge cases: ...44```4546## Execute Mode4748### Procedure49501. **Find the plan.** If `$ARGUMENTS` is a file path, use it. If `$ARGUMENTS` is "execute", find the most recent test plan in `docs/test-plans/`. If none exists, tell the user to generate one first.512. **Read the plan.** Parse each scenario and its steps.523. **Run each scenario.** For each scenario, use Playwright MCP to:53 - Navigate to the relevant page54 - Follow the steps exactly as written55 - Use `browser_snapshot` to verify page state after each action56 - Verify the expected result574. **Record results.** For each scenario, record one of:58 - **PASS** -all steps completed and expected result verified59 - **FAIL** -a step didn't produce the expected result (include `browser_take_screenshot` as evidence)60 - **BLOCKED** -couldn't reach the step (prerequisite failed, page unreachable, login required)615. **Update the plan.** Append results to the test plan file:6263```64### Execution Results - <date>6566| Scenario | Result | Notes |67|---|---|---|68| <name> | PASS/FAIL/BLOCKED | <details> |69```7071## Rules7273- **Test scenarios describe what a user does, not what the code does.** Write "Click the submit button and verify the success message appears" not "POST /api/form returns 200."74- **Steps must be reproducible by someone who has never seen the codebase.** No references to file names, function names, or implementation details.75- **One scenario per user action.** Don't combine "create an account" and "update profile" into one scenario.76- **Include the unhappy path.** For every form, test with empty fields, invalid data, and duplicate submissions. For every action, test what happens when it fails.77- **In execute mode, follow steps literally.** Do not improvise or skip steps. If a step is ambiguous, record it as BLOCKED with a note about what was unclear.78- **Use `browser_snapshot` first** to understand page structure before interacting. Use `browser_take_screenshot` to capture evidence of failures.79- **Limit file reads to 15 files.** If the diff touches more than 15 files, group by feature area and generate scenarios from the diff summary and the 15 most relevant files. Tell the user which files were skipped.