Dynamic Context
Current working state:
!git status --short 2>/dev/null
Recent changes:
!git diff --stat 2>/dev/null | tail -5
Verification Loop Skill
Purpose
Ensure quality through systematic 6-phase verification after code changes and confirm PR-ready state.
Core Principle: Build failure β Immediate stop β Fix issue β Re-verify
Activation Triggers
- After feature implementation completion
- Before PR creation (
--pre-pr) - After refactoring work
- Periodic quality checks (15-min intervals or major component completion)
- User explicit request:
/verify,verify,check
6-Phase Verification Pipeline
Phase 1: Build Verification π¨
Purpose: Confirm project compilation/build success
# JavaScript/TypeScript
npm run build || pnpm build || yarn build
# Python
python -m py_compile src/**/*.py
# Go
go build ./...
# Rust
cargo build
On Failure: π¨ Immediate stop - Build error resolution is top priority
Phase 2: Type Checking π
Purpose: Verify type safety
# TypeScript
npx tsc --noEmit
# Python (with type hints)
pyright src/ || mypy src/
# Flow
npx flow check
Output: Type error count and locations
Phase 3: Linting π
Purpose: Detect code style and potential issues
# JavaScript/TypeScript
npm run lint || npx eslint src/
# Python
ruff check src/ || flake8 src/
# Go
golangci-lint run
# Rust
cargo clippy
Output: Lint violation count and severity
Phase 4: Testing π§ͺ
Purpose: Confirm test passing and coverage
# JavaScript/TypeScript
npm test -- --coverage
# Python
pytest --cov=src --cov-report=term-missing
# Go
go test -cover ./...
# Rust
cargo test
Criteria:
- β All tests pass
- β Coverage β₯ 80% (business logic)
- β οΈ Coverage < 80% β Show warning
Phase 5: Security Scanning π‘οΈ
Purpose: Check security vulnerabilities and sensitive information exposure
5.1 Secrets Detection:
# Check .env, credentials, API keys
grep -r "PRIVATE_KEY\|SECRET\|PASSWORD\|API_KEY" src/ --include="*.ts" --include="*.js" --include="*.py"
5.2 Debug Statement Detection:
# Check console.log, print, debugger
grep -rn "console\.log\|console\.debug\|debugger" src/ --include="*.ts" --include="*.tsx" --include="*.js"
grep -rn "print(" src/ --include="*.py" | grep -v "# noqa"
5.3 Dependency Vulnerabilities (optional):
npm audit --audit-level=high
pip-audit
Output: List of discovered security issues
Phase 6: Diff Review π
Purpose: Final review of changes
git diff --stat
git diff HEAD~1 --name-only
Review Items:
- [ ] No unintended file changes
- [ ] No missing error handling
- [ ] Edge case handling confirmed
- [ ] Unnecessary console.log/print removed
- [ ] No hardcoded values
Verification Modes
Quick Mode (`/verify quick`)
Fast verification - Execute Build + Type Check only
Phase 1: Build β
Phase 2: Types β
β±οΈ Complete: ~30 seconds
Full Mode (`/verify` or `/verify full`)
Complete 6-phase verification
Phase 1: Build β
Phase 2: Types β
Phase 3: Lint β
Phase 4: Tests β
(Coverage: 85%)
Phase 5: Security β
Phase 6: Diff β
β±οΈ Complete: ~2-5 minutes
Pre-PR Mode (`/verify pre-pr`)
Strict verification before PR submission (Enhanced security)
Phase 1-6: Full verification
+ Additional security scan
+ Dependency vulnerability check
+ Commit message review
Pre-Commit Mode (`/verify pre-commit`)
Quick verification before commit
Phase 1: Build β
Phase 2: Types β
Phase 3: Lint β
Phase 5: Security (secrets only) β
Report Format
Success Report
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π― VERIFICATION REPORT β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Phase 1: Build β
OK β
β Phase 2: Type Check β
OK β
β Phase 3: Lint β
OK (0 issues) β
β Phase 4: Tests β
OK (47/47 passed, 85% cov) β
β Phase 5: Security β
OK (0 issues) β
β Phase 6: Diff Review β
OK (3 files changed) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β π Total Issues: 0 β
β π PR Ready: YES β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Failure Report
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π― VERIFICATION REPORT β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Phase 1: Build β
OK β
β Phase 2: Type Check β FAIL (3 errors) β
β β src/api/user.ts:45 - Type 'string' not assignableβ
β β src/utils/format.ts:12 - Missing return type β
β β src/components/Card.tsx:78 - Property missing β
β Phase 3: Lint β οΈ WARN (2 warnings) β
β Phase 4: Tests βΈοΈ SKIPPED (blocked by Phase 2)β
β Phase 5: Security βΈοΈ SKIPPED β
β Phase 6: Diff Review βΈοΈ SKIPPED β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β π Total Issues: 5 β
β π PR Ready: NO β
β β
β π§ Suggested Fixes: β
β 1. Fix type errors in src/api/user.ts:45 β
β 2. Add return type to formatDate function β
β 3. Add missing 'onClick' prop to Card component β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Periodic Verification Strategy
Mental Checkpoints
- After function/component completion β
/verify quick - After 15 minutes elapsed β
/verify - Major milestone completed β
/verify full
Session Integration
Start work
β
βββ Feature implementation
β β
β βββ [15min elapsed] β /verify quick
β
βββ Component completion
β β
β βββ /verify
β
βββ Feature completion
β β
β βββ /verify full
β
βββ PR preparation
β
βββ /verify pre-pr
Integration with Other Skills
With `/checkpoint`
/checkpoint create "before-refactor"
... refactoring work ...
/verify full
/checkpoint verify "before-refactor" # Compare changes
With `/feature-planner`
Auto-execute /verify at each Phase Quality Gate
Auto-Fix Suggestions
Suggest automatic fixes on verification failure:
| Issue Type | Suggested Fix |
|------------|---------------|
| Type Error | Add/modify type annotation |
| Lint Error | npm run lint -- --fix or ruff --fix |
| Missing Test | Suggest test case creation |
| console.log | Remove line or replace with logger |
| Security Issue | Suggest moving to environment variables |
Configuration
Project-specific configuration (.claude/verify.config.json):
{
"coverageThreshold": 80,
"skipPhases": [],
"customCommands": {
"build": "pnpm build",
"test": "pnpm test:ci",
"lint": "pnpm lint"
},
"securityPatterns": [
"API_KEY",
"SECRET",
"PASSWORD",
"PRIVATE_KEY"
],
"ignoreFiles": [
"**/*.test.ts",
"**/*.spec.ts",
"**/fixtures/**"
]
}
Quick Reference
| Command | Description |
|---------|-------------|
| /verify | Full 6-phase verification |
| /verify quick | Verify Build + Type only |
| /verify pre-pr | Strict verification before PR |
| /verify pre-commit | Quick verification before commit |
| /verify --fix | Fix auto-fixable issues |