Quality Gates API
The Quality Gates API provides configurable quality checks for your codebase, including type checking, linting, testing, and security audits.
Overview#
Quality gates are predefined sets of checks that run at different stages of development:
- pre-commit: Quick checks before committing code
- pre-push: Thorough checks before pushing to remote
- pre-deploy: Full audit before deployment
The system automatically detects available tools in your project and runs appropriate checks.
REST API Endpoints#
List Quality Gates#
Returns available quality gates.
Response:
Run Quality Gate#
Run a quality gate and get results.
Request Body:
Response:
Get Report#
Get a previously generated quality report.
Available Checks#
typecheck#
TypeScript type checking.
| Tool | Command | Detection |
|---|---|---|
| tsc | npx tsc --noEmit | tsconfig.json |
lint#
Code linting.
| Tool | Command | Detection |
|---|---|---|
| eslint | npx eslint . | eslint.config.js, .eslintrc.js, .eslintrc.json |
| biome | npx biome check . | biome.json |
format#
Code formatting.
| Tool | Command | Detection |
|---|---|---|
| prettier | npx prettier --check . | .prettierrc, .prettierrc.json, prettier.config.js |
| biome | npx biome format --check . | biome.json |
test#
Test execution.
| Tool | Command | Detection |
|---|---|---|
| jest | npm test | jest.config.js |
| vitest | npm test | vitest.config.ts |
| mocha | npm test | package.json:mocha |
| npm | npm test | package.json:scripts.test |
build#
Production build.
| Tool | Command | Detection |
|---|---|---|
| next | npm run build | next.config.js |
| vite | npm run build | vite.config.ts |
| npm | npm run build | package.json:scripts.build |
security#
Security audit.
| Tool | Command | Detection |
|---|---|---|
| npm | npm audit --audit-level=high | package-lock.json |
| yarn | yarn audit --level high | yarn.lock |
| pnpm | pnpm audit --audit-level high | pnpm-lock.yaml |
Default Gates#
pre-commit#
Quick checks before committing.
Checks: typecheck, lint, format
pre-push#
Thorough checks before pushing.
Checks: typecheck, lint, test, build
pre-deploy#
Full audit before deployment.
Checks: typecheck, lint, test, build, security
MCP Tool#
The bootspring_quality MCP tool provides quality gate functionality.
Tool Definition#
Example#
CLI Commands#
Error Handling#
Unknown Gate#
Check Failure#
When a check fails, the result includes the check ID, name, status (fail), error message, and exit code.
Tool Not Available#
When a check's tool is not detected in the project, the check is skipped with status skip and message "Tool not available".
Best Practices#
- Start with pre-commit: Run quick checks before every commit
- Use pre-push for CI: Mirror your CI checks in pre-push
- Skip thoughtfully: Only skip checks when necessary
- Use strict mode in CI: Fail fast on any issue
- Run pre-deploy before releases: Catch security issues early
- Customize for your needs: Create custom gates for your workflow