recover

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Not every problem is a bug. Not every bug needs debugging.
When something goes wrong with AI-assisted development, the instinct is to keep prompting — describe the problem, ask for a fix, get another broken version, describe that problem, ask for another fix. The session gets longer. The context gets polluted. The code gets worse.
The problem is not the code. The problem is not knowing what type of failure you are dealing with.
This skill diagnoses the failure first. Then it prescribes the right response. Those are two separate steps and they cannot be swapped.

并非所有问题都是Bug。也并非所有Bug都需要调试。
在AI辅助开发过程中遇到问题时,人们的本能反应是不断提示——描述问题、请求修复、得到另一个有问题的版本、再描述问题、再请求修复。会话时长越来越久,上下文变得混乱,代码质量越来越差。
问题不在于代码本身,而在于你不清楚自己面对的是哪种类型的故障。
本Skill会先诊断故障,再给出正确的应对方案。这是两个独立的步骤,不能颠倒顺序。

Step 1 — Describe What Went Wrong

步骤1 — 描述问题详情

The developer describes the problem. The skill listens before doing anything else.
Ask:
Describe what is wrong. Be specific:
- What did you expect to happen?
- What happened instead?
- How many times have you tried to fix it already?
Read the answer carefully. The number of fix attempts is important — it tells you whether this is a fresh problem or a session that has already gone wrong.

开发者描述问题,Skill在采取任何行动前先倾听。
询问:
Describe what is wrong. Be specific:
- What did you expect to happen?
- What happened instead?
- How many times have you tried to fix it already?
仔细阅读回答。尝试修复的次数很重要——它能告诉你这是一个新出现的问题,还是已经陷入混乱的会话。

Step 2 — Identify the Failure Mode

步骤2 — 识别故障模式

Based on the description, determine which of three failure modes this is.
根据描述,判断属于以下三种故障模式中的哪一种。

Failure Mode 1 — A specific thing is broken

故障模式1 — 特定功能损坏

Signs:
  • The problem is isolated — one component, one function, one route
  • The rest of the project works correctly
  • This is the first or second attempt at fixing it
  • The error message or wrong behaviour is clear and specific
What it means: This is a normal bug. It has a root cause that can be found and fixed precisely.
Response: Targeted fix — go to Step 3A.

特征:
  • 问题具有孤立性——仅涉及一个组件、一个函数或一个路由
  • 项目其余部分运行正常
  • 这是第一次或第二次尝试修复
  • 错误信息或异常行为清晰明确
含义: 这是一个常规Bug,存在可被定位并精准修复的根本原因。
应对方案: 针对性修复——进入步骤3A。

Failure Mode 2 — The session has gone wrong

故障模式2 — 会话陷入混乱

Signs:
  • Multiple fix attempts have made things worse or created new problems
  • The code has become tangled — fixes are patching fixes
  • Context in this session is full of failed attempts
  • It is no longer clear what the original problem was
What it means: The session is polluted. More prompting will not help — it will compound the damage. The feature needs to be rebuilt in a clean context, not patched further.
Response: Hard reset — go to Step 3B.

特征:
  • 多次修复尝试导致问题恶化或产生新问题
  • 代码变得混乱——修复只是在已有修复的基础上打补丁
  • 本次会话的上下文充斥着失败的尝试记录
  • 已不清楚最初的问题是什么
含义: 会话上下文已被污染。继续提示毫无帮助——只会加剧问题。该功能需要在干净的上下文中重新构建,而非继续打补丁。
应对方案: 硬重置——进入步骤3B。

Failure Mode 3 — The foundation is wrong

故障模式3 — 基础逻辑错误

Signs:
  • The code runs but produces fundamentally wrong behaviour
  • Claude has been confidently building something that misunderstands a core requirement, library API, or architectural pattern
  • The problem is not a bug in the implementation — the implementation itself is wrong
  • Fixing individual pieces will not help because the approach is incorrect
What it means: This is not a debugging problem. The approach needs to be reconsidered before any code is written. More implementation in the wrong direction makes things harder to untangle.
Response: Rethink — go to Step 3C.

Tell the developer which failure mode this is before proceeding:
This looks like Failure Mode [1/2/3] — [name].

[One sentence explaining why you identified it this way.]

Here is how we handle this:

特征:
  • 代码能运行,但产生根本性的错误行为
  • Claude一直在自信地构建功能,却误解了核心需求、库API或架构模式
  • 问题不在于实现中的Bug——而是实现本身就是错误的
  • 修复个别部分毫无意义,因为整体思路不正确
含义: 这不是调试能解决的问题。在编写任何代码前,需要重新考虑整体思路。沿着错误方向继续实现只会让问题更难理清。
应对方案: 彻底重构——进入步骤3C。

在继续操作前,告知开发者故障模式:
This looks like Failure Mode [1/2/3] — [name].

[One sentence explaining why you identified it this way.]

Here is how we handle this:

Step 3A — Targeted Fix

步骤3A — 针对性修复

For Failure Mode 1.
适用于故障模式1。

Diagnose before touching code

修改代码前先诊断

Ask the developer to share:
  • The exact error message or wrong behaviour
  • The specific file or function where it happens
  • What the code is supposed to do versus what it actually does
Read the relevant code. Do not read the entire codebase — only what is directly relevant to the problem.
请开发者提供:
  • 确切的错误信息或异常行为
  • 问题发生的具体文件或函数
  • 代码预期功能与实际表现的差异
阅读相关代码。无需通读整个代码库——仅阅读与问题直接相关的部分。

Find the root cause

定位根本原因

Identify the root cause before suggesting any fix. A root cause is the actual reason the problem exists — not a symptom of it.
State the root cause clearly:
Root cause: [specific explanation of why this is happening]

This is different from the symptom because: [explanation]
在提出修复方案前先定位根本原因。根本原因是问题存在的真实缘由——而非问题的表象。
清晰说明根本原因:
Root cause: [specific explanation of why this is happening]

This is different from the symptom because: [explanation]

Suggest a precise fix

提出精准修复方案

Describe the fix that addresses the root cause. Not a workaround. Not a patch on top of broken code.
Fix: [what needs to change and why]

This will resolve the root cause because: [explanation]
Wait for the developer to confirm before making any changes.
描述针对根本原因的修复方案。不要提供临时解决方案,也不要在已有问题的代码上打补丁。
Fix: [what needs to change and why]

This will resolve the root cause because: [explanation]
在进行任何修改前,等待开发者确认。

If the fix does not work

若修复方案无效

If the suggested fix does not resolve the problem — stop. Do not suggest another fix immediately.
Re-examine the root cause diagnosis. If the fix did not work, the root cause was probably wrong. Diagnose again from the beginning before trying again.
If two root cause diagnoses have both been wrong — this may actually be Failure Mode 2 or 3. Re-evaluate.

若建议的修复方案未能解决问题——停止操作。不要立即提出另一个修复方案。
重新审视根本原因的诊断结果。若修复无效,很可能是根本原因判断错误。再次尝试前,从头开始重新诊断。
若两次根本原因诊断均错误——这可能实际属于故障模式2或3。重新评估。

Step 3B — Hard Reset

步骤3B — 硬重置

For Failure Mode 2.
适用于故障模式2。

Acknowledge the situation honestly

坦诚告知当前状况

This session has gone too far in the wrong direction
to recover by patching. The right move is a clean start.

This is not a failure — it is the correct response
to a polluted context. A fresh session with clear intent
will be faster than continuing here.
This session has gone too far in the wrong direction
to recover by patching. The right move is a clean start.

This is not a failure — it is the correct response
to a polluted context. A fresh session with clear intent
will be faster than continuing here.

Save what is worth keeping

保留有价值的内容

Before the session ends, extract anything valuable from the current state:
  • What was the original feature supposed to do?
  • What parts of the current implementation, if any, are actually correct?
  • What has been learned about what does not work?
  • What should the next session avoid?
Write this as a brief reset note:
undefined
在会话结束前,从当前状态中提取所有有价值的内容:
  • 最初的功能需求是什么?
  • 当前实现中哪些部分(如果有的话)是正确的?
  • 从失败尝试中学到了哪些经验?
  • 下一次会话应避免哪些问题?
将这些内容整理成简短的重置笔记:
undefined

Reset Note — [Feature Name]

Reset Note — [Feature Name]

What we were building

What we were building

[Original feature description]
[Original feature description]

What went wrong

What went wrong

[Honest summary of how the session went off track]
[Honest summary of how the session went off track]

What to avoid next time

What to avoid next time

[Specific approaches or patterns that did not work]
[Specific approaches or patterns that did not work]

Starting point for next session

Starting point for next session

[Where to begin fresh — what to keep, what to discard]
undefined
[Where to begin fresh — what to keep, what to discard]
undefined

Instruct the developer

指导开发者操作

Next steps:

1. Save this reset note somewhere accessible
2. End this session completely
3. Start a fresh session
4. Begin with /remember restore if memory exists
5. Approach [feature name] again with the reset note as context

Do not continue in this session.

Next steps:

1. Save this reset note somewhere accessible
2. End this session completely
3. Start a fresh session
4. Begin with /remember restore if memory exists
5. Approach [feature name] again with the reset note as context

Do not continue in this session.

Step 3C — Rethink

步骤3C — 彻底重构

For Failure Mode 3.
适用于故障模式3。

Name the wrong assumption

指出错误假设

The foundation being wrong means something was assumed that should not have been. Find it.
The core issue is not a bug — it is a wrong assumption:

Assumed: [what was assumed]
Reality: [what is actually true]

This means the current implementation cannot be fixed
by patching. The approach needs to change.
基础逻辑错误意味着存在不应有的假设。找出这个假设。
The core issue is not a bug — it is a wrong assumption:

Assumed: [what was assumed]
Reality: [what is actually true]

This means the current implementation cannot be fixed
by patching. The approach needs to change.

Propose the correct approach

提出正确思路

Based on the correct understanding, describe what the approach should have been:
Correct approach: [description]

Key difference from current approach: [explanation]

What needs to be discarded: [what cannot be salvaged]
What can be kept: [what is still valid]
基于正确的认知,描述原本应采用的思路:
Correct approach: [description]

Key difference from current approach: [explanation]

What needs to be discarded: [what cannot be salvaged]
What can be kept: [what is still valid]

Do not start rebuilding immediately

不要立即开始重构

A rethink needs the developer to understand and agree before any code changes. Present the analysis and wait for confirmation.
Does this diagnosis match your understanding?

If yes — we can start fresh with the correct approach.
If no — tell me what I am getting wrong.
Only after the developer confirms does any rebuilding begin.

在进行任何代码修改前,需要开发者理解并同意重构思路。提交分析结果并等待确认。
Does this diagnosis match your understanding?

If yes — we can start fresh with the correct approach.
If no — tell me what I am getting wrong.
只有在开发者确认后,才能开始重构。

The Principle

核心原则

The worst thing you can do when something is broken is keep doing the same thing faster.
Diagnose first. Respond correctly. Different failures need different responses — and knowing which failure you are dealing with is more than half the solution.
当出现问题时,最糟糕的做法是更快地重复同样的操作。
先诊断,再采取正确应对。不同的故障需要不同的解决方案——而明确你面对的是哪种故障,就已经解决了一半的问题。