Agent skill

RustPython Stdlib Upgrade

by RustPython in RustPython/RustPython

Upgrades a Python standard library module from CPython into RustPython with update_lib, then triages and marks the tests that still fail.

MITAuto-check passedDevelopment

Install RustPython Stdlib Upgrade

skills CLI
$ npx skills add RustPython/RustPython --skill upgrade-pylib -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install RustPython/RustPython upgrade-pylib --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/RustPython/RustPython.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/upgrade-pylib .claude/skills/upgrade-pylib && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
upgrade-pylib
GitHub stars
22k
Token cost
~876 tokens
SKILL.md length
328 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Upgrades a Python standard library module from CPython into RustPython with update_lib, then triages and marks the tests that still fail.

  • Works in 2 steps: What went wrong or what is missing. → Expected vs actual behavior.
  • Bringing a CPython standard library module and its tests up to date in RustPython
  • SKILL.md covers Arguments, Important: Report Tool Issues…, Workflow and Example usage, plus 1 more section
  • Calls python3, git and cargo

What it does

The agent takes a module name or CPython path such as inspect, asyncio or json and runs the quick mode of scripts/update_lib. That step copies the library files, patches tests while preserving existing markers where it can, runs the tests, auto-marks new failures, removes stale expectedFailure markers and creates a commit. A warning that a test class does not exist in the remote file means the class structure changed and some markers must be restored by hand.

Next it reviews the test diff and restores only changes tagged with RUSTPYTHON comments, finds dependent test modules with the deps command, runs them and investigates each failure. Remaining failures are marked with auto-mark, which can also mark regressions and so needs a careful look. Tests that panic, crash or hang get a skip decorator, subclass-specific failures move to the failing override, and markers go into a separate commit. If update_lib itself misbehaves, the agent stops and reports the tooling problem first.

When your agent uses it

  • Bringing a CPython standard library module and its tests up to date in RustPython
  • Triaging failures after a library upgrade and marking the expected ones
  • Deciding whether a failing test needs a skip instead of an expectedFailure marker

Example prompts

  • “Upgrade the json module from CPython and mark whatever still fails.”
  • “Run update_lib quick on asyncio and show me which RustPython-specific test changes need restoring.”
  • “The inspect upgrade has tests that hang, so mark them properly and commit the markers separately.”

Requirements

  • A RustPython checkout with a CPython copy under cpython/Lib
  • Python 3 and cargo
  • Pre-approved tools (allowed-tools): Bash(git add:*), Bash(git commit:*), Bash(git diff:*), Bash(cargo run:*), Bash(python3 scripts/update_lib quick:*), Bash(python3 scripts/update_lib auto-mark:*)

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. What went wrong or what is missing.
  2. Expected vs actual behavior.

What it can do on your machine

Read from SKILL.md and the folder at commit 1e72b22. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(git add:*)
    • Bash(git commit:*)
    • Bash(git diff:*)
    • Bash(cargo run:*)
    • Bash(python3 scripts/update_lib quick:*)
    • Bash(python3 scripts/update_lib auto-mark:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3
    • git
    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

RustPython Stdlib Upgrade loads about 876 tokens when it runs. Until then it costs about 38 tokens; SKILL.md has 328 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~38
When it runs · the whole SKILL.md, loaded when a task matches
~876

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from RustPython/RustPython at commit 1e72b22, republished under its MIT licence (© RustPython). 328 words, ~876 tokens.

Download SKILL.mdSave it as .claude/skills/upgrade-pylib/SKILL.md (or your agent's skills folder).
name
upgrade-pylib
description
Upgrade a Python standard library module from CPython into RustPython using scripts/update_lib and then triage and mark remaining failures.
allowed-tools
Bash(git add:*), Bash(git commit:*), Bash(git diff:*), Bash(cargo run:*), Bash(python3 scripts/update_lib quick:*), Bash(python3 scripts/update_lib auto-mark:*)

Upgrade Python Library from CPython

Upgrade a Python standard library module from CPython to RustPython.

Arguments

  • Library name or path (examples: inspect, asyncio, json, cpython/Lib/inspect.py, cpython/Lib/json/)

Important: Report Tool Issues First

If scripts/update_lib shows a bug, missing automation, or unexpected behavior, stop the upgrade and report the tooling issue first, including:

  1. What you were trying to do:
  • Library name.
  • Full command used.
  1. What went wrong or what is missing.
  2. Expected vs actual behavior.

Workflow

  1. Run quick upgrade with update_lib:
  • python3 scripts/update_lib quick <module>
  • or python3 scripts/update_lib quick cpython/Lib/<module>.py
  • or python3 scripts/update_lib quick cpython/Lib/<module>/

This step copies library files, patches tests while preserving markers where possible, runs tests, auto-marks new failures, removes stale @unittest.expectedFailure, and creates a commit.

If warnings like WARNING: TestCFoo does not exist in remote file appear, class structure changed and some markers must be restored manually.

  1. Review diff and restore RustPython-specific changes:
  • Run git diff Lib/test/test_<module>.
  • Restore only changes with explicit RUSTPYTHON comments.
  • Do not restore unrelated upstream CPython changes.
  1. Investigate failing dependent tests:
  • Get dependencies:

    shell
    cargo run --release -- scripts/update_lib deps <module>
  • Find direct dependent test modules from the - [ ] <module>: line.

  • Run dependent tests and collect failures:

    shell
    cargo run --release -- -m test <test_modules...> 2>&1 | grep -E "^(FAIL|ERROR):"
  • For each failing test identifier, investigate with the investigate-test-failure workflow.

  1. Mark remaining failures with auto-mark:
  • python3 scripts/update_lib auto-mark Lib/test/test_<module>.py --mark-failure
  • or python3 scripts/update_lib auto-mark Lib/test/test_<module>/ --mark-failure

Note: --mark-failure marks all current failures including regressions; review carefully.

  1. Handle panics manually:
  • For tests that panic/crash/hang, use @unittest.skip("TODO: RUSTPYTHON; ...") rather than expectedFailure.
  1. Handle class-specific failures:
  • If only one subclass fails (for example TestCFoo but not TestPyFoo), move marker to the failing subclass override.
  1. Commit test-fix markers as a separate commit:
shell
git add -u && git commit -m "Mark failing tests"

Example usage

text
upgrade-pylib inspect
upgrade-pylib json
upgrade-pylib asyncio
upgrade-pylib cpython/Lib/inspect.py
upgrade-pylib cpython/Lib/json/

Notes

  • The cpython/ directory should contain the CPython source used for sync.
  • scripts/update_lib modes:
    • quick: patch + auto-mark
    • migrate: patch only
    • auto-mark: mark failures only
    • copy-lib: copy library files only
  • Patching transfers @unittest.expectedFailure and @unittest.skip with TODO: RUSTPYTHON markers where possible.
  • The tool does not preserve every RustPython-specific change; always review and restore explicit RUSTPYTHON-marked logic.

© RustPython, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/upgrade-pylib of RustPython/RustPython.

Open the folder on GitHubat commit 1e72b22

Compare with similar skills

RustPython Stdlib Upgrade next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

RustPython Stdlib Upgrade compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
RustPython Stdlib Upgrade this skillRustPython/RustPython22k—~876Automated safety check: PassMIT
jscpd Code Migration Trackerkucherenko/jscpd6.4k—~5kAutomated safety check: PassMIT
Code Migrationanthropics/code-migration-kit-with-claude-code743—~983Automated safety check: PassCustom licence
Dbgtheodo-group/debug-that158—~2.2kAutomated safety check: PassMIT
Debuggnomeria/usbtree690—~715Automated safety check: PassMIT
Elodin Develodin-sys/elodin547—~896Automated safety check: PassApache-2.0

Similar skills

  • Measures a code port between languages or frameworks with jscpd's function-level comparison, porting tests before code and tracking what is left unmatched.

    6.4k GitHub stars~5k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Migration

    anthropics/code-migration-kit-with-claude-code

    Official

    Run a large-scale language migration with the six-step process: create the map and the rules, stress-test the rules, translate everything, compile, run it, match behavior.

    743 GitHub stars~983 tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Dbg

    theodo-group/debug-that

    Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.

    158 GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Debug

    gnomeria/usbtree

    Systematic root-cause debugging — reproduce, isolate, fix at the source, prove the fix.

    690 GitHub stars~715 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Elodin Dev

    elodin-sys/elodin

    Develop and contribute to the Elodin codebase. An agent skill from elodin-sys/elodin.

    547 GitHub stars~896 tokensUpdated today
    DevelopmentAuto-check passed
  • Rocky Codegen

    rocky-data/rocky

    Rocky CLI JSON-output schema cascade. An agent skill from rocky-data/rocky.

    304 GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed

More from RustPython/RustPython

  • Apple Container Test Runner

    RustPython/RustPython

    Runs RustPython tests inside a Linux container built with Apple's container CLI, so macOS users can compare Linux results with their local ones.

    22k GitHub stars~467 tokensUpdated today
    Auto-check passed
  • RustPython C-API Expansion

    RustPython/RustPython

    Implements missing CPython C-API functions in RustPython's crates/capi, mapping each header to its module with the pyo3-ffi header split.

    22k GitHub stars~831 tokensUpdated today
    Auto-check passed
  • Investigates a failing RustPython test by comparing it with CPython, then either fixes it or gathers the details for an incompatibility report.

    22k GitHub stars~467 tokensUpdated today
    Auto-check passed
  • Picks the next CPython standard library module ready for a RustPython upgrade, skipping modules that already have an open upgrade pull request.

    22k GitHub stars~257 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about RustPython Stdlib Upgrade

What does RustPython Stdlib Upgrade do?

Upgrades a Python standard library module from CPython into RustPython with update_lib, then triages and marks the tests that still fail. The agent takes a module name or CPython path such as inspect, asyncio or json and runs the quick mode of scripts/update_lib. That step copies the library files, patches tests while preserving existing markers where it can, runs the tests, auto-marks new failures, removes stale expectedFailure markers and creates a commit.

When should I use RustPython Stdlib Upgrade?

RustPython Stdlib Upgrade fits situations like: bringing a CPython standard library module and its tests up to date in RustPython; triaging failures after a library upgrade and marking the expected ones; deciding whether a failing test needs a skip instead of an expectedFailure marker.

How do I install RustPython Stdlib Upgrade in Claude Code?

Run `npx skills add RustPython/RustPython --skill upgrade-pylib -a claude-code`. Or copy the skill folder (.agents/skills/upgrade-pylib in RustPython/RustPython) into .claude/skills/upgrade-pylib in your project. Claude Code loads it when a task matches its description.

How do I install RustPython Stdlib Upgrade in Codex?

Run `npx skills add RustPython/RustPython --skill upgrade-pylib -a codex`. Or copy the skill folder (.agents/skills/upgrade-pylib in RustPython/RustPython) into .agents/skills/upgrade-pylib in your project. Codex loads it when a task matches its description.

Can I use RustPython Stdlib Upgrade in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add RustPython/RustPython --skill upgrade-pylib -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/upgrade-pylib, .gemini/skills/upgrade-pylib, .github/skills/upgrade-pylib and .opencode/skills/upgrade-pylib in your project.

What does RustPython Stdlib Upgrade need to run?

Going by SKILL.md and its folder, RustPython Stdlib Upgrade needs the command-line tools its instructions call (python3, git and cargo). Our summary lists: A RustPython checkout with a CPython copy under cpython/Lib; Python 3 and cargo. Its frontmatter pre-approves these tools: Bash(git add:*), Bash(git commit:*), Bash(git diff:*), Bash(cargo run:*), Bash(python3 scripts/update_lib quick:*), Bash(python3 scripts/update_lib auto-mark:*).

Does RustPython Stdlib Upgrade access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is RustPython Stdlib Upgrade safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does RustPython Stdlib Upgrade use?

RustPython Stdlib Upgrade is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does RustPython Stdlib Upgrade use?

About 876 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to RustPython Stdlib Upgrade?

Skills that share tags, products or a category with RustPython Stdlib Upgrade: jscpd Code Migration Tracker (kucherenko/jscpd, 6.4k stars), Code Migration (anthropics/code-migration-kit-with-claude-code, 743 stars), Dbg (theodo-group/debug-that, 158 stars) and Debug (gnomeria/usbtree, 690 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains RustPython Stdlib Upgrade?

RustPython (a GitHub organization) maintains it in RustPython/RustPython, which has 22,383 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 8, 2026.

Source: RustPython/RustPython on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.