Validate Tasks
Validate all task files for correctness — no CLI required.
Instructions
The user's arguments are in $ARGUMENTS (e.g. a directory path to scope validation).
Find the task directory:
- Read
.taskmd.yamlif it exists to check for a customdirfield - Default to
tasksif not configured - If
$ARGUMENTScontains a directory path, validate only that directory
- Read
Scan for task files: Use
Globwith<task-dir>/**/*.md- Exclude
.worklogs/directories
- Exclude
Read and validate each task file. For each file, check:
Required checks (errors)
a. Frontmatter exists
- File must start with
---and contain a second---delimiter - Error: "Missing YAML frontmatter"
b. Required fields present
id: Must be a non-empty stringtitle: Must be a non-empty string- Error: "Missing required field: "
c. Valid enum values
status: must be one of: pending, in-progress, completed, in-review, blocked, cancelledpriority: must be one of: low, medium, high, criticaleffort: must be one of: small, medium, largetype: must be one of: feature, bug, improvement, chore, docs- Error: "Invalid value ''. Valid values: "
d. Unique IDs
- Collect all task IDs; no duplicates allowed
- Error: "Duplicate ID '' found in: , "
e. Valid dependency references
- Each ID in
dependenciesmust exist as a task ID in the project - Error: "Unknown dependency '' in task ''"
f. No circular dependencies
- Follow dependency chains; no task should transitively depend on itself
- Error: "Circular dependency detected: → → ... → "
g. Valid parent references
parentmust reference an existing task ID- No self-references (parent != own id)
- No parent cycles
- Error: "Invalid parent reference '' in task ''"
Advisory checks (warnings)
h. File naming convention
- Files should match
<ID>-<slug>.mdpattern - Warning: "File '' doesn't follow naming convention"
i. Missing created date
- Warning: "Task '' has no created date"
j. Phase validation (if phases configured in
.taskmd.yaml)- Task
phasevalues should match a configured phaseid - Warning: "Task '' references unknown phase ''"
- File must start with
Report results:
Validated N task files Errors (M): ✗ tasks/cli/042-fix-bug.md: Missing required field: title ✗ tasks/web/003-auth.md: Invalid status value 'done'. Valid values: pending, in-progress, completed, in-review, blocked, cancelled ✗ Duplicate ID '042' found in: tasks/cli/042-fix-bug.md, tasks/web/042-other.md Warnings (W): ⚠ tasks/old-task.md: File doesn't follow naming convention ⚠ tasks/cli/043-new.md: No created date Result: FAIL (M errors, W warnings)If no errors:
Result: PASS (0 errors, W warnings)
See SPEC_REFERENCE.md (in the plugin root) for valid field values and validation rules.