Verifier Agent
The verifier agent verifies that a phase achieved its GOAL, not just completed its TASKS.Purpose
Goal-backward verification. Start from what the phase SHOULD deliver, verify it actually exists and works in the codebase.When Invoked
Spawned by/gsd:execute-phase orchestrator after all plans complete.
Core Principle
Task completion ≠ Goal achievement A task “create chat component” can be marked complete when the component is a placeholder. The task was done — a file was created — but the goal “working chat interface” was not achieved. Goal-backward verification starts from the outcome and works backwards:- What must be TRUE for the goal to be achieved?
- What must EXIST for those truths to hold?
- What must be WIRED for those artifacts to function?
What It Does
1. Establish Must-Haves
Option A: Must-haves in PLAN frontmatter Extract from plans:- Use each Success Criterion directly as a truth
- Derive artifacts: For each truth, “What must EXIST?”
- Derive key links: For each artifact, “What must be CONNECTED?”
- State the goal from ROADMAP.md
- Derive truths: “What must be TRUE?” (3-7 observable behaviors)
- Derive artifacts: “What must EXIST?”
- Derive key links: “What must be CONNECTED?“
2. Verify Observable Truths
For each truth, determine if codebase enables it. Verification status:- ✓ VERIFIED: All supporting artifacts pass all checks
- ✗ FAILED: One or more artifacts missing, stub, or unwired
- ? UNCERTAIN: Can’t verify programmatically (needs human)
3. Verify Artifacts (Three Levels)
Use gsd-tools for artifact verification:{ all_passed, passed, total, artifacts: [{path, exists, issues, passed}] }
For wiring verification (Level 3):
- WIRED: Imported AND used
- ORPHANED: Exists but not imported/used
- PARTIAL: Imported but not used (or vice versa)
Final Artifact Status
4. Verify Key Links (Wiring)
Use gsd-tools for key link verification:verified=true→ WIREDverified=falsewith “not found” in detail → NOT_WIREDverified=falsewith “Pattern not found” → PARTIAL
- Component → API
- API → Database
- Form → Handler
5. Check Requirements Coverage
Extract requirement IDs from PLAN frontmatter:- Find its full description in REQUIREMENTS.md
- Map to supporting truths/artifacts verified
- Determine status:
- ✓ SATISFIED: Implementation evidence found
- ✗ BLOCKED: No evidence or contradicting evidence
- ? NEEDS HUMAN: Can’t verify programmatically
requirements field, flag as ORPHANED.
6. Scan for Anti-Patterns
Identify files modified in this phase, then run anti-pattern detection:7. Identify Human Verification Needs
Always needs human:- Visual appearance
- User flow completion
- Real-time behavior
- External service integration
- Performance feel
- Error message clarity
8. Determine Overall Status
Status: passed — All truths VERIFIED, all artifacts pass levels 1-3, all key links WIRED, no blocker anti-patterns. Status: gaps_found — One or more truths FAILED, artifacts MISSING/STUB, key links NOT_WIRED, or blocker anti-patterns found. Status: human_needed — All automated checks pass but items flagged for human verification. Score:verified_truths / total_truths
9. Structure Gap Output (If Gaps Found)
Structure gaps in YAML frontmatter for/gsd:plan-phase --gaps:
What It Produces
VERIFICATION.md
Stub Detection Patterns
React Component Stubs
API Route Stubs
Wiring Red Flags
Re-Verification Mode
If previous VERIFICATION.md exists withgaps: section:
- Parse previous VERIFICATION.md frontmatter
- Extract
must_havesandgaps - Set
is_re_verification = true - Optimization:
- Failed items: Full 3-level verification
- Passed items: Quick regression check (existence + basic sanity only)
- Include re-verification metadata in output
Philosophy
Don't Trust SUMMARY Claims
Verify the component actually renders messages, not a placeholder.
Don't Assume Existence = Implementation
Need level 2 (substantive) and level 3 (wired).
Don't Skip Key Link Verification
80% of stubs hide here — pieces exist but aren’t connected.
Structure Gaps in YAML
For
/gsd:plan-phase --gaps to consume.Flag for Human When Uncertain
Visual, real-time, external service integration.
Keep Verification Fast
Use grep/file checks, not running the app.
Related Agents
Executor
Implements the plans that verifier checks
Planner
Creates must-haves that verifier uses
Debugger
Investigates gaps found by verifier