Python Rope Refactor
A skill that teaches LLM agents how to use rope for python codebase refactors
Install
git clone https://github.com/brian-yu/python-rope-refactorInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →python-rope-refactor
A small Codex CLI skill that nudges the agent to use rope (via a wrapper script) for mechanical Python refactors: renames, moves, import updates, etc.
Disclaimer
This skill is under development!
- it is intentionally pragmatic
- it may have sharp edges
- please treat it like a helpful power tool, not a polished library
Prerequisites
Make sure uv is installed and available.
What's in here
SKILL.md: the skill instructions Codex reads (includes a rope-first workflow + examples)scripts/rope_refactor.py: a small CLI wrapper around common Rope refactorings
The wrapper is designed around a safer loop:
- run with
--dry-run - review the diff-like output
- re-run with
--apply - review
git diffand run tests/typechecks
What it can do (via scripts/rope_refactor.py)
- Move a module into another package (
move-module) - Rename a module file (
rename-module) - Rename a symbol (class/function/variable) (
rename-symbol) - Extract function / method (
extract-function,extract-method) - Inline variable / method (
inline-variable,inline-method) - Organize imports (
organize-imports) - Run a JSON-driven batch of operations (
batch)
Run uv run scripts/rope_refactor.py --help for the full command list.
Installing / using as a Codex skill
This repo is meant to be copied into your Codex skills directory.
Typical location:
~/.codex/skills/python-rope-refactor/
Minimum required files:
SKILL.mdscripts/rope_refactor.py
Once installed, Codex will discover it at startup and (when prompted for mechanical Python refactors) prefer Rope over hand-editing imports/usages.
Limitations / gotchas
- Rope cannot reliably update dynamic/string-based references (for example
importlib.import_module("pkg.mod")or config strings like"pkg.mod:Class"). - If scan roots are too narrow, Rope may miss references; widen scanning or scan the whole project (slower).
- Rope APIs can differ across versions; this was built around Rope 1.14.x.
Similar plugs
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local…
Why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.
Production-grade engineering skills for AI coding agents.
The 1st Collaborative AI Design Agent Workspace. Local-first and open source. Create prototypes, websites, apps, dashboards, presentations, images, and videos with your team…