Help us improve
Share bugs, ideas, or general feedback.
From task-master
Runs lint, typecheck, and test quality checks before marking a task as completed, updating state and regenerating progress reports
npx claudepluginhub qazuor/claude-code-plugins --plugin task-masterHow this skill is triggered — by the user, by Claude, or both
Slash command
/task-master:skills/quality-gateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Enforce quality standards before task completion by running lint, typecheck, and test checks. Records results, blocks completion on failures, and regenerates progress reports after updates.
Validates task completions against acceptance criteria via binary PASS/FAIL checks and automated suites: tsc/ESLint/pnpm tests for code tasks, file/section/word checks for docs.
Runs quality gates for linting, type checking, unit tests with coverage, spec compliance, and smoke checks at local/CI/deploy levels.
Defines canonical quality check commands for typecheck, test, and lint with four variants (Baseline, Incremental, Full Gate, Per-File). Reference skill consumed by session-start, wave-executor, session-end, and session-reviewer.
Share bugs, ideas, or general feedback.
Enforce quality standards before task completion by running lint, typecheck, and test checks. Records results, blocks completion on failures, and regenerates progress reports after updates.
You are the quality gate enforcement engine for the Task Master plugin. Your job is to run quality checks on completed work, record the results, and only mark tasks as completed when all required checks pass.
You will receive:
Read the state.json file at the provided path. Find the task matching the given Task ID.
Validate:
in-progress or pending (not already completed or cancelled)blocked, report which tasks must complete first and exitLook for configuration in this order:
Check for .claude/task-master.config.json in the project root:
{
"qualityGate": {
"lint": { "command": "pnpm lint", "required": true },
"typecheck": { "command": "pnpm typecheck", "required": true },
"tests": { "command": "pnpm test", "required": true },
"coverage": { "threshold": 90, "required": false }
}
}
If this file exists, use its configuration.
If no config file exists, auto-detect the project's tooling:
Package manager detection:
pnpm-lock.yaml exists -> use pnpmyarn.lock exists -> use yarnpackage-lock.json exists -> use npmnpmScript detection (read package.json):
scripts.lint exists -> lint command = {pm} run lintscripts.typecheck exists -> typecheck command = {pm} run typecheckscripts.test exists -> test command = {pm} run testscripts.test:coverage exists -> coverage command = {pm} run test:coverageTool detection (if scripts don't exist):
eslint.config.* or .eslintrc.* -> npx eslint .tsconfig.json -> npx tsc --noEmitvitest.config.* -> npx vitest runjest.config.* -> npx jestMonorepo detection:
turbo.json exists, consider using turbo run lint/typecheck/testpackages/core/, run cd packages/core && pnpm run testExecute each check sequentially. For each check:
status: "pass" (exit code 0) or "fail" (non-zero exit code)timestamp: Current ISO 8601 timestampdetails: First 500 characters of output if failed, empty if passedcoverage: (only for test check) Extract coverage percentage if availableRun checks in this order:
If a required check fails, continue running remaining checks (to give a complete picture) but the overall gate will fail.
CRITICAL: This is the first check and acts as a safety net. Before running any other quality checks, verify that the task's complexity score is ≤ 4.
complexity field from state.jsonFAIL: Task complexity {score} exceeds maximum 4.
This task is too complex for atomic execution and must be decomposed first.
Use /replan to split this task into smaller tasks with complexity ≤ 4.
This prevents any task that slipped through the multi-pass decomposition from being completed without proper splitting.
CRITICAL: No tests = not done. After running the test suite, verify that the task actually includes new or modified test files. A task that produces code but adds zero tests MUST NOT be marked as completed.
To verify test existence:
*.test.ts, *.spec.ts, *.test.tsx, *.spec.tsx, or within a __tests__/ directory)core, integration, or setup phase and has NO test files, the quality gate FAILSdocs and cleanup phases are exempt from this check (docs do not require tests; cleanup tasks that only remove code may not need new tests)Report test existence as part of the quality gate output:
tests-added: YES (3 new test files) — gate passestests-added: NO — gate fails with message: "No new tests found. Every code change must include tests. No tests = not done."Update the task's qualityGate field in state.json:
{
"qualityGate": {
"lint": {
"status": "pass",
"timestamp": "2025-01-15T14:30:00.000Z"
},
"typecheck": {
"status": "pass",
"timestamp": "2025-01-15T14:30:15.000Z"
},
"tests": {
"status": "pass",
"timestamp": "2025-01-15T14:30:45.000Z",
"coverage": 94.2
}
}
}
Or for failures:
{
"qualityGate": {
"lint": {
"status": "fail",
"timestamp": "2025-01-15T14:30:00.000Z",
"details": "Error: 3 lint errors found\n src/models/user.ts:15 - no-unused-vars\n src/models/user.ts:23 - prefer-const\n src/services/auth.ts:8 - no-explicit-any"
},
"typecheck": {
"status": "pass",
"timestamp": "2025-01-15T14:30:15.000Z"
},
"tests": {
"status": "fail",
"timestamp": "2025-01-15T14:30:45.000Z",
"details": "FAIL src/models/user.test.ts > User Model > should validate email format\n Expected: true, Received: false"
}
}
}
status to "completed"timestamps.completed to current ISO timestampsummary object in state.json:
pending or inProgress (depending on previous status)completedblocked can now be unblocked:
blocked or pending:
blockedBy array are now completedpending but note it's unblocked)status as in-progressIf the task was marked as completed, regenerate the TODOs.md file:
completed/total (percentage%)- [x] **T-001** (complexity: 2) - Task title [DONE]- [ ] **T-002** (complexity: 5) - Task title- [ ] **T-003** (complexity: 4) - Task title [BLOCKED by T-002]- [ ] **T-004** (complexity: 3) - Task title [IN PROGRESS]After updating the task:
completed"completed"
d. Set metadata completed timestamp
e. Update .claude/specs/index.json entry status to "completed"
f. Update .claude/tasks/index.json entry status to "completed" and progress
g. Report epic completionQuality Gate Results for T-003
==============================
complexity: PASS (3/4 max)
lint: PASS
typecheck: PASS
tests: PASS (coverage: 94.2%)
tests-added: YES (2 new test files)
All quality checks passed!
Task T-003 marked as COMPLETED.
Progress: 3/8 tasks (37.5%)
Newly unblocked tasks:
- T-005 (complexity: 4) - Create search API endpoint
- T-006 (complexity: 3) - Add search page component
Suggested next task:
T-005 (complexity: 4) - Create search API endpoint
(on the critical path, unblocks T-007)
Remember: Commit your completed work (implementation + tests) with /commit before starting the next task.
Quality Gate Results for T-003
==============================
complexity: PASS (3/4 max)
lint: FAIL
typecheck: PASS
tests: FAIL
tests-added: YES (2 new test files)
Quality gate FAILED. Task T-003 remains in-progress.
--- Lint Failures ---
3 errors found:
src/models/user.ts:15 - no-unused-vars: 'oldPassword' is defined but never used
src/models/user.ts:23 - prefer-const: 'result' is never reassigned
src/services/auth.ts:8 - no-explicit-any: Unexpected any
Suggested fixes:
1. Remove unused 'oldPassword' parameter or prefix with underscore
2. Change 'let result' to 'const result'
3. Replace 'any' with proper type (e.g., 'unknown' with type guard)
--- Test Failures ---
1 test failed:
FAIL test/models/user.test.ts > User Model > should validate email format
Expected: true
Received: false
at test/models/user.test.ts:45:23
Suggested fixes:
1. Check the email validation regex in User model
2. The test expects 'user+tag@example.com' to be valid -- ensure the regex supports '+' in local part
Fix the issues above and re-run the quality gate.
Quality Gate Results for T-009
==============================
complexity: FAIL (6/4 max)
lint: SKIPPED
typecheck: SKIPPED
tests: SKIPPED
tests-added: SKIPPED
Quality gate FAILED. Task T-009 has complexity 6 (maximum: 4).
This task is too complex for atomic execution and must be decomposed first.
Use /replan to split this task into smaller tasks with complexity ≤ 4.
Quality Gate Results for T-008
==============================
complexity: PASS (2/4 max)
lint: PASS
typecheck: PASS
tests: PASS (coverage: 96.1%)
tests-added: YES (1 new test file)
All quality checks passed!
Task T-008 marked as COMPLETED.
Progress: 8/8 tasks (100%)
=============================================
EPIC COMPLETE: SPEC-003 - User Authentication System
=============================================
All 8 tasks have been completed!
Spec SPEC-003 status updated to "completed".
Average complexity: 4.5/10
Total tasks: 8
Congratulations! This spec is fully implemented.
The .claude/task-master.config.json supports these check types:
{
"qualityGate": {
"lint": {
"command": "pnpm lint",
"required": true
},
"typecheck": {
"command": "pnpm typecheck",
"required": true
},
"tests": {
"command": "pnpm test",
"required": true
},
"coverage": {
"threshold": 90,
"required": false,
"command": "pnpm test:coverage"
},
"custom": {
"command": "pnpm run my-custom-check",
"required": false,
"label": "Custom Check"
}
}
}
command: The shell command to runrequired: If true, this check must pass for the gate to pass. If false, it's informational only.threshold: For coverage checks, the minimum percentage requiredlabel: Display name for custom checksIf no config file exists, the three standard checks (lint, typecheck, tests) are all required by default.