claude

refactor-python

Verified decomposition of Python modules, classes, functions and tests using rope, LibCST, manifest oracles, test-ID gates and quality guardrails.

0 on GitHubv0.1.2MITupdated 1 month ago

Not in a marketplace yet, so it loads for one session with --plugin-dir.

Plugin refactor-python in nixlim/refactor-python. Commands read from the repo's manifest — 1 month ago.

This plugin runs code on your machine — its hooks fire automatically on events like tool use. The exact commands are listed below; read them before installing.

What it installs

Skills (3)

  • decompose

    Decompose oversized Python classes, functions, and test classes using manifest-verified method moves, statement extraction, and test-ID checks. Use split-module for whole top-level relocations.

  • guardrails

    Install and verify file-size, complexity, and import-boundary guardrails for a Python repo worked on by AI agents: ruff complexity rules, a max-code-lines pre-commit hook with a grandfather baseline, import-linter contracts, a CI job, and a CLAUDE.md/AGENTS.md section that points at the enforcing to

  • split-module

    Safely decompose an oversized Python module (anything over ~500 code lines, especially multi-thousand-line "god files") into a package of small modules, using deterministic tools (rope for moves, an AST body-hash oracle, a test/type/import gate) and parallel subagents in git worktrees. Use this when

Subagents (5)

  • extractor

    Moves one cluster of symbols from a Python god-module into a target module using rope, runs the verification gate, and commits on its own worktree branch. Spawned in parallel by the split-module skill, one per cluster. Never used for anything but mechanical moves.

  • gate-runner

    Runs the split-module verification gate (verify.sh) after a merge and returns a short verdict, keeping test and lint output out of the main conversation. Use from the split-module skill in fan-in.

  • plan-critic

    Adversarially reviews a module-split plan produced by split-planner before any code moves. Use from the split-module skill in Phase 2. Read-only.

  • refactor-reviewer

    Adjudicating review of a completed module split: independently checks the diff AND verifies the headless Codex (GPT-5.6 Sol) review verdict finding by finding. Use from the split-module skill in Phase 6b, never as the extractor. Read-only.

  • split-planner

    Produces the decomposition plan for splitting one oversized Python module into a package. Use from the split-module skill after inventory.py has run. Read-only; never edits code.

Hooks (2)

  • SessionStart

    if [ -d .refactor ]; then echo "refactor-python: split in progress. $(python3 "${CLAUDE_PLUGIN_ROOT}"/skills/split-module/scripts/type_baseline.py status 2>/dev/null)"; fi

  • PostToolUse

    python3 "${CLAUDE_PLUGIN_ROOT}"/skills/split-module/scripts/check_file_length.py --hook

View source on GitHub

Similar plugins

Skill: add headroom-ai compress() to a Python or TypeScript app to cut LLM input tokens (tool outputs, logs, JSON, chat history). No API key.

1 skill

headroomlabs-ai/headroom 79,508

Generate natively editable PPTX from PDF / DOCX / URL / Markdown — real DrawingML shapes, text boxes, charts, and animations. Note: run `pip install -r requirements.txt` inside the installed plugin directory for the Python post-processing scripts to work.

1 skill

hugohe3/ppt-master 76,375

Web scraping, Google search, structured data extraction, and MCP server integration powered by Bright Data. Includes 7 skills: scrape any webpage as markdown (with bot detection/CAPTCHA bypass), search Google with structured JSON results, extract data from 40+ websites (Amazon, LinkedIn, Instagram, TikTok, YouTube, and more), orchestrate Bright Data's 60+ MCP tools, built-in best practices for Web Unlocker, SERP API, Web Scraper API, and Browser API, Python SDK best practices for the brightda...

21 skills

anthropics/claude-plugins-official 47,076

Modern Python development with Python 3.12+, Django, FastAPI, async patterns, and production best practices

16 skills · 1 command · 3 agents

wshobson/agents 42,461

Web scraping, Google search, structured data extraction, and MCP server integration powered by Bright Data. Includes 7 skills: scrape any webpage as markdown (with bot detection/CAPTCHA bypass), search Google with structured JSON results, extract data from 40+ websites (Amazon, LinkedIn, Instagram, TikTok, YouTube, and more), orchestrate Bright Data's 60+ MCP tools, built-in best practices for Web Unlocker, SERP API, Web Scraper API, and Browser API, Python SDK best practices for the brightda...

21 skills

anthropics/knowledge-work-plugins 35,601

Maintain refactor-python?

This page updates itself from your repo. Add the badge to your README, or get it Featured to pin it above the organic results with a followed link to your site.

claude & codex pluginslisted