Python Code Organizer
Paste the following prompt into your AI chat to install this skill:
Please install @user_8f9cac4a/code-organizer according to https://skillhub.cn/install/skillhub.md.
About this skill
What Problem It Solves
Many Python projects start as scripts or experiment code, then quickly accumulate inconsistent naming, messy import statements, unclear directory responsibilities, and missing documentation. A blind refactor can easily overshoot: adding full test suites, configuration systems, or DDD layers to a handful of scripts usually makes the project harder to read.
This skill constrains the cleanup process into assess first, confirm twice, execute last, avoiding default execution of every possible optimization. It is not just an autoformatter; it proposes an approved maintenance plan based on project type and engineering goals.
How It Works
- Round one: strategy selection: it scans project scale, type, and main issues, then presents four levels:
light cleanup,standard organization,deep refactor, andfull refactor, with a recommendation and rationale. - Round two: plan confirmation: it lists directory changes, file edits, deletions, new configuration, and documentation changes, then waits for explicit approval.
- Execution phase: depending on the selected strategy, it applies code formatting, naming conventions,
importsorting, type annotations, comment standards, dead-code cleanup, configuration parameterization, or test coverage. - Documentation generation: it produces
README.md,CHANGELOG.md, andNOTE.mdat a level of detail matched to the strategy, covering users, change tracking, and quick personal reference.
For deep learning projects, it prioritizes models/, data/, experiments/, hyperparameter configuration, and logging. For Web/API projects, it focuses on routing, middleware, and authentication boundaries. For CLI or data pipelines, it emphasizes centralized configuration, logging, and progress feedback.
Where It Fits
This skill is most useful for maintainable Python projects, especially prototype tools, data processing scripts, small services, and publishable libraries. It is not intended for aggressive best-practice enforcement: if the goal is only to run an experiment, light or standard organization is usually enough. Deep or full refactoring makes sense when the project needs team collaboration, release, or long-term maintenance. Execution still depends on user approval, so it should not delete files or restructure the project without confirmation.
Use Cases
- Take over a messy Python data-processing script, confirm a strategy, then remove unused imports and duplicate logic.
- Maintain a small FastAPI service by splitting routes by resource and extracting hard-coded settings into traceable configuration.
- Organize deep-learning experiment code by separating models, data, and experiments, then move lr and epochs into configuration.
- Before publishing a Python tool, standardize naming, import order, and type hints, then generate README, CHANGELOG, and NOTE.
Best For
- Engineers maintaining internal Python tools who want cleanup without forced tests or configuration systems.
- Algorithm engineers owning data pipelines who need duplicate-logic cleanup and consistent naming and import order.
- Developers preparing experiment scripts as publishable libraries who need directory and documentation depth checks.
- Maintainers taking over legacy code who want to review a low-risk change plan before execution.
Related Skills
Guides Java Spring Boot backend development across REST APIs, data access, security, microservices, testing, deployment, and troubleshooting.
A systematic code error fixing skill that follows a five-step workflow: Reproduce, Isolate, Understand, Fix, Verify, to help developers resolve code errors.
Restores Lanhu designs to target framework code using schema JSON, design tokens, and image assets.
Automatically detects engineering or competition code, analyzes bugs, vulnerabilities, algorithm complexity, and edge cases, then produces risk-level findings with before/after fixes.