Community编程与开发github.com

完成前验证

在声称工作完成、修复或测试通过之前,必须运行验证命令并确认输出,然后才能做出任何成功断言;证据先于断言。

完成前验证 是什么?

该技能强制实施“证据先于断言”的核心原则,要求开发者或AI代理在声称任何工作状态(如完成、修复或通过)之前,必须运行完整的验证命令并检查输出,否则不得做出任何断言。它定义了一个严格的“门函数”流程:识别验证命令、完整执行、读取输出并检查退出码、确认输出是否支持断言,最后才能做出声明。该技能适用于所有平台(如Claude Code、Cursor、Codex等),并详细列出了常见失败模式(如测试、lint、构建、bug修复)对应的验证要求,以及多种理性化借口(如“应该可以了”、“我很确定”)的预防措施。它特别强调情绪化规避(如疲惫时想快速结束工作)和措辞规避(如使用“大概”、“似乎”等模糊词汇)都属于违规,并建议在每次提交、创建PR或代理委托前执行该流程。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/obra/superpowers/tree/main/skills/verification-before-completion

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

完成前验证 是做什么的?

概述

核心原则: 证据先于断言,始终如此。

违反此规则的文字表述等同于违反规则的精神。

铁律

未经新鲜验证证据,不得做出完成声明

如果你尚未在此消息中运行验证命令,就不能声称它通过了。

门函数

在声称任何状态或表达满意度之前:

1. 识别:什么命令能证明这一断言?
2. 运行:执行完整的命令(新鲜、完整)
3. 读取:完整输出,检查退出码,统计失败数量
4. 验证:输出是否确认了断言?
   - 如果否:用证据说明实际状态
   - 如果是:用证据进行断言
5. 然后才:做出断言

跳过任何步骤 = 撒谎,而非验证

常见失败模式

断言需要不足够
测试通过测试命令输出:0 失败之前运行、“应该能通过”
Lint 干净Lint 输出:0 错误部分检查、推断
构建成功构建命令:退出码 0Lint 通过、日志看起来不错
Bug 已修复测试原始症状:通过代码已更改、假设已修复
回归测试有效红绿循环已验证测试通过一次
代理已完成VCS 差异显示变更代理报告“成功”
需求已满足逐项核对清单测试通过

红旗 - 立即停止

  • 使用“应该”、“大概”、“似乎”
  • 在验证之前表达满意(“太棒了!”、“完美!”、“完成!”等)
  • 即将提交/推送/创建 PR 而未验证
  • 信任代理的成功报告
  • 依赖部分验证
  • 认为“仅此一次”
  • 疲惫且想快速结束工作
  • 任何未经运行验证就暗示成功的措辞

理性化借口预防

借口现实
“现在应该行了”运行验证
“我很确定”确定性 ≠ 证据
“仅此一次”没有例外
“Lint 通过了”Lint ≠ 编译器
“代理说成功了”独立验证
“我累了”疲惫 ≠ 借口
“部分检查就够了”部分检查证明不了什么
“用词不同所以规则不适用”精神高于文字

关键模式

测试:

✅ [运行测试命令] [看到:34/34 通过] “所有测试通过”
❌ “现在应该能通过了” / “看起来正确”

回归测试(TDD 红绿):

✅ 编写 → 运行(通过)→ 恢复修复 → 运行(必须失败)→ 恢复修复 → 运行(通过)
❌ “我已经编写了回归测试”(未进行红绿验证)

构建:

✅ [运行构建命令] [看到:退出码 0] “构建通过”
❌ “Lint 通过了”(Lint 不检查编译)

需求:

✅ 重新阅读计划 → 创建清单 → 逐项验证 → 报告差距或完成
❌ “测试通过,阶段完成”

代理委托:

✅ 代理报告成功 → 检查 VCS 差异 → 验证更改 → 报告实际状态
❌ 信任代理报告

何时应用

在以下情况始终适用:

  • 任何成功/完成声明的变体
  • 任何满意表达
  • 关于工作状态的任何肯定陈述
  • 提交、创建 PR、任务完成
  • 移至下一个任务
  • 委托给代理

规则适用于:

  • 确切的措辞
  • 释义和同义词
  • 成功的暗示
  • 任何暗示完成/正确性的沟通

Individual skills in this repo

This repo contains 14 individual skills — each has its own dedicated page.

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

diagnosing-superpowers

Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

dispatching-parallel-agents

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

executing-plans

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

finishing-a-development-branch

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

receiving-code-review

Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation

requesting-code-review

Use when completing tasks, implementing major features, or before merging to verify work meets requirements

subagent-driven-development

Use when executing implementation plans with independent tasks in the current session

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code

using-git-worktrees

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback

using-superpowers

Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions

writing-plans

Use when you have a spec or requirements for a multi-step task, before touching code

writing-skills

Use when creating new skills, editing existing skills, or verifying skills work before deployment

相关技能