Skip to content
Skills Library
Programming · Testing

verification

/verification

Verify that code actually works before claiming it does. Use when writing or reviewing tests, validating a fix, benchmarking or profiling, debugging silent failures, or reporting completion status. Applies to any language, engine, or framework.

Repository
pi-skills ↗
Licence
MIT
Last repository change
31.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 31.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: templates/test_runner.sh

What it does and when to use it

Verify that code actually works before claiming it does. Use when writing or reviewing tests, validating a fix, benchmarking or profiling, debugging silent failures, or reporting completion status. Applies to any language, engine, or framework.

Original author description

Verify that code actually works before claiming it does. Use when writing or reviewing tests, validating a fix, benchmarking or profiling, debugging silent failures, or reporting completion status. Applies to any language, engine, or framework.

How it works

  1. 六条硬规则
  2. 检查清单
  3. 断言怎么写
  4. 测试组织(跨语言通用)
  5. 性能与测量
  6. 报告话术(最容易失分的地方)
  7. 反自欺速查
Original SKILL.md headings · 98 lines, 275 words
SKILL.md preview
---
name: verification
description: Verify that code actually works before claiming it does. Use when writing or reviewing tests, validating a fix, benchmarking or profiling, debugging silent failures, or reporting completion status. Applies to any language, engine, or framework.
---

# 验证:把「我觉得对」变成「有证据」

适用于任何技术栈。核心是六条规则 + 一套检查清单 + 反自欺清单。

## 六条硬规则

1. **双观察面**:任何"它工作了"的结论,至少要有两个**独立**证据面
   (例如:退出码 / 日志 / 画面或产物 / 数值 / 文件 diff / 外部进程状态)。
   只有一个面时,明确说"未交叉验证"。
2. **假信号优先**:先问"这个信号可能怎么骗我",再相信它。详见 `references/false-signals.md`。
   高频陷阱:退出码≠成功、无报错≠跑了、指标>0≠正确、返回 success≠发生了、测量被优化掉、计数器被封顶。
3. **探针优先**:同一个假设链失败**两次**就停止推理,去插桩打印中间状态。
   不要用第三个猜想解释前两个猜想的失败。
4. **对照必须能失败**:每个对照实验至少有一条"预期会失败"的断言,
   否则你只是在验证自己能写出必然通过的东西。
5. **排空后再断言**:异步 / 并发 / 网络 / 缓存的系统,等状态静止(drain)再判断终态;
   飞行中读到的值几乎总是错的。
6. **量化门槛**:改进必须给数字与阈值(`0.267 → 0.109,阈值 <0.15`),
   而不是"更流畅""更快了"。

## 检查清单

**动手前**
- [ ] 先写一个能**失败**的探针或断言,再改代码(否则无法证明修好了)
- [ ] 明确这次改动的"观察面"是什么:哪个日志行 / 哪个数值 / 哪个产物文件
- [ ] 涉及 GUI 编辑器或格式化工具会重写文件时:**先提交**,事后用 diff 审查

**验证中**
- [ ] 每条断言都打印实测值和阈值(失败时能直接看出差多少)
- [ ] 至少一个负控制(应当失败的用例确实失败)
- [ ] 关键数字问过一次"它可能怎么骗我"(见假信号清单)
- [ ] 异步系统等静止再读终态
- [ ] 计数器按"事件总数"计,不要用被截断的缓冲长度

**声称完成前**
- [ ] 结论有两面证据
- [ ] 数字带阈值
- [ ] 明确列出**未验证**的部分(见 `templates/playbook.md` 的「未解决」字段)
- [ ] 需要人眼审美的(配色、手感)与需要凭证/硬件的(账号、真机)单独标注,不混进"完成"

## 断言怎么写

```text
好:  期望 位置误差 < 0.15;实测 0.109;命令 <复现方式>
坏:  assert ok            # 永远通过,等于没测
坏:  print("看起来正常")   # 人的眼睛不是断言
```

- 断言里带上**实测值**,而不是只回 `false`。
- 边界用显式容差,不用浮点 `==`。
- 状态类断言优先"读回来比较"(写完文件 grep / 存完资源重新 load),
  而不是"调用没抛异常"。

## 测试组织(跨语言通用)

- **双模式**:纯逻辑测试(快、无运行时依赖)与集成测试(需要单例/物理/渲染/网络)分开,
  并写明"哪些能力在哪种模式可用"——很多测试框架在两种模式下行为不同(例如单例是否存在)。
- **可复现**:随机测试固定 seed 并打印 seed;仿真必须能重放出同一结果。
- **可分片跳过**:依赖特定架构/凭证/硬件的用例,缺失时**跳过并说明原因**,而不是判红或假装通过。
- **执行器三件事**:收集退出码 + grep 错误模式 + **检测挂死**。
  模板:`templates/test_runner.sh`(超时、挂死不退出、错误模式命中都算失败)。
  错误模式必须包含 `^ERROR:` / `^error:` —— 大量工具(含 Godot)**打错误日志但退出码为 0**;
  我用这份模板跑真实工程时就吃过一次假阴性:不存在的脚本退出 0,runner 报"通过"。
  对"预期会报错"的用例,单独设 `ERR_PATTERN` 或置空。
- **测测试**:给自己要交付的测试工具写一组自测(通过/失败/只打日志/挂死 四种)。

## 性能与测量

- **防优化**:基准必须让结果逃逸(volatile、参与返回值、写入 sink),并在文档里写明方法。
  只写 `if (x == -1) print()` 通常防不住。
- **分阶段计时**:整体耗时往往由某一阶段主导(例如"入树"比"构造"贵一个数量级),
  拆开测才知道该优化什么。
- **采样窗口匹配事件时长**:0.16 s 的样本不要配 20 帧的采样窗口。
- 记录**环境**(机器、版本、seed、是否开窗口/并行),否则数字不可比。

## 报告话术(最容易失分的地方)

把"完成了 ✅"拆成三段:

1. **证据**:改了哪个文件,用什么命令/断言验证,数字是多少,在哪里能看到(截图/日志路径)。
2. **边界**:哪些部分没验证、为什么(技术卡点 vs 身份卡点 vs 需要人眼)。
3. **未解决**:明确写出来,附上"走过的弯路"——弯路比结论更省别人时间。

反模式:把"没报错"当成功;把"我能跑通一次"当稳定;把未验证项悄悄删掉。

## 反自欺速查

| 自欺的说法 | 真实问题 |
|---|---|
| 测试全绿 | 错误有没有被框架吞掉?退出码真的非零吗? |
| 日志没有 ERROR | 程序真的执行到那一步了吗? |
| 指标从 0 变成 600 | 600 的东西长对了吗?(可能被剔除/在屏幕外) |
| 工具返回 success | 副作用真的发生了吗?(查进程/文件/端口) |
| 基准只花 0.0 ms | 循环是不是被编译器删了? |
| 收到 8 个包 | 计数器是不是被封顶了? |
| 我改好了 | 改动真的写进文件了吗?(grep 回读) |
Files in this package (4)
  • SKILL.md 6 KB
  • references/false-signals.md 4 KB
  • templates/playbook.md 2 KB
  • templates/test_runner.sh 4 KB

Versions

RepositoryScoreLicence
This page · CooCoode/pi-skills100MIT
aws-solutions/konductor100Apache-2.0
YuDefine/nuxt-supabase-starter100MIT
assafkip/huntkit100MIT
vercel/vercel-plugin100Apache-2.0
romiluz13/cc10x100MIT
Aurite-ai/agent-verifier100MIT
fusengine/agents100MIT
420company/artemis95MIT

Database snapshot: 13.11.2026 · package version 3cf97fbb6d24 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90dev-verify
    Verify that a change really works before claiming completion. Use when the user wants confidence that a feature, fix, or refactor actually works — turns vague "it should work" claims into concrete evidence. Pairs with @oath-verifier agent.
  • 100verification-before-completion
    Use when an imminent complete, fixed, passing, ready, or safe claim—or final status after edits/tests—needs an evidence gate; not as an implementation substitute.
  • 90clade-verification
    Verification, testing, review, screenshots, and evidence rules. Use when testing, reviewing, debugging, collecting evidence, or claiming completion.
  • 90verification-before-completion
    Requires fresh verification evidence before claiming work complete. Use this skill when about to say done, open a PR, or hand off, before asserting tests pass or behavior is correct. Do not use when/for choosing merge vs discard options after verification (use branch-completion)…
  • 90verify
    Prove that a change actually works by running the project's checks and reporting the evidence. Use after implementing anything, when the user asks whether a change works, or before declaring a task done.
  • 95runtime-verification
    Verify that a code change actually does what it's supposed to by running the app and observing behavior. Use when asked to verify a PR, confirm a fix works, test a change manually, check that a feature works, or validate local changes before pushing.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.