Agent skill

quality-gate

Comprehensive quality validation for TypeScript/JavaScript projects - runs TypeScript checks, tests, coverage analysis, build validation, and linting with structured JSON results

Stars 6
Forks 3

Install this agent skill to your Project

npx add-skill https://github.com/BerryKuipers/claude-code-toolkit/tree/main/.claude/api-skills-source/quality-gate

SKILL.md

Quality Gate

Complete quality validation workflow for TypeScript/JavaScript projects. Executes all quality checks and returns structured results.

Purpose

Execute comprehensive quality validation before code can proceed to PR creation, ensuring all quality standards are met through automated checks and minimum thresholds.

Quality Standards

All checks must pass:

  • ✅ TypeScript type checking (no errors)
  • ✅ Linting validation (no errors, warnings acceptable)
  • ✅ All tests passing
  • ✅ Test coverage ≥ 80% (configurable)
  • ✅ Production build successful

Usage

This skill runs the Python script skill.py which executes all quality checks.

Parameters

  • project_path: Absolute path to the project directory
  • coverage_threshold: Minimum coverage percentage (default: 80)

Example

python
# In Claude conversation or API
result = use_skill("quality-gate", {
    "project_path": "/path/to/your/project",
    "coverage_threshold": 80
})

if result["qualityGate"] == "pass":
    # All checks passed, proceed to PR creation
    print("✅ Quality gate passed!")
else:
    # Show blockers
    for blocker in result["blockers"]:
        print(f"❌ {blocker}")

Output Format

Returns structured JSON:

json
{
  "qualityGate": "pass" | "fail",
  "timestamp": "2025-10-22T...",
  "checks": {
    "typeCheck": {
      "status": "pass",
      "errors": 0
    },
    "lint": {
      "status": "pass",
      "errors": 0,
      "warnings": 2
    },
    "tests": {
      "status": "pass",
      "total": 45,
      "passed": 45,
      "failed": 0,
      "coverage": 87.5
    },
    "build": {
      "status": "pass",
      "duration": "12.3s",
      "warnings": 0
    }
  },
  "blockers": [],
  "warnings": ["2 lint warnings"]
}

Implementation

The skill executes checks in this order:

  1. TypeScript type checking (fast, catches syntax errors)
  2. Linting (fast, catches style issues)
  3. Tests with coverage (slower, comprehensive validation)
  4. Production build (final validation)

Fast-failing approach ensures quick feedback.

Integration with Conductor

Used in Conductor Phase 3 (Quality Assurance):

markdown
**Phase 3: Quality Assurance**

Use `quality-gate` API skill:
1. Execute quality gate with project path
2. If pass: Proceed to Phase 4 (PR Creation)
3. If fail:
   - Identify failing check
   - Route to appropriate agent for fixes
   - Re-run quality gate

When to Use

  • Conductor workflow Phase 3 (Quality Assurance)
  • Before creating any pull request
  • After refactoring changes
  • As part of CI/CD pipeline
  • Before merging to development branch

Failure Handling

If quality gate fails:

  1. Check blockers array for specific issues
  2. Route to appropriate agent:
    • TypeScript errors → Fix type issues
    • Lint errors → Auto-fix with npm run lint -- --fix
    • Tests fail → Debugger agent
    • Build fails → Investigate build errors
  3. Re-run quality gate after fixes
  4. Maximum 3 retries before escalating to human

Expand your agent's capabilities with these related and highly-rated skills.

BerryKuipers/claude-code-toolkit

validate-typescript

Run TypeScript compiler type-checking (tsc --noEmit) to validate type safety and catch type errors. Returns structured output with error counts, categories (type/syntax/import errors), and affected files. Used for quality gates and pre-commit validation.

6 3
Explore
BerryKuipers/claude-code-toolkit

validate-coverage-threshold

Validate test coverage meets minimum thresholds (default 80% overall, 80% statements, 75% branches, 80% functions). Parses coverage reports from coverage/coverage-summary.json or test output. Returns pass/fail status with detailed metrics and identifies uncovered files.

6 3
Explore
BerryKuipers/claude-code-toolkit

run-comprehensive-tests

Execute comprehensive test suite (Vitest/Jest) with coverage reporting and failure analysis. Returns structured output with test counts (total/passed/failed), coverage percentage, duration, and detailed failure information. Used for quality gates and CI/CD validation.

6 3
Explore
BerryKuipers/claude-code-toolkit

validate-build

Run production build validation (npm run build, vite build, tsc) to ensure code compiles and builds successfully. Returns structured output with build status, duration, size metrics, and error details. Used for quality gates and deployment readiness checks.

6 3
Explore
BerryKuipers/claude-code-toolkit

validate-lint

Run ESLint and Prettier validation to check code style, formatting, and best practices. Returns structured output with error/warning counts, rule violations, and affected files. Used for code quality gates and pre-commit validation.

6 3
Explore
BerryKuipers/claude-code-toolkit

validate-git-hygiene

Validate git commit messages, branch naming conventions, and repository hygiene. Returns structured output with validation results for commit format (conventional commits), branch naming, and best practices. Used for quality gates and git workflow validation.

6 3
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results