| name | self-verification |
| description | Guides the user through systematic pre-commit quality verification. ALWAYS trigger on "review my code", "check my work", "before commit", "self-review", "quality check", "am I ready to commit", "pre-commit review", "code quality", "verify my changes", "sanity check", "review before merge", "is this ready". Use before any commit, merge, or code review submission. |
Self-Verification
Run scripts/self-review.sh or execute these 6 steps manually before every commit.
1. Review Staged Changes
git diff --staged
2. Completeness Check
3. Quality Check
git diff --cached | grep -E "breakpoint|pdb|console\.log|debugger|TODO|FIXME|HACK"
4. Test Verification
pytest --cov=. --cov-report=term-missing --cov-fail-under=80
npm test -- --coverage --coverageThreshold='{"global":{"lines":80}}'
go test -cover ./...
5. Security Check
git diff --cached | grep -iE "api[_-]?key|password|secret|token"
bandit -r . -q
npm audit
Security questions to answer:
| # | Question |
|---|
| 1 | Who can call this? (Authentication) |
| 2 | Are they allowed to? (Authorization) |
| 3 | What if they send malicious input? (Validation) |
| 4 | What if they send huge input? (Resource limits) |
| 5 | Can they see data they shouldn't? (Data exposure) |
| 6 | Will we know if they try? (Audit logging) |
6. Documentation Check
Fresh Eyes Techniques
Use these to break the "see what you intended" bias:
- Time Gap (10+ min) -- let your brain forget what you meant
- Context Switch -- work on something else, then return
- Read Aloud -- speaking forces slower processing
- Rubber Duck -- explain code to an imaginary colleague
- Reverse Review -- read diff from last line to first
See references/fresh-eyes-techniques.md for detailed guides.
Common Self-Review Failures
| Failure | Symptom | Prevention |
|---|
| "Works on My Machine" | Fails in CI/production | Test in clean environment |
| Missing Edge Cases | Breaks with unexpected input | Test null, empty, negative, huge |
| Unclear Intent | Can't explain without reading | Extract to well-named functions |
| Incomplete Error Handling | Crashes on first error | Identify all failure points |
See references/self-review-failures.md for detailed prevention strategies.
Script
Run the interactive self-review protocol:
skills/self-verification/scripts/self-review.sh
./scripts/self-review.sh && git commit -m "your message"
References
references/fresh-eyes-techniques.md -- detailed technique guides
references/self-review-failures.md -- prevention strategies with examples
scripts/self-review.sh -- interactive self-review script