Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Phaedra-Solutions/cursor-rules --skill upgrade-pythongit clone --depth 1 https://github.com/Phaedra-Solutions/cursor-rulesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/phaedra-solutions/cursor-rules/upgrade-python)<a href="https://agentmods.dev/skills/phaedra-solutions/cursor-rules/upgrade-python"><img src="https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/upgrade-python/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/phaedra-solutions/cursor-rules/upgrade-python"><img src="https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/upgrade-python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00137 | $0.01438 |
| Opus 5.5 | $0.00055 | $0.00575 |
| Sonnet 5.5 | $0.00027 | $0.00288 |
| Haiku 4.5 | $0.00014 | $0.00144 |
Grade A, and why
upgrade-python scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Upgrade Python
When to use
- The user asks to upgrade Python, or the project runs an EOL version (3.10 or older; see
legacy/python-legacy). - A dependency upgrade (Django 6.x, SQLAlchemy 2.1, Starlette 1.x) needs a newer Python.
- Planning ahead: 3.11 reaches EOL in Oct 2027.
Before you start
- List every place that pins Python:
requires-python,.python-version,runtime.txt,tox.ini/noxfile.py,setup.cfgclassifiers, Dockerfiles (FROM python:…), CI matrices, serverless/PaaS runtimes, and type-checker settings (pythonVersion,python_version). - List C-extension and binary dependencies (
numpy,pandas,psycopg,cryptography,lxml,grpcio,pydantic-core, anything without wheels for the target). - Working tree clean; new branch (
chore/python-3.13). - Ask the user:
- the target: 3.13 (security support to Oct 2029; most compatible) or 3.14 (bugfix, to Oct 2030). 3.15 (Oct 2026) is fine for new work once dependencies publish wheels;
- whether to stop for review after each minor hop;
- whether network installs are approved (
core/supply-chaincooldown applies).
Steps
-
Baseline on the current version: locked install, lint, type check, tests, and the production image starting. Record failures first.
-
Surface the next version's breakage now: run the tests with warnings as errors on the current version:
uv run python -W error::DeprecationWarning -W error::PendingDeprecationWarning -m pytestFix each warning (or record it with the owning dependency) before changing versions.
-
Hop one minor version (for example 3.10 → 3.11):
- install it (
uv python install 3.11) and update all pins in one change (requires-python = ">=3.11",.python-version, Docker base image by digest, CI, runtimes, type-checker version); - re-lock (
uv lock --upgrade-package <only what's needed>or a fulluv lockif the user agrees) and sync; - update packages without wheels for the new version, or replace unmaintained ones;
- run
pyupgrade --py311-plus $(git ls-files '*.py')(match the flag to the new minimum:--py312-plus,--py313-plus,--py314-plus) and review the diff; Ruff'sUPrules withtarget-versiondo the same.
- install it (
-
Fix version-specific changes listed in that version's "What's New" (Porting section). Common ones:
- 3.11:
asyncio.coroutineremoved; stricterenumandtypingbehavior; - 3.12:
distutilsremoved (usesetuptools/packaging);impremoved;datetime.utcnow()deprecated (usedatetime.now(UTC)); - 3.13: dead batteries removed (
cgi,crypt,telnetlib,nntplib,imghdr,pipes, …);locale.getdefaultlocaledeprecated; - 3.14: deferred evaluation of annotations by default;
asynciochild-watcher APIs removed.
- 3.11:
-
Verify (next section). Show the diff and results; wait for approval before the next hop. Commit only when asked (
git-commitskill). -
Repeat until the target, then switch to
languages/pythonand update the frameworks' version rules if needed.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 76 lines · 137 tokens per session scan A bca00e5c676e
upgrade-python is a skill published in the GitHub repository Phaedra-Solutions/cursor-rules (4 stars, last pushed 2d ago), licensed MIT. It adds 137 tokens to every session and 1,438 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-01.
Other skills, from other repositories
python-expert
Use for Python code changes, FastAPI/Django/Flask services, packaging, typing, async, pytest, data scripts, dependency hygiene, or Python performance fixes.
flask
Skill "flask" from rishapgandhi/python-skills, covering flask skill, stack, project structure, app factory and app/init.py.
django
Skill "django" from rishapgandhi/python-skills, covering django skill, stack, project structure, settings pattern (split by environment) and config/settings/base.py.
drf
Skill "drf" from rishapgandhi/python-skills, covering django rest framework (drf) skill, stack additions (on top of django), settings, config/settings/base.py and serializer standards.
fastapi
Skill "fastapi" from rishapgandhi/python-skills, covering fastapi skill, stack, project structure (fastapi-specific additions), app factory pattern and app/main.py.
python-patterns
Pythonic idioms, PEP 8 standards, type hints, and best practices for building robust, efficient, and maintainable Python applications.