Communitygithub.com

驗證迴圈

Claude Code 會話的全面驗證系統。用於驗證 Claude Code 會話。

驗證迴圈 是什麼?

此技能提供了一個結構化的驗證流程,專為 Claude Code 會話設計,有助於確保在提交 PR 或繼續開發之前,程式碼符合品質標準。它涵蓋了六個階段:建置驗證、型別檢查、程式碼檢查、測試套件執行、安全性掃描以及差異審查。使用者可以根據專案類型(JavaScript/TypeScript 或 Python)執行對應的指令。最終會產出一個標準化的驗證報告,總結每個階段的通過/失敗狀態,並列出待解決的問題。此技能也支援持續模式,建議在長時間會話中定期執行,或作為開發過程中的心智檢查點。

相容平台✓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:安全性掃描

# 檢查機密資訊
grep -rn "sk-" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
grep -rn "api_key" --include="*.ts" --include="*.js" . 2>/dev/null | head -10

# 檢查 console.log
grep -rn "console.log" --include="*.ts" --include="*.tsx" src/ 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.

相關技能