---
name: planu-validate
description: Validate the current implementation against its Planu spec — runs acceptance criteria checks, health scan, and reports gaps with actionable fixes.
triggers:
  - validate
  - check the spec
  - does it match the spec
  - run validation
  - verify implementation
  - check compliance
  - validate spec
  - check criteria
version: 1.0.0
---

# /planu-validate — Validate Implementation

## When to invoke

Use this skill after implementation is complete, before marking a spec as done, or when spot-checking compliance.

**Trigger phrases**: "validate", "check the spec", "does it match the spec?", "run validation", "verify implementation", "check compliance"

## How it works

1. **Find active spec** — calls `planu_status` to identify the current `implementing` spec
2. **Run validation** — calls `validate({ specId })` which checks each acceptance criterion
3. **Health check** — calls `spec_health_check({ specId })` for structural quality
4. **Auto-fix** — calls `auto_fix_validation` for automatically fixable issues
5. **Report** — presents a structured pass/fail report with next steps for each failure

## Output format

```
## Validation — SPEC-NNN: <title>

✅ Passing: N/M criteria
❌ Failing: K criteria

Failures:
1. <criterion> — Root cause: <why>
   Fix: <concrete action>
```

## What counts as passing

- Each GIVEN/WHEN/THEN criterion has a corresponding test that passes
- All tests reach ≥95% branch coverage on new files
- `pnpm typecheck && pnpm lint` both pass with zero errors
- No cross-layer architecture violations

## Tips

- Run this skill before every commit on an implementing spec
- If validation fails, fix the gaps and re-run — don't proceed to `done` with failures
- Use the Planu Validator agent for a deeper analysis with fix suggestions
