Skip to main content
skill CX Codex

quality-gates-enforcer — Claude Code skill: what it does

quality-gates-enforcer enforces strict CI thresholds for test coverage, ESLint zero-warning rules, type safety, vulnerability audits, and bundle budgets.

MIT 284 installs ★ 64 updated 2026-01-12

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add patricio0312rev/skills --skill quality-gates-enforcer -a claude-code
Open on GitHub

What quality-gates-enforcer does

The skill provides workflow templates and configs for GitHub Actions, Jest thresholds, and branch protection settings. It orchestrates pull request verification by setting global test coverage bars (defaulting to 80% across statements, lines, functions, and branches, plus 90% for critical directories) alongside tsc --noEmit checks.

Security enforcement bundles npm audit at moderate severity alongside Snyk scanning targeting high-severity issues. The pipeline also measures build output via size-limit-action and publishes an automated Markdown summary directly into PR comments.

Without a valid SNYK_TOKEN configured in GitHub Secrets, the security scanning step will fail immediately.

What it helps with

  • enforce mandatory test coverage thresholds in CI before merging
  • fail PR builds on any ESLint warning or TypeScript compilation error
  • automate dependency vulnerability scanning with Snyk and npm audit
  • track bundle size limits on every incoming pull request

Example prompts for the agent

  • Set up GitHub Actions quality gates with an 80% test coverage threshold
  • Configure Jest coverage thresholds and branch protection checks
  • Add a pull request workflow that generates a Markdown quality report

How to install quality-gates-enforcer

1Skills CLI (Vercel)

npx skills add patricio0312rev/skills --skill quality-gates-enforcer -a claude-code

2Manually: put the files in place

~/.claude/skills/quality-gates-enforcer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/quality-gates-enforcer/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about quality-gates-enforcer

How to install quality-gates-enforcer in Claude Code?

Run npx skills add patricio0312rev/skills --skill quality-gates-enforcer -a claude-code. The file will be placed in ~/.claude/skills/quality-gates-enforcer/SKILL.md.

What does quality-gates-enforcer do?

It provides automated CI workflows to enforce code coverage, zero ESLint warnings, TypeScript validation, bundle size caps, and security audits before PRs get merged.

What secrets are needed for the security scanning step?

The Snyk scanner step requires SNYK_TOKEN in your repository secrets, while package auditing relies on native npm audit.

Source text

SKILL.md · MIT
---
name: quality-gates-enforcer
description: Enforces minimum quality thresholds in CI including code coverage, linting, type checking, and security scanning. Provides required checks, PR rules, and automated enforcement. Use for "quality gates", "CI checks", "code quality", or "PR requirements".
---

# Quality Gates Enforcer

Enforce minimum quality standards before merging code.

## Coverage Requirements

```yaml
# .github/workflows/quality-gates.yml
name: Quality Gates

on:
  pull_request:

jobs:
  coverage:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"

      - run: npm ci

      - name: Run tests with coverage
        run: npm test -- --coverage

      - name: Check coverage threshold
        run: |
          COVERAGE=$(node -p "require('./coverage/coverage-summary.json').total.lines.pct")
          THRESHOLD=80

          if (( $(echo "$COVERAGE < $THRESHOLD" | bc -l) )); then
            echo "❌ Coverage $COVERAGE% is below threshold $THRESHOLD%"
            exit 1
          fi

          echo "✅ Coverage $COVERAGE% meets threshold $THRESHOLD%"

      - name: Comment coverage on PR
        uses: romeovs/[email protected]
        with:
          lcov-file: ./coverage/lcov.info
          github-token: ${{ secrets.GITHUB_TOKEN }}
          delete-old-comments: true
```

## Jest Configuration

```javascript
// jest.config.js
module.exports = {
  coverageThreshold: {
    global: {
      branches: 80,
      functions: 80,
      lines: 80,
      statements: 80,
    },
    "./src/critical/": {
      branches: 90,
      functions: 90,
      lines: 90,
      statements: 90,
    },
  },
};
```

## Linting Gate

```yaml
lint:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4

    - uses: actions/setup-node@v4
      with:
        node-version: "20"
        cache: "npm"

    - run: npm ci

    - name: Run ESLint
      run: npm run lint -- --max-warnings 0

    - name: Check formatting
      run: npm run format:check
```

## Type Checking Gate

```yaml
typecheck:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4

    - uses: actions/setup-node@v4
      with:
        node-version: "20"
        cache: "npm"

    - run: npm ci

    - name: TypeScript check
      run: npx tsc --noEmit
```

## Security Scanning

```yaml
security:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4

    - name: Run Snyk security scan
      uses: snyk/actions/node@master
      env:
        SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
      with:
        args: --severity-threshold=high

    - name: Audit dependencies
      run: npm audit --audit-level=moderate

    - name: Check for outdated dependencies
      run: |
        OUTDATED=$(npm outdated || true)
        if [ ! -z "$OUTDATED" ]; then
          echo "⚠️ Outdated dependencies found:"
          echo "$OUTDATED"
        fi
```

## Bundle Size Gate

```yaml
bundle-size:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4

    - uses: actions/setup-node@v4
      with:
        node-version: "20"
        cache: "npm"

    - run: npm ci
    - run: npm run build

    - name: Check bundle size
      uses: andresz1/size-limit-action@v1
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        skip_step: install
```

## Required Status Checks

```yaml
# .github/workflows/required-checks.yml
name: Required Checks

on:
  pull_request:

jobs:
  required:
    runs-on: ubuntu-latest
    needs: [lint, typecheck, test, coverage, security]
    if: always()
    steps:
      - name: Check all required jobs passed
        run: |
          if [ "${{ contains(needs.*.result, 'failure') }}" == "true" ]; then
            echo "❌ Required checks failed"
            exit 1
          fi
          echo "✅ All required checks passed"
```

## Quality Thresholds

```typescript
// quality-thresholds.ts
export const QUALITY_GATES = {
  coverage: {
    lines: 80,
    branches: 80,
    functions: 80,
    statements: 80,
  },
  linting: {
    maxWarnings: 0,
    maxErrors: 0,
  },
  bundleSize: {
    maxSize: "200kb",
    maxGzipSize: "100kb",
  },
  performance: {
    maxLighthouseScore: 90,
  },
  security: {
    maxVulnerabilities: 0,
    maxSeverity: "moderate",
  },
  dependencies: {
    maxOutdated: 5,
  },
};
```

## Branch Protection Rules

```yaml
# Configure via GitHub settings or API
{
  "required_status_checks":
    {
      "strict": true,
      "contexts":
        ["lint", "typecheck", "test", "coverage", "security", "bundle-size"],
    },
  "required_pull_request_reviews":
    {
      "required_approving_review_count": 1,
      "dismiss_stale_reviews": true,
      "require_code_owner_reviews": true,
    },
  "enforce_admins": true,
  "restrictions": null,
}
```

## Quality Report

```yaml
- name: Generate quality report
  run: |
    cat > quality-report.md << EOF
    # Quality Report

    ## Coverage
    - Lines: $(node -p "require('./coverage/coverage-summary.json').total.lines.pct")%
    - Branches: $(node -p "require('./coverage/coverage-summary.json').total.branches.pct")%
    - Functions: $(node -p "require('./coverage/coverage-summary.json').total.functions.pct")%

    ## Linting
    - ESLint warnings: $(npm run lint 2>&1 | grep -c warning || echo 0)
    - ESLint errors: $(npm run lint 2>&1 | grep -c error || echo 0)

    ## Type Safety
    - TypeScript errors: $(npx tsc --noEmit 2>&1 | grep -c error || echo 0)

    ## Security
    - Vulnerabilities: $(npm audit --json | jq '.metadata.vulnerabilities.total')

    ## Bundle Size
    - Main bundle: $(ls -lh dist/main.js | awk '{print $5}')
    EOF

- name: Comment report on PR
  uses: actions/github-script@v7
  with:
    script: |
      const fs = require('fs');
      const report = fs.readFileSync('quality-report.md', 'utf8');
      github.rest.issues.createComment({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
        body: report
      });
```

## Auto-fail on Thresholds

```yaml
- name: Check all quality gates
  run: |
    EXIT_CODE=0

    # Coverage
    COVERAGE=$(node -p "require('./coverage/coverage-summary.json').total.lines.pct")
    if (( $(echo "$COVERAGE < 80" | bc -l) )); then
      echo "❌ Coverage below 80%"
      EXIT_CODE=1
    fi

    # Lint warnings
    WARNINGS=$(npm run lint 2>&1 | grep -c warning || echo 0)
    if [ "$WARNINGS" -gt 0 ]; then
      echo "❌ Found $WARNINGS lint warnings"
      EXIT_CODE=1
    fi

    # TypeScript errors
    if ! npx tsc --noEmit; then
      echo "❌ TypeScript errors found"
      EXIT_CODE=1
    fi

    # Security vulnerabilities
    if ! npm audit --audit-level=moderate; then
      echo "❌ Security vulnerabilities found"
      EXIT_CODE=1
    fi

    exit $EXIT_CODE
```

## Best Practices

1. **Strict thresholds**: No compromises on quality
2. **Fast feedback**: Run checks early in CI
3. **Clear messages**: Explain why checks failed
4. **Incremental improvement**: Gradually increase thresholds
5. **Bypass mechanism**: For emergencies only
6. **Local pre-commit**: Catch issues before push
7. **Team agreement**: Align on standards

## Output Checklist

- [ ] Coverage threshold enforced (80%+)
- [ ] Linting with zero warnings
- [ ] Type checking required
- [ ] Security scanning enabled
- [ ] Bundle size checks
- [ ] Branch protection rules
- [ ] Quality report generated
- [ ] PR comments automated

© patricio0312rev · MIT · patricio0312rev/skills

Similar skills

All skills for DevOps and infrastructure →

From the same set148

The whole set →
secrets-scanner secrets-scanner catches leaked keys, tokens and passwords in a repo, with checks before commit and in CI. Handy when a .env file or a live key already slipped into history. CX Codex +1 287installs project-scaffolder project-scaffolder scaffolds complete starter repositories for web and API frameworks with configs, tooling, working baseline routes, and setup guides. CX Codex +1 287installs background-jobs-designer The background-jobs-designer skill designs queued background work with retries, idempotency, and monitoring. Use it when building BullMQ, Celery, or worker-based processing. CX Codex +1 286installs adr-writer The adr-writer skill turns technical choices into Architecture Decision Records with context, options, tradeoffs, consequences, and owners. Use it when a decision needs a lasting record. CX Codex +1 286installs system-design-generator system-design-generator turns product or feature requirements into architecture plans with components, data flows, API contracts, and scaling notes. Useful before implementation starts. CX Codex +1 284installs pii-redaction-logging-policy-builder pii-redaction-logging-policy-builder sets up redaction rules and a logging policy to keep sensitive user data out of logs. Replaces emails, phone numbers, and payment cards with safe placeholders. CX Codex +1 283installs flaky-test-detective The flaky-test-detective skill traces intermittent test failures to timing, state, random data, or network calls. Use it when a test passes and fails across runs. CX Codex +1 283installs monorepo-setup monorepo-setup lays out a Turborepo and pnpm monorepo: apps, shared packages, TypeScript and ESLint configs, and a build pipeline. CX Codex +1 283installs

Project sponsors

Companies that keep this analytics open