feature-validate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feature Validate Skill

Feature Validate技能

Purpose

目的

Run comprehensive quality gates on the implemented feature. Phase 4 of the feature lifecycle (design → plan → implement → validate → release).
对已实现的功能运行全面的质量门验证。属于功能生命周期的第4阶段(设计→规划→实现→验证→发布)。

Operator Context

操作上下文

Hardcoded Behaviors (Always Apply)

硬编码行为(始终生效)

  • CLAUDE.md Compliance: Read and follow repository CLAUDE.md
  • Implementation Required: CANNOT validate without implementation artifacts
  • State Management via Script: All state operations through
    python3 ~/.claude/scripts/feature-state.py
  • Show Full Output: NEVER summarize test results. Show actual command output.
  • All Gates Must Pass: Cannot proceed to release with any gate failing
  • Existing Quality Gate Integration: Use our existing quality gate skills (go-pr-quality-gate, python-quality-gate, universal-quality-gate)
  • 遵循CLAUDE.md规范:读取并遵循仓库中的CLAUDE.md文件
  • 必须有实现产物:无实现产物则无法进行验证
  • 通过脚本管理状态:所有状态操作均通过
    python3 ~/.claude/scripts/feature-state.py
    执行
  • 显示完整输出:绝不要总结测试结果,需展示命令的实际输出
  • 所有质量门必须通过:若有任何质量门未通过,则无法进入发布阶段
  • 集成现有质量门技能:使用我们已有的质量门技能(go-pr-quality-gate、python-quality-gate、universal-quality-gate)

Default Behaviors (ON unless disabled)

默认行为(除非禁用否则开启)

  • Auto-detect Language: Detect project language and run appropriate quality gate
  • Context Loading: Read L0, L1, and implementation artifact at prime
  • Regression Check: Verify existing tests still pass
  • 自动检测语言:检测项目语言并运行对应的质量门
  • 加载上下文:在初始化阶段读取L0、L1及实现产物
  • 回归检查:验证现有测试仍能通过

Optional Behaviors (OFF unless enabled)

可选行为(除非启用否则关闭)

  • Security scan: Run security-focused review agent
  • Performance check: Run benchmarks against baseline
  • 安全扫描:运行专注于安全的审查Agent
  • 性能检查:基于基准线运行基准测试

What This Skill CAN Do

本技能可执行的操作

  • Run language-specific quality gates (tests, lint, type checks)
  • Verify all planned files were created/modified
  • Check for regressions
  • Produce validation report
  • 运行语言专属的质量门(测试、Lint检查、类型检查)
  • 验证所有规划的文件已创建/修改
  • 检查回归问题
  • 生成验证报告

What This Skill CANNOT Do

本技能不可执行的操作

  • Fix failing tests (route back to feature-implement)
  • Skip validation gates
  • Approve with failures
  • 修复失败的测试(需转回/feature-implement处理)
  • 跳过验证门
  • 存在失败时仍批准通过

Instructions

操作步骤

Phase 0: PRIME

阶段0:初始化(PRIME)

  1. Verify feature state is
    validate
    and
    implement
    is completed.
  2. Load implementation artifact from
    .feature/state/implement/
    .
  3. Load L1 validate context.
Gate: Implementation artifact loaded. Proceed.
  1. 验证功能状态为
    validate
    implement
    阶段已完成。
  2. .feature/state/implement/
    加载实现产物。
  3. 加载L1验证上下文。
门限:已加载实现产物。继续执行。

Phase 1: EXECUTE (Quality Gates)

阶段1:执行(质量门)

Step 1: Language Detection
Detect project language(s) from file extensions, build files, and implementation artifact.
Step 2: Run Quality Gates
For each detected language, run the appropriate quality gate:
LanguageQuality GateCommand
Gogo-pr-quality-gate
make check
or
go test ./... && go vet ./...
Pythonpython-quality-gate
ruff check && pytest && mypy
TypeScriptuniversal-quality-gate
npm run typecheck && npm run lint && npm test
Otheruniversal-quality-gateDetect and run project-specific checks
Step 3: Regression Check
Run full test suite and compare against pre-implementation baseline:
  • New test failures = regression
  • Missing tests for new code = coverage gap
Step 4: Custom Gates
If the design document specified custom validation criteria, check those too.
Gate: All quality gates pass. Proceed.
步骤1:语言检测
从文件扩展名、构建文件及实现产物中检测项目语言。
步骤2:运行质量门
针对每种检测到的语言,运行对应的质量门:
语言质量门命令
Gogo-pr-quality-gate
make check
go test ./... && go vet ./...
Pythonpython-quality-gate
ruff check && pytest && mypy
TypeScriptuniversal-quality-gate
npm run typecheck && npm run lint && npm test
其他universal-quality-gate检测并运行项目专属的检查
步骤3:回归检查
运行完整测试套件并与实现前的基准线对比:
  • 新出现的测试失败=回归问题
  • 新代码缺少测试=覆盖率缺口
步骤4:自定义门限
若设计文档中指定了自定义验证标准,也需进行检查。
门限:所有质量门均通过。继续执行。

Phase 2: VALIDATE (Report)

阶段2:验证(生成报告)

Produce validation report:
markdown
undefined
生成验证报告:
markdown
undefined

Validation Report: [Feature Name]

验证报告: [功能名称]

Quality Gates

质量门

  • Tests: PASS/FAIL (X/Y passed)
  • Lint: PASS/FAIL (N issues)
  • Type Check: PASS/FAIL
  • Regression: PASS/FAIL
  • 测试: 通过/失败 (X/Y通过)
  • Lint: 通过/失败 (N个问题)
  • 类型检查: 通过/失败
  • 回归检查: 通过/失败

Coverage

覆盖率

  • New files: X
  • Modified files: Y
  • Test coverage: Z%
  • 新增文件: X
  • 修改文件: Y
  • 测试覆盖率: Z%

Issues Found

发现的问题

Verdict: PASS / NEEDS_FIXES / BLOCK

结论: 通过 / 需要修复 / 阻塞


If `NEEDS_FIXES`: suggest running `/feature-implement` with specific fix tasks.
If `BLOCK`: explain blocking issues.

**Gate**: Report produced. Proceed to Checkpoint.

若结论为`NEEDS_FIXES`:建议运行`/feature-implement`并附带具体修复任务。
若结论为`BLOCK`:说明阻塞问题的详情。

**门限**:已生成报告。进入检查点阶段。

Phase 3: CHECKPOINT

阶段3:检查点

  1. Save validation artifact:
    bash
    echo "VALIDATION_REPORT" | python3 ~/.claude/scripts/feature-state.py checkpoint FEATURE validate
  2. Record learnings — if this phase produced non-obvious insights, record them:
    bash
    python3 ~/.claude/scripts/learning-db.py record TOPIC KEY "VALUE" --category design
  3. If validation passed, advance:
    bash
    python3 ~/.claude/scripts/feature-state.py advance FEATURE
  4. Suggest next step:
    Validation passed. Run /feature-release to merge and release.
  1. 保存验证产物:
    bash
    echo "VALIDATION_REPORT" | python3 ~/.claude/scripts/feature-state.py checkpoint FEATURE validate
  2. 记录经验 — 若本阶段产生了非显而易见的洞察,需进行记录:
    bash
    python3 ~/.claude/scripts/learning-db.py record TOPIC KEY "VALUE" --category design
  3. 若验证通过,推进阶段:
    bash
    python3 ~/.claude/scripts/feature-state.py advance FEATURE
  4. 建议下一步操作:
    验证已通过。运行/feature-release进行合并与发布。

Error Handling

错误处理

ErrorCauseSolution
Tests failImplementation bugsRoute back to /feature-implement with failure details
No test framework detectedProject setup incompleteReport gap, suggest setup
Lint failuresStyle issuesAuto-fix if trivial, otherwise route back
错误原因解决方案
测试失败实现存在Bug转回/feature-implement并提供失败详情
未检测到测试框架项目设置不完整报告缺口,建议完成设置
Lint检查失败代码风格问题若为小问题则自动修复,否则转回处理

References

参考资料

  • Verification Checklist
  • Retro Loop
  • State Conventions
  • 验证清单
  • 回顾循环
  • 状态约定