Skip to main content
The validate subcommand checks that all required task artifact files are present, that evidence.json and verdict.json are valid JSON with the correct top-level keys, that status values are within the allowed set, and that task_id fields in both JSON files match the requested --task-id. Run validate before sign-off to confirm the full artifact set is complete and consistent.

Usage

python3 "$SKILL_PATH/scripts/task_loop.py" validate --task-id <TASK_ID> [options]

Flags

--task-id
string
required
Task identifier to validate. Must match the task_id field inside evidence.json and verdict.json.
--repo-root
string
Optional working directory inside the repo. Defaults to the current directory. The script walks up from this path to discover the git repository root.

What validate checks

1

File presence

Checks that every required file exists under .agent/tasks/<TASK_ID>/:
spec.md
evidence.md
evidence.json
verdict.json
problems.md
raw/build.txt
raw/test-unit.txt
raw/test-integration.txt
raw/lint.txt
raw/screenshot-1.png
2

JSON parseability

Attempts to parse evidence.json and verdict.json. A parse failure is recorded as an error.
3

Top-level key presence

Checks that evidence.json contains all required keys: task_id, overall_status, acceptance_criteria, changed_files, commands_for_fresh_verifier, known_gaps.Checks that verdict.json contains all required keys: task_id, overall_verdict, criteria, commands_run, artifacts_used.
4

Allowed status values

Checks that overall_status in evidence.json and overall_verdict in verdict.json are one of PASS, FAIL, or UNKNOWN.Checks that every item in acceptance_criteria (evidence) and criteria (verdict) has a status field that is also one of PASS, FAIL, or UNKNOWN.
5

task_id consistency

Checks that the task_id field in evidence.json matches the --task-id argument, and that the task_id field in verdict.json also matches.

Exit code

  • 0 — all required files are present and all checks pass.
  • 1 — one or more files are missing, or one or more validation errors were found.

JSON output

validate prints a JSON object to stdout regardless of exit code:
{
  "repo_root": "/path/to/repo",
  "task_id": "feature-auth-hardening",
  "task_dir": "/path/to/repo/.agent/tasks/feature-auth-hardening",
  "valid": true,
  "missing_files": [],
  "errors": []
}
When validation fails:
{
  "repo_root": "/path/to/repo",
  "task_id": "feature-auth-hardening",
  "task_dir": "/path/to/repo/.agent/tasks/feature-auth-hardening",
  "valid": false,
  "missing_files": [
    "/path/to/repo/.agent/tasks/feature-auth-hardening/raw/screenshot-1.png"
  ],
  "errors": [
    "evidence.json overall_status must be PASS, FAIL, or UNKNOWN.",
    "verdict.json task_id does not match the requested TASK_ID."
  ]
}
FieldTypeDescription
validbooleantrue only when missing_files and errors are both empty.
missing_filesarray of stringsAbsolute paths to required files that do not exist.
errorsarray of stringsValidation error messages from JSON structure and consistency checks.

Example

python3 "$SKILL_PATH/scripts/task_loop.py" validate \
  --task-id feature-auth-hardening

Build docs developers (and LLMs) love