一键导入
quality-gates
Pre-commit quality validation procedures. Use when validating code quality before committing or in CI/CD.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Pre-commit quality validation procedures. Use when validating code quality before committing or in CI/CD.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | quality-gates |
| description | Pre-commit quality validation procedures. Use when validating code quality before committing or in CI/CD. |
Purpose: Pre-commit quality validation procedures (type-check, lint, todos, branch guard) Target: Coder Agent, pre-commit hooks, CI/CD pipelines
# Type check validation
npm run type-check # or: tsc --noEmit
# Lint validation
npm run lint # or: eslint . --ext .ts,.tsx
# Todo validation
/03_close # Validates all SCs complete before closing plan
# Branch guard (Git native)
git config --global receive.denyDeleteCurrent warn
Pre-commit hooks enforce quality standards before code enters the repository.
Skills as procedures, hooks as automation:
Why Opt-In Hooks?
Command: tsc --noEmit or npm run type-check
Output: Success (exit 0) | Type errors with file/line (exit 1)
Example Failure: src/auth/login.ts:15:11 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
Command: npx eslint . --ext .ts,.tsx or npm run lint
Output: Success (exit 0) | Lint errors with file/line/rule (exit 1)
Example Failure: src/utils/format.ts:42:5 error Unused vars no-unused-vars
Command: /03_close
Steps: Read plan → Check all SCs [x] → Verify evidence → Block if incomplete
Example Block: ⚠️ Incomplete SCs detected: - [ ] SC-3: Add unit tests (evidence missing)
Purpose: Prevent accidental commits to protected branches
Git Config: git config --global receive.denyDeleteCurrent warn
Pre-commit Hook: Check if CURRENT_BRANCH in main master develop → exit 1 if protected
| Gate | Command | Exit 0 | Exit 1 |
|---|---|---|---|
| Type Check | tsc --noEmit | No type errors | Type errors found |
| Lint | npm run lint | No lint errors | Lint violations found |
| Todos | /03_close | All SCs complete | Incomplete SCs |
| Branch Guard | Pre-commit hook | Safe to commit | Protected branch |
Note: Pre-commit hooks were removed in v4.4.14 as part of skill-based architecture migration. Use the docs-verify skill for documentation validation instead.
# .github/workflows/quality.yml
jobs:
quality:
steps:
- name: Type check
run: npm run type-check
- name: Lint
run: npm run lint
- name: Test
run: npm test
Causes: Missing types npm install --save-dev @types/node | Incorrect tsconfig | Third-party types
Debug: tsc --noEmit --listFiles | tsc --noEmit src/problem.ts
Solution: Update .eslintrc.js rules or // eslint-disable-next-line
Auto-fix: npx eslint . --fix
Internal: @.claude/skills/quality-gates/REFERENCE.md - Complete hook scripts, CI/CD integration, troubleshooting | @.claude/skills/ralph-loop/SKILL.md - Quality gates in Ralph Loop
External: Husky | pre-commit
Coordinate specialized teammates in Agent Teams for execution, review, and planning. Delegate mode mandatory with TaskCompleted/TeammateIdle hooks.
Plan completion workflow - archive plan, verify todos, create git commit, push with retry. Use for finalizing completed plans.
Plan confirmation workflow - extract plan from conversation, create file, auto-review with Interactive Recovery. Use for confirming plans after /00_plan.
Plan execution workflow - parallel SC implementation, worktree mode, verification patterns, GPT delegation. Use for executing plans with TDD + Ralph Loop.
Use when blocked, stuck, or needing fresh perspective. Consults GPT experts via Codex CLI with graceful fallback.
Coordinate independent teammates concurrently in Agent Teams for 50-70% speedup. Launch multiple teammates simultaneously.