Catalogue / verify-code-changes
verify-code-changes
Older skill: source not recordedSignedRuns the full quality gate sequence after code edits, covering formatting, linting, static type checking, and the test suite, in a fixed order, stopping at the first failure and restarting the whole sequence after each fix. Use when changes touch source files, tests, or build and test configuration,…--- name: verify-code-changes description: > Runs the full quality gate sequence after code edits, covering formatting, linting, static type checking, and the test suite, in a fixed order, stopping at the first failure and restarting the whole sequence after each fix. Use when changes touch source files, tests, or build and test configuration, or before reporting any coding task as finished. Not for documentation-only edits, comment tweaks, or repository metadata, unless the user explicitly asks for the full check sequence. ---
Verify Code Changes
When to apply this routine
Run this routine whenever your edits could change program behavior: source files, test files, or any configuration that shapes how code is built, linted, type checked, or tested (dependency manifests, linter configs, CI definitions, Makefiles, package scripts). Skip it for prose-only changes unless the user asks for the full run.
The reasoning behind the routine: a green test suite alone can hide formatting drift, lint debt, or type regressions. Each gate catches a different class of defect, so no single gate substitutes for another, and a task is only done when all of them pass together.
Step 1: Discover the project's own gate commands
Before executing anything, read how this project defines each gate. Check, in this order of authority: the Makefile, package.json scripts, pyproject.toml tool sections, tox/nox configuration, pre-commit configuration, and CI workflow files. Map what you find to the four stages:
| Stage | Typical Makefile target | Typical package.json script | Typical direct tool | |---|---|---|---| | Format | make fmt / make format | npm run format | ruff format, gofmt, prettier | | Lint | make lint | npm run lint | ruff check, eslint, golangci-lint | | Type check | make type / make typecheck | npm run typecheck | mypy, tsc with no-emit | | Tests | make test | npm test | pytest, go test, vitest |
Rules for this step:
- If the project offers one command that runs everything (an all-in-one check target or a pre-commit hook set), prefer it, since it encodes the maintainers' intended order.
- If a stage is configured nowhere, record it as "not configured" and continue with the remaining gates.
- If you cannot find any gate at all, stop and ask the user rather than guessing at commands. Never install a new tool on the user's machine to fill a gap without asking first.
Step 2: Refresh the environment once, if needed
If you changed a dependency file during your work, or a gate fails to launch because a tool or module is missing, run the project's own install or sync step (for example a sync target driven by the lockfile). Do this once, then move on. A stale environment produces confusing failures that look like code bugs but are not.
Step 3: Run the four gates in order, from the repository root
Execute one gate at a time, in this order, and understand why:
- Format, in write mode. Apply mechanical layout fixes first so the substantive diffs you review afterwards are not buried in reformatting noise. Because this pass rewrites files, confirm the working tree is committed or otherwise recoverable before running it; if it is not, run the formatter in check-only mode, list the files it would change, and let the user decide.
- Lint. Usually the fastest gate; it surfaces unused imports, dead code, and style issues a reviewer would reject. If the lint target has a fix flag, you may use it after reading what it changes.
- Type check. Slower, and it catches interface mismatches that the test suite may never exercise.
- Tests. The strongest signal, run last so its results reflect real regressions rather than environment or setup problems.
The moment any gate exits with a failure, stop. Do not start the next gate. Read the entire failing output, fix the underlying cause (not the symptom), and then restart the sequence from gate 1. A complete restart matters because a fix in one file can break formatting or types in another; only one uninterrupted green pass through all four gates proves the tree is clean.
While fixing, do not manufacture a green run: never silence a rule, loosen a threshold in the config, mark a test as expected to fail, skip a failing test, or delete a failing assertion. If a reported issue is genuinely pre-existing and unrelated to your change, leave the code and config untouched and say so in your final report with the evidence.
Step 4: Report results honestly
Declare the task complete only when all configured gates passed in a single consecutive pass. Summarize per gate: the exact command you ran, its outcome, and for the test stage the counts and duration (for example, 217 passed, 0 failed, 5 skipped, 41.2s). Mention any stage you skipped because the project does not configure it. Never claim success from a partial run or from memory of an earlier pass.
Worked example
Fictional Python service "ledger-api" with a Makefile exposing fmt, lint, type, test. You edited payment.py and added test_payment.py:
make fmtrewrites 3 files, exits 0.make lintexits 1 withpayment.py:57:12: F841 local variable 'raw_total' is assigned but never used. You remove the dead variable and restart atmake fmt.- Second pass: fmt clean, lint clean, but
make typefails withpayment.py:88: error: Incompatible types in assignment (expression has type "str", variable has type "Decimal"). You wrap the value in a Decimal conversion and restart atmake fmt. - Third pass: all four gates green;
make testreports 217 passed, 0 failed, 5 skipped. Only now do you report the task as done, listing each gate and its result.
For a package.json project the same pattern maps to npm run format, npm run lint, npm run typecheck, npm test, with the same stop-and-restart discipline.
Hard rules
- Do not skip, reorder, or run the gates in parallel.
- Do not proceed past a failure or declare success from a partial sequence.
- Do not disable checks or remove tests to force a green result.
- Do not run a formatter in write mode on anything outside the repository.
Scope
This skill does not ship the wrapper runners or repository-specific Make targets the original workflow depended on; you execute the equivalent command sequence yourself as described above. It also does not cover building a toolchain from scratch or repairing CI pipelines — if gates are unconfigured or the environment is broken, report that and ask the user how to proceed.
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 6.5 kB | b7a0e1181520 |
| examples.json | 1.9 kB | 9613f116a384 |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 1.0.0 Current | Not recorded | 6 Oct 2026 |
Locking a skill to one version needs Pro.