Cc verify between waves

From markus41/claude · View interactive version

Cc verify between waves is an AI agent skill from the GitHub repository markus41/claude. Checkpoint-between-waves cadence for multi-file refactors. After each logical batch (wave) of edits, run typecheck + tests; commit only on green; roll back the wave (not the whole branch) on red. Use for any refactor touching more than three files or three distinct concerns.

How to use this skill

Skill file

Verify Between Waves

A named cadence for multi-file refactors. This codifies what happens in practice on successful

large refactors — and what's missing on the ones that go sideways.

Why this exists

Refactors fail when edits compound before any get verified. Classic failure mode: wave 1 edits

look fine; wave 2 breaks something subtle in wave 1; by wave 4 the tsc errors are so tangled the

repro takes longer than redoing the work.

Session evidence

Applied to the scrapin-aint-easy Tier-A refactor pass (one real session, n=1):

When to use this

Any edit set that:

Skip for single-file fixes, one-line edits, and documentation-only commits.

The cadence

Wave = a logically coherent group of edits that can be reasoned about as one change.

Per wave:
  1. Read the target files (batched, parallel Reads).
  2. Make the edits (batched, parallel Edits). Keep edits narrow and related.
  3. Gate: run typecheck (`tsc --noEmit`) and tests (`pnpm test` or equivalent).
  4. If RED:
     a. Do NOT add more edits.
     b. Fix the regression inside the current wave.
     c. Re-run the gate until GREEN.
     d. If the fix grows the wave beyond "one coherent change", split into two waves
        with a commit boundary between them.
  5. If GREEN:
     a. Commit with a scoped message naming the wave.
     b. Move to the next wave.

After N waves: push.

Wave-sizing heuristics

| Signal | Wave size |

|---|---|

| Mechanical replace_all (e.g., errMsg helper replacing 11 ternaries) | One wave by itself |

| Related fixes in one file | One wave |

| Same pattern applied across 2-3 files | One wave |

| Cross-cutting change (interface extraction, rename of a widely-used symbol) | One wave, then verify, then cleanup wave |

| New feature + tests | One wave for feature, one for tests |

Anti-pattern: stuffing "security fixes + cleanup + new tests + doc update" into one wave.

The gate: what counts as "green"

Minimum:

Better (if available):

Example: commit messages

wave 1 — security hardening
wave 2 — tools.ts cleanup + schema visibility
wave 3 — pino redact + telemetry race + HNSW init
wave 4 — Puppeteer page pool
wave 5 — safePaginate helper, vector dirty flag

Each message states the wave's coherent theme; body documents what changed and what was left out.

Interaction with other patterns

role formalized as a repeating cadence instead of a single final step.

periodically; verify-between-waves saves code state (commits) periodically. Complementary.

boundaries — after each green commit, the surrounding context is a good candidate to summarize.

Rollback recipe (if a wave went bad)

git reset --mixed HEAD~1      # undo the wave commit but keep files
git checkout -- <files>       # drop the bad edits
# or: git stash                # keep them for inspection

Then either redo the wave in smaller steps, or abandon that particular change and move on.

Red flags that you're NOT running this cadence

Any of these → stop editing, run the gate, commit what's green, re-plan the rest as new waves.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.