tygwan

quality-gate

1
0
# Install this skill:
npx skills add tygwan/cc-initializer --skill "quality-gate"

Install specific skill from multi-skill repository

# Description

Automated quality gates for development lifecycle. Pre-commit checks, pre-merge validation, release readiness verification, and post-release documentation.

# SKILL.md


name: quality-gate
description: Automated quality gates for development lifecycle. Pre-commit checks, pre-merge validation, release readiness verification, and post-release documentation.


Quality Gate Skill

Automated quality validation at critical development checkpoints. Ensures code quality, documentation completeness, and release readiness.

Usage

/quality-gate <checkpoint> [options]

Checkpoints

Checkpoint Trigger Purpose
pre-commit Before commit Code quality, lint, format
pre-merge Before PR merge Tests, review, docs
pre-release Before release Full validation
post-release After release Documentation, changelog
check On demand Run all applicable checks

Quality Gate Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    QUALITY GATE PIPELINE                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                 β”‚
β”‚  Code Change β†’ Pre-Commit β†’ Pre-Merge β†’ Pre-Release β†’ Release  β”‚
β”‚       ↓            ↓            ↓            ↓           ↓     β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”   β”‚
β”‚   β”‚ Edit β”‚ β†’  β”‚ Lint β”‚ β†’  β”‚ Test β”‚ β†’  β”‚ Docs β”‚ β†’  β”‚ Tag  β”‚   β”‚
β”‚   β”‚      β”‚    β”‚Formatβ”‚    β”‚Reviewβ”‚    β”‚ Sec  β”‚    β”‚Deployβ”‚   β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                 β”‚
β”‚  Gate Status: βœ… Pass   ⚠️ Warning   ❌ Block                  β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Checkpoints Detail

/quality-gate pre-commit

Run before committing code changes.

/quality-gate pre-commit [--fix] [--skip <check>]

Checks:
| Check | Description | Blocking |
|-------|-------------|:--------:|
| lint | Code linting | βœ… |
| format | Code formatting | ⚠️ |
| types | Type checking | βœ… |
| secrets | Secret detection | βœ… |
| size | File size limits | ⚠️ |

Output:

πŸ” PRE-COMMIT QUALITY GATE

[1/5] Linting...
      βœ… No lint errors

[2/5] Formatting...
      ⚠️ 2 files need formatting
      β†’ Run with --fix to auto-format

[3/5] Type Checking...
      βœ… No type errors

[4/5] Secret Detection...
      βœ… No secrets found

[5/5] File Size Check...
      βœ… All files under limit

━━━━━━━━━━━━━━━━━━━━━━━━━
Result: ⚠️ PASS WITH WARNINGS

Warnings: 1
- Format: 2 files need formatting

Proceed with commit? (Y/n)

/quality-gate pre-merge

Run before merging PR to main branch.

/quality-gate pre-merge [--pr <number>]

Checks:
| Check | Description | Blocking |
|-------|-------------|:--------:|
| tests | All tests pass | βœ… |
| coverage | Test coverage threshold | ⚠️ |
| review | Code review approved | βœ… |
| conflicts | No merge conflicts | βœ… |
| docs | Documentation updated | ⚠️ |
| changelog | CHANGELOG updated | ⚠️ |

Output:

πŸ” PRE-MERGE QUALITY GATE

PR: #42 - Add user authentication

[1/6] Tests...
      βœ… 127 tests passed

[2/6] Coverage...
      ⚠️ Coverage: 72% (threshold: 80%)
      New code coverage: 85%

[3/6] Code Review...
      βœ… Approved by: @reviewer

[4/6] Merge Conflicts...
      βœ… No conflicts

[5/6] Documentation...
      ⚠️ README.md not updated
      Consider: /readme-sync

[6/6] Changelog...
      βœ… CHANGELOG.md updated

━━━━━━━━━━━━━━━━━━━━━━━━━
Result: ⚠️ PASS WITH WARNINGS

Blocking: 0
Warnings: 2
- Coverage below threshold
- Documentation may need update

Recommend: Run /agile-sync before merge

/quality-gate pre-release

Comprehensive validation before release.

/quality-gate pre-release --version <semver>

Checks:
| Check | Description | Blocking |
|-------|-------------|:--------:|
| tests | Full test suite | βœ… |
| coverage | Coverage threshold | βœ… |
| lint | Zero lint errors | βœ… |
| security | Security scan | βœ… |
| docs | Documentation complete | βœ… |
| changelog | Version in changelog | βœ… |
| version | Version consistency | βœ… |
| dependencies | No vulnerable deps | ⚠️ |
| build | Build succeeds | βœ… |

Output:

πŸ” PRE-RELEASE QUALITY GATE

Version: v1.2.0

[1/9] Full Test Suite...
      βœ… 342 tests passed (0 failed, 0 skipped)

[2/9] Coverage Analysis...
      βœ… Coverage: 84% (threshold: 80%)
      - Statements: 86%
      - Branches: 79%
      - Functions: 88%
      - Lines: 84%

[3/9] Lint Check...
      βœ… Zero lint errors

[4/9] Security Scan...
      βœ… No vulnerabilities found
      Scanned: dependencies, code patterns

[5/9] Documentation...
      βœ… All required docs present
      - README.md: βœ…
      - CHANGELOG.md: βœ…
      - API docs: βœ…

[6/9] Changelog Version...
      βœ… v1.2.0 entry found

[7/9] Version Consistency...
      βœ… Version matches across:
      - package.json: 1.2.0
      - CHANGELOG.md: 1.2.0

[8/9] Dependency Audit...
      ⚠️ 1 low severity issue
      β†’ lodash: prototype pollution (low)

[9/9] Build Verification...
      βœ… Build successful
      Size: 2.3 MB (within limit)

━━━━━━━━━━━━━━━━━━━━━━━━━
Result: βœ… RELEASE READY

All blocking checks passed!

Warnings: 1
- Low severity dependency issue

Next Steps:
1. Create release tag: git tag v1.2.0
2. Push tag: git push origin v1.2.0
3. Run: /quality-gate post-release

/quality-gate post-release

Documentation and tracking after release.

/quality-gate post-release --version <semver>

Actions:
| Action | Description |
|--------|-------------|
| Archive sprint | Close active sprint if any |
| Update docs | Update version references |
| Velocity | Record release velocity |
| Notify | Generate release notes |
| Retro prompt | Suggest retrospective |

Output:

πŸ“¦ POST-RELEASE QUALITY GATE

Version: v1.2.0 released!

[1/5] Sprint Archive...
      βœ… Sprint 3 closed
      Velocity: 34 points

[2/5] Documentation Update...
      βœ… Version references updated
      - README.md: badge updated
      - docs/index.md: version updated

[3/5] Velocity Recording...
      βœ… Release velocity recorded
      - Features: 8
      - Fixes: 5
      - Docs: 3

[4/5] Release Notes...
      βœ… Generated: RELEASE-v1.2.0.md

[5/5] Retrospective...
      πŸ’‘ Consider running: /feedback retro --milestone v1.2.0

━━━━━━━━━━━━━━━━━━━━━━━━━
βœ… Post-release tasks complete!

Generated:
- docs/releases/RELEASE-v1.2.0.md
- Updated: docs/feedback/VELOCITY.md

/quality-gate check

Run applicable checks based on current state.

/quality-gate check [--all] [--fix]

Automatically detects:
- Uncommitted changes β†’ pre-commit checks
- Open PR β†’ pre-merge checks
- Release branch β†’ pre-release checks

Configuration

settings.json

{
  "quality-gate": {
    "pre-commit": {
      "enabled": true,
      "checks": ["lint", "format", "types", "secrets"],
      "auto-fix": false
    },
    "pre-merge": {
      "enabled": true,
      "coverage-threshold": 80,
      "require-review": true,
      "require-changelog": true
    },
    "pre-release": {
      "enabled": true,
      "coverage-threshold": 80,
      "security-scan": true,
      "require-all-docs": true
    },
    "post-release": {
      "auto-archive-sprint": true,
      "generate-release-notes": true,
      "prompt-retro": true
    }
  }
}

Custom Checks

Add project-specific checks:

# .claude/quality-checks.yml
custom-checks:
  pre-commit:
    - name: "API Schema"
      command: "npm run validate-schema"
      blocking: true

  pre-release:
    - name: "License Check"
      command: "npm run license-check"
      blocking: true

    - name: "Bundle Size"
      command: "npm run analyze-bundle"
      threshold: "5MB"
      blocking: false

Integration

With Git Hooks

# .git/hooks/pre-commit
#!/bin/bash
/quality-gate pre-commit --fail-on-warning

With CI/CD

# GitHub Actions
- name: Quality Gate
  run: |
    /quality-gate pre-merge
    /quality-gate pre-release --version ${{ github.ref_name }}

With Other Skills

# Before PR
/quality-gate pre-merge && /agile-sync

# Release workflow
/quality-gate pre-release --version v1.2.0
git tag v1.2.0
git push origin v1.2.0
/quality-gate post-release --version v1.2.0

Check Reference

Lint Commands by Language

Language Command
JavaScript/TypeScript eslint .
Python ruff check . or flake8
Go golint ./...
Rust cargo clippy
C# dotnet format --verify-no-changes

Test Commands by Framework

Framework Command
Jest npm test -- --coverage
pytest pytest --cov
Go go test -cover ./...
.NET dotnet test --collect:"XPlat Code Coverage"

Security Scanners

Tool Purpose
npm audit Node.js dependencies
safety Python dependencies
trivy Container images
gitleaks Secret detection

Best Practices

DO

  • βœ… Run pre-commit before every commit
  • βœ… Require pre-merge for all PRs
  • βœ… Run full pre-release before tags
  • βœ… Document skipped checks with reason
  • βœ… Fix warnings before they become blockers

DON'T

  • ❌ Skip security scans
  • ❌ Ignore coverage drops
  • ❌ Release without pre-release check
  • ❌ Disable blocking checks permanently

Troubleshooting

"Check failed but code is correct"

# Skip specific check with reason
/quality-gate pre-commit --skip lint --reason "false positive in generated code"

"Coverage dropped below threshold"

# View uncovered lines
/quality-gate pre-merge --coverage-details

"Security scan timeout"

# Run with extended timeout
/quality-gate pre-release --timeout 600
Skill Purpose
/agile-sync Sync all agile artifacts
/sprint Sprint management
/feedback Post-release retrospective
/test Test execution

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.