anomaly-investigation
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "anomaly-investigation":https://skillpi.com/zh/skills/deepskill-ab0f81be59f3ec8347bc3e887a379107b81c070b45bb3f28e3370f1719acb276。安装前核对上游来源和版本:https://github.com/gaasher/Agent-Loop-Skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
当数据中存在已知观测到的异常(如指标突增/突降、离群值、意外数值)并需诊断根本原因时使用。该方法生成候选原因并逐一以数据检验,排除被数据证伪的选项,逐步缩小候选集合,直至仅剩一个既未被证伪又通过正向确认测试的原因。最终输出一份调查日志,包含已确认的根本原因及排除其他可能性的证据。不适用于对无特定异常的数据集做开放式探索或基于外部来源验证主张。
介绍来源: third_party · gaasher · 0.1.0 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 适合谁
- 翻译待完成,请参阅来源文档。
- 软件、账号及付费要求
- 翻译待完成,请参阅来源文档。
- 限制与区别
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: anomaly-investigation
description: >
Use when the user has a known, already-observed anomaly in their data — a metric spike or drop, an
outlier, an unexpected number — and wants its root cause diagnosed, not guessed. Forms a slate of
candidate causes, tests each against the data, and eliminates the ones the data refutes, narrowing
the live candidates until exactly one survives refutation and passes a positive confirming test. The
result is an investigation log with the confirmed root cause and the evidence that ruled out the
alternatives. Not for open-ended discovery over a dataset with no specific anomaly in hand (that is
data-analysis), and not for checking an external claim against sources (that is claim-verify) — this
is reactive diagnosis of one anomaly you already know about.
compatibility: Requires Python 3.9+
metadata:
version: "0.1.0"Anomaly Investigation Loop
A form → test → eliminate → confirm loop — root-cause analysis as a search. The artifact is an investigation log; the feedback signal is the count of live candidate explanations, driven down toward a single cause that is confirmed, not merely consistent. Each iteration you test one candidate against the data and drop the ones the data refutes, narrowing the field until one survives.
The discipline this enforces: a cause is "root" only when it both survives an honest attempt to refute it and makes a positive prediction that checks out (e.g. "if this is the cause, removing it restores normal" — and it does). A story that merely could explain the anomaly is a hypothesis, not a finding.
When to use
Use this when an anomaly is already in hand — you know roughly what looks wrong and want the cause diagnosed by elimination against the data. Default to a broad initial slate of mutually distinguishable causes, then test the one that splits the field fastest; if the anomaly is vague, your first job is to make it precise (iteration 0). Not for open-ended exploration of a dataset with no anomaly to chase (use data-analysis), and not for verifying an external claim against the literature (use claim-verify).
Setup
Resolve bindings interactively. If loop.run.yaml exists in the working dir, load it, confirm the
values in one line, and skip to the loop. Otherwise: on Claude Code (the AskUserQuestion tool is
available) infer a likely value for each binding and present it as the recommended option; on other
hosts ask each as a quoted plain-text prompt. Then write loop.run.yaml (format:
examples/run.example.yaml) and confirm the values before creating any other files.
| binding | meaning | default | how to infer |
|---|---|---|---|
<dataset> |
data (or logs) to investigate; read-only ground truth | — | scan the working dir for a data/log file |
<anomaly> |
what looks wrong: the metric, where/when, and how big the deviation is | — | ask the user; make precise in iter 0 |
<analysis_cmd> |
interpreter that runs analysis snippets in the user's env | python3 |
pyproject.toml/.venv/uv in the working dir |
<log> |
output investigation log | <sandbox_root>/investigation.md |
— |
<sandbox_root> |
where snippets + ledger live | ./sandbox |
— |
<budget> |
max iterations | 8 | — |
Analysis snippets run in the user's environment via <analysis_cmd>, so they may use whatever the
user has installed. Keep helper code stdlib-first (csv, statistics): if a snippet needs
pandas/numpy, probe with try/except ImportError and degrade to a stdlib path, or offer a
consented uv pip install "pandas==<ver>" — never assume the package is installed.
The loop
Copy this checklist and tick items off:
- [ ] Iteration 0 — characterize the anomaly precisely; form an initial slate of candidate causes in
<log>. - [ ] Pick a candidate to test (the one whose test most cleanly splits the remaining field).
- [ ] Test it: write
<sandbox_root>/iter<N>/test.py, run with<analysis_cmd>, redirect toout.txt. - [ ] Eliminate (data refutes it → drop from the live set) or advance (data supports it → keep it live).
- [ ] Confirm the survivor: when one candidate leads, run a positive test only it predicts, after a refutation attempt.
- [ ] Append a ledger row; stop when one cause is confirmed or at
<budget>.
Iteration 0 — characterize. Quantify the anomaly precisely: write and run a snippet that pins down
what deviated, where/when, and how big the deviation is against the normal baseline (the same
metric on surrounding periods/segments). Then form an initial slate of candidate causes — mutually
distinguishable explanations, broad enough to contain the truth (a real change, a composition/mix
shift, a data-quality bug, a measurement change, seasonality, an outlier segment). List them in
<log> as the live candidates. Record nothing as confirmed yet.
Then, until stop (one confirmed cause, or budget):
- Pick a candidate to test. Ideally the one whose test most cleanly splits the remaining field, so each iteration removes as many live candidates as possible.
- Test it. Write
<sandbox_root>/iter<N>/test.pythat computes the thing that would refute or support it (slice by segment/source/time, recompute the metric, compare distributions). Run it with<analysis_cmd>, redirecting output to<sandbox_root>/iter<N>/out.txt(never flood your context). - Eliminate or advance.
- Data refutes it → mark it eliminated in
<log>with the evidence; drop it from the live set. - Data supports it → keep it live, and if it is now the leading candidate run a confirming test: a positive prediction it uniquely makes (e.g. "remove / seasonally-adjust the suspected factor → the anomaly disappears"). Also try to refute it — a leading candidate that survives a genuine refutation attempt and passes its confirming test is the root cause.
- Data refutes it → mark it eliminated in
- Log one ledger row and continue, narrowing the live set.
Observational equivalence. Two mechanistically different candidates can make identical predictions in the data you have (e.g. a bot flood and a pipeline double-count both look like "sessions spike, conversions flat" in daily aggregates). When that happens you cannot separate them here — do not pick one arbitrarily. Report them as a single confirmed cause at the resolution of the available data, and name the additional data that would distinguish them (finer-grained logs, raw event records, an upstream check). Distinguish, too, the mechanism (how the metric moved) from the root cause (why the inputs were wrong) — confirming the mechanism is progress, but is not the cause.
Ledger
<sandbox_root>/ledger.tsv, tab-separated, never commas in the text. Header:
iter candidate_tested verdict live_candidates
verdict ∈ {characterize, refuted, supported, confirmed}. Example:
iter candidate_tested verdict live_candidates
0 characterize anomaly + slate characterize 5
1 real drop across all segments refuted 4
2 one segment's conversions fell refuted 3
3 one source's sessions inflated supported 2
4 removing that source restores normal confirmed 1
Report the confirmed root cause with its confirming evidence, the alternatives and how each was ruled out, and — if you stop without a single confirmed cause — the remaining live candidates and the test that would separate them.
Constraints
- Confirm, don't just fit. The root cause must survive an honest refutation attempt and pass a positive confirming test; "consistent with the data" is not enough, since several stories usually are.
- Test against the data, not intuition — every elimination and the final confirmation is backed by
a computation you ran, recorded in
<log>. - Keep candidates distinguishable and prefer the test that splits the field fastest, so the live count falls; do not chase one pet theory while leaving alternatives untested.
- Only read
<dataset>— never modify it, because it is the ground truth every test is checked against. The sandbox is self-contained (no../escapes). - Do not pause the loop to ask whether to continue; run until a cause is confirmed or the budget is hit.
Stops
- Confirmed — exactly one candidate survived refutation and passed a positive confirming test.
- Budget —
<budget>iterations reached without a single confirmed cause; report the live set.
当前收录版本
0.1.0
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 针对已知数据异常的根因诊断,解决明确业务痛点
- 采用科学证伪方法,避免主观猜测
- 适用于数据分析、运维、产品等多个高频场景
亮点
- 触发条件清晰:已知异常 + 需要根因诊断
- 边界明确:排除开放式探索和外部主张验证
- description 位置正确且内容完整
待提升项
-
缺少 When to Use 独立章节 原报告严重程度:轻微
When to Use 内容已融入主体,但未作为独立章节呈现
改进建议:建议将 When to Use 提取为独立章节,提升可读性
亮点
- 执行流程清晰:Setup → Iteration 0 → Loop → Stops
- 包含详细的 ledger.tsv 示例
- frontmatter 完整,单文件长度适中
待提升项
-
未明确处理 uv pip install 失败场景 原报告严重程度:轻微
在需要安装 pandas/numpy 时,未说明 uv pip install 失败后的处理策略
改进建议:建议补充安装失败时的降级方案或错误提示
亮点
- 工具来源明确,Python 3.9+ 要求清晰
- stdlib-first 策略,ImportError 降级处理
- 仅读取数据,无不可逆操作风险
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 57 行
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
翻译待完成,请参阅来源文档。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。