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

# specpilot validate

> Check .specs/ for missing files, broken structure and stale content, and fix what can be fixed.

```bash theme={null}
specpilot validate [options]
```

Alias: `specpilot v`.

## Options

| Option | What it does | Default |
| - | - | - |
| `-d, --dir <directory>` | The project folder | `.` |
| `--fix` | Fixes what it can, then checks again | Off |
| `--verbose` | Adds a summary: files checked, errors and warnings | Off |

## What it does

1. Finds `.specs/`, or an older `.project-spec/`, `specs/` or `specifications/` folder.
2. Checks that the required files exist, then runs each file's own checks. Each [spec file's page](https://docs.specpilot.dev/reference/spec-files/readme.md) lists them.
3. Prints errors and warnings. One warning is for Cursor's old rules file, `.cursor/rules/project.mdc`, which `--fix` doesn't change. See [specpilot migrate](https://docs.specpilot.dev/reference/cli/migrate.md#the-old-cursor-rules-file).
4. When only content issues are left, prints prompts to paste into your agent so it can fix them.

## What `--fix` does

* Creates missing required files.
* Renames a `tasks.md` heading when exactly one heading is a variant of a missing lane.
* Renames a root key in `api.yaml` that isn't OpenAPI to its `x-` form.

## Exit status

1 with any error, 0 with warnings only.

To run it on every pull request, see [Check specs in CI](https://docs.specpilot.dev/help/ci.md).

## Examples

```bash theme={null}
specpilot validate
specpilot validate --fix
```

Checked against SpecPilot 2.22.0.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.