Quality Gates Reference
Complete reference for Bootspring quality gates, checks, and configuration
Quality gates are automated checks that ensure code meets standards before committing, pushing, or deploying. This reference covers all available gates, checks, and configuration options.
Overview
Quality gates run at different stages of development:
| Gate | When | Speed | Thoroughness |
|---|---|---|---|
pre-commit | Before every commit | Fast | Basic |
pre-push | Before pushing to remote | Medium | Moderate |
pre-deploy | Before deployment | Slow | Comprehensive |
full | On demand | Slowest | Complete |
Gates
pre-commit
Fast checks that run on every commit. Designed to catch common issues quickly.
Checks included:
| Check | Description | Auto-fixable |
|---|---|---|
| lint | ESLint code analysis | Yes |
| format | Prettier formatting | Yes |
| types | TypeScript type checking | No |
| imports | Import sorting and organization | Yes |
| naming | File naming conventions | No |
Typical duration: 5-15 seconds
pre-push
More thorough checks before pushing to a remote branch.
Checks included:
| Check | Description | Auto-fixable |
|---|---|---|
| All pre-commit checks | - | - |
| test | Unit tests | No |
| coverage | Test coverage threshold | No |
| build | Build verification | No |
| bundle-size | Bundle size check | No |
Typical duration: 30-120 seconds
pre-deploy
Comprehensive checks before deployment to production.
Checks included:
| Check | Description | Auto-fixable |
|---|---|---|
| All pre-push checks | - | - |
| integration | Integration tests | No |
| e2e | End-to-end tests | No |
| security | Security vulnerability scan | No |
| performance | Performance audit | No |
| accessibility | Accessibility check | No |
Typical duration: 2-10 minutes
full
All available checks. Use for comprehensive audits.
Checks included:
- All pre-deploy checks
- Additional deep analysis
- Historical trend comparison
Available Checks
lint
Runs ESLint to identify code quality issues.
Configuration:
Common issues detected:
- Unused variables
- Missing dependencies in useEffect
- Accessibility issues in JSX
- Import order problems
format
Checks code formatting with Prettier.
Configuration:
types
Runs TypeScript compiler to check for type errors.
Configuration:
test
Runs the test suite.
Configuration:
coverage
Checks test coverage meets thresholds.
Configuration:
build
Verifies the project builds successfully.
Configuration:
bundle-size
Checks bundle size against limits.
Configuration:
security
Scans for security vulnerabilities.
Configuration:
Checks performed:
- npm audit for dependency vulnerabilities
- Secret detection in code
- Hardcoded credentials
- Insecure patterns
performance
Audits performance metrics.
Configuration:
accessibility
Checks accessibility compliance.
Configuration:
Configuration
Global Configuration
Per-Gate Configuration
CLI Usage
Basic Commands
Options
Git Hooks Integration
Using Husky
Using lint-staged
CI/CD Integration
GitHub Actions
Vercel
Custom Checks
Adding Custom Checks
Output Formats
Default Output
Quality Gate: pre-commit
========================
[PASS] lint (1.2s)
[PASS] format (0.4s) - Fixed 3 files
[PASS] types (2.1s)
Summary
-------
Total: 3 checks
Passed: 3
Failed: 0
Duration: 3.7s
Result: PASSED
JSON Output
Troubleshooting
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| Checks too slow | Too many files | Use exclude patterns |
| Type errors in dependencies | Missing types | Install @types/* packages |
| Coverage threshold not met | Insufficient tests | Add more tests or lower threshold |
| Security audit fails | Vulnerable dependencies | Run npm audit fix |
Debugging
Best Practices
Gate Selection
| Stage | Recommended Gate | Rationale |
|---|---|---|
| Every commit | pre-commit | Fast feedback |
| Before PR | pre-push | Thorough validation |
| Before deploy | pre-deploy | Production safety |
Threshold Guidelines
| Metric | Recommended | Minimum |
|---|---|---|
| Test coverage | 80% | 60% |
| Lighthouse performance | 90 | 70 |
| Bundle size | <500kb | <1MB |
| LCP | <2.5s | <4s |
Team Conventions
- Never skip gates - Use
--fixinstead of bypassing - Start strict, relax if needed - Easier than tightening later
- Document exceptions - If you lower a threshold, explain why
- Review regularly - Adjust thresholds as the project matures
Related
- bootspring_quality MCP Tool - MCP tool reference
- CLI Reference - Full CLI documentation
- Best Practices - Development guidelines