mirror of
https://github.com/sweetwisdom/everything-claude-code-zh.git
synced 2026-03-22 06:20:10 +00:00
docs: 完成所有文档的中文翻译并应用到项目
This commit is contained in:
@@ -1,39 +1,39 @@
|
||||
# Verification Loop Skill
|
||||
# 验证循环技能(Verification Loop Skill)
|
||||
|
||||
A comprehensive verification system for Claude Code sessions.
|
||||
一个用于 Claude Code 会话的全面验证系统。
|
||||
|
||||
## 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
|
||||
在以下场景调用此技能(Skill):
|
||||
- 完成功能开发或重大代码变更后
|
||||
- 创建 PR 之前
|
||||
- 当你想确保质量门禁(Quality Gates)通过时
|
||||
- 代码重构之后
|
||||
|
||||
## Verification Phases
|
||||
## 验证阶段(Verification Phases)
|
||||
|
||||
### Phase 1: Build Verification
|
||||
### 阶段 1:构建验证(Build Verification)
|
||||
```bash
|
||||
# Check if project builds
|
||||
# 检查项目是否可以构建
|
||||
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
|
||||
### 阶段 2:类型检查(Type Check)
|
||||
```bash
|
||||
# TypeScript projects
|
||||
# TypeScript 项目
|
||||
npx tsc --noEmit 2>&1 | head -30
|
||||
|
||||
# Python projects
|
||||
# Python 项目
|
||||
pyright . 2>&1 | head -30
|
||||
```
|
||||
|
||||
Report all type errors. Fix critical ones before continuing.
|
||||
报告所有类型错误。在继续之前修复关键错误。
|
||||
|
||||
### Phase 3: Lint Check
|
||||
### 阶段 3:Lint 检查(Lint Check)
|
||||
```bash
|
||||
# JavaScript/TypeScript
|
||||
npm run lint 2>&1 | head -30
|
||||
@@ -42,46 +42,46 @@ npm run lint 2>&1 | head -30
|
||||
ruff check . 2>&1 | head -30
|
||||
```
|
||||
|
||||
### Phase 4: Test Suite
|
||||
### 阶段 4:测试套件(Test Suite)
|
||||
```bash
|
||||
# Run tests with coverage
|
||||
# 运行带有覆盖率报告的测试
|
||||
npm run test -- --coverage 2>&1 | tail -50
|
||||
|
||||
# Check coverage threshold
|
||||
# Target: 80% minimum
|
||||
# 检查覆盖率阈值
|
||||
# 目标:最低 80%
|
||||
```
|
||||
|
||||
Report:
|
||||
- Total tests: X
|
||||
- Passed: X
|
||||
- Failed: X
|
||||
- Coverage: X%
|
||||
报告内容:
|
||||
- 总测试数:X
|
||||
- 通过:X
|
||||
- 失败:X
|
||||
- 覆盖率:X%
|
||||
|
||||
### Phase 5: Security Scan
|
||||
### 阶段 5:安全扫描(Security Scan)
|
||||
```bash
|
||||
# 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 console.log
|
||||
# 检查 console.log
|
||||
grep -rn "console.log" --include="*.ts" --include="*.tsx" src/ 2>/dev/null | head -10
|
||||
```
|
||||
|
||||
### Phase 6: Diff Review
|
||||
### 阶段 6:差异审查(Diff Review)
|
||||
```bash
|
||||
# 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
|
||||
## 输出格式(Output Format)
|
||||
|
||||
After running all phases, produce a verification report:
|
||||
运行完所有阶段后,生成一份验证报告:
|
||||
|
||||
```
|
||||
VERIFICATION REPORT
|
||||
@@ -101,20 +101,20 @@ Issues to Fix:
|
||||
2. ...
|
||||
```
|
||||
|
||||
## Continuous Mode
|
||||
## 持续模式(Continuous Mode)
|
||||
|
||||
For long sessions, run verification every 15 minutes or after major changes:
|
||||
对于长时间的会话(Session),每 15 分钟或在重大变更后运行一次验证:
|
||||
|
||||
```markdown
|
||||
Set a mental checkpoint:
|
||||
- After completing each function
|
||||
- After finishing a component
|
||||
- Before moving to next task
|
||||
设置心理检查点:
|
||||
- 完成每个函数后
|
||||
- 完成一个组件后
|
||||
- 在开始下一个任务之前
|
||||
|
||||
Run: /verify
|
||||
运行:/verify
|
||||
```
|
||||
|
||||
## Integration with Hooks
|
||||
## 与钩子(Hooks)集成
|
||||
|
||||
This skill complements PostToolUse hooks but provides deeper verification.
|
||||
Hooks catch issues immediately; this skill provides comprehensive review.
|
||||
此技能(Skill)是对 `PostToolUse` 钩子(Hooks)的补充,但提供了更深层次的验证。
|
||||
钩子可以立即发现问题;此技能则提供全面的审查。
|
||||
|
||||
Reference in New Issue
Block a user