verification-loop

pure-maple's avatarfrom pure-maple

验证闭环提醒。当代码修改完成、Story完成、准备PR时自动激活。确保每次变更都经过验证,效率提升2-3倍。

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 7, 2026⬇️1downloads

When & Why to Use This Skill

The Verification Loop Claude skill establishes a robust, automated feedback mechanism for AI-driven software development. By implementing a multi-tiered validation strategy—ranging from immediate linting to comprehensive E2E testing—it ensures that every code modification, feature completion, and pull request is rigorously verified, significantly reducing regressions and improving output quality by 2-3x.

Use Cases

  • Immediate Code Validation: Automatically trigger linting and type-checking (e.g., pnpm lint, mypy) immediately after code modifications to catch syntax and type errors in real-time.
  • Task-Level Testing: Execute unit and integration test suites upon the completion of a specific user story or subtask to ensure functional correctness before proceeding.
  • Pre-PR Quality Assurance: Conduct a final delivery check using independent reviewer agents and E2E frameworks like Playwright to guarantee the code is production-ready and meets all requirements.
  • Automated Failure Recovery: Utilize the structured failure handling loop to analyze root causes and automatically attempt fixes when verification steps fail.
nameverification-loop
description验证闭环提醒。当代码修改完成、Story完成、准备PR时自动激活。确保每次变更都经过验证,效率提升2-3倍。
allowed-toolsBash, Read, Grep

验证闭环

核心理念

"没有验证闭环,AI输出永远不可靠。" —— Boris Cherny (Claude Code之父)

拥有反馈回路后,最终产出质量可提升2-3倍。

验证层级

Level 1: 即时验证(每次代码变更后)

# TypeScript项目
pnpm lint
pnpm typecheck

# Python项目
ruff check .
mypy .

触发时机:PostToolUse Hook自动执行

Level 2: 阶段验证(Story/任务完成后)

# 单元测试
pnpm test

# 集成测试
pnpm test:integration

触发方式:

  • 手动调用 /mmo:verify
  • 或让Claude使用后台agent验证

Level 3: 交付验证(PR前)

  • 使用 reviewer agent(独立SESSION,客观视角)
  • 运行E2E测试
  • 检查CI状态
# E2E测试
pnpm test:e2e

# 或使用Playwright
npx playwright test

验证失败处理

┌─────────────────────────────────────┐
│          验证失败?                 │
└─────────────────────────────────────┘
                │
                ▼
┌─────────────────────────────────────┐
│  1. 不继续下一阶段                  │
│  2. 记录失败原因                    │
│  3. 分析根因                        │
│  4. 修复问题                        │
│  5. 重新验证                        │
└─────────────────────────────────────┘
                │
                ▼
        ┌──────┴──────┐
        │   通过?     │
        └──────┬──────┘
               │
        Yes ───┴─── No(循环)
               │
               ▼
        继续下一阶段

与BMAD集成

BMAD工作流 验证检查点
dev-story 每个subtask完成后
code-review PR前必须通过
sprint-status 检查所有Story验证状态

Stop Hook提醒

会话结束时自动提醒:

"✅ 会话结束。建议运行 /mmo:verify 进行验证。"