Skip to main content
ClaudeWave
Skill402 repo starsupdated 2d ago

create-test-plan

This Claude Code skill analyzes code changes and generates a structured test plan saved to .turbo/test-plan.md with four escalating test levels: basic functionality, complex operations, adversarial testing, and cross-cutting scenarios. Use it when asked to create a test plan, plan tests, generate test scenarios, or identify test cases for a pull request or recent code change.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/tobihagemann/turbo /tmp/create-test-plan && cp -r /tmp/create-test-plan/claude/skills/create-test-plan ~/.claude/skills/create-test-plan
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Create Test Plan

Analyze what changed and generate a comprehensive test plan covering four escalating levels of testing depth.

## Step 1: Determine Scope

Resolve scope using the first match:

1. **User-specified** — the user says what to test. Use that.
2. **PR** — a PR URL or number is provided. Fetch the PR details (title, description, changed files, comments) and read the changed code.
3. **Conversation context** — prior conversation contains recent work (a feature, fix, or refactor). Extract what changed, where it lives, and expected behavior.
4. **App-level discovery** — fresh context with no prior work. Examine the project (entry points, routes, commands, README) to identify the app's core user-facing flows.

If the resolved scope spans more than one git branch and the user named no single branch, cover each of them instead of only the branch currently checked out. Include scenarios that exercise them together where the branches can be combined in the working tree the plan's executor will have, and state the required branch state in each such scenario's steps.

## Step 2: Determine Testing Approach

Always check for project-specific testing skills or MCP tools first. Use the fallbacks below when nothing project-specific is available:

- **Web app** → `/agent-browser` skill if available, otherwise `claude-in-chrome` MCP
- **UI/native app** → `computer-use` MCP
- **CLI tool** → direct terminal execution
- **Library with no entry point** → report that interactive testing is not applicable and stop

## Step 3: Resolve the Output Path

Pick a slug for the test plan from the change under test:

- Lowercase
- Replace non-alphanumeric characters with hyphens
- Collapse consecutive hyphens
- Trim leading and trailing hyphens
- Truncate to 40 characters at a word boundary

If the work is anchored to an existing plan at `.turbo/plans/<slug>.md`, reuse that plan's slug verbatim.

The user may pass an explicit slug or output path; honor it.

Resolve a collision at `.turbo/test-plans/<slug>.md` by how the slug was chosen. A slug generated from the change under test takes `-2`, `-3`, and so on until the path is free; do not overwrite. For a slug reused from an anchoring artifact, use `AskUserQuestion` to offer overwrite or a different slug, since a numeric suffix would break its pairing with that artifact. For a slug or path the user supplied, use `AskUserQuestion` to offer overwrite, a numeric suffix, or a different slug.

State the chosen slug and the resulting test plan path before continuing.

## Step 4: Analyze the Change

After identifying scope, read the actual code in depth to understand:

- What was added, modified, or removed
- Expected behavior (from PR descriptions, comments, commit messages, or specs)
- Assumptions the implementation makes
- Error paths and edge cases
- Other features or components that could be affected

## Step 5: Generate the Test Plan

For each level, generate specific, actionable test scenarios tailored to the actual change. Each scenario needs exact steps and an expected outcome.

Confirm a scenario's starting state can be reached before writing it. When a precondition depends on a system the executor does not control (another team's service, an external platform), confirm a write path for it exists. Where the write path is uncertain or absent, write the scenario so it names what to attempt and what to record when the attempt fails.

### Level 1: Basic Functionality

Does the feature work at all? Verify the happy path and the most obvious behavior.

- Core feature works as described
- Expected output/UI matches the spec or PR description
- No regressions in directly related functionality

### Level 2: Complex Operations

Combine multiple actions in sequence. Verify state consistency across operations.

- Chain related operations (e.g., create, edit, rename, delete)
- Exercise different combinations of feature parameters
- Verify intermediate states are correct, not just the final result

### Level 3: Adversarial Testing

Actively try to break the feature. Explore boundary conditions and unexpected inputs.

- Invalid, empty, or extreme inputs
- Rapid repeated actions
- An action re-applied to its own output, checked against what the feature intends on the second application
- Interrupting operations midway (cancel, disconnect, close)
- Resource limits (very large files, deep structures, long names)
- Permission and access edge cases

### Level 4: Cross-Cutting Scenarios

Explore state interactions across system boundaries. These surface the hardest bugs.

- Concurrent modifications from different sources
- State transitions (online to offline to online, foreground to background)
- Interactions with other features that share state
- Race conditions between asynchronous operations

### When a Level Does Not Apply

If the change is small enough that a level has no meaningful scenarios (e.g., a typo fix has no cross-cutting scenarios), note "N/A for this change" with a brief explanation.

## Step 6: Present and Write

Output the plan as text. Then use `AskUserQuestion` to ask for approval before writing.

Create `.turbo/test-plans/` if it does not exist. Write the plan to `.turbo/test-plans/<slug>.md` using this format:

```markdown
# Test Plan: <Feature/Change Name>

## Context

<Brief description of what changed and why>

## Approach

<Testing approach: agent-browser / claude-in-chrome / computer-use / terminal>
<Dev server command if applicable>

## Level 1: Basic Functionality

- [ ] **<Test name>** — <Steps to perform> → Expected: <expected outcome>

## Level 2: Complex Operations

- [ ] **<Test name>** — <Steps to perform> → Expected: <expected outcome>

## Level 3: Adversarial Testing

- [ ] **<Test name>** — <Steps to perform> → Expected: <expected outcome>

## Level 4: Cross-Cutting Scenarios

- [ ] **<Test name>** — <Steps to perform> → Expected: <expected outcome>
```

Then use the TaskList tool and proceed to any remaining task.

## Rules

- Genera
answer-reviewer-questionsSkill

For each reviewer question on a PR, recall implementation reasoning and compose a raw answer. Use when the user asks to \"answer reviewer questions\", \"draft answers to PR questions\", or \"explain reviewer questions\".

apply-findingsSkill

Apply findings by making the suggested code changes. Applies accepted verdicts, escalates ambiguous findings to the user, and offers to note genuine improvements for later. Use when the user asks to \"apply findings\", \"apply fixes\", \"apply suggestions\", \"apply accepted findings\", \"fix the findings\", or \"apply the review results\".

auditSkill

Project-wide health audit pipeline that fans out to all analysis skills in parallel, evaluates findings, and produces a unified report at .turbo/audit.md. Use when the user asks to \"audit the project\", \"run a full audit\", \"project health check\", \"audit my code\", \"codebase audit\", or \"comprehensive review\".

changelog-rulesSkill

Shared changelog conventions and formatting rules referenced by $create-changelog and $update-changelog. Not typically invoked directly.

code-styleSkill

Enforce existence, reuse, mirror, and symmetry principles to keep new code minimal and consistent with surrounding code. Use when writing new code in an existing codebase, adding new features, refactoring, or making any code changes.

codex-execSkill

Run autonomous task execution using the codex CLI. Use when the user asks to \"codex exec\", \"run codex exec\", \"execute a task with codex\", or \"delegate to codex\".

codex-reviewSkill

Run AI-powered code review using the codex CLI. Use when the user asks to \"codex review\", \"run codex review\", or \"review a commit with codex\".

commit-rulesSkill

Shared commit message rules and technical constraints referenced by /stage-commit and /commit-staged. Not typically invoked directly.