> ## 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.

# Check specs in CI

> Run specpilot validate on every pull request, so a broken .specs/ folder fails the build.

`specpilot validate` exits with 1 when `.specs/` has an error, so a CI job that runs it fails the pull request. It asks no questions and needs only the checked-out repo.

## GitHub Actions

Save this as `.github/workflows/specs.yml`:

```yaml theme={null}
name: Specs
on:
  pull_request:
  push:
    branches: [main]
permissions:
  contents: read
jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: 24
      - run: npm install -g specpilot@2.22.0
      - run: specpilot validate --verbose
```

* Node.js 24 meets SpecPilot's requirement: 22.23.5 or later in 22.x, 24.22.3 or later in 24.x, or 26.13.1 or later.
* The version is pinned, so a new release never changes your build by surprise. Raise it when you [upgrade](https://docs.specpilot.dev/help/upgrading.md).
* `--verbose` adds a summary to the log: files checked, errors and warnings.

## What fails the job

Only errors. Warnings are printed, but the job passes.

| Fails the job (errors) | Doesn't (warnings) |
| - | - |
| No `.specs/` folder | A `lastUpdated` date more than 90 days old |
| A required file missing | A file over its line limit, such as Completed in `tasks.md` |
| `project.yaml` empty, unreadable or missing a required field | SpecPilot's old Cursor rules file still in place |
| `api.yaml` unreadable, or `openapi` without its required fields | A `tasks.md` heading that's a variant of a lane |
| A spec file without its front matter | |

Each [spec file's page](https://docs.specpilot.dev/reference/spec-files/readme.md) lists its checks. The date and line-limit checks are warnings, so a quiet month doesn't break the build. A new project also has warnings until you fill in its files.

## Don't use `--fix` in CI

`--fix` writes files on the runner, and they're never committed. Run `specpilot validate --fix` on your machine and commit what it creates.

## More than one project in the repo

Add one step per folder:

```yaml theme={null}
      - run: specpilot validate -d services/api
      - run: specpilot validate -d services/web
```

## Other CI systems

Any CI with Node.js works the same way: install `specpilot`, run `specpilot validate`, and a non-zero exit fails the job.

## If Node.js is too old

SpecPilot prints a security notice and still runs, so the job doesn't fail for it. Set `node-version` to a supported release.

Checked against SpecPilot 2.22.0.


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