code-quality-gate
Enforces automated quality checks before every deploy. Prevents production failures through a 5-stage Quality Gate System (Pre-Commit, PR-Check, Preview, E2E, Production). Activate on code changes, deployments, PR reviews, build failures.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Code Quality Gate
This skill prevents production failures through a 5-stage Quality Gate System.
The 5 Quality Gates
- Pre-Commit (local): TypeScript, Lint, Format - blocks commit on errors
- PR-Check (GitHub Actions): Unit Tests, Build - blocks merge on errors
- Preview Deploy: Vercel/Netlify Preview URL for visual review
- E2E Tests: Playwright against Preview, Lighthouse performance audit
- Production Deploy: Only when ALL gates pass
Critical Rules
-
CRITICAL: NEVER use
continue-on-error: truefor TypeScript checks in GitHub Actions! - Husky Setup:
npm install -D husky lint-staged && npx husky init - Rollback:
vercel rollback
Example: Pre-Commit Hook (.husky/pre-commit)
#!/bin/sh
npx lint-staged
npx tsc --noEmit
Example: lint-staged.config.js
module.exports = {
'*.{ts,tsx}': ['eslint --fix', 'prettier --write'],
'*.{json,md}': ['prettier --write'],
};
Example: GitHub Actions Workflow
name: Quality Gate
on: [push, pull_request]
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
# Gate 1: TypeScript (NEVER skip!)
- name: TypeScript Check
run: npx tsc --noEmit
# Gate 2: Linting
- name: ESLint
run: npm run lint
# Gate 3: Unit Tests
- name: Unit Tests
run: npm run test
# Gate 4: Build
- name: Build
run: npm run build
When to Activate
- Code changes that touch production code
- Deployment requests
- PR reviews
- Build failures (for debugging)
Real-World Impact
At fabrikIQ.com, this quality gate system caught:
- 2 TypeScript errors that would have caused runtime crashes
- 1 missing environment variable in the deploy
- 3 performance regressions before they hit production
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-28
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!