agentleFS
jdharmonjdharmon/skills/python/SKILL.md

python

Skill0 starsChanged 3 months agoMITView on GitHub

Python conventions built entirely on uv. Use whenever installing Python packages, creating or activating a virtual environment, installing or running a Python CLI tool, choosing or pinning an interpreter version, running a Python script, setting up a new Python project, or adding dependencies to an existing one. Also use when about to write any pip, pipx, pyenv, poetry, virtualenv, or `python -m venv` command — those are all replaced here.

  • Installs packages

26 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use typescript, cicd and 9 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.
  • MicrosoftSkill

    typescript

    Use this guide when working on TypeScript changes in the FAST monorepo — authoring Web Components, writing templates and styles, working with the observable/reactive system, and testing.

    Also in 9 projects that use this

  • ffsshhttiikkSkill

    cicd

    Continuous integration and delivery pipelines

    Also in 3 projects that use this

  • martinholovskySkill

    fastapi

    REST API and WebSocket development with FastAPI emphasizing security, performance, and async patterns

    Also in 3 projects that use this

  • 0xSeroSkill

    security

    Also in 7 projects that use this

  • akornmeierSkill

    docker

    Guide for using Docker - a containerization platform for building, running, and deploying applications in isolated containers. Use when containerizing applications, creating Dockerfiles, working with Docker Compose, managing images/containers, configuring networking and storage, optimizing builds, deploying to production, or implementing CI/CD pipelines with Docker.

    Also in 4 projects that use this

  • MicrosoftSkill

    code-quality

    Statically check changed C# against the same deterministic rules github-code-quality[bot] runs on pull requests, so a contributor can fix likely findings before opening the PR and keep the bot's inline comments to a minimum. Activate when a contributor asks to "check code quality", "run code quality on my changes", "will the code quality bot complain", "pre-check before I open the PR", "code quality check", or similar. Scoped to C#. Reads the diff and compares it against the enumerated csharp-code-quality rule set below — no CodeQL download or build required. This is a fast approximation of a dataflow engine, not a reproduction; report accordingly. Does NOT apply fixes unless explicitly asked.

    Also in 3 projects that use this

  • +1 more from microsoft

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never invoke pip, pipx, poetry, pyenv, virtualenv, or python -m venv directly.

    line 12
  2. Very specific:

    Commit pyproject.toml and uv.lock.

    line 43
  3. Very specific:

    Prefer this over a bare venv even for small things — the lockfile makes the environment reproducible, and uv run removes any question of …

    line 45
  4. Very specific:

    Only when a pyproject.toml is not appropriate, such as an existing requirements.txt repo you don't own:

    line 49
  5. Distinctive:

    Never install something permanently just to run it once.

    line 63
  6. Distinctive:

    Prefer uv-managed standalone builds over whatever Python the OS ships:

    line 87

“Common” is measured: kept by at least 6 in 10 of the 24 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

uv is the only entry point for Python work: packages, tools, virtual environments, and interpreters.

The rule that matters: nothing is ever installed into a system or user-level site-packages. Every package lives in either a project venv or a uv-managed tool venv. A system Python that has been written to is contaminated and hard to clean up, so treat the boundary as absolute rather than as a default to be overridden when convenient.

Never invoke pip, pipx, poetry, pyenv, virtualenv, or python -m venv directly.

Replacements

Instead ofUse
python3 -m venv .venv, virtualenvuv venv
pip install <pkg>uv add <pkg> (project) or uv pip install <pkg> (bare venv)
pip install -r requirements.txtuv pip install -r requirements.txt
pip uninstall <pkg>uv remove <pkg> or uv pip uninstall <pkg>
pip freeze, pip listuv pip freeze, uv pip list
pipx install <tool>uv tool install <tool>
pipx run <tool>uvx <tool>
pyenv install 3.13uv python install 3.13
pyenv local 3.13uv python pin 3.13
python script.pyuv run script.py
source .venv/bin/activatenot needed — uv run and uv pip auto-detect ./.venv

Projects (preferred)

Anything with — or deserving — a pyproject.toml. uv creates and manages .venv for you.

uv init                 # new project
uv add <package>        # dependency (updates pyproject.toml + uv.lock)
uv add --dev <package>  # dev-only dependency
uv remove <package>
uv sync                 # reconcile .venv with uv.lock
uv run <command>        # run inside the project env

Commit pyproject.toml and uv.lock. Never commit .venv/.

Prefer this over a bare venv even for small things — the lockfile makes the environment reproducible, and uv run removes any question of which interpreter is active.

Bare virtual environments

Only when a pyproject.toml is not appropriate, such as an existing requirements.txt repo you don't own:

uv venv                            # creates ./.venv
uv pip install <package>           # installs into ./.venv, no activation needed
uv pip install -r requirements.txt

uv pip resolves the target environment from ./.venv or $VIRTUAL_ENV. If neither exists it errors rather than falling back to system Python — that failure is correct behavior, so create a venv instead of reaching for --system.

Watch for an inherited VIRTUAL_ENV from an unrelated directory; it wins over ./.venv and will silently install into the wrong environment. Check it before installing if the shell state is uncertain.

One-off scripts and tools

Never install something permanently just to run it once.

uvx ruff check .                 # run a CLI tool in a throwaway env
uv tool install ruff             # install a CLI tool persistently, in its own venv
uv run --with httpx script.py    # ad-hoc dep; does not touch the project env
uv run --no-project script.py    # run ignoring any surrounding project

uv tool install gives each tool its own isolated venv and links only the executable onto PATH, so tools never share a dependency graph with each other or with a project.

For standalone scripts, prefer PEP 723 inline metadata so dependencies travel with the file:

# /// script
# requires-python = ">=3.12"
# dependencies = ["httpx"]
# ///

Then uv run script.py builds the environment on demand — no project, no venv to manage.

Interpreters

Prefer uv-managed standalone builds over whatever Python the OS ships:

uv python install 3.13   # download a managed interpreter
uv python pin 3.13       # write .python-version for this project
uv python list

Set UV_MANAGED_PYTHON=1 (or pass --managed-python) to make uv refuse to fall back to a system interpreter.

Never

  • sudo pip, sudo uv, or any install as root
  • pip install --user, pip install --break-system-packages
  • uv pip install --system — installs into the system interpreter and defeats the point
  • Modifying the Homebrew or OS-vendored Python in any way
  • Committing .venv/

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.