Skill
Legacy refactor chunk checkpoint
Safe AI-assisted refactor protocol: map file into chunks, get plan approval per chunk, commit+test after each chunk, rollback to last green checkpoint on failure
Primitives inside (7)
approved-map-before-any-editdisciplineBefore an agent edits a large file, require a no-edit MAP of its logical sections (name, approximate line range, one-sentence purpose, coupling risks) and a human approval of that map — the one cheap moment to re-scope.
When: An agent is about to modify a large, multi-concern file where an unscoped pass would be hard to review or debug.
chunk-refactor-trigger-thresholdscalibrationSwitch from single-pass to chunk-and-checkpoint refactoring when the file exceeds ~200 lines, mixes multiple concerns, cannot be fully tested in under ~30 seconds, or a previous large agent change proved hard to debug.
When: Deciding how to structure an upcoming agent-driven refactor of an existing file.
commit-plus-test-checkpoint-per-chunktool-sequenceAfter each chunk of a risky change: git add -A, commit with a chunk-named message, run the test suite; green means proceed to the next chunk, red means roll back — yielding a bisectable history that is green at every commit.
When: A multi-chunk change is in progress and one chunk's edits have just been completed.
dedicated-branch-before-checkpoint-loopdisciplineBefore starting a multi-checkpoint change loop, create (or switch to) a dedicated, dated branch named for the work, so the whole commit sequence is isolated from the main line and disposable or mergeable as a unit.
When: A change protocol is about to produce a series of intermediate commits (checkpoints) that should not land directly on the main branch.
no-test-runner-manual-gatefailsafeIf a checkpoint script detects no test runner, it must not silently pass: emit a warning and block on explicit human confirmation of manual verification before the loop continues.
When: An automated checkpoint step tries to run tests but finds no recognizable test configuration in the repo.
plan-per-section-no-editsdisciplineFor each approved section, have the agent write a section-scoped plan — what changes, which other sections/files might be affected, and the smallest change that achieves the goal — returned with zero edits, and execute only after that plan is approved.
When: A mapped-and-approved section is next in line for modification.
rollback-to-last-green-checkpointfailsafeWhen tests go red after a checkpoint commit, restore safety immediately with git reset --hard HEAD~1 (or to the last known-green hash) instead of debugging forward on top of a broken state; then fix the chunk's plan before retrying.
When: The test run following a checkpoint commit has failed in a chunk-and-checkpoint workflow.
Get the whole skill
All 7 primitives of this skill as one package, with the order to apply them.
Buy only the primitives you need
Each primitive is 1 credit (≈ €0.10). Pick them from the list above — the button is next to each one.
Upgrade your own skill
Paste your skill; we pick the 5 primitives from the shelf that fit it best, as one bundle for 5 credits (≈ €0.50).
Upgrade my skillNeighbour skills
Skills whose primitives are closest to this one (bge-m3 similarity):