跳到正文
Skillpedia
测试6.0k · #14511

verification-loop

它能做什么

这项技能在代码改动分享之前运行一套质量检查。适合希望在拉取请求前发现构建、类型、代码检查、测试和安全问题的开发者。

适用场景

  • ✓当你完成了一项功能或较大的代码改动,希望对其进行检查时。
  • ✓当你准备发起拉取请求时。
  • ✓当你重构了代码,需要确认没有任何东西被破坏的时候。

技能链接

https://github.com/Galaxy-Dawn/claude-scholar/blob/main/skills/verification-loop/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/Galaxy-Dawn/claude-scholar/blob/main/skills/verification-loop/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“在我发起拉取请求之前,请对我的改动运行所有质量检查。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会为你的项目选择合适的命令,依次运行构建、类型检查、代码检查和测试,汇报结果;如果构建失败,会先停下来修复。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Verification Loop Skill

A comprehensive verification system for Claude Code sessions.

When to Use

Invoke this skill:

  • After completing a feature or significant code change
  • Before creating a PR
  • When you want to ensure quality gates pass
  • After refactoring

Verification Phases

Choose the commands adaptively for the current project instead of running every example blindly. Use the stack-appropriate command from references/STACK-DETECTION.md when the repo does not match the default examples below.

Phase 1: Build Verification

# Python projects (uv)
uv build 2>&1 | tail -20
# OR
python -m build 2>&1 | tail -20

# Node.js projects
npm run build 2>&1 | tail -20
# OR
pnpm build 2>&1 | tail -20

If build fails, STOP and fix before continuing.

Phase 2: Type Check

# TypeScript projects
npx tsc --noEmit 2>&1 | head -30

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

Report all type errors. Fix critical ones before continuing.

Phase 3: Lint Check

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

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

Phase 4: Test Suite

# Python projects
pytest --cov=src --cov-report=term-missing 2>&1 | tail -50

# Node.js projects
npm run test -- --coverage 2>&1 | tail -50

Report:

  • Total tests: X
  • Passed: X
  • Failed: X
  • Coverage: X%

Phase 5: Security Scan

# Python: Check for secrets
grep -rn "sk-" --include="*.py" . 2>/dev/null | head -10
grep -rn "api_key" --include="*.py" . 2>/dev/null | head -10
pip-audit

# Node.js: Check for secrets
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

# Check for debug statements
grep -rn "print(" --include="*.py" src/ 2>/dev/null | head -10
grep -rn "console.log" --include="*.ts" --include="*.tsx" src/ 2>/dev/null | head -10

Phase 6: Diff Review

# Show what changed
git diff --stat
git diff HEAD~1 --name-only

Review each changed file for:

  • Unintended changes
  • Missing error handling
  • Potential edge cases

Output Format

After running all phases, produce a verification report:

VERIFICATION REPORT
==================

Build:     [PASS/FAIL]
Types:     [PASS/FAIL] (X errors)
Lint:      [PASS/FAIL] (X warnings)
Tests:     [PASS/FAIL] (X/Y passed, Z% coverage)
Security:  [PASS/FAIL] (X issues)
Diff:      [X files changed]

Overall:   [READY/NOT READY] for PR

Issues to Fix:
1. ...
2. ...

Continuous Mode

For long sessions, run verification every 15 minutes or after major changes:

Set a mental checkpoint:
- After completing each function
- After finishing a component
- Before moving to next task

Run: /verify

Integration with Hooks

This skill complements PostToolUse hooks but provides deeper verification. Hooks catch issues immediately; this skill provides comprehensive review.

Reference Files

Load only what is needed:

  • references/STACK-DETECTION.md - how to choose the right verification command set for the current repo
  • references/REPORT-TEMPLATE.md - report structure for final verification output
  • examples/example-verification-report.md - example final report
常见问题

每个项目都运行同样的命令吗?

不会。它会选择符合项目技术栈的命令,例如 Python 或 Node.js 的命令。

如果构建失败会怎样?

智能体会先停下来修复构建,然后再继续。

它包括安全扫描吗?

包括。其中一个阶段是安全扫描,同时还会审阅代码差异。

详情

作者的原始描述

This skill should be used when the user asks to "verify code", "run verification", "check quality", "validate changes", or before creating a PR. Provides comprehensive verification including build, type check, lint, tests, security scan, and diff review.

repo: Galaxy-Dawn/claude-scholar

热度

GitHub 星标
6.0k
排名
#14511
许可证
MIT
更新时间
2026/10/19

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能