> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stably.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Test Planning (stably plan)

> Analyze your repository, discover coverage gaps, and generate test.fixme() plan files.

`stably plan` analyzes your repository and generates user-facing `test.fixme()` plan files for missing or weak coverage areas.

Use it when you want a concrete testing backlog before generating real tests or filling in gaps manually.

```bash theme={null}
stably plan
```

## Command Syntax

```bash theme={null}
stably plan [prompt...]
```

`stably plan` accepts an optional prompt. If you omit it, Stably uses a default planning prompt that analyzes the repository and generates a comprehensive test coverage plan.

## What It Does

* Reads your codebase and existing tests
* Identifies likely coverage gaps, missing scenarios, and edge cases
* Generates plan files using `test.fixme()` so the plan is visible in your repo
* Lets you review and refine the plan before turning it into finished tests
* Stays focused on repository analysis rather than browser-driven verification

## When To Use It

| Use `stably plan` when you want to...   | Why it fits                                                             |
| --------------------------------------- | ----------------------------------------------------------------------- |
| Review coverage before a release        | It gives you a structured backlog instead of ad hoc ideas               |
| Audit a large repo or legacy test suite | It helps surface missing scenarios without requiring a full rewrite     |
| Scope work for a team or agent          | `test.fixme()` plan files are easy to review and split up               |
| Plan first, implement later             | It stays in planning mode instead of trying to finish tests immediately |

## Usage

```bash theme={null}
# Analyze the repository and create a broad coverage plan
stably plan

# Focus the plan on a part of the product
stably plan "focus on checkout, login, and billing edge cases"

# Ask for a plan around recent product work
stably plan "look for missing coverage around the new onboarding flow"
```

## How It Fits In The Workflow

`stably plan` is the planning step. `stably create` is the implementation step.

| Command         | Best for                                                                   |
| --------------- | -------------------------------------------------------------------------- |
| `stably plan`   | Discovering what should be tested next                                     |
| `stably create` | Generating real Playwright tests                                           |
| `stably verify` | Checking that behavior works in a live browser without creating test files |
| `stably test`   | Running your existing suite                                                |
| `stably fix`    | Repairing failing tests                                                    |

## Typical Workflow

```bash theme={null}
# 1. Find gaps
stably plan "focus on checkout and account recovery"

# 2. Review the generated plan files and pick the scenarios you want to implement

# 3. Turn planned coverage into real tests
stably create "implement the highest-priority checkout scenarios from the plan"

# 4. Run the suite
stably test
```

Review the generated `test.fixme()` files, decide which scenarios matter most, and then use those scenarios to guide `stably create` or manual test authoring.

## Notes

* `stably plan` is a repo-analysis command. It does not launch a browser.
* It is intended to produce planning artifacts, not complete end-to-end tests.
* The output is meant to be reviewed by a developer or coding agent before being turned into finished tests.
* The exact files generated depend on what the agent finds in your repository, so review the new `test.fixme()` plan files after the command completes.

<Card title="CLI Commands" icon="terminal" href="/stably-cli/commands">
  See the full CLI command overview
</Card>
