Back to .md Directory

Backend

Defines Python tooling rules and a linting/formatting workflow using uv, pyrefly, and black.

May 2, 2026
0 downloads
0 views
View source

What this file does

Defines Python tooling rules and a linting/formatting workflow using uv, pyrefly, and black.

When to use it

  • You want to enforce uv as the only Python package manager
  • You need a simple make-based lint-and-format check for Python code
  • You want to prevent direct edits to pyproject.toml

Assumes this stack

Pythonuvpyreflyblackmake

Backend

Python

Always use uv for Python. Never edit pyproject.toml directly. Never use pip.

Linting and formatting

After every bigger code change, run:

make check-and-format-py

This runs pyrefly (type checker) then black (formatter). Fix any errors before proceeding.

By bigger code we mean that you should not actually run this check every time you edit something, but you should always run it before you try to present the code to the user.

What's inside

2 sections: Python tooling rule and linting/formatting workflow with one make command.

Change this for your project

  • Replace make check-and-format-py with your own make target if different
  • Replace pyrefly with your preferred type checker if different

Where it goes

Save as CLAUDE.md in your repository root. Claude Code reads it automatically at the start of every session.

Related Documents