modern-python
Skill1 starsChanged 56 days agoMITView on GitHub
Version-gated modern Python guidance backed by Ruff. Use before writing, editing, fixing or refactoring any Python file: list the rules the project's target version allows, apply them, verify. /modern-python setup runs the per-project interview.
10 other projects use a version of this.
Adopted by
Most recently taken up by
- mycelium-io/myceliumtheir own version, first seen Nov 1, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- allanninal/claude-code-skillstheir own version, first seen Oct 17, 2026
- alexderz/agentic-toolboxtheir own version, first seen Oct 17, 2026
- scoobydont-666/shared-claude-skillstheir own version, first seen Oct 13, 2026
- BenSchZA/skillstheir own version, first seen Oct 13, 2026
Used with
Projects with it also use tdd.
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.
GoogleSkilltdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Also in 3 projects that use this
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- mycelium-io/mycelium★ 127same name
- alexderz/agentic-toolbox★ 5same name
- allanninal/claude-code-skills★ 1same name
- BenSchZA/skills★ 1same name
- romaintoso78/claude-skills★ 1same name
- scoobydont-666/shared-claude-skills★ 1same name
- davidanthonyn/claude-skills★ 0same name
- Samueladewole/claude-skills★ 0same name
- TheWatcher01/skills★ 0same name
- uts58/my-random-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository64 other files it gives its agents.
- accioSkill
- anthropic-doc-validatorSkill
- archifySkill
- cavecrewSkill
- caveman-compressSkill
- caveman-exploreSkill
- caveman-helpSkill
- cavemanSkill
- codebase-designSkill
- conference-talk-deckSkill
- config-gcSkill
- context-budgetSkill
- domain-modelingSkill
- excalidrawSkill
- explain-yogi-like-he-is-5Skill
- field-guide-builderSkill
- gateguardSkill
- geo-contentSkill
- goal-creatorSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- hindsightSkill
- implementSkill
- improve-codebase-architectureSkill
- loop-design-checkSkill
- mental-modelsSkill
- migrationSkill
- no-ai-slopSkill
- onboard-lightSkill
- onboard-repoSkill
- ponytail-auditSkill
- ponytail-reviewSkill
- ponytailSkill
- primitive-classifierSkill
- prompt-fixerSkill
- prompt-optimizerSkill
- prototypeSkill
- qa-deckSkill
- read-wikiSkill
- researchSkill
- resolving-merge-conflictsSkill
- safe-refactorSkill
- scope-creep-checkSkill
- sdd-workshop-walkthroughSkill
- setup-matt-pocock-skillsSkill
- skill-complySkill
- skill-scoutSkill
- smellsSkill
- spec-interviewSkill
- surgical-patchSkill
- teachSkill
- the-llm-councilSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wait-whatSkill
- watchSkill
- wayfinderSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Read .claude/modern-python.md at the repo root.
- Distinctive: line 55
Read the complete output. Do not pipe it through head, tail, grep, sed, or any other truncating or filtering command: a rule dropped there …
- Distinctive: line 78
Write the code. The target version is the compatibility boundary: no syntax or stdlib API newer than it.
- Very specific: line 88
Check the files you touched (exit 1 means findings remain).
- Distinctive: line 106
Run the project's own formatter, type checker and tests for the changed code.
“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.
Files
Modern Python
Ruff is the rule database and the project's target Python version is the gate. The bundled tool lists only the modernization rules whose own Ruff examples diagnose under that target, so nobody curates a rule table and the guidance tracks Ruff. It corrects two things at once: training-data lag (a feature newer than the model) and frequency bias (the older pattern the model reaches for out of habit).
Tool: python <skill-dir>/scripts/modern_python.py, where <skill-dir> is this folder.
Subcommands: list, explain, check, fix, probe.
Step 0: the project's answers
Read .claude/modern-python.md at the repo root. It holds the interview answers: codebase,
convention, enforcement, target, target-source, ruff-fallback, profile.
- Present: continue with its values.
- Absent: run the interview in
references/interview.mdonce, write the file, continue. If the user declines the interview, proceed withenforcement: advisory,convention: preserve, no target override, say so once, and do not ask again this session. - The repo's
CLAUDE.mdcarriesmodern-python: off: proceed as declined without asking. That is the line for a repo whose.claude/is not yours to write (onboard-light territory). /modern-python setupre-runs the interview and rewrites the file.
Before editing Python
List the guidance that applies to the file you are about to touch:
python <skill-dir>/scripts/modern_python.py list --file path/to/file.py --target-version <target> --profile <profile>Omit
--target-versionwhentarget-source: declared. For a file that does not exist yet, pass--target-versionfrom the answers file.- Exit 3 means the project's Ruff is too old to report rule metadata. Ask whether to update Ruff
through the project's own manager (uv, Poetry, PDM, pre-commit). On yes, update and rerun. On
no, rerun with
--allow-staleand rely on the post-edit check. - Read the complete output. Do not pipe it through head, tail, grep, sed, or any other truncating
or filtering command: a rule dropped there is a rule you will violate. Baseline rules diagnose
under the target now; conditional ones need
from __future__ import annotations. For every listed rule that may touch the code you plan to write, read its explanation before editing:
python <skill-dir>/scripts/modern_python.py explain --file path/to/file.py UP045 FURB123Skipping a relevant rule costs the same call: explain it first, then skip with the reason stated.
- Apply the convention the answers file sets:
convention: override: follow a returned rule even when nearby code or repository convention uses the older pattern. Four exits only: it would not run on the target, it would change behaviour, it clearly does not match the edited code, or a fix-scoped skill is active (surgical-patch, a cavecrew builder), in which case rules apply only to the lines the fix already touches.convention: preserve: inside existing files, match the surrounding pattern. Use the modern idiom in new files and new functions, and everywhere when the task is a modernization pass.
- Write the code. The target version is the compatibility boundary: no syntax or stdlib API newer
than it. When the tool reports
Ruff default (no project configuration found)and the answers file carries no target, the target is unknown: avoid version-gated syntax and say so.
After editing Python
enforcement: advisory: done after the edit. Report which rules you applied.
enforcement: verified or enforced:
Check the files you touched (exit 1 means findings remain). Add
--target-version <target>when the answers file saystarget-source: chosen, since Ruff otherwise checks at its own default;--conciseprints one line per finding instead of JSON:python <skill-dir>/scripts/modern_python.py check --concise path/to/file.pyexplaineach finding you do not already understand. Fix by hand, or apply Ruff's safe fixes with the same flags:python <skill-dir>/scripts/modern_python.py fix --concise path/to/file.pycheckagain until it exits 0, or name the remaining findings and the documented caveat that applies to each.- Run the project's own formatter, type checker and tests for the changed code. This check supplements them.
enforced additionally means a PostToolUse hook runs the same check on every edited .py file
and returns findings as context. That hook is installed only by onboard-repo Phase 4b, with its
HARNESS.md entry and a tested fire case; this skill never writes settings.json. Asked for
enforcement outside onboarding: say to run onboard-repo and re-run Phase 4b alone.
Profiles
core is UP, FURB, F401. modern (default) adds SIM, C4, PIE, PTH, FLY, PERF. Preview
rules stay off unless the project opts in.
Done when
The listed rules were read in full, every relevant one was applied or explained away, the edit respects the target, and under verified or enforced the check exits 0 or the remaining findings are named with their caveat.
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
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.

