Comprehensive pre-commit verification for security, best practices, code standards, and performance. Checks for vulnerabilities, efficiency issues, N+1 queries, and convention adherence.
Comprehensive pre-commit verification for security, best practices, code standards, and performance. Checks for vulnerabilities, efficiency issues, N+1 queries, and convention adherence.
Verify Work Skill
Comprehensive pre-commit verification of code changes for security vulnerabilities, best practices violations, efficiency issues, and code standards adherence. Works with any project.
When to Use
Invoked automatically as Phase 0 of /ship (mandatory)
Can also be invoked manually with /verify-work to check changes before committing
Behavior
Non-interactive: Runs all checks, auto-fixes what it can, and reports remaining issues
No prompts: Does not ask for input — just fixes and reports
Universal: Works with any TypeScript/JavaScript project
Instructions
CRITICAL — NON-INTERACTIVE: Run every phase to completion without pausing. Never ask questions, request confirmation, offer choices, or wait for input at any point. Auto-fix what you can silently. Report everything at the end. Do not stop early even if blocking issues are found.
Phase 1: Analyze Changed Files
Goal: Get comprehensive view of all changes
# Get changed file list
git status --short
# Get diff statistics
git diff --stat HEAD
# Get detailed diff
git diff HEAD
# Get file paths only
git diff --name-only HEAD
Phase 2: Security Checks [BLOCKING]
2.1 Hardcoded Secrets Detection
git diff HEAD | grep -iE | grep -v
git diff HEAD | grep -E
git diff --name-only HEAD | grep -E
# SELECT without LIMIT or ID filter
git diff HEAD -- '**/*.ts' | grep -nE "SELECT.*FROM" | grep -v "LIMIT|WHERE.*id\s*=|RETURNING|COUNT\(|EXISTS\(|MAX\(|MIN\("
Flag if found:
BLOCKING: Unbounded queries without LIMIT (add pagination or ID filter)
4.5.3 Missing Index Patterns [WARNING]
# Leading wildcard LIKE (full table scan)
git diff HEAD -- '*.ts''*.tsx' | grep -nE "LIKE\s*['\"]%|LIKE\s*\\\$"# Functions on indexed columns (prevents index use)
git diff HEAD -- '*.ts''*.tsx' | grep -nE "WHERE\s*(LOWER|UPPER|TRIM|DATE)\("
Flag if found:
WARNING: LIKE '%term%' — cannot use B-tree index
WARNING: Functions on columns in WHERE clause
4.5.4 Missing Transaction Boundaries [WARNING]
# Multiple writes without transaction
git diff HEAD -- '*.ts''*.tsx' | grep -E "INSERT|UPDATE|DELETE" | grep -v "BEGIN|COMMIT|ROLLBACK|transaction|\$transaction"
Flag if found:
WARNING: Multiple INSERT/UPDATE/DELETE in the same function without a transaction
4.5.5 Data Fetching Issues [BLOCKING]
# Data fetching hooks inside loops (client-side N+1)
git diff HEAD -- '*.tsx' | grep -nE "\.map\(.*useSWR|\.map\(.*useQuery|\.map\(.*fetch"
Flag if found:
BLOCKING: Data fetching hooks (useSWR, useQuery) inside .map() or loops
4.5.6 Sequential Awaits [OPTIMIZATION]
# Back-to-back independent awaits
git diff HEAD -- '*.ts''*.tsx' | grep -nE "const.*=\s*await" -A 1 | grep -E "const.*=\s*await"
Flag if found:
OPTIMIZATION: Sequential awaits on independent queries — consider Promise.all([])
Check that the project's styling approach is followed consistently. If the project uses CSS Modules, check for inline styles. If it uses a utility framework, check for raw CSS where utilities should be used.
# Check for inline styles when CSS Modules are used
git diff HEAD -- '**/*.tsx' | grep -E "style=\{\{"
Flag if found:
WARNING: Inline styles when the project uses CSS Modules or another styling system