diagnostic-reasoning
它能做什么
这项技能是一套分步方法,用于在有人尝试修复漏洞之前先弄清楚被报告的漏洞。适合希望获得可靠修复、而不是靠猜测的人。
适用场景
- ✓当有人报告漏洞,而没有人能说清楚具体是什么触发它的时候。
- ✓当诊断报告提出一个原因,而你希望在行动前先加以核实的时候。
- ✓当漏洞只是偶尔出现,你想弄清楚原因的时候。
技能链接
https://github.com/kunchenguid/firstmate/blob/main/.agents/skills/diagnostic-reasoning/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“用户说结账页面有时会出错。在我们做任何修改之前,请帮我弄清楚到底是什么触发了它。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体首先像真实用户那样重现问题。然后它区分三件事:什么引发了问题,什么隐藏或暴露了问题,以及用户实际看到了什么。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
diagnostic-reasoning
Use this procedure before scoping a reported bug and before acting on a diagnostic report. This skill is the single owner of Firstmate's bug-diagnosis reasoning procedure. Firstmate applies it when briefing delegated investigation and evaluating the resulting evidence, without taking over project-specific investigation itself.
Establish the observed behavior
Start from the end user's experience rather than an internal error string or an implementation hypothesis. Require an end-to-end reproduction aligned with the real user path whenever it is feasible and safe. If a faithful reproduction is not feasible, record the exact limitation and use the closest representative path without presenting it as equivalent evidence. Capture the expected behavior, observed behavior, setup, inputs, and repeatability before assigning a cause.
Separate these three facts explicitly:
- The initiating trigger is the event, input, or transition that starts the faulty behavior.
- The masking condition is the independent state, environment, timing, cache, configuration, or path difference that hides or exposes the fault.
- The visible symptom is what the end user or operator can actually observe.
Do not collapse those facts into one label. A masking condition may explain why a fault appears only sometimes without being the initiating cause, and the visible symptom may be several layers downstream from both.
Test the causal explanation
Inspect the failing path and a proven path where the intended behavior is known to work. Compare their inputs, state transitions, dependencies, timing, and control flow to find the earliest meaningful divergence. Inspect relevant history, including blame, commits, migrations, and prior implementations, when it can explain why the paths diverged or which invariant was intended. Do not treat the most recent nearby change as causal without evidence.
Identify the smallest counterfactual that should change the outcome if the leading explanation is true. Change one condition at a time where practical, and record whether the symptom appears, disappears, or remains unchanged. Seek disconfirming evidence deliberately: name what observation would falsify the leading explanation, run that check when feasible, and retain contradictory results instead of explaining them away. Compare the final explanation against the proven path and show why the proposed causal boundary accounts for both the failure and the success.
Scope and act on the result
A diagnosis brief should ask for the reproduction, trigger/mask/symptom separation, divergent and proven path comparison, relevant history, smallest counterfactual, and disconfirming evidence in the report. A diagnostic report should distinguish observed facts from hypotheses and state any unresolved uncertainty that could change the recommended scope. Before acting on the report, verify that its claimed cause explains the end-user reproduction and the proven path without relying on an untested masking condition. If a load-bearing element is missing, route a focused follow-up investigation instead of treating confidence or implementation detail as proof. A diagnosis or implementation-ready recommendation is evidence, not authorization to change code. Implementation still requires the captain's request or another existing lifecycle authority, and the reproduction should become the regression test when a fix is authorized.
常见问题
为什么不直接修复第一个错误信息?
错误信息未必是真正的原因,因此这项技能从用户的实际体验出发。
如果无法重现漏洞怎么办?
智能体会记录这一限制,并使用最接近的安全测试,而不会声称它与真实情况完全相同。
它适用于任何类型的漏洞吗?
它是一种通用方法,因此可用于许多类型的问题报告。
详情
作者的原始描述
Load before scoping a reported bug and before acting on a diagnostic report.
repo: kunchenguid/firstmate
热度
- GitHub 星标
- 8.5k
- 排名
- #12433
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …