# py-refactor

> Systematic Python refactoring workflow for complexity, security, and test quality

- **Publisher**: l-mb (Community) (APPROVED)
- **Upstream GitHub Repository**: https://github.com/l-mb/python-refactoring-skills/tree/main/skills/py-refactor
- **skills.sh Listing**: https://skills.sh/l-mb/python-refactoring-skills/py-refactor
- **License**: MIT
- **GitHub Stars**: 58
- **Canonical Web Page**: https://builderthread.dev/skill/l-mb/python-refactoring-skills/py-refactor
- **Parent Topic**: [python](https://builderthread.dev/skill/for/python.md)
- **Last Audited**: 2026-11-21
- **Supported Coding Agents**: Claude Code, Cursor, Codex, Windsurf

## Overview
Audited MIT-licensed refactoring skill coordinating phased Python analysis, complexity reduction, modern syntax upgrades, and regression-safe test verification.

Inspect the full upstream `SKILL.md` source and license on GitHub before installing: https://github.com/l-mb/python-refactoring-skills/tree/main/skills/py-refactor

## Install Command
```bash
npx skills add l-mb/python-refactoring-skills --skill py-refactor
```

## When to Use This Skill
- Refactoring legacy Python services into typed, modern Python 3.12+ modules
- Breaking down deeply nested functions without altering behavior
- Running structured cleanup passes guarded by Ruff and pytest

## Focus Areas
- Phased refactoring workflow
- Cyclomatic complexity reduction
- Python 3.12+ modernization
- Test-gated remediation

## Upstream Package Files
- `skills/py-refactor/SKILL.md`

---

## Ship With a Private Starter Repo, Living PRD & MCP Tasks

Builderthread pairs verified stack skills with a cited market brief, living PRD, private GitHub starter repo, and ordered MCP tasks for Claude Code, Cursor, and Codex.

- Supported languages: Rust, TypeScript, React Native (Expo), Python
- Starter stacks: Next.js SaaS, Hono API, FastAPI AI, Expo mobile, Tauri Rust desktop, WXT Chrome extension
- Start now: https://builderthread.dev/auth/signup
