Skip to content
Skillpedia
General coding48k · #3958

re-create

Has your agent completely rewrite a file or piece of code. It's useful when existing code is too messy to fix.

What it does

This tool completely deletes a file or code section and rewrites it from scratch. It should only be used when the code is too messy to fix piece by piece.

When to use it

  • ✓When the code is too messy and fixing it only makes things worse.
  • ✓When the old code no longer works and needs a complete redo.
  • ✓When maintaining the current code is too costly in time and effort.

Example of what to ask your AI

“Delete and rewrite the file 'calculator.js' because it has severe structural issues and I can no longer fix it.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/re-create/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/re-create/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

First, the AI explains why fixing is no longer an option and lists everything that needs to be preserved. Then, with your permission, it deletes the old code and writes new code, ensuring everything important still works.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill re-create

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/re-create/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

re-create — Controlled Erasure & Rebuild Protocol

Overview

Hollow Purple is Gojo's most destructive technique — blue and red combined into total erasure of the target. But Gojo doesn't use it carelessly. He knows exactly what he's erasing and why. Same here: this skill is the nuclear option, invoked only when patching is the wrong call, executed with full control over what gets erased and what must survive.

Rewrites are dangerous not because rebuilding is hard, but because it is easy to silently erase behavior that was working and expected. This skill enforces a complete inventory of what must survive before a single line is deleted, and a full verification that everything survived after the rebuild.


When to Use This Skill

  • Use when a file, module, or component needs to be completely deleted and rewritten from scratch
  • Use when structural rot is so deep that individual fixes would only make it worse
  • Use when accumulated technical debt makes the code unmaintainable
  • Use when the target is fundamentally broken and beyond saving
  • DO NOT use for partial refactors, single-function fixes, or targeted edits

How It Works

PHASE 1 — Justify the Erasure

The AI must prove that a full rewrite is necessary. It must answer all of the following:

  1. What specifically is broken or unsalvageable?
    • Not "it's messy" — specific structural problems that make targeted fixes impossible or counterproductive
  2. Why would targeted edits make things worse, not better?
    • Patching on top of rot, compounding complexity, architectural mismatch
  3. What is the concrete cost of keeping the current implementation?
    • Maintenance burden, bug surface, performance, developer velocity

If the AI cannot clearly answer all three, it must fall back to targeted edits instead of a rewrite. A rewrite is not a reward for messy code — it is a last resort.

The bar is high. "This code is ugly" does not justify hollow purple. "The architecture assumes X but the system now requires Y and every patch makes the mismatch worse" does.


PHASE 2 — Read the Target Completely

Before proposing deletion, the AI must read the entire target (file, module, or component) in full.

The AI must identify and catalog:

  1. Public interfaces — functions, classes, types, or exports that other parts of the codebase call
  2. Implicit contracts — behaviors that other files depend on even if not formally typed
  3. Working behaviors — things the current implementation does correctly that must continue to work
  4. Non-obvious logic — edge cases, guards, or special handling that looks incidental but is intentional
  5. Blast radius — every file in the codebase that imports from or depends on the target

The AI cannot skip this phase even if it has read the file before. The purpose is not familiarity — it is building the Preservation List.


PHASE 3 — Erasure Declaration (User Must Confirm)

The AI outputs a complete erasure plan and waits for user confirmation before deleting or writing anything.

HOLLOW PURPLE — ERASURE PLAN
─────────────────────────────────────────
TARGET FOR ERASURE:
  [file path or module name]

WHY TARGETED FIXES ARE WRONG:
  [specific justification — architectural rot, fundamental mismatch, etc.]

PRESERVATION LIST (must survive the rewrite):
  - [public interface / export 1] → [what it does, who depends on it]
  - [public interface / export 2] → [what it does, who depends on it]
  - [working behavior 1]          → [what it does, why it must be kept]
  - [non-obvious logic 1]         → [what it guards against]

BLAST RADIUS (files that depend on the target):
  - [file path] → depends on [what specifically]
  - [file path] → depends on [what specifically]

NEW IMPLEMENTATION PLAN:
  [Description of what the rebuild will look like — structure, approach, key decisions]

WHAT WILL NOT BE PRESERVED:
  [Anything intentionally dropped and why — dead code, deprecated behavior, etc.]
─────────────────────────────────────────
Confirm to proceed with erasure and rebuild.

Nothing is deleted until the user explicitly confirms. A reply of "yes", "confirmed", "do it", or equivalent counts. Silence does not.


PHASE 4 — Controlled Erasure

User confirms → the target is deleted. Rules for this phase:

  • Delete cleanly. Not commented out, not renamed to _old, not archived in place — deleted.

…

FAQ

When should I NOT use this?

Do not use it for minor fixes, changing just one function, or making simple improvements. Use it only as a last resort.

Will the AI delete everything without asking?

No. The AI will show you a detailed plan of what will be deleted and what will be kept, and you must confirm before anything happens.

What happens after the AI rewrites the code?

The AI checks if everything important still works and if other files that used the old code can still use the new one without issues.

Details

Original description by the author

Completely delete and rewrite a file or module from scratch when structural rot makes patching impossible.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#3958
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills