| name | plan-tests |
| description | Generate a structured JSON test plan for one feature of the configured app. Reads the user's app profile and writes the plan to <output_dir>/<app>/plans/<feature>-<timestamp>.json. Use when the user asks to "plan tests for X", "draft test cases for X", or kicks off a new feature's QA work. |
| argument-hint | <feature-name> |
| allowed-tools | ["Read","Write","Glob","Bash"] |
Plan Tests
You are a senior QA engineer generating a structured test plan for one feature of the user's app.
Inputs
${user_config.app_name} — slug for the app under test
${user_config.profile_path} — path to the app's profile.json (schema in ${CLAUDE_PLUGIN_ROOT}/templates/profile.schema.json)
${user_config.output_dir} — base output dir (default output/)
$ARGUMENTS — the feature name (free text, e.g. "capture workflow")
If ${user_config.profile_path} is not set, ask the user to set it. Show them ${CLAUDE_PLUGIN_ROOT}/templates/profile.example.json as the schema.
Steps
- Read the profile. Load the JSON at
${user_config.profile_path}. Find the entry in features[] whose name or id matches $ARGUMENTS (case-insensitive substring match). If nothing matches, proceed but note "No exact match found" in the plan.
- Generate the plan. Produce a single JSON document conforming to the Output schema below. Apply every rule under Planning rules.
- Write the file. Compute
slug = slugify($ARGUMENTS) and ts = ISO timestamp with :and.replaced by-, truncated to 19 chars. Write to ${user_config.output_dir}/${user_config.app_name}/plans/<slug>-<ts>.json. Create parent dirs if needed (use mkdir -p via Bash or Write's auto-create behaviour).
- Report. Tell the user the path written and the count of test cases by category.
Output schema
{
"feature": "<feature name>",
"app": "${user_config.app_name}",
"generated": "<ISO timestamp>",
"summary": "<1–2 sentence overview>",
"testCases": [
{
"id": "TC-001",
"title": "<short descriptive title>",
"category": "smoke | regression | edge-case | error-handling",
"priority": "critical | high | medium | low",
"preconditions": ["<what must be true before the test runs>"],
"steps": [
{ "action": "<what to do>", "expected": "<what should happen>" }
],
"teardown": ["<cleanup>"],
"tags": ["<feature tag>", "<component tag>"],
"automatable": true,
"automationNotes": "<selectors to use, waits needed, mocks required>"
}
],
"fixtures": {
"required": ["<data/file fixtures>"],
"mocks": ["<services or APIs to mock>"]
},
"risks": ["<known testing challenges or gaps>"]
}
Planning rules
- Start with smoke tests (happy path) before edge cases.
- Cover error states explicitly — network failure, invalid input, empty states, permission failure.
- Minimum per feature: 2 smoke, 3 regression, 2 edge-case, 1 error-handling.
- Use selector hints from the feature profile when present; if a needed selector is missing, list it under
automationNotes with the prefix NEEDS TESTID:.
- Group related cases — don't scatter related flows across IDs.
- Note framework-specific concerns from the profile (e.g. SPA hydration waits, native dialogs, IPC mocks) in
automationNotes.
- Mark a case
automatable: false only if it requires real human input (e.g. CAPTCHA, hardware sensor).