--- name: verification-loop description: Systematic verification before claiming completion — run tests, check coverage, verify edge cases, inspect CI. Use when about to mark a task done, before merge, or when user asks "is it ready?" --- # Verification Loop Skill Based on ECC verification-loop + verification-before-completion patterns. ## When to Use - Before claiming any task is complete - Before merge or PR - User asks "is it ready?" or "có ổn chưa?" - After fixing a bug ## Loop Steps ### 1. Run Tests ```bash npm test # or your test command pytest tests/ # Python go test ./... # Go ``` If ANY test fails — FIX first, do NOT claim done. ### 2. Check Coverage ```bash npm run coverage # or equivalent ``` Thresholds: - Line coverage: > 80% - Branch coverage: > 70% - Critical paths: 100% (auth, payments, data mutations) ### 3. Verify Edge Cases For each input or parameter: - null / None / undefined - Empty string, empty array, empty object - Maximum allowed length/value - Minimum allowed length/value - Special characters - Boundary values (just above, just below limit) ### 4. Check for Regressions ```bash git diff --name-only HEAD~1 # or relevant range ``` Verify changes don't break existing functionality. Run full test suite. ### 5. Lint and Type Check ```bash npm run lint && npm run typecheck # TypeScript ruff check . && mypy . # Python golangci-lint run # Go ``` ### 6. Review the Diff ```bash git diff ``` Read every changed line. Verify: - No accidental deletions - No debug code left (print, console.log, debugger) - No commented-out code - No TODO without ticket reference - Code matches what was asked ### 7. Build Check ```bash npm run build # or equivalent ``` Must succeed with zero errors. ## Decision If ALL steps pass — safe to mark complete. If ANY step fails — list issues, fix, re-run loop. ## Report Template ``` ## Verification: [Task/Feature] Tests: X/X pass (previously Y/Z) Coverage: X% line (threshold: 80%), Y% branch (threshold: 70%) Lint: clean / X warnings / X errors Build: success / failed with [details] Edge cases: all covered / gaps: [list] Regressions: none / [list with test names] Diff review: clean / issues: [list] Status: READY / NOT READY ```