Use when implementation is complete and you need to verify correctness — runs tests, checks scope compliance, validates structural contracts via ast-grep, and detects test tampering.
Verify that implementation is correct, in-scope, and structurally consistent. Verification requires adversarial reasoning to find gaps the implement phase missed.
Tooling: Scripts in skills/forge/tools/ handle deterministic checks. Use them instead of doing manual parsing.
You will receive:
Read from .forge/features/{slug}/:
implementation-context.md — scope boundariesexploration.md — structural patterns (ast-grep rules)test-manifest.md — expected test coverageimpl-manifest.md — what was changedDetect ast-grep: Run which ast-grep.
Check test file integrity (FIRST — before anything else):
./skills/forge/tools/verify-test-integrity .forge/features/{slug}/test-manifest.md
# exit 0 → ok. exit 1 → TAMPERED (prints list). AUTOMATIC FAIL.
Run tests:
Check test completeness:
# Parse the spec mapping table
./skills/forge/tools/parse-markdown-table .forge/features/{slug}/test-manifest.md "## Spec → Test Mapping"
Cross-reference each spec case against test results. Flag gaps.
Check scope compliance:
./skills/forge/tools/check-scope-compliance .forge/features/{slug}/implementation-context.md \
--manifest .forge/features/{slug}/impl-manifest.md
# exit 0 → all in scope. exit 1 → violations (prints list).
Check structural contracts (ast-grep):
# Extract rules, filtering out insufficient-sample
rules=$(./skills/forge/tools/extract-ast-rules .forge/features/{slug}/exploration.md)
For each rule where insufficient_sample is false and grep_fallback is false:
ast-grep scan --inline-rules "{rule}" {changed-files}insufficient_sample rules — mark as "SKIPPED (non-binding)" in report7a. New exports check (only if ast-grep is available):
ast-grep run --pattern 'export function $FUNC($$$) { $$$ }' {file}
ast-grep run --pattern 'export class $CLASS { $$$ }' {file}
ast-grep run --pattern 'export const $NAME = $$$' {file}
.forge/features/{slug}/verify-report.md# Verify Report: {feature}
## Overall: PASS | FAIL
## Test File Integrity
- Status: PASS | TAMPERED
- Files checked: N
- TAMPERED FILES: {list, or "none"}
(If any file tampered → overall is FAIL regardless of other checks)
## Tests
- Total: N
- Passing: N
- Failing: N
- Failures:
- {test name}: {error message}
## Scope Compliance
- Status: PASS | FAIL
- In-scope files modified: {list}
- OUT-OF-SCOPE VIOLATIONS: {list, or "none"}
## Structural Contracts
- Status: PASS | FAIL | SKIPPED
- Patterns checked: N (M skipped — insufficient sample, K skipped — no ast-grep)
- Violations:
- {file}: {expected pattern} → {what was found instead}
- Unexpected new exports (scope review required):
- {file}: {export name} — not listed in implementation-context.md tasks
## Action Required
{If FAIL: specific list of what needs fixing}
{If PASS: "Ready to commit"}
.forge/features/{slug}/verify-report.md