Communitygithub.com

验证循环技能

为 Claude Code 会话提供全面的验证系统。在需要验证 Claude Code 会话时使用。

验证循环技能 是什么?

验证循环技能是一个专为 Claude Code 会话设计的综合验证系统。它涵盖构建验证、类型检查、代码检查、测试套件、安全扫描和差异审查等六个阶段,确保代码质量在所有关键维度上得到保障。该技能适用于完成功能、重构后或创建 PR 前的场景,并支持 npm 和 pnpm 构建系统、TypeScript 和 Python 项目。通过生成结构化的验证报告,它帮助开发者快速判断是否准备好提交 PR。此外,它还可与 PostToolUse 钩子配合使用,以提供更深层次的验证,而不仅仅是即时代码检查。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/verification-loop

在你喜欢的 AI 中提问

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

文档

验证循环技能 是做什么的?

适用于 Claude Code 会话的全面验证系统。

何时使用

在以下情况调用此技能:

  • 完成一个功能或重要的代码更改后
  • 在创建 PR 之前
  • 当您希望确保质量关口通过时
  • 在重构之后

验证阶段

阶段 1:构建验证

# 检查项目是否能构建
npm run build 2>&1 | tail -20
# 或者
pnpm build 2>&1 | tail -20

如果构建失败,请停止并先修复问题。

阶段 2:类型检查

set -o pipefail
# TypeScript 项目
npx --no-install tsc --noEmit 2>&1 | head -30

# Python 项目
pyright . 2>&1 | head -30

报告所有类型错误。在继续之前修复关键错误。

阶段 3:代码检查

# JavaScript/TypeScript
npm run lint 2>&1 | head -30

# Python
ruff check . 2>&1 | head -30

阶段 4:测试套件

# 运行测试并生成覆盖率
npm run test -- --coverage 2>&1 | tail -50

# 检查覆盖率阈值
# 目标:最低 80%

报告:

  • 总测试数:X
  • 通过:X
  • 失败:X
  • 覆盖率:X%

阶段 5:安全扫描

# 检查密钥
find . -name '*.ts' -o -name '*.js' 2>/dev/null | xargs grep -rn "sk-" --include='*.ts' --include='*.js' 2>/dev/null | head -10
find . -name '*.ts' -o -name '*.js' 2>/dev/null | xargs grep -rn "api_key" --include='*.ts' --include='*.js' 2>/dev/null | head -10

# 检查 console.log
find src/ -name '*.ts' -o -name '*.tsx' 2>/dev/null | xargs grep -rn "console.log" --include='*.ts' --include='*.tsx' 2>/dev/null | head -10

阶段 6:差异审查

# 显示变更内容
git diff --stat
git diff HEAD~1 --name-only

审查每个变更的文件:

  • 无意的更改
  • 缺少错误处理
  • 潜在的边界情况

输出格式

运行所有阶段后,生成验证报告:

验证报告
==================

构建:     [通过/失败]
类型:     [通过/失败](X 个错误)
代码检查: [通过/失败](X 个警告)
测试:     [通过/失败](X/Y 通过,Z% 覆盖率)
安全:     [通过/失败](X 个问题)
差异:     [X 个文件变更]

整体:     [准备好/未准备好] 提交 PR

需要修复的问题:
1. ...
2. ...

持续模式

对于长时间会话,每 15 分钟或在重大更改后运行验证:

设置心理检查点:
- 完成每个函数后
- 完成每个组件后
- 在移动到下一个任务之前

运行:/verify

与钩子的集成

此技能与 PostToolUse 钩子相辅相成,但提供更深入的验证。 钩子可即时捕获问题;此技能提供全面的审查。

Individual skills in this repo

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

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相关技能