AI Blocks › Build and ship software
Careful rewrite guard
Name a file too rotten to patch. Get a justified delete and rebuild that keeps the behaviour that worked.
Careful rewrite guard is a free AI skill for the job "Build and ship software". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · CC BY 4.0 licence · Made by sickn33 · Level: advanced · Thinking: high
Made by sickn33. See the original on GitHub; we copied it as it is, with its licence.
What it does
When a file is too broken to patch, you get a deletion that is justified and a rebuild that keeps every behaviour that worked. Name the file, and the AI must make its case before it removes a single line. The process has phases. First it must prove a rewrite is needed, giving specific structural problems and showing why targeted edits would make things worse. Next it lists everything the old code does that must survive, so nothing disappears quietly. Then it rebuilds, and finally it checks each item on the list against the new version. It is for whole files or modules, not small refactors or one-function fixes.
You give it
- The file or module to rewrite
- What it should do
- Existing tests (optional)
- Known bugs and pain points (optional)
You get
- A written case for or against the rewrite
- A list of behaviours that must survive
- The rebuilt code
- A check that each behaviour still works
Use it when
- A module has been patched so many times that every fix breaks something else.
- You want to rewrite a file but fear losing behaviour nobody wrote down.
- A reviewer asks you to justify a full rewrite.
- An AI assistant suggests deleting a file and you want proof first.
How to use it
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.
- It works best when your AI can read and write your project files.