一键导入
run-quality-gate
// Execute quality gate validation with configurable blocking behavior. Use when running type-check, build, tests, lint, or custom validation commands in orchestrators or workers to enforce quality standards.
// Execute quality gate validation with configurable blocking behavior. Use when running type-check, build, tests, lint, or custom validation commands in orchestrators or workers to enforce quality standards.
| name | run-quality-gate |
| description | Execute quality gate validation with configurable blocking behavior. Use when running type-check, build, tests, lint, or custom validation commands in orchestrators or workers to enforce quality standards. |
| allowed-tools | Bash, Read |
Execute validation commands as quality gates with configurable blocking/non-blocking behavior and structured error reporting.
Accept gate configuration as input.
Expected Input:
{
"gate": "type-check|build|tests|lint|custom",
"blocking": true,
"custom_command": "pnpm custom-validate"
}
Parameters:
gate: Type of quality gate to run (required)blocking: Whether failure should stop workflow (default: true)custom_command: Command to run when gate="custom" (required for custom gates)Determine command to execute based on gate type.
Gate Commands:
type-check → pnpm type-checkbuild → pnpm buildtests → pnpm testlint → pnpm lintcustom → Use custom_command parameterValidation:
custom_command must be providedRun command via Bash tool with timeout.
Execution Parameters:
Tools Used: Bash
Determine if gate passed based on exit code.
Pass/Fail Logic:
Extract Errors: Look for error patterns in output:
Calculate action based on result and blocking flag.
Action Logic:
IF exit_code == 0:
action = "continue"
passed = true
ELSE:
IF blocking == true:
action = "stop"
ELSE:
action = "warn"
passed = false
Return complete quality gate result.
Expected Output:
{
"gate": "type-check",
"passed": true,
"blocking": true,
"action": "continue",
"errors": [],
"exit_code": 0,
"duration_ms": 2345,
"command": "pnpm type-check",
"timestamp": "2025-10-18T14:30:00Z"
}
Output Fields:
gate: Gate type that was runpassed: Whether gate passed (boolean)blocking: Whether gate was blockingaction: Action to take (continue|stop|warn)errors: Array of error messages extractedexit_code: Command exit codeduration_ms: Execution time in millisecondscommand: Actual command executedtimestamp: ISO-8601 timestamp of executionInput:
{
"gate": "type-check",
"blocking": true
}
Command Output:
$ pnpm type-check
✓ No type errors found
Done in 2.3s
Output:
{
"gate": "type-check",
"passed": true,
"blocking": true,
"action": "continue",
"errors": [],
"exit_code": 0,
"duration_ms": 2345,
"command": "pnpm type-check",
"timestamp": "2025-10-18T14:30:00Z"
}
Input:
{
"gate": "build",
"blocking": true
}
Command Output:
$ pnpm build
✗ Build failed
ERROR in src/app.ts
Module not found: Error: Can't resolve 'missing-module'
exit code: 1
Output:
{
"gate": "build",
"passed": false,
"blocking": true,
"action": "stop",
"errors": [
"ERROR in src/app.ts",
"Module not found: Error: Can't resolve 'missing-module'"
],
"exit_code": 1,
"duration_ms": 5432,
"command": "pnpm build",
"timestamp": "2025-10-18T14:30:05Z"
}
Input:
{
"gate": "lint",
"blocking": false
}
Command Output:
$ pnpm lint
✗ 12 problems (8 errors, 4 warnings)
src/utils.ts:10:5 - error - Missing semicolon
src/app.ts:25:1 - warning - Prefer const over let
exit code: 1
Output:
{
"gate": "lint",
"passed": false,
"blocking": false,
"action": "warn",
"errors": [
"src/utils.ts:10:5 - error - Missing semicolon",
"src/app.ts:25:1 - warning - Prefer const over let"
],
"exit_code": 1,
"duration_ms": 1234,
"command": "pnpm lint",
"timestamp": "2025-10-18T14:30:07Z"
}
Input:
{
"gate": "custom",
"blocking": true,
"custom_command": "pnpm validate-schemas"
}
Command Output:
$ pnpm validate-schemas
✓ All schemas valid
exit code: 0
Output:
{
"gate": "custom",
"passed": true,
"blocking": true,
"action": "continue",
"errors": [],
"exit_code": 0,
"duration_ms": 876,
"command": "pnpm validate-schemas",
"timestamp": "2025-10-18T14:30:08Z"
}
Input:
{
"gate": "tests",
"blocking": true
}
Output (after 5 minutes):
{
"gate": "tests",
"passed": false,
"blocking": true,
"action": "stop",
"errors": [
"Command timed out after 300000ms (5 minutes)"
],
"exit_code": -1,
"duration_ms": 300000,
"command": "pnpm test",
"timestamp": "2025-10-18T14:35:00Z"
}
Input:
{
"gate": "build",
"blocking": true
}
Command Output:
bash: pnpm: command not found
exit code: 127
Output:
{
"gate": "build",
"passed": false,
"blocking": true,
"action": "stop",
"errors": [
"bash: pnpm: command not found"
],
"exit_code": 127,
"duration_ms": 45,
"command": "pnpm build",
"timestamp": "2025-10-18T14:30:09Z"
}
## Quality Gate: Type Check
Use run-quality-gate Skill with gate="type-check" and blocking=true.
If action="stop", halt workflow and report failure.
If action="continue", proceed to next phase.
## Step 5: Self-Validation
Use run-quality-gate Skill to validate changes:
1. Run type-check (blocking=true)
2. Run build (blocking=true)
3. Run tests (blocking=false)
If any blocking gate returns action="stop", rollback changes.
## Phase 2: Execute Quality Gates
For each gate in [type-check, build, tests, lint]:
result = run-quality-gate(gate, blocking=true)
if result.action == "stop":
HALT and report failure
if result.action == "warn":
LOG warning and continue
gate-mappings.json: Gate command mappings and configurations (see below)