Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rohitg00/pro-workflow/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Quality gates are automated checkpoints that run linting, typechecking, and tests at strategic moments during development. They help catch issues early and maintain code quality throughout the session.Configuration
Quality gates are configured in your project’sconfig.json:
config.json
Enable automatic linting at quality gate checkpoints
Enable automatic type checking at quality gate checkpoints
Enable automatic test execution at quality gate checkpoints
Shell command to run linting
Shell command to run type checking
Shell command to run tests (typically only affected tests)
When Quality Gates Run
Quality gates trigger automatically at strategic checkpoints:Edit Count Thresholds
The system tracks edits and prompts for validation:| Checkpoint | Default Threshold | Action |
|---|---|---|
| First | 5 edits | Review checkpoint - suggest git diff --stat |
| Second | 10 edits | Run full quality gates |
| Repeat | Every 10 edits | Run quality gates again |
Thresholds are adaptive based on your correction history. If recent sessions have high correction rates, thresholds tighten automatically (e.g., 3/6/6 instead of 5/10/10).
Adaptive Thresholds
The quality gate script analyzes your recent sessions to determine optimal checkpoint frequency:corrections_count / edit_count across last 10 sessions.
Hook Integration
Quality gates work seamlessly with the hook system:PostEdit Hook
Runs after every file edit to track edit count and trigger checkpoints:PreCommit Hook
Runs validation before allowing commits to proceed:Wrap-Up Integration
Quality gates also run during wrap-up phase:config.json
Check for uncommitted changes and prompt for action
Run tests one final time before session ends
Update CLAUDE.md with learned patterns
Generate session summary with changes and decisions
Commands Configuration
Customize quality gate commands for your project’s tooling:ESLint with auto-fix
ESLint with auto-fix
TypeScript with strict mode
TypeScript with strict mode
Jest with coverage threshold
Jest with coverage threshold
Vitest for unit tests only
Vitest for unit tests only
Prettier format check
Prettier format check
Parallel execution (faster)
Parallel execution (faster)
Quality Gate Script
The reference implementation fromscripts/quality-gate.js:
Session Tracking
Quality gates integrate with session tracking to improve over time:Database schema
- Edit patterns: How many edits before issues appear
- Correction frequency: How often you need to fix Claude’s code
- Quality gate success rate: How often gates pass on first try
Manual Quality Gates
Run quality gates manually at any time:Disabling Quality Gates
Disable specific gates when not needed:config.json
config.json
Performance Optimization
Run Only Changed Tests
Cache-Friendly Commands
Parallel Execution
Troubleshooting
Quality gates not triggering
Quality gates not triggering
Cause: PostEdit hook not configuredFix: Add to
hooks.json:Commands failing with 'command not found'
Commands failing with 'command not found'
Cause: npm scripts not defined in
package.jsonFix: Add scripts:Thresholds not adapting
Thresholds not adapting
Cause: Session database not initializedFix: Check database configuration:
Gates running too frequently
Gates running too frequently
Cause: High correction rate from recent sessionsFix: This is intentional - the system detected issues. Improve code quality or manually override thresholds by modifying the script.
Best Practices
Fast Feedback
Keep quality gate commands fast (<10s) for quick feedback loops. Use
--changed and --related flags.Fail Early
Configure PreCommit hooks to block commits with quality issues. Better to catch errors before they enter git history.
Adapt to Project
Customize commands for your tech stack. Not all projects need all three gates.
Monitor Trends
Review correction rates periodically. Increasing rates indicate architectural or tooling issues.
Next Steps
Hooks System
Learn about the hook events that power quality gates
Model Preferences
Configure models for different task types
Wrap-Up Phase
Understand end-of-session quality verification