WORK-033
ID:WORK-033Status:done

plan validate Command

Priority:mediumComplexity:moderateSource:SPEC-022

Criteria completion

Criteria completion: 10 of 10 (100%) checked; history from Mar 22 to Mar 230%25%50%75%100%Mar 22Mar 23
Branches 2
History 4
  1. e900a90
    Created (done)by bjornolofandersson
  2. f262d7b
    Content editedby Claude
  3. d9a8fae
    • ☑ Detects broken `ref`/`xref` links — entity ID not found (error)
    • ☑ Detects duplicate IDs across all plan files (error)
    • ☑ Detects invalid status, priority, and severity values (error)
    • ☑ Detects circular dependencies (error)
    • ☑ Detects orphaned work items with no milestone assigned (warning)
    • ☑ Detects completed milestones with open work items (warning)
    • ☑ `--strict` promotes warnings to errors
    • ☑ Exit codes: 0 = clean, 1 = errors found, 2 = bad arguments
    • ☑ `--format json` for programmatic consumption
    • ☑ Tests for each check type
    by Claude
  4. 30b2ae0
    Created (ready)by Claude
    Add 9 work items for SPEC-022 (Plan CLI) implementation

Summary

Structural validation for plan files with CI-friendly exit codes. Checks for broken references, duplicate IDs, invalid attribute values, circular dependencies, and consistency issues. Add npx refrakt plan validate --strict to CI in one line.

Acceptance Criteria

  • Detects broken ref/xref links — entity ID not found (error)
  • Detects duplicate IDs across all plan files (error)
  • Detects invalid status, priority, and severity values (error)
  • Detects circular dependencies (error)
  • Detects orphaned work items with no milestone assigned (warning)
  • Detects completed milestones with open work items (warning)
  • --strict promotes warnings to errors
  • Exit codes: 0 = clean, 1 = errors found, 2 = bad arguments
  • --format json for programmatic consumption
  • Tests for each check type

Dependencies

  • WORK-027 (plugin architecture)
  • WORK-028 (plan file scanner)

References

  • SPEC-022 (Plan CLI)