Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

quality-gates

БесплатноБез исполняемых скриптовНе проверен

Run comprehensive quality checks including linting, type checking, tests, and security audits before commits or deployments

aiskillstoreот aiskillstore★ 509 звёзд на GitHub17 установок в других каталогах

Об этом скилле

Quality Gates Skill

Objective

Enforce code quality standards by running automated checks that must pass before code can be committed, merged, or deployed. Acts as a guardian ensuring consistent quality across the codebase.

When to Use This Skill

Auto-invoke when:

  • User completes feature implementation
  • Before creating commits or pull requests
  • User asks to "test", "validate", "check quality", or "verify"
  • Before deployment or release
  • After significant refactoring

Quality Gate Levels

Level 1: Pre-Commit Gates (Fast, < 30 seconds)

Essential checks that run before every commit.

Level 2: Pre-Push Gates (Moderate, < 2 minutes)

Comprehensive checks before pushing to remote.

Level 3: Pre-Deploy Gates (Thorough, < 5 minutes)

Complete validation before production deployment.

Gate Execution Workflow

Gate 1: Linting (JavaScript/TypeScript)

Purpose: Enforce code style and catch common errors

Tools: Bash, Read

Process:

  1. Detect linter by checking for:

    • ESLint: .eslintrc*, eslint.config.*
    • Biome: biome.json
    • None: Skip this gate
  2. Read package.json to find lint script:

    "scripts": {
      "lint": "eslint .",
      "lint:fix": "eslint . --fix"
    }
    
  3. Execute linter:

    # Try to run lint script
    npm run lint
    
    # If fails, try direct commands
    npx eslint . || npx biome check .
    
  4. Parse results:

    • Exit code 0: ✅ PASS
    • Exit code non-zero: ❌ FAIL
    • Extract error count and file locations
  5. Auto-fix attempt (if failures found):

    npm run lint:fix || npx eslint . --fix
    

Success Criteria: Zero linting errors (warnings acceptable)

Gate 2: Type Checking (TypeScript)

Purpose: Verify type safety and catch type errors

Tools: Bash, Read, Grep

Process:

  1. Detect TypeScript by checking for:

    • tsconfig.json
    • TypeScript in dependencies
  2. Read tsconfig.json to check strictness:

    • strict: true
    • noImplicitAny, strictNullChecks, etc.
  3. Execute type checker:

    # Try to run typecheck script
    npm run typecheck || npm run type-check
    
    # If no script, run directly
    npx tsc --noEmit
    
  4. Parse results:

    • Exit code 0: ✅ PASS
    • Exit code non-zero: ❌ FAIL
    • Extract error count and locations

Success Criteria: Zero type errors

Gate 3: Unit & Integration Tests

Purpose: Verify code functionality and prevent regressions

Tools: Bash, Read, Grep

Process:

  1. Detect test framework:

    • Vitest: vitest.config.*, vitest in dependencies
    • Jest: jest.config.*, jest in dependencies
    • Native test: --test flag with Node.js 20+
  2. Count test files:

    # Use Grep to find test files
    find . -name "*.test.*" -o -name "*.spec.*" | wc -l
    
  3. Execute tests:

    # Run unit tests (fast)
    npm run test || npm run test:unit
    
    # Or direct command
    npx vitest run || npx jest --ci
    
  4. Parse results:

    • Total tests run
    • Passed / Failed / Skipped
    • Coverage percentage (if available)
  5. Coverage check (if configured):

    npm run test:coverage
    
    # Check if meets threshold (e.g., 80%)
    

Success Criteria:

  • All tests pass (100%)
  • Coverage ≥ configured threshold (if set)

Gate 4: Build Verification

Purpose: Ensure code compiles and builds without errors

Tools: Bash

Process:

  1. Detect build system:

    • Next.js: next build
    • Vite: vite build
    • Webpack: webpack --mode production
    • TypeScript: tsc
  2. Execute build:

    npm run build
    
  3. Check build artifacts:

    • Verify output directory exists: dist/, build/, .next/
    • Check for build errors in logs
  4. Clean up (optional):

    # Remove build artifacts to save space
    rm -rf dist/ build/ .next/
    

Success Criteria: Build completes with exit code 0

Gate 5: Security Audit

Purpose: Identify known vulnerabilities in dependencies

Tools: Bash, Read

Process:

  1. Run npm/pnpm audit:

    npm audit --json || pnpm audit --json
    
  2. Parse audit results:

    • Critical vulnerabilities: 0
    • High vulnerabilities: 0
    • Moderate vulnerabilities: < threshold
    • Low vulnerabilities: informational
  3. Check for specific vulnerabilities:

    • Prototype pollution
    • Remote code execution (RCE)
    • SQL injection
    • Cross-site scripting (XSS)
  4. Suggest fixes:

    npm audit fix
    # or
    npm audit fix --force  # (if safe)
    

Success Criteria:

  • Zero critical/high vulnerabilities
  • Moderate vulnerabilities acknowledged or fixed

Gate 6: Code Complexity Analysis (Optional)

Purpose: Flag overly complex code that may need refactoring

Tools: Grep, Bash

Process:

  1. Detect code complexity tools:
    • eslint-plugin-complexity
    • SonarQube
    • CodeCl
Полный SKILL.md на GitHub

Установить quality-gates в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

skill-report.json

FAQ

Что делает скилл quality-gates?

Run comprehensive quality checks including linting, type checking, tests, and security audits before commits or deployments

Как установить скилл quality-gates?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл quality-gates запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить quality-gates с