quality-gates

Python code quality gates script for linting, type checking, complexity analysis, and testing before commits. Use when enforcing consistent code quality across Python projects with fast (unit-tests) or comprehensive (all-tests) modes.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "quality-gates" with this command: npx skills add ederheisler/agent-skills/ederheisler-agent-skills-quality-gates

Quality Gates

Overview

Project-agnostic bash script enforcing Python code quality gates using pyrefly, radon, hypothesis, pytest, and markdownlint. Three execution modes provide flexibility for different workflows: unit-tests for fast feedback, all-tests for comprehensive pre-merge validation, no-tests for static analysis only. Coverage runs are excluded by default; run coverage only when the user explicitly requests it.

When to Use

Before committing Python code to enforce consistent quality checks across projects without directory structure assumptions.

Modes

ModeGates RunUse Case
unit-testspyrefly, radon, hypothesis checks, pytest (unit/), markdownlintFast feedback during development
all-testspyrefly, radon, hypothesis checks, pytest (unit/ + integration/), markdownlintPre-merge/deploy comprehensive check
no-testspyrefly, radon, hypothesis checks, markdownlintStatic analysis only (time critical)

Quick Start

Running quality gates:

Make sure uv is installed.

# Fast feedback: lint + type check + unit tests
.claude/skills/quality-gates/scripts/quality-gates.sh unit-tests

# Pre-merge: everything including integration tests
.claude/skills/quality-gates/scripts/quality-gates.sh all-tests

# Quick static checks only
.claude/skills/quality-gates/scripts/quality-gates.sh no-tests

Implementation Details

  • Script: scripts/quality-gates.sh - Uses uv/uvx for tool management
  • Excluded directories: tests, test, docs, doc, examples, scripts, build, dist, .venv, venv, .tox, .git, node_modules, pycache, *.egg-info
  • Graceful fallbacks: Skips missing tools without failing

Common Anti-Patterns

RationalizationReality
"Time-critical, skip checks"Use no-tests mode for fast static validation
"Already tested manually"Automation catches edge cases manual testing misses
"Partial checks sufficient"Modes provide full coverage options; incomplete coverage misses bugs
"Coverage by default"Coverage pollutes context; run it only when explicitly requested
"Too slow"Tools are fast; skipping misses complexity and type issues
"Script not in project"Copy to project to .claude/; run locally
"Tools not installed"Install uv; graceful fallbacks skip missing tools

Red Flags

Stop and re-evaluate if you're:

  • Skipping all checks
  • "This time is different"
  • "Good enough for now"
  • Rationalizing under deadline pressure
  • Adding coverage without an explicit request

All of these suggest running the script with the appropriate mode.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

test-driven-development

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

subagent-driven-development

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

finishing-a-development-branch

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

ask-questions-if-underspecified

No summary provided by upstream source.

Repository SourceNeeds Review