python-code-style

Enforces ruff configuration, naming conventions, and formatting standards for Python projects.

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/chris-prener/dev-kit --skill python-code-style-chris-prener
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python-code-style
Source: https://github.com/chris-prener/dev-kit/tree/main/dev-kit/skills/python-code-style
Command: npx skills add https://github.com/chris-prener/dev-kit --skill python-code-style-chris-prener

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Python teams waste time on inconsistent formatting, naming, and linting debates. This Skill provides a single, enforceable style standard covering ruff configuration, snake_case naming rules, docstring conventions, and file organization so every Python project follows the same conventions. ## Core Features & Use Cases - Ruff Configuration & Formatting: Applies a canonical [tool.ruff] block in pyproject.toml and runs ruff check / ruff format (black-compatible) with auto-fix support. - Naming & Style Rules: Enforces snake_case functions and variables, PascalCase classes, verb-first function names, boolean prefixes like is_/has_, and typed public functions. - Code Organization Standards: Defines import grouping, module docstrings, file size limits, and early-return patterns. - Use Case: When setting up a new Python package, ask Claude to configure linting and formatting — it will write the ruff config, format the codebase, and verify ruff check and ruff format --check both pass cleanly. ## Quick Start Ask Claude to configure ruff linting and formatting for my Python project and fix all style violations in the src directory.

Frequently Asked Questions about python-code-style

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

FAQPage Schema
How do I configure ruff for a Python project?▼

Add a canonical [tool.ruff] block to pyproject.toml defining line length and lint rules, then run uv run ruff check and uv run ruff format. The shared ruff-config partial provides the source-of-truth configuration used across projects.

How to auto-fix Python linting errors with ruff?▼

Run uv run ruff check . --fix to automatically resolve safe violations, then uv run ruff format . to apply black-compatible formatting. In CI, use ruff check and ruff format --check to fail builds on findings.

Does ruff format replace black for Python formatting?▼

Yes, ruff format is black-compatible and replaces black entirely. It enforces 4-space indentation, double quotes, trailing commas, and respects the line-length setting in the [tool.ruff] configuration.

What naming conventions should Python functions and classes follow?▼

Functions and variables use snake_case with verb-first names like calculate_total, classes use PascalCase, constants use SCREAMING_SNAKE_CASE, and booleans are prefixed with is_, has_, should_, or can_. Private members get a leading underscore.

When should I not use this code style skill?▼

It does not write docstring content (use python-documentation), enforce test patterns (python-testing), set up CI pipelines (python-ci), or define packaging conventions (python-packaging). It covers only formatting, naming, and organization rules.