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

Loading code block...

Returns available quality gates.

Response:

Loading code block...

Run Quality Gate

Loading code block...

Run a quality gate and get results.

Request Body:

Loading code block...

Response:

Loading code block...

Get Report

Loading code block...

Get a previously generated quality report.

Available Checks

typecheck

TypeScript type checking.

ToolCommandDetection
tscnpx tsc --noEmittsconfig.json

lint

Code linting.

ToolCommandDetection
eslintnpx eslint .eslint.config.js, .eslintrc.js, .eslintrc.json
biomenpx biome check .biome.json

format

Code formatting.

ToolCommandDetection
prettiernpx prettier --check ..prettierrc, .prettierrc.json, prettier.config.js
biomenpx biome format --check .biome.json

test

Test execution.

ToolCommandDetection
jestnpm testjest.config.js
vitestnpm testvitest.config.ts
mochanpm testpackage.json:mocha
npmnpm testpackage.json:scripts.test

build

Production build.

ToolCommandDetection
nextnpm run buildnext.config.js
vitenpm run buildvite.config.ts
npmnpm run buildpackage.json:scripts.build

security

Security audit.

ToolCommandDetection
npmnpm audit --audit-level=highpackage-lock.json
yarnyarn audit --level highyarn.lock
pnpmpnpm audit --audit-level highpnpm-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

Loading code block...

Example

Loading code block...

CLI Commands

Loading code block...

Error Handling

Unknown Gate

Loading code block...

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

  1. Start with pre-commit: Run quick checks before every commit
  2. Use pre-push for CI: Mirror your CI checks in pre-push
  3. Skip thoughtfully: Only skip checks when necessary
  4. Use strict mode in CI: Fail fast on any issue
  5. Run pre-deploy before releases: Catch security issues early
  6. Customize for your needs: Create custom gates for your workflow