Skip to content

openspec validate

Validates change proposals and specifications for correct formatting.

Terminal window
openspec validate [item] [options]
ArgumentDescription
itemChange or spec name (optional - validates all if omitted)
OptionDescription
--strictComprehensive validation
--type <type>Force type: change or spec
--jsonMachine-readable output
--no-interactiveDisable spinner (for CI)
  • Directory structure exists
  • Required files present (proposal.md, tasks.md)
  • Spec files parseable
  • Scenario format: #### Scenario: Name
  • Requirement wording: SHALL/MUST
  • Delta operations valid
  • No empty sections
  • At least one scenario per requirement
Terminal window
$ openspec validate add-user-auth --strict
add-user-auth validated successfully
Terminal window
$ openspec validate add-user-auth --strict
add-user-auth validation failed
Errors:
specs/auth/spec.md:15 - Requirement must have at least one scenario
specs/auth/spec.md:23 - Invalid scenario format (use #### Scenario:)
Terminal window
openspec validate my-change
Terminal window
openspec validate my-change --strict
Terminal window
openspec validate --strict
Terminal window
openspec validate --strict --no-interactive
Terminal window
openspec validate my-change --json

”Requirement must have at least one scenario”

Section titled “”Requirement must have at least one scenario””

Every requirement needs at least one scenario block:

### Requirement: User Login
#### Scenario: Valid credentials
- **WHEN** valid email and password
- **THEN** return JWT token

Use exactly #### Scenario: (4 hashtags):

#### Scenario: Success case ✓ Correct
### Scenario: Wrong header ✗ Wrong
- **Scenario: Bullet format ✗ Wrong

Ensure changes/name/specs/ contains .md files with operation headers:

## ADDED Requirements
...
CodeMeaning
0Validation passed
1Validation failed
2Item not found