Skip to content

Conversation

@Pertempto
Copy link
Collaborator

Summary

Implements the validate command from the MVP spec (000-basic-cli.md).

Changes

New Files

  • internal/validate/parser.go - Goldmark-based spec parser with frontmatter extension
  • internal/validate/parser_test.go - Tests for spec parsing
  • internal/validate/validator.go - Validation logic for frontmatter, status, title, and task lists
  • internal/validate/validator_test.go - Tests for validation
  • cmd/validate_test.go - Integration tests for the validate command

Updated Files

  • cmd/validate.go - Full implementation replacing stub
  • specs/000-basic-cli.md - Marked validate command tasks as complete

Features

  • Parse specs using goldmark with frontmatter extension
  • Validate frontmatter - checks for presence and required status field
  • Validate status - must be one of: draft, approved, in-progress, completed, rejected
  • Validate title - checks for H1 heading
  • Validate task list - checks for checkbox items
  • Single-spec mode - specture validate 000 or specture validate specs/000-mvp.md
  • All-specs mode - specture validate validates all specs in specs/
  • Summary output - shows "X of Y specs valid"
  • Clear error messages - actionable output for validation failures

Testing

just test  # All tests pass

Manual testing:

just build
./specture validate           # Validates all specs
./specture validate 000       # Validates specific spec by number
./specture v                  # Alias works

exe.dev user added 3 commits January 1, 2026 20:02
- Add internal/validate/parser.go with ParseSpec and ParseSpecContent
- Parse YAML frontmatter (status, author fields)
- Extract title from first H1 heading
- Detect task list items using goldmark task list extension
- Add comprehensive tests for parser functionality
…ist checks

- Add ValidateSpec and ValidateSpecFile functions
- Validate frontmatter presence and required status field
- Validate status against allowed values (draft/approved/in-progress/completed/rejected)
- Validate H1 heading (title) exists
- Validate task list exists
- Add FormatValidationResult for displaying results
- Add comprehensive tests for all validation scenarios
- Update spec to mark completed tasks
- Add validate command with 'v' alias
- Support validating all specs with 'specture validate'
- Support validating single spec by number (e.g., 'specture validate 000')
- Support validating by file path (e.g., 'specture validate specs/000-mvp.md')
- Add summary output showing X of Y specs valid
- Add clear error messages for validation failures
- Add comprehensive integration tests for all modes
- Update spec to mark completed tasks
@Pertempto Pertempto marked this pull request as draft January 1, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants