Guide · Agent skill
How to use the Python Code Style Guide agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The python-code-style skill is a set of written Python style rules that an AI agent loads and follows when it writes or reviews code. It covers linting and formatting with ruff, strict type checking with mypy or pyright, PEP 8 naming, a fixed import order and Google-style docstrings. This guide shows you how to install the skill, ask for work in a way that triggers it, and check that the output matches what you wanted.
Quick start
- 1Download the ZIP. Get the python-code-style ZIP from this page and unzip it. The folder contains SKILL.md.
- 2Place the skill folder. Move it to ~/.claude/skills/ for all projects, or to .claude/skills/ inside one project. Alternatively, upload it in the Claude apps under Settings → Capabilities → Skills.
- 3Install the tools. Run pip install ruff mypy in your Python environment, or install pyright if you prefer it for type checking.
- 4Ask in plain language. Make a request that involves writing code, reviewing style, configuring linters, writing docstrings or setting project standards.
- 5Review the configuration. Check the pyproject.toml snippet against your project's line length, quote style and minimum Python version before you accept it.
- 6Run the tools. Run ruff check --fix and ruff format, then run mypy or pyright and fix the reported issues.
What does this skill make the agent do?
When the skill is installed, the agent follows a defined set of Python style rules while writing or reviewing code. It recommends ruff as an all-in-one linter and formatter, and mypy or pyright for strict type checking. It also applies PEP 8 naming conventions, groups imports as standard library, third-party, then local, and uses absolute imports rather than relative ones.
The skill also tells the agent to write Google-style docstrings for public classes, methods and functions. It can produce pyproject.toml configuration snippets and README-style project documentation in that format.
- Linting and formatting setup with ruff, including a sample [tool.ruff] configuration
- Strict type checking setup with mypy, or pyright as an alternative
- Naming rules: snake_case for modules and functions, PascalCase for classes, SCREAMING_SNAKE_CASE for constants
- Import order and absolute-import preference
- Google-style docstrings with Args, Returns, Raises and Example sections
- Project README and CHANGELOG (Keep a Changelog) templates
Install the skill from the ZIP
Download the ZIP for this skill from this page and unzip it. The skill is a folder that contains a single file, SKILL.md. Put that folder in one of two places, depending on how you want to use it.
For all of your projects, place it in your personal skills folder at ~/.claude/skills/. For one project only, place it in that project's .claude/skills/ folder so it travels with the repository.
If you use the Claude apps instead of a local setup, you can upload the skill there under Settings → Capabilities → Skills.
- Personal (all projects): ~/.claude/skills/
- Single project: .claude/skills/ inside the project folder
- Claude apps: Settings → Capabilities → Skills, then upload
Set up the tools the skill relies on
The skill needs a Python environment and pip, so the tools it recommends can be installed. The source installs ruff and mypy with pip. If you prefer pyright for type checking, install that instead of mypy.
The skill does not run scripts or use the network itself. Installing ruff and mypy is your own step, and the agent's advice assumes those tools are available in your project.
- A Python environment
- pip, to install ruff and mypy (or pyright)
pip install ruff mypyTrigger the skill with natural requests
You do not need a special command. The skill is meant to load when your request involves writing new code, reviewing style, configuring linters, writing docstrings or establishing project standards. Say what you want in plain words and mention Python so the agent knows which rules apply.
Be specific about the outcome. A request such as 'set up ruff and strict mypy for this new Python project' tells the agent exactly which configuration to produce. A request such as 'review this pull request for Python style' asks for feedback against the same rules.
- 'Set up linting and formatting for this new Python project.'
- 'Configure ruff and strict mypy in pyproject.toml.'
- 'Write Google-style docstrings for the public functions in this module.'
- 'Review this Python file for naming and import style.'
- 'Create a README for this project in the standard format.'
Read the output with the rules in mind
The skill makes the agent apply its own conventions, so check the result against your project's needs. The sample configuration uses a 120-character line length, double quotes, space indentation and strict mypy settings such as disallow_untyped_defs. Test scope is handled by an override that relaxes untyped-definition checks for tests.*, which you can keep or change.
Treat generated configuration as a starting point. Run ruff check and ruff format on the code, and run mypy or pyright, then fix what they report.
- Check the line length and quote style against your team's standard
- Confirm the Python target version matches your project's minimum version (the source says to adjust it)
- Run the tools the skill names and review any warnings
ruff check --fix .
ruff format .When this skill is not the right fit
The skill pushes its own conventions. If your project already uses a different style guide, such as Black with a custom configuration or NumPy-style docstrings, the agent will likely suggest changing to its rules instead of matching yours. Pick a different approach or give the agent your existing standard explicitly.
The skill only addresses Python. For other languages the advice does not apply.
- Existing Black with custom config: expect conflicts
- Existing NumPy docstrings: the skill recommends Google style
- Non-Python codebases: out of scope
What people use it for
- Setting up ruff, strict mypy and a pyproject.toml for a new Python project
- Getting consistent feedback on naming and import order in a Python pull request
- Writing Google-style docstrings for the public API of an existing module
- Drafting a README or CHANGELOG in the format the skill describes
Frequently asked questions
Is the Python code style skill free?
The skill is published under the MIT licence, as stated on this page. The tools it recommends, ruff, mypy and pyright, are separate projects that you install yourself with pip. Check the licence file in the source repository for the exact terms.
What do I need to use this skill?
You need a Python environment and pip so you can install ruff and mypy (or pyright). The skill does not run scripts and does not use the network. It is a single SKILL.md file that the agent reads.
Where do I put the skill so Claude can find it?
Put the unzipped skill folder in ~/.claude/skills/ to use it across projects, or in .claude/skills/ inside a single project. In the Claude apps, upload it under Settings → Capabilities → Skills.
Why does the agent ignore my Black config or NumPy docstrings?
The skill applies its own conventions, which are ruff, PEP 8 naming, absolute imports and Google-style docstrings. If your project uses a different style guide, the agent may push its rules instead. State your existing standard clearly in the request, or do not use this skill for that project.
Should I use mypy or pyright with this skill?
The skill lists both. It gives mypy with strict = true as the main configuration and pyright with typeCheckingMode set to strict as an alternative that the source describes as faster. Choose one based on your team's tooling preference.
Does the skill run my linters for me?
No. The skill guides the agent's writing and review and produces configuration. You run ruff, mypy or pyright yourself, for example with ruff check --fix . and ruff format .
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you are setting up linting, formatting and type checking in a new Python project, or want a shared written standard for naming, imports and docstrings that an agent can apply in reviews. Pick something else if your project already follows a different style guide, such as Black with custom settings or NumPy docstrings, because this skill will push its own conventions. It is not relevant for non-Python code.
Download the skill