refactor-structure
Installation
SKILL.md
Structure refactor workflow
- Inspect the current layout using the following commands to identify structural issues, such as oversized files, mixed responsibilities, misplaced modules, unclear names, and duplicated organization patterns.
find src -type f -not -path '*/__generated__/*' -print0 | xargs -0 wc -l 2>/dev/null | sort -rn | head -30tree -h src- If the user specifies a directory, replace
srcwith it.
- Reorganize the code by responsibility to improve cohesion and reduce coupling.
- Split oversized files, group related modules, and create new directories only when they clarify ownership.
- Update imports alongside your changes while maintaining existing behavior.
- Rename files and identifiers (such as variables and functions) to more accurately reflect their roles.
- Ensure all references are updated accordingly.
- Run the quickest relevant verification tools, such as type checkers or linters, to detect broken imports or incorrect module wiring.
- Commit and push the changes, then execute either the
open-prorupdate-prskill. - Summarize the changes made and explain why the new structure is more maintainable.