# 先调查后修改 (investigate-first)

> 面对原因不明的故障，先收集证据、按证据排序假设，再动产品代码。

- 分类: [测试与调试](https://www.myskills.tools/zh/categories/testing-debugging/)
- 来源: 社区 · Julius Brussee
- 代码仓库: https://github.com/JuliusBrussee/caveman/tree/main/skills/investigate-first (commit 82864c8)
- SKILL.md: https://github.com/JuliusBrussee/caveman/blob/main/skills/investigate-first/SKILL.md
- 安装命令: `npx skills add JuliusBrussee/caveman --skill investigate-first`
- 许可证: Apache-2.0
- 兼容工具: Claude Code, Codex, Gemini CLI
- 权限: read-repo ✓, write-files ✗, shell ✗, network ✗
- 状态: 扫描通过
- 规则扫描无法覆盖所有风险，安装前请阅读此技能的 SKILL.md，确认权限后再使用。

## 核心规则

在一个可信机制能解释全部证据之前，不修改代码。

## 执行阶段

1. **区分现象与推测** — 把观察到的现象和推断出的原因分开记录。
2. **追踪证据** — 追踪输入、状态变化、所有权边界和失败输出。
3. **排序假设** — 按证据强度和低成本证伪的价值排列假设，证据足够时停止探索。
4. **报告原因与证据** — 报告原因和证明，或说明确切的阻塞点；未经授权不做修复。

## 权限说明（据 SKILL.md 整理）

| 能力 | 是否需要 | 说明 |
|---|---|---|
| 文件写入 | 部分需要 | 调查阶段不改产品代码，只有任务授权实现时才修复。 |
| 命令执行 | 不需要 | 技能未要求运行特定命令。 |
| 网络外发 | 不需要 | 技能未要求访问网络。 |

## SKILL.md 头部信息（YAML）

```yaml
---
name: investigate-first
description: Diagnose ambiguous failures before editing. Use for unknown causes, intermittent behavior, performance regressions, or investigations needing evidence-ranked hypotheses.
---
```

首页: https://www.myskills.tools/zh/ · URL: https://www.myskills.tools/zh/skills/investigate-first/
