Gemini Verification Loop Skill
This skill provides a structured verification loop to ensure that all code modifications are robust, high-quality, and regression-free before a task is considered complete.
When to Use
- After completing a feature or bug fix.
- Before considering a task "done".
- After a refactoring session.
Verification Phases
Execute these phases sequentially using the run_shell_command tool. If any phase fails, STOP, fix the underlying issue, and restart the verification loop from Phase 1.
Phase 1: Build & Type Check
Run the project's build and type-checking commands.
- TypeScript/JavaScript:
npm run buildornpx tsc --noEmit - Python:
pyright .ormypy . - Go:
go build ./... - Rust:
cargo check
Action: Fix all critical build and type errors before proceeding.
Phase 2: Lint & Format Check
Run the project's linter to ensure code style consistency.
- TypeScript/JavaScript:
npm run lintornpx eslint . - Python:
ruff check .orflake8 . - Go:
go vet ./... - Rust:
cargo clippy
Action: Address all linting errors. Do not bypass or disable lint rules unless explicitly requested by the user.
Phase 3: Test Suite Verification
Run the automated test suite.
- Node.js:
npm testornpx jest - Python:
pytest - Go:
go test ./... - Rust:
cargo test
Action: Ensure all tests pass. If tests fail due to the recent changes, update the code or the tests as appropriate.
Phase 4: Diff Review
Review the changes to ensure no unintended modifications were made.
- Run
git diff HEADto review the exact changes.
Action: Look for leftover debugging code (e.g., console.log, print()), missing error handling, or unintended file modifications.
Output Format
After successfully completing all phases, provide a concise verification summary to the user:
VERIFICATION REPORT
==================
Build/Types: [PASS]
Lint: [PASS]
Tests: [PASS]
Diff Review: [PASS]
Task is complete and verified.