skills/process/verification-before-completion/SKILL.md
Defense-in-depth verification before declaring any task complete.
npx skillsauth add notque/claude-code-toolkit verification-before-completionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Enforce rigorous, adversarial verification before declaring any task complete. Implements defense-in-depth validation with multiple independent checks to catch errors before they reach users. The core principle: verify independently rather than trusting executor claims — verify what ACTUALLY exists in the codebase through testing, inspection, and data-flow tracing.
This skill prevents the most common form of premature completion: claiming success without running tests, summarizing results instead of showing evidence, or trusting code that "looks right" without verification.
| Signal | Load These Files | Why |
|---|---|---|
| tasks related to this reference | adversarial-methodology.md | Loads detailed guidance from adversarial-methodology.md. |
| checklist-driven work | checklist.md | Loads detailed guidance from checklist.md. |
| example-driven tasks | verification-examples.md | Loads detailed guidance from verification-examples.md. |
Verification means execution, not reasoning. Run the command. Do not reason about whether the command would pass. Do not summarize the expected output. Execute the check, paste the exit code, paste the relevant output. A verification phase that produces a verdict without an observed tool result is not a verification — it is a guess with a rigor aesthetic.
Before verification, understand the scope of changes:
# For git repositories
git diff --name-only
Why: Use git status --short (not just git diff) to capture both modified AND untracked (new) files. New files created during the session are easy to miss in status summaries. Over-engineering prevention requires limiting scope to what was actually changed — limit verification to what was actually changed. Focus only on the specific changes made.
For each changed file:
Report separately:
?? or A status in git]M status]Run the appropriate test suite and show complete output (not summaries):
| Language | Test Command | Build Command | Lint Command |
|----------|-------------|---------------|-------------|
| Python | pytest -v | python -m py_compile {files} | ruff check {files} |
| Go | go test ./... -v -race | go build ./... | golangci-lint run ./... |
| JavaScript | npm test | npm run build | npm run lint |
| TypeScript | npm test | npx tsc --noEmit | npm run lint |
| Rust | cargo test | cargo build | cargo clippy |
Why full test suite, not just changed files: ALWAYS run relevant tests before saying "done". The same agent that writes code has inherent bias toward believing its own output is correct. Running the full suite catches regressions and unintended side effects that focused testing misses.
Output Requirements:
Critical constraint: Show test output when reporting test results. Summary claims document what was SAID, not what IS. Evidence-based reporting is required.
Run the build command from the table above and show the full output. Confirm:
# Example: Go project
go build ./...
# Example: Python - check syntax of changed files
python -m py_compile path/to/changed_file.py
# Example: JavaScript/TypeScript
npm run build
Critical gate: If the build fails, stop immediately. Fix build issues before proceeding to any other verification step. A failed build is a blocker that supersedes all other checks. Re-run from Step 1 after fixing. This prevents declaring "done" when the code doesn't compile.
For each changed file, use the Read tool to inspect the actual file contents. Validate assumptions: Re-read the file to confirm the actual contents — re-read the file to confirm. Verify that what you think happened actually happened.
For each file verify:
This step counteracts confirmation bias where executors believe their own edits are correct without evidence.
# Check git diff for unexpected changes
git diff
# Look for debug code that should be removed
grep -r "console.log\|print(\|fmt.Println\|debugger\|pdb.set_trace" {changed_files}
# Check for TODO/FIXME comments that should be resolved
grep -r "TODO\|FIXME\|HACK\|XXX" {changed_files}
# Verify no sensitive data
grep -r "password\|secret\|api_key\|token" {changed_files}
Why this matters: If git diff shows changes to files you didn't intend to modify, investigate before proceeding. Unintended changes are a red flag for accidental side effects. Detecting this early prevents silent regressions that reach users.
Constraint: No stub patterns (TODO, FIXME, pass, not implemented) should remain in new code created by the task.
Core Verification (Required):
Extended Verification (Recommended):
See
references/checklist.mdfor domain-specific checklists (Python, Go, JavaScript, Database, Infrastructure).
ONLY AFTER all checks pass, provide verification statement:
Verification Complete
**Tests Run:**
{paste actual test output}
**Build Status:**
{paste actual build output}
**Files Verified:**
- {file1}: Reviewed, syntax valid, logic correct
- {file2}: Reviewed, syntax valid, logic correct
**Checklist Status:** X/X core checks passed
Test if this addresses the issue.
Critical constraints on communication:
Replace with:
ALWAYS say:
See
references/adversarial-methodology.mdfor the complete methodology: goal-backward framing, all four verification levels (EXISTS, SUBSTANTIVE, WIRED, DATA FLOWS), stub detection patterns with automated scan command, completion shortcut scan, verification report format, and the "when to apply each level" table.
Steps 1-7 above verify that tests pass, builds succeed, and files contain what you expect. The adversarial methodology goes deeper: it verifies that artifacts are real implementations (not stubs), actually integrated (not orphaned), and processing real data (not hardcoded empties). Apply this methodology after Steps 1-7 pass, focusing on artifacts that are part of the stated goal.
Summary of levels:
Error: "Tests failed after changes"
Error: "Build failed"
Error: "No tests exist for changed code"
Error: "Cannot run tests (missing dependencies)"
Error: "Stub patterns detected in changed files"
return [] when empty list is the correct result)Error: "Artifact exists but is not wired (Level 3 failure)"
Error: "Data flow gap detected (Level 4 failure)"
[] or {} instead of computed valuesCore Principles
Key Constraints (Integrated Above)
Reference Files
references/adversarial-methodology.md — 4-level verification system, stub detection, goal-backward framingreferences/checklist.md — Domain-specific checklists (Python, Go, JS, Database, Infrastructure)references/verification-examples.md — Good vs bad verification examples per languageSchema gate for review artifacts
When the artifact being verified is a code-review output, prefer a deterministic schema check over reading the prose for completeness: python3 scripts/validate-review-output.py --type {systematic|parallel|sapcc-review|sapcc-audit} <file.md> (exit 0 = valid, 1 = schema errors, 2 = unparseable, 3 = jsonschema not installed — pip install jsonschema). The parallel and systematic review skills wire this as a validate-on-return + retry-once-then-stop gate. This is the L1/L2 EXISTS/SUBSTANTIVE check for review documents: it confirms a verdict, severity buckets, and file:line locations are actually present, not just that a file was written.
documentation
Document translation: quick/normal/refined modes with chunked parallel subagents and glossary support.
development
AI image generation: Gemini and Nano Banana backends; single/series/batch workflows with prompt-to-disk.
testing
Unified voice content generation pipeline with mandatory validation and joy-check. 13-phase pipeline: LOAD, GROUND, STATS-CHECKPOINT, GENERATE, HOOK-GATE, VALIDATE, REFINE, VARIETY-GATE, JOY-CHECK, ANTI-AI, CLOSE-GATE, OUTPUT, CLEANUP. Use when writing articles, blog posts, or any content that uses a voice profile. Use for "write article", "blog post", "write in voice", "generate content", "draft article", "write about".
documentation
Critique-and-rewrite loop for voice fidelity validation.