关于 verify-changes
verify-changes 是面向开发者和编码 Agent 的技能,通过实际执行而非检查或推测来验证代码变更。它按变更类型选择验证方式,并指导汇报验证证据。
主要功能
- 01识别变更文件与预期行为
- 02按变更类型选择检查方式
- 03执行构建、测试与运行检查
- 04汇报验证证据
适用场景
- 01复现并确认缺陷修复
- 02检查新功能的输出
- 03重构后运行现有测试
- 04验证 API、界面或配置变更
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ vudovn/ ag-kit --skill verify-changes安装后在 Claude Code 中输入/verify-changes确认已加载。
详细介绍
验证更改 — 证明代码可用
“代码存在” ≠ “代码可用”。此技能可确保通过执行来验证更改。
核心原则
❌ Verification by inspection: "I can see the function exists, it should work"
❌ Verification by assumption: "The types check out, so it's correct"
✅ Verification by execution: "I ran it, here's the output, it works because [evidence]"
验证流程
步骤 1:确认更改内容
- Which files were modified?
- What behavior should be different now?
- What was the original bug/requirement?
步骤 2:确定验证方法
| 更改类型 | 验证方法 |
|---|---|
| Bug 修复 | 重现原始 Bug 场景 → 确认问题不再出现 |
| 新功能 | 运行该功能 → 确认输出符合预期 |
| 重构 | 运行现有测试 → 确认没有破坏任何内容 |
| API 更改 | 调用端点 → 确认响应结构 |
| UI 更改 | 渲染组件 → 确认视觉输出 |
| 配置更改 | 加载配置 → 确认配置值已生效 |
| 构建/基础设施 | 运行构建命令 → 确认构建成功 |
步骤 3:执行验证
# For Node.js projects
npm run build # Does it compile?
npm run test # Do tests pass?
npm run dev # Does it start?
# For specific files
node -e "require('./path/to/module'); console.log('✅ Loads correctly')"
# For API endpoints
curl http://localhost:3000/api/endpoint
# For scripts
python script.py --test
步骤 4:报告证据
## Verification Report
### What was changed
- [File list and summary]
### How it was verified
- [Exact commands run]
### Evidence
- Build: ✅ Compiled without errors
- Tests: ✅ 42/42 passing
- Runtime: ✅ Server starts, endpoint returns expected JSON
- Edge case: ✅ Empty input handled correctly
### Not yet verified
- [Anything that couldn't be tested automatically]
按项目类型划分的验证清单
Web 应用
-
npm run build— 编译无错误 -
npm run lint— 没有代码检查错误 -
npm run test— 所有测试均通过 - 开发服务器成功启动
- 更改后的页面渲染正确
- 浏览器控制台没有错误
API / 后端
- 服务器启动时没有错误
- 更改后的端点响应正确
- 错误情况返回适当的状态码
- 数据库查询成功执行
CLI / 脚本
- 脚本运行时没有错误
- 预期输出与实际输出一致
- 错误处理正常(测试错误输入)
- 帮助/用法文本正确
反模式
| 反模式 | 问题所在 | 修正方法 |
|---|---|---|
| “应该能用” | 没有证据 | 运行代码并展示输出 |
| 只检查正常情况 | Bug 会藏在边界情况中 | 也要测试错误路径 |
| 只验证是否编译通过 | 编译通过 ≠ 正确 | 测试运行时行为 |
| 跳过“微不足道”的更改的验证 | 微小更改也会导致实际 Bug | 验证所有更改 |
与其他技能集成
| 使用之后 | 使用以下方式验证 |
|---|---|
frontend-design → UI 更改 | 在浏览器中渲染并检查控制台 |
backend-specialist → API 更改 | 使用 curl 调用端点并检查响应 |
database-design → 架构更改 | 运行迁移并查询数据 |
testing-patterns → 新增测试 | 运行测试套件并检查覆盖率 |
评论
支持 Markdown