re-create
它能做什么
这个工具会彻底删除一个文件或代码段,然后从头重写。只有当代码乱到无法逐段修复时,才应该使用它。
适用场景
- ✓代码太乱,修修补补只会让情况更糟时。
- ✓旧代码已经无法运行,需要彻底重做时。
- ✓维护现有代码的时间和精力成本太高时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/re-create/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请删除并重写 “calculator.js” 文件,它的结构问题很严重,我已经没办法修复了。”
每周 5 个新技能,1 分钟读完。
工作原理
首先,AI 会解释为什么修复已经不再可行,并列出所有需要保留的内容。然后,在你同意后,它会删除旧代码并编写新代码,同时确保所有重要功能依然正常。
技术内容(原始 SKILL.md)
作者在 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:
- What specifically is broken or unsalvageable?
- Not "it's messy" — specific structural problems that make targeted fixes impossible or counterproductive
- Why would targeted edits make things worse, not better?
- Patching on top of rot, compounding complexity, architectural mismatch
- 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:
- Public interfaces — functions, classes, types, or exports that other parts of the codebase call
- Implicit contracts — behaviors that other files depend on even if not formally typed
- Working behaviors — things the current implementation does correctly that must continue to work
- Non-obvious logic — edge cases, guards, or special handling that looks incidental but is intentional
- 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.
…
常见问题
什么时候不应该使用它?
不要用于小修小补、只修改一个函数或做简单优化的情况。只有在万不得已时才使用。
AI 会不经询问就删除所有内容吗?
不会。AI 会先向你展示详细的计划,列出将被删除和保留的内容,你确认后才会执行任何操作。
AI 重写代码后会发生什么?
AI 会检查所有重要功能是否仍然正常,并确认其他使用旧代码的文件能否无问题地使用新代码。
详情
作者的原始描述
Completely delete and rewrite a file or module from scratch when structural rot makes patching impossible.
热度
- GitHub 星标
- 48k
- 排名
- #5572
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。