From 326b65f507dd1dd51c048983d06a4856be8f6c42 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Mon, 20 Apr 2026 00:05:28 +0300 Subject: [PATCH] Elaborate on the iterative process for refactor scripts --- .claude/CLAUDE.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 14f10e2..fa6545c 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -23,6 +23,11 @@ The preferred workflow: If inspecting the results reveals missed cases or inappropriate changes, use git to clean up (`git restore`, `git reset --hard` against the pre-script commit), then improve the script. Commit improvements as follow-ups, or amend the script's commit for trivial bug fixes, and re-run. +Continue iterating until: + +- **(a) No incorrect changes are included in the diff.** This is a hard requirement — a script that produces even one wrong edit is not done. +- **(b) Either no missing cases remain, or the remaining cases are few and share too little in common for their inclusion in the script to be easier to validate than just editing them by hand.** When a handful of outlier cases survive the automated pass, handle them in a dedicated commit, separate from both the script-creation commit and the script-execution commit. + ### Why This Matters for Review A refactor script plus a spot-check of its output is far easier to review than a diff of 50 manual edits. The reviewer can be convinced of the logical correctness of the script and sample its results, rather than verifying every edit individually and separately confirming that no instances were accidentally skipped.