coding.reorg_functions
Reorganize the Python functions in a file
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-02
- Stars
- ★ 155
- Forks
- 170
01 前言 Front Matter
- model
- haiku
- description
- Reorganize the Python functions in a file
02 资源文件 3
- 参考文档references/course-book.md3.6 KB
- 参考文档references/lemida-watch.md16.8 KB
- 参考文档references/library-refs.md21.4 KB
03 SKILL.md 正文
Reorganize Python Functions Within a File
-
Reorganize the Python functions in the user-provided file according to the general rules in the
coding.rules.mdfile for organizing code- Follow the section
## Organize Functions Into Logical Layersfrom the file.claude/skills/coding.rules.md - Follow the section
## Order Layers by Abstraction Levelfrom the file.claude/skills/coding.rules.md - Follow the section
## Order Functions Within Each Layerfrom the file.claude/skills/coding.rules.md - Follow the section
## Keep Related Functions Togetherfrom the file.claude/skills/coding.rules.md - Follow the section
## Mark Private Functionsfrom the file.claude/skills/coding.rules.md
- Follow the section
Additional Guidance
- Avoid circular ordering where possible
- Preserve existing comments and docstrings
- Keep public entry points easy to locate near the end of the file
- Prefer cohesion and readability over strict categorization
Constraints
Preserve Behavior Exactly
- Do not modify functionality, logic, signatures, control flow, side effects, or semantics
- The resulting code must behave identically to the original.
Move Code Only
-
The refactor must be structural only
-
Allowed changes:
- Reordering functions
- Adding section headers
- Renaming internal/private functions consistently
-
Disallowed changes:
- Rewriting logic
- Simplifying implementations
- Changing APIs
- Changing imports unnecessarily
- Modifying formatting beyond what is required for reorganization
Verification
- [ ] Confirm every function from the original file is still present
- [ ] Run the file's unit tests to confirm behavior is unchanged
04 同仓库更多 Skills
tutorial_in_60_mins.propagate_docker_changes
Sync tutorial and class-project Docker files to match project_template
tutorial_in_60_mins.merge_markdown
Merge the content of a markdown file into a Jupyter notebook
tutorial_in_60_mins.format
Format a directory to follow the "Learn X in 60 Minutes" tutorial conventions
tutorial_in_60_mins.create
Create a tutorial directory for the Learn X in 60 Minutes conventions
todo.reorg_in_progress
Reorganize ai_task_queue.md so in-progress tasks, not-started tasks, and mislabeled topic headers sit under the right H1 stage
todo.reorg_headers
Reorganize ai_task_queue.md .md so every H2 topic matches ALL TOPICS and every H3 task sits under the right topic, keeping its H1 stage