agentleFS
scoobydont-666scoobydont-666/shared-claude-skills/skills/modern-python/SKILL.md

modern-python

Skill1 starsChanged 29 days agoMITView on GitHub

Configure or migrate Python projects using uv, Ruff, pytest and a supported type checker; maintain packaging, dependency and script conventions.

10 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Use an approved installation of uv and inspect the installed version's help.

    line 14
  2. Very specific:

    Add actual runtime dependencies with uv add.

    line 28
  3. Very specific:

    Use [dependency-groups] for development tools and [project.optional-dependencies] for optional installed product features.

    line 33
  4. Distinctive:

    Only remove obsolete configuration after all consumers, including CI and release jobs, have migrated.

    line 59
  5. Distinctive:

    Follow the migration checklist.

    line 62
  6. Distinctive:

    Use meaningful tests for accepted behavior, error paths and state isolation.

    line 66
  7. Distinctive:

    Run local checks through pre-commit or prek if the repository uses them.

    line 73
  8. Distinctive:

    Run the selected formatting, linting, typing, tests, build and installation checks against the changed revision.

    line 83

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

Modern Python

Inspect the supported Python versions, existing package manager, build backend, lockfile, CI and tests first. Preserve functioning project conventions unless a migration is requested. A different formatter or type checker is not itself a defect. Background inspiration: https://github.com/trailofbits/cookiecutter-python.

New project

Use an approved installation of uv and inspect the installed version's help. For a plain application, uv init myproject creates a root main.py; for an installable package, use uv init --package myproject and inspect its generated source layout and build configuration. Do not copy a stale backend version pin.

uv init myproject
cd myproject
uv add --group dev ruff pytest
uv run python main.py
uv run ruff check .
uv run pytest

Add actual runtime dependencies with uv add. Choose a type checker compatible with the project's annotations and integrations; ty is one option, while existing mypy or Pyright configurations may remain appropriate. Do not remove stubs or checks simply because a different tool produces fewer findings.

Use [dependency-groups] for development tools and [project.optional-dependencies] for optional installed product features. Commit the resolved lockfile for a uv project. Match Python/tool targets to the supported interpreter range. Configure Ruff incrementally around existing style, and keep formatting changes separate when they would obscure a behavior change.

See pyproject configuration, uv commands, and Ruff settings.

Scripts

For a standalone script with dependencies, consider PEP 723 inline metadata and uv run script.py. Inspect dependencies and source before execution; metadata is not a trust guarantee. See script examples.

Migration

Record baseline tests, supported platforms, entry points, dependency groups and build artifacts. Work in an isolated branch and keep the old configuration until the replacement preserves required behavior. Translate constraints, indexes, extras and environment markers deliberately; do not filter requirement lines through a loop that hides errors and then delete the source files.

Validate the lockfile with uv lock --check or use uv sync --locked. The --frozen flag skips the freshness check; it is not a substitute. Test package build and installation in a clean environment as well as source-tree tests. Only remove obsolete configuration after all consumers, including CI and release jobs, have migrated. Preserve history and a practical rollback path.

Follow the migration checklist.

Tests, security and CI

Use meaningful tests for accepted behavior, error paths and state isolation. Coverage percentages supplement those checks; they do not establish correctness. See pytest examples and adapt fixtures to the actual app and installed plugins, including ASGI lifespan and database transaction behavior.

Choose scanners for the project's threats; distinguish findings from tool/network failures, and preserve nonzero outcomes. See security setup. Run local checks through pre-commit or prek if the repository uses them. Keep CI as the authoritative execution path for required checks.

Public repositories use GitHub-hosted runners. Private repositories use approved private runners with isolation suitable for the code's trust level. Pin external Actions to verified full commit SHAs and use minimal token permissions. Use Dependabot configuration for reviewed dependency updates.

Verification and handoff

Run the selected formatting, linting, typing, tests, build and installation checks against the changed revision. Record what executed, what failed or could not run, and the exact interpreter/tool versions. Never claim migration success when the lockfile changed unexpectedly, tests were not collected, or a required consumer still uses the old configuration.

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.