pair-capability-verify-quality
Checks quality gates against the current codebase. Reads project-specific quality gate command from way-of-working adoption and universal standards from quality-standards guidelines. Gates already pas
SKILL.md.claude/skills/pair-capability-verify-quality/SKILL.md
GitHub/pair-capability-verify-quality — Quality Gate Checker
Validate the current codebase against quality gates. Two sources of truth:
- way-of-working.md — project-specific quality gate command and process (e.g.,
pnpm quality-gate). This is "what command we run." - quality-standards — universal quality standards (gates, DoD, checklists). This is "what we check."
Only check gates that are not already passing.
Arguments
| Argument | Required | Description |
|---|---|---|
$scope |
No | Limit checking: code-quality, tests, lint, all, or any custom scope key from adoption (default: all) |
Algorithm
Execute each gate in order. For every gate, follow the check → skip → act → verify pattern.
Step 1: Read Adoption Quality Gate Configuration
- Check: Read way-of-working.md and look for a Quality Gates section declaring the project-specific quality gate command (e.g.,
pnpm quality-gate). - Skip: If
way-of-working.mdhas no Quality Gates section, fall back topackage.jsonscripts for detectable gate commands (e.g.,test,lint,ts:check). - Act: If found, record the command for use in Step 5. Also note any sub-checks listed (e.g., type checking, testing, linting, formatting).
Step 2: Lint Gate
- Check: Run the project linter (e.g.,
pnpm lintorturbo lint). Capture output. - Skip: If zero violations, report "Lint: PASS" and move to Step 3.
- Act: If violations found, report each violation with file and line.
- Verify: After developer fixes, re-run linter to confirm zero violations.
Step 3: Type Check Gate
- Check: Run the type checker (e.g.,
pnpm tsc --noEmitorturbo build). Capture output. - Skip: If zero errors, report "Type Check: PASS" and move to Step 4.
- Act: If errors found, report each error with file and line.
- Verify: After developer fixes, re-run type checker to confirm zero errors.
Step 4: Test Gate
- Check: Run the test suite (e.g.,
pnpm testorturbo test). Capture output including coverage. - Skip: If all tests pass, report "Tests: PASS (N tests, X% coverage)" and move to Step 5.
- Act: If tests fail, report each failure with test name, file, and assertion message.
- Verify: After developer fixes, re-run tests to confirm all pass.
Step 5: Custom Gates (from adoption)
Check: Read way-of-working.md → look for a
### Custom Gate Registrysection.Branch based on what is found:
A) Custom Gate Registry table found → execute custom gates (Step 5.A).
B) Explicit opt-out found (section contains "No custom quality gates") → skip to Step 6 silently.
C) No Custom Gate Registry section at all → first-time setup (Step 5.C).
Step 5.A: Execute Custom Gates
- Act: For each row in the table, ordered by
Order, filtered by$scope:$scope = all→ run all custom gates.$scope = <scope-key>→ run only gate(s) matching that scope key.- For each gate, apply check → skip → act → verify:
- Check: Has this gate already run in this session?
- Skip: If cached result exists, reuse it.
- Act: Run the gate command. Capture output and exit code.
- Verify: Record result based on
Requiredcolumn:Required = Yes→ exit code 0 = PASS, non-zero = FAIL (contributes to overall FAIL).Required = No(Advisory) → exit code 0 = PASS, non-zero = WARNING (does not block).
- Verify: All custom gates executed and results recorded. Move to Step 6.
Step 5.C: First-Time Custom Gate Setup
Act: Ask the developer:
No custom quality gates configured. Would you like to add custom gate steps (e.g., formatting, security scan, markdown lint)? If not, I'll record the opt-out so this question won't be asked again.
Branch:
Developer says yes → help define gates and write the Custom Gate Registry table to way-of-working.md. Then execute them (Step 5.A).
Developer says no → write the opt-out marker to way-of-working.md:
### Custom Gate Registry No custom quality gates configured. To add custom gates, replace this line with the gate table (see quality-gates.md).
Verify: way-of-working.md updated. Move to Step 6.
See quality-gates.md for Custom Gate Registry table schema and enforcement level semantics.
Step 6: Aggregate Quality Gate
If a project-level quality gate command exists (from Step 1):
- Check: Run the aggregate command (e.g.,
pnpm quality-gate). - Skip: If exit code 0, report "Quality Gate: PASS" and move to output.
- Act: If non-zero exit, report the failing sub-gates.
- Verify: After developer fixes, re-run to confirm pass.
Output Format
Present results as:
QUALITY GATE REPORT:
├── Lint: [PASS | FAIL — N violations]
├── Type Check: [PASS | FAIL — N errors]
├── Tests: [PASS — N tests, X% coverage | FAIL — N failures]
├── Custom: [N gates — N PASS, N FAIL, N WARNING | No custom gates]
└── Aggregate: [PASS | FAIL | N/A]
RESULT: [ALL GATES PASS | BLOCKED — N gates failing]
Composition Interface
When composed by /pair-process-implement or /pair-process-review:
- Input: The composing skill invokes
/pair-capability-verify-qualityafter implementation or before commit. - Output: Returns PASS or FAIL with details. The composing skill decides what to do:
/pair-process-implement: HALT on FAIL — developer must fix before commit./pair-process-review: Report FAIL as review finding — does not block review completion.
When invoked independently:
- Run all gates (or scoped gates if
$scopeis provided). - Report results. No side effects — this skill only reads and reports.
Graceful Degradation
- If a standard gate command is not available (e.g., no test script in package.json), skip that gate and report: "Tests: SKIPPED — no test command found."
- If quality-standards directory is not found, warn and run only detectable gates (lint, type check, tests from package.json scripts).
- If no quality-related scripts are found at all, report: "No quality gates detected. Configure quality gate commands in package.json or way-of-working.md."
- If a custom gate command fails to execute (command not found), report as WARNING: "Gate
[name]: SKIPPED — command not found." - If way-of-working.md is not found, skip custom gates entirely (standard gates still run).
Notes
- This skill is read-only except for Step 5.C (first-time setup writes opt-out or Custom Gate Registry to way-of-working.md). All other steps only run existing commands.
- Two sources: way-of-working.md for the project-specific quality gate command and custom gates (adoption-driven), quality-standards for universal quality standards.
- Standard gates (Lint, Type Check, Test) are universal and language/platform-independent. Custom gates are project-specific and defined in adoption.
- Each gate is independent — a failure in one gate does not prevent checking subsequent gates.
- Re-invoke after fixes to confirm resolution. Already-passing gates are re-verified but complete instantly.
- First-time setup (Step 5.C) only triggers once — after the developer responds, way-of-working.md is updated and subsequent invocations follow branch A or B.