pre-commit

Automate Python code quality checks and formatting with pre-commit hooks.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/bswrundquist/devtools --skill pre-commit-bswrundquist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pre-commit
Source: https://github.com/bswrundquist/devtools/tree/main/src/devtools/templates/claude/user/.claude/skills/pre-commit
Command: npx skills add https://github.com/bswrundquist/devtools --skill pre-commit-bswrundquist

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers automate code quality checks and formatting before code is committed, ensuring consistency and catching errors early in the development cycle.

Core Features & Use Cases

  • Automated Linting & Formatting: Integrates tools like Ruff and MyPy to enforce code style and catch bugs.
  • Pre-commit Hook Management: Simplifies the setup and maintenance of .pre-commit-config.yaml.
  • CI Integration: Provides examples for integrating pre-commit checks into GitHub Actions and GitLab CI.
  • Use Case: Ensure all Python code adheres to project standards and is free of common errors before each commit, reducing review time and merge conflicts.

Quick Start

Set up pre-commit hooks by running pip install pre-commit and then pre-commit install.

Frequently Asked Questions about pre-commit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Python code formatting and linting before commits?

Automate Python code formatting and linting by configuring pre-commit hooks to run tools like Ruff and MyPy locally before each commit. This catches style violations and bugs early, ensuring consistency across the project.

What is the best way to configure pre-commit hooks for a Python project?

The best way to configure pre-commit hooks is by managing the `.pre-commit-config.yaml` file. This configuration specifies which hooks to run, integrating linters and type checkers to enforce code standards automatically.

Can I integrate pre-commit checks into GitHub Actions or GitLab CI?

Yes, you can integrate pre-commit checks into GitHub Actions and GitLab CI. The setup provides examples for running these automated code quality checks in your continuous integration pipelines to prevent merging faulty code.

Do I need to install pre-commit separately before using this configuration?

Yes, you need to install pre-commit separately using `pip install pre-commit` and run `pre-commit install` to set up the git hooks in your local repository before the configuration takes effect.

Why use pre-commit hooks instead of running linters manually?

Using pre-commit hooks automates code quality checks before code is committed, ensuring consistency and catching errors early. This reduces manual review time and prevents merge conflicts by enforcing standards locally.

Does this setup support type checking with MyPy and linting with Ruff?

Yes, the setup supports type checking with MyPy and linting with Ruff. It manages the integration of these tools within the `.pre-commit-config.yaml` to enforce code style and catch bugs automatically.