返回 Skill 列表
extension
分类: 开发与工程无需 API Key

rulebook-quality-gates

自动化代码提交的质量检查和强制执行。在验证代码质量、运行预提交检查、确保测试覆盖率或在提交和推送前强制执行编码标准时使用。

person作者: jakexiaohubgithub

Quality Gates Enforcement

Pre-Commit Checklist

MUST run these checks before every commit:

npm run type-check    # Type check
npm run lint          # Lint (0 warnings)
npm run format        # Format check
npm test              # All tests (100% pass)
npm run build         # Build verification
npm run test:coverage # Coverage check (95%+)

If ANY fail, FIX before committing.

Quality Thresholds

| Check | Requirement | |-------|-------------| | Type Check | Zero errors | | Lint | Zero warnings | | Tests | 100% pass rate | | Coverage | 95%+ | | Build | Must succeed |

Git Hooks

Rulebook can install automated Git hooks:

rulebook init  # Prompts to install hooks

Pre-commit Hook

  • Format check
  • Lint check
  • Type check

Pre-push Hook

  • Build verification
  • All tests
  • Coverage threshold check

Fixing Common Issues

npm run type-check  # See type errors
npm run lint        # See lint warnings
npm run lint:fix    # Auto-fix lint issues
npm test            # Run all tests
npm run test:coverage  # See coverage report