跳到正文
Skillpedia
通用编程70k · #3144

fix-root-cause

它能做什么

这个技能指导调试,直指问题的真正原因,而不是它首次显现的位置。它面向希望修复能够长期有效的开发者。

适用场景

  • ✓快速修补之后,问题在另一处反复出现的时候。
  • ✓有人想添加守卫、重试或变通方法来隐藏错误的时候。
  • ✓问题只在重启后出现,且原因不清楚的时候。

技能链接

https://github.com/remotion-dev/remotion/blob/main/.agents/skills/fix-root-cause/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/remotion-dev/remotion/blob/main/.agents/skills/fix-root-cause/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“每次重启应用,都会出现不同的错误。请帮我找出真正的原因,而不是逐个修补症状吗?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会复现问题,并在每一步追问原因,直到找到第一个错误的决定。然后它会修复该原因,并检查其他地方是否存在同样的模式。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Fix Root Causes

When debugging, fix the fault, not the place where it surfaced. The symptom is where a wrong state became visible. The root cause is the first place the system did something it should not do, or failed to handle a state it should handle.

Why: A symptom fix hides the evidence and leaves the fault free to surface somewhere else. Each one makes the system harder to reason about, because the code now carries a workaround for a bug that nobody named.

Pattern:

  • Reproduce first.
  • Ask "why" at each step until the answer is a wrong decision in the code, not a consequence of an earlier one.
  • When stuck, instrument. Read the actual error and the actual state. Do not guess.
  • Ask whether the state that triggered the symptom is legitimate. If the system may be in that state, the code that broke on it is the root cause, and handling the state there is the fix. If the state should never exist, a check where it broke hides the bug. Find what produced the state. Guards, retries, swallowed errors, clamped values, and discarded state are the usual ways to hide a bug.
  • When something fails only after a restart, suspect persisted state first: config files, caches, lock files, serialized state.
  • Check for the pattern, not just the instance. Find every place with the same fault and fix them all.
  • If a workaround needs a paragraph-long comment to justify it, the code is wrong. Fix the code, not the comment.
  • If the deciding fact took a deep dig to find, propose the cheap, always-on signal that would have shown it at first look.
常见问题

症状和根本原因有什么区别?

症状是错误状态变得可见的地方。根本原因是代码第一次做了不该做的事情的地方。

什么时候守卫算是真正的修复?

这个技能说,只有当它处理的状态是合法的时候,守卫才算修复。如果该状态本不应存在,守卫只是掩盖了错误。

如果问题只在重启后出现怎么办?

这个技能说,应先怀疑已保存的状态,例如配置文件、缓存、锁文件和序列化数据。

详情

作者的原始描述

Apply when debugging. Trace each symptom back to the first place the system went wrong and fix it there. A guard is a fix only when the state it handles is legitimate.

repo: remotion-dev/remotion

热度

GitHub 星标
70k
排名
#3144
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能