From python-clean-architecture
Find and split god classes into focused collaborators
How this command is triggered — by the user, by Claude, or both
Slash command
/python-clean-architecture:extract-god-class pathThe summary Claude sees in its command listing — used to decide when to auto-load this command
Analyze the code at `$ARGUMENTS` (or the current working directory if no path given) for god classes and generate the split. ## Process 1. **Read the code** — Find and read ALL Python files in the target path recursively. Read every `.py` file. 2. **Identify god classes** — A class is a god class if it has any of: - Too many distinct responsibilities (doing more than one thing) - Methods that cluster into unrelated groups - Too many instance variables - Methods that don't use most of the class's state 3. **Analyze responsibilities** — For each god class: - Group methods b...
Analyze the code at $ARGUMENTS (or the current working directory if no path given) for god classes and generate the split.
Read the code — Find and read ALL Python files in the target path recursively. Read every .py file.
Identify god classes — A class is a god class if it has any of:
Analyze responsibilities — For each god class:
Propose extraction — Show:
__init__ parametersAsk before applying — Use AskUserQuestion to confirm the split. The user may want to adjust which methods go where.
Apply changes — Create the new files and update the original class and its callers.
Principles: P1 High Cohesion, P4 Composition over Inheritance. Consult ${CLAUDE_PLUGIN_ROOT}/skills/clean-architecture/references/design-principles.md for refactoring recipes.
npx claudepluginhub mktoronto/python-clean-architecture --plugin python-clean-architecture/extractExtracts functions, components, modules, hooks, or class methods from code into new units. Analyzes dependencies, replaces inline code with calls, updates imports, and verifies with tests.
/refactorSafely refactors code progressively using techniques like Extract Method, quantitatively scores SOLID principle adherence (0-100), visualizes technical debt, and prioritizes improvements.
/sc-refactorPlans refactoring opportunities in code or executes specific behavior-preserving refactors like extract/rename/simplify, verifying with tests before/after.