Skip to main content

Validate Loop

The Validate Loop is the quality gate before a PR is opened. It runs a more thorough check than the Dev Loop validators: a three-part review covering ticket completeness, code quality, and security.

What it does

The validate skill runs a structured quality gate:

  1. Ticket completeness: checks the spec, acceptance criteria, and tasks are complete
  2. Code quality: reviews the diff against codebase patterns, style, and naming conventions
  3. Security: scans for vulnerabilities introduced by the change

The output is a structured report with a clear READY FOR PR or NEEDS WORK verdict.

How to start it

The Validate Loop fires automatically when the Dev Loop completes. You can also run it manually:

/dmx/run-loop validate

The human gate

After validate runs, the loop pauses. Review the validation report. If it says NEEDS WORK, address the findings before continuing.

When you're satisfied:

/dmx/loop-continue

The Validate Loop validators run (tests and spec adherence again as a final confirmation), then the loop chains to the Release Loop.

Validators

The Validate Loop runs the same validators as the Dev Loop, but as a final check before the PR opens.

run_tests

CheckRequired
tests_passYes

spec_adherence

CheckRequired
scope_matches_specYes
no_regressionsYes

The no_regressions check is required here but not in the Dev Loop. It scans for regression-related language in the validator output.

Loop config

name: validate
skills:
- validate
trigger:
type: on_complete
goal_state: "All required checks pass, code reviewed, ready for PR"
validators:
- tool: run_tests
checks:
- name: tests_pass
required: true
- tool: spec_adherence
checks:
- name: scope_matches_spec
required: true
- name: no_regressions
required: true
on_optional_failure: warn
failure_handling: pause
human_gate: true
on_complete:
on_success:
trigger_loop: release

Extending the Validate Loop

The validate skill covers ticket completeness, code quality, and basic security. For production teams, you'll want additional validators:

  • A real security scanner (Bandit, Semgrep, Snyk)
  • A coverage threshold check
  • A lint or format check
  • An LLM-backed spec adherence check

Override these by replacing validators/spec_adherence.py or adding new validators to your loop config. See Writing Validators.

Tips

Read the NEEDS WORK report. When validate returns NEEDS WORK, it's a structured report with specific findings. These are the things a human reviewer would catch. Don't skip them.

The Validate Loop is not the only gate. The Dev Loop should catch test failures. The Validate Loop is where you catch what the Dev Loop misses: security issues, scope creep, code quality problems.