About redoing-implementations
A coding-agent skill for replacing an implementation from scratch after understanding its constraints and edge cases. It emphasizes getting approval, preserving the baseline, and limiting resets to files touched by the attempt.
Key features
- 01Separate essential from accidental complexity
- 02Propose a design and wait for approval
- 03Record checks before changes
- 04Save and reset only touched files
- 05Reimplement and rerun baseline checks
Use cases
- 01Simplify an implementation after exploring edge cases
- 02Replace unnecessary abstractions with a smaller design
- 03Safely retry work while preserving other changes
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ bostonaholic/ skills --skill redoing-implementationsAfter installing, type/redoing-implementationsin Claude Code to confirm it loaded.
Bundled filesagents/openai.yamlscripts/save-and-reset-attempt.sh
Details
From the project READMEElegant Redo
After working through a problem and learning its constraints and edge cases, reimplement it from scratch with the simplest design that meets them.
-
Design, or stop. From the conversation, separate the essential complexity (the constraints and edge cases discovered) from the accidental. If the current implementation is already the minimum design a senior engineer with full context would accept, say so and stop; never rewrite for its own sake. Otherwise describe the new approach in 3 to 5 sentences: fewer moving parts, less indirection.
-
Get approval. Open the reply with the step 1 design as one paragraph of 3 to 5 sentences that holds only the design; count them before replying. After the paragraph, a list or code sketch gives what changes, why it is better, and every further detail (edge cases, line numbers, ordering). List the files the attempt touched in two groups: tracked files it changed or committed, and untracked files it created. Step 4 resets or deletes exactly these. Keep every touched file in one of the two groups; to propose keeping one out of the save and reset, ask after the lists. Wait for approval.
-
Record the baseline. Run every check the current implementation passes (tests, linters, type checks, manual checks from the conversation) and note each result.
-
Save, then reset only the attempt's files. From the repository root, run
scripts/save-and-reset-attempt.sh <base> <topic> <out> -- <files>, with<base>the commit the attempt started from (HEADwhen it committed nothing, otherwise the parent of its first commit),<topic>a short branch-name word for the work,<out>a new directory outside the working tree (mktemp -d), and<files>every file in the step 2 list. Never reset or clean the whole working tree; other work stays as it is.- Exit 0: tell the user the
branch=,patch=, andtar=saves that are notnone, and give therestore=commands, in order, as the way to bring the attempt back. - Exit 1: a save failed its check and nothing was reset. Stop and report the stderr.
- Exit 2 or 3: fix the named argument or install the named tool, then
rerun with a new
<out>. - Exit 4: the saves are intact but the reset failed. Stop and report the
stderr and
<out>.
- Exit 0: tell the user the
-
Implement cleanly. Write the new design from scratch rather than patching, carrying forward no abstraction, workaround, or dead code from the previous attempt.
-
Re-pass the baseline. Run the step 3 checks. Fix and re-run until every check the previous attempt passed passes again, and report each result that changed.