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
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 directorycoverage_threshold: Minimum coverage percentage (default: 80)
Example
# 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:
{
"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:
- TypeScript type checking (fast, catches syntax errors)
- Linting (fast, catches style issues)
- Tests with coverage (slower, comprehensive validation)
- Production build (final validation)
Fast-failing approach ensures quick feedback.
Integration with Conductor
Used in Conductor Phase 3 (Quality Assurance):
**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:
- Check
blockersarray for specific issues - 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
- Re-run quality gate after fixes
- Maximum 3 retries before escalating to human
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
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.
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.
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.
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.
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.
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.
Didn't find tool you were looking for?