agentleFS
jmlrtjmlrt/skills/python-development/SKILL.md

python-development

Skill0 starsChanged 4 months agoMITView on GitHub

Guide Python development with greenfield defaults and brownfield flexibility. Apply when writing, maintaining, or reviewing Python code to ensure consistency with modern tooling (uv, ruff, ty, pytest, pre-commit) and patterns (CLI separation, type safety, error handling).

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use javascript-typescript, typescript-development and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • pepebot-spaceSkill

    javascript-typescript

    JavaScript and TypeScript development with ES6+, Node.js, React, and modern web frameworks. Use for frontend, backend, or full-stack JavaScript/TypeScript projects.

    Also in 4 projects that use this

  • carloss765Skill

    typescript-development

    Comprehensive guidelines for writing type-safe, scalable TypeScript applications. Use when working with .ts files, TypeScript projects, or when adding type safety to JavaScript code.

    Also in 4 projects that use this

  • carloss765Skill

    rust-development

    Comprehensive guidelines for writing safe, concurrent, and performant Rust code. Use when working with .rs files, building systems software, or high-performance applications.

    Also in 3 projects that use this

  • harrissohail6Skill

    database-design

    Database schema design and SQL best practices. Use when designing tables, writing queries, or optimizing database performance.

    Also in 3 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 3 projects that use this

  • JetBrainsSkill

    brand-guidelines

    Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the existing code and tooling first and match it.

    line 41
  2. Distinctive:

    Keep the existing build system.

    line 44
  3. Very specific:

    Keep a flat tests/ under ~50 tests.

    line 47
  4. Distinctive:

    When a blocker is found, grep for the same pattern across the codebase and report every instance.

    line 65

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Python Development

Personal tooling defaults and non-obvious patterns. Generic Python knowledge is assumed.

Supporting Files

  • tooling.md — read when setting up a greenfield project: pyproject.toml, Makefile, .pre-commit-config.yaml templates (use them verbatim)
  • patterns.md — read when structuring a CLI, defining exceptions, or writing tests that touch module-level state

Toolchain

uv (uv sync, uv run), ruff (check + format), ty (or mypy if the repo uses it), pytest, pre-commit; make targets install, test, lint, fmt/format, typecheck, check. Older repos may use other tools (e.g. poetry): read the Makefile first.

Greenfield Defaults

  • Python 3.12 (.python-version), hatchling, src/ layout with cli.py, commands/, core/; tests/conftest.py.
  • Modern type hints on every function (str | None, list[str], collections.abc), no from __future__.
  • One-line docstring per function and module; no Args:/Returns: sections.
  • Absolute imports only; pathlib.Path only; @dataclass for models with 2+ fields.
  • Output via typer.echo; add Rich + logging only when a --verbose flag is requested.
  • Config: tomllib + TOML file; Pydantic only for nested config needing validation. Env vars only for secrets or CI overrides.
  • __init__.py empty, or just __version__ when the CLI has --version.
  • TYPE_CHECKING guard only after hitting a real circular import.
  • Done when make install && make check passes and pre-commit install is enabled.

Brownfield

Read the existing code and tooling first and match it; don't retrofit greenfield defaults or change tooling unless asked.

  • Keep the existing build system; missing → hatchling.
  • Python ≤3.11 → keep it.
  • Type checking: 80%+ hint coverage → ty check; less → ruff check only; none → tests only.
  • Keep a flat tests/ under ~50 tests.
  • Refactor argparse/custom CLIs to Typer only when actively developing them.

Review Checklist

Blockers

  • Bare except: or except Exception without re-raising
  • Unused imports or dead code
  • Hardcoded secrets

Nits

  • Missing type hints or docstrings; os.path; mutable default arguments
  • Re-raise without from e; raising base Exception instead of a domain error
  • Tests touching real filesystem or env without tmp_path / monkeypatch
  • Module-level mutable state not isolated by an autouse fixture — see patterns.md

When a blocker is found, grep for the same pattern across the codebase and report every instance.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.