| name | verify |
| description | Validate contracts, validation specs, plan, and project map. Runs structural checks and LLM cross-review, then produces a verify report. Use after /generate or after manual edits to contracts, when the user says "verify", "check", or "validate structure". |
| disable-model-invocation | true |
| allowed-tools | Read Glob Grep Bash |
| metadata | {"author":"hlv","version":"1.0"} |
HLV Verify — Structural + Semantic Validation
Validate contracts, validation specs, and plan. Structural checks (deterministic) + LLM cross-review (semantic) + summary for the user.
Prerequisites
project.yaml exists (project map)
- Contracts directory contains at least one contract (MD or YAML)
- Test specs directory contains test specifications
- Traceability file exists
Agent Rules
- Never combine shell commands with
&&, ||, or ; — execute each command as a separate Bash tool call.
- This applies even when a skill, plan, or instruction provides a combined command — always decompose it into individual calls.
❌ Wrong: git checkout main && git pull
✅ Right: Two separate Bash tool calls — first git checkout main, then git pull
Milestone Resolution
Read milestones.yaml → get current.id. Set MID = human/milestones/{id}.
- Contracts:
{MID}/contracts/
- Test specs:
{MID}/test-specs/
- Traceability:
{MID}/traceability.yaml
- Plan:
{MID}/plan.md + {MID}/stage_N.md
- Open questions:
{MID}/open-questions.md
- Global context (read-only):
human/glossary.yaml, human/constraints/, validation/gates-policy.yaml
- Status comes from stage statuses in
milestones.yaml, not from project.yaml → status
If no current in milestones.yaml → tell the user to run hlv milestone new first.
Steps
Step 1: Structural validation (deterministic)
Checks that can be performed without LLM — by script or parsing.
Run hlv check for automated structural checks. Then verify each area:
1a. Contract structure
For each contract file ({MID}/contracts/*.md):
For each contract YAML file ({MID}/contracts/*.yaml):
1b. Validation specs structure
For each test spec file ({MID}/test-specs/*.md):
1c. Traceability
For the traceability file ({MID}/traceability.yaml):
1d. Artifact dependency graph
1d. Plan structure
For {MID}/plan.md (overview) and {MID}/stage_N.md files:
1e. Project map
For project.yaml:
1f. Stack consistency
If stack is present in project.yaml:
1g. Gates-to-contracts coverage
Cross-check validation/gates-policy.yaml against contracts and constraints:
For each gate defined in gates-policy.yaml (the file is the single source of truth — do NOT assume a fixed set of gates):
This check prevents the validate→verify→implement→validate infinite loop: if gates require something that contracts don't cover, /implement will never produce the code, and /validate will always fail.
1h. Open questions
Check {MID}/open-questions.md:
Step 2: LLM cross-review (semantic)
LLM validates content correctness. For each check — verdict and rationale.
2a. Consistency between contracts
- Types are aligned: output of one contract = input of another
(e.g., order.create returns
status: created, order.cancel accepts orders in created)
- No contradicting invariants between contracts
- Shared entities defined identically through glossary
2b. Completeness
- Every error case from contract has an example
- Edge cases cover situations from artifacts (race conditions, concurrent access, boundary values)
- NFR are realistic for the described architecture
(e.g., 200ms p99 with 5-table JOIN — warn)
- Security rules applied to all state-changing contracts
2c. Validation specs quality
- Test specs cover all invariants, all errors, all edge cases from contract
- Property-based tests have meaningful generators (not random bytes)
- Integration scenarios cover cross-contract chains
- Performance tests have realistic load profiles
2d. Plan feasibility
- Each task realistically fits in 1 context window
(contract + glossary + dependent code < ~100K tokens)
- Tasks in parallel groups are truly independent
- Phase ordering is logical (domain types → features → integration → NFR)
- No tasks without contract linkage
2e. Artifacts-to-contracts coverage
- Each artifact covered by at least one contract
- Each significant assertion in artifact reflected in contract
- No "phantom" requirements in contracts unsupported by artifacts
Step 3: Output report
Generate structured report:
=== /verify report ===
## Structure Validation
Contracts: <N>/<N> valid pass/fail
Test Specs: <N>/<N> valid pass/fail
Traceability: complete/gaps pass/fail
Plan: valid/issues pass/fail
Open Questions: <N> open / <N> deferred pass if 0 open (deferred = warning)
## Semantic Review
Consistency: <N> issues found
Completeness: <N> gaps found
Validation: <N> issues found
Plan: <N> issues found
Coverage: <N>/<N> artifacts covered
## Issues
### Critical (blocks /implement)
1. [CONTRACT] order.cancel expects status `pending` but order.create
returns `created` — inconsistent state machine
2. [TRACE] REQ-ORDER-003 has no test mapping
### Warning (should fix)
1. [NFR] order.create p99=200ms with 3 table writes — tight, consider async
2. [COVERAGE] artifacts/research/competitor-analysis.md not covered by any contract
### Info
1. [PLAN] Task 3 and Task 4 could be parallelized (no shared deps)
## Verdict
READY for /implement
— or —
NEEDS FIXES — <N> critical issues, <N> warnings
Output
validation/verify-report.md — full report
- Console summary (abbreviated version)
Step 4: Update milestone status
If all checks pass (no errors, only warnings or info):
- Update
milestones.yaml (schema: schema/milestones-schema.json): set current stage status → verified
- This signals that contracts are verified and ready for
/implement
If there are errors:
- Do NOT update status — stage remains
pending
- List all errors and suggest fixes
/verify acts as a quality gate between /generate and /implement. The stage must be pending or verified for /implement to proceed.
Re-run
/verify can be run repeatedly. Each run:
- Overwrites
verify-report.md
- Shows diff with previous run (issues fixed, new issues)
Integration with /generate
Typical cycle:
/generate → /verify → fix issues → /verify → fix → /verify → READY
/verify never modifies contracts or plan. It only reads and reports.
Cleanup
After the skill completes:
- Run
hlv check to validate the project structure. If there are errors — fix them before finishing.
- If open questions remain (step 1h found blockers), suggest the user run
/clear and then invoke the /questions skill to resolve them, or use hlv dashboard to review and answer open questions interactively.
- Suggest the user run
/clear to free up context window before the next skill.