verify

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Code Forge — Verify

Code Forge — 验证

Evidence-based completion verification. Run before claiming any work is done.
基于证据的完成验证机制。在宣称任何工作完成前执行。

When to Use

使用场景

  • About to say "tests pass", "build succeeds", "bug is fixed", or "feature is complete"
  • Before committing, creating a PR, or marking a task as done
  • After any code change that should be verified
  • When reviewing sub-agent output before trusting it
Note: code-forge:impl runs verification automatically. This skill is for general use.
  • 当你即将说出“测试通过”“构建成功”“Bug已修复”或“功能已完成”时
  • 在提交代码、创建PR或标记任务为完成前
  • 在任何需要验证的代码变更之后
  • 在信任子Agent输出前进行审核时
注意: code-forge:impl会自动运行验证。本技能适用于通用场景。

Iron Law

铁则

NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.
No exceptions. Not "it should work." Not "I just ran it." Not "the agent said it passed."
无最新验证证据,不得宣称工作完成。
无一例外。禁止使用“应该能运行”“我刚运行过”“Agent说它通过了”这类表述。

Workflow

工作流程

IDENTIFY verification command → RUN fresh → READ full output → VERIFY against claim → CLAIM
确定验证命令 → 全新运行 → 读取完整输出 → 对照宣称内容进行验证 → 做出宣称

The Gate

必经关卡

Every claim must pass through this gate:
IDENTIFY → RUN → READ → VERIFY → CLAIM
  1. IDENTIFY the verification command (test, build, lint, type-check)
  2. RUN the command fresh (not from memory, not from a previous run)
  3. READ the complete output (not skimmed, not truncated)
  4. VERIFY the output matches the claim (zero failures, exit code 0)
  5. ONLY THEN make the claim
所有宣称都必须通过以下关卡:
确定 → 运行 → 读取 → 验证 → 宣称
  1. 确定验证命令(测试、构建、代码检查、类型检查等)
  2. 全新运行该命令(不依赖记忆,不使用之前的运行结果)
  3. 读取完整输出(不略读、不截断)
  4. 验证输出与宣称内容匹配(零失败、退出码为0)
  5. 仅在此时做出宣称

Forbidden Words

禁用词汇

These words in a completion claim are red flags — they mean you haven't verified:
  • "should work" / "should pass"
  • "probably" / "likely"
  • "seems to" / "appears to"
  • "I believe" / "I think"
  • "based on the changes"
  • "it worked before"
Replace with evidence: "All 34 tests pass (output: 34 passed, 0 failed, exit code 0)."
完成宣称中出现以下词汇均为危险信号——意味着你未进行验证:
  • “应该能运行”/“应该能通过”
  • “可能”/“大概”
  • “看起来”/“似乎”
  • “我相信”/“我认为”
  • “基于所做的变更”
  • “之前运行正常”
需用证据替代,例如:“全部34项测试通过(输出:34项通过,0项失败,退出码0)。”

Verification Patterns

验证模式

Tests

测试验证

Run command → See "X passed, 0 failed" → Claim "all tests pass"
NOT: "Tests should pass now" or "I fixed the issue so tests will pass."
运行命令 → 查看“X项通过,0项失败” → 宣称“所有测试通过”
禁止:“现在测试应该能通过”或“我修复了问题,所以测试会通过。”

Regression Test

回归测试

Write test → Run (PASS) → Revert fix → Run (MUST FAIL) → Restore fix → Run (PASS)
The revert-and-fail step proves the test actually catches the bug.
编写测试 → 运行(通过) → 回滚修复 → 运行(必须失败) → 恢复修复 → 运行(通过)
回滚并失败的步骤可证明该测试确实能发现Bug。

Build

构建验证

Run build → See exit code 0, no errors → Claim "build passes"
运行构建命令 → 查看退出码为0且无错误 → 宣称“构建通过”

Requirements Checklist

需求清单验证

For each requirement:
  [ ] Identified verification method
  [ ] Ran verification
  [ ] Evidence recorded
NOT: "Tests pass, so the feature is complete."
针对每项需求:
  [ ] 确定验证方法
  [ ] 执行验证
  [ ] 记录证据
禁止:“测试通过,所以功能已完成。”

Sub-Agent Output

子Agent输出验证

Agent claims success → Check VCS diff → Run tests yourself → Verify changes
NEVER trust agent reports without independent verification.
Agent宣称成功 → 检查VCS差异 → 自行运行测试 → 验证变更
未经独立验证,绝不要信任Agent的报告。

Common Mistakes

常见错误

  • Trusting memory of a previous test run instead of running fresh
  • Reading only the last line of output, missing errors above
  • Claiming "build passes" after only running tests (or vice versa)
  • Verifying one aspect but claiming completeness for all aspects
  • Skipping verification "just this once" because it's a small change
  • 依赖之前测试运行的记忆,而非重新运行
  • 仅读取输出的最后一行,忽略上方的错误
  • 仅运行测试后就宣称“构建通过”(反之亦然)
  • 仅验证一个方面,却宣称所有方面均已完成
  • 因变更微小而“就这一次”跳过验证