一键导入
reorganize
Reorganize code file structure: rearrange modules, extract reuse, remove redundancy, add section comments. Preserves all functionality and logic.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Reorganize code file structure: rearrange modules, extract reuse, remove redundancy, add section comments. Preserves all functionality and logic.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Codex Stage 1 execute skill. Run the execution + quality polish + delivery stages of review-loop against one of three entry modes: resume an approved session (`--session`), execute a user-supplied plan (`--plan`), or run a pure-CR pass on the current working tree (`--review-only`). Supports batched runs via `--stop-after <stage>`. Use when you already have a plan, or only want CR on existing code.
Codex-native Stage 1 review-loop skill. Orchestrates planning and execution with a Codex Executor and Claude/Codex reviewer backends while sharing the .review-loop protocol with Claude Code.
Run the execution + quality polish + delivery stages of review-loop against one of three entry modes: resume an approved session (`--session`), execute a user-supplied plan (`--plan`), or run a pure-CR pass on the current working tree (`--review-only`). Supports batched runs via `--stop-after <stage>`. Use when you already have a plan, or only want CR on existing code.
Automates a Plan-Execute-Review workflow with built-in iteration loops. An Orchestrator coordinates an Executor sub-agent and a configurable Reviewer (external AI CLI like Codex, or Claude sub-agent) to drive work items from description to delivery — with every review finding visible to the user. Trigger: "run review-loop on", "start review loop", "let the agents handle", or any task the user wants driven by a plan→review→implement→CR cycle.
Codex Stage 1 planning-only skill. Drives a work item from raw description to a reviewer-approved plan in `.review-loop/sessions/{uuid}.md`, then exits with a hint to resume via `review-loop:execute --session <uuid>`. Use when you want plan-only iteration without immediately entering execution.
Run the planning phase only: drive a work item from raw description to a reviewer-approved plan in `.review-loop/sessions/{uuid}.md`, then exit with a hint to resume via `review-loop:execute --session <uuid>`. Use when you want plan-only iteration without immediately entering execution.
| name | reorganize |
| description | Reorganize code file structure: rearrange modules, extract reuse, remove redundancy, add section comments. Preserves all functionality and logic. |
| argument-hint | <file/dir or 'diff'> |
Restructure the specified code files: rearrange module layout, reorder logically, extract shared logic, remove redundancy, add section separators and comments. Must not change any functionality or logic.
$ARGUMENTS specifies the target:
/reorganize src/engine.go — reorganize a single file/reorganize src/core/ — reorganize all code files in the directorydiff: /reorganize diff — reorganize all uncommitted files (via git diff --name-only --diff-filter=d HEAD)If no argument is provided, prompt the user to specify a target.
Resolve the file list from $ARGUMENTS. For directories, recursively collect all code files (excluding vendor, node_modules, generated files, etc.). For diff, collect all uncommitted modified files (staged + unstaged).
Output:
REORGANIZE
Target: {file/dir/diff}
Files: {N} files
{file list}
Process files one at a time. Complete each file before moving to the next.
Read the entire file and analyze:
Split into multiple files when the file couples multiple clearly distinct functional modules, making it hard to read and maintain:
When splitting:
engine.go -> engine.go + engine_strategies.go + engine_signals.go)If the file is already focused and coherent, do not split.
After splitting, apply steps 2.3-2.7 to each resulting file.
Import fixing: After splitting, scan the project for files that import or reference the original file. If the split moved symbols to new files, update the affected imports. This may require modifying files outside the original target scope — this is the only case where that is allowed.
Organize code blocks in a logical order based on the file's actual content. Common reference (adapt as needed):
- package/module declaration, imports
- constants, variables
- type definitions
- constructors
- core business methods
- helper / utility methods
Core principle: a reader scanning top-to-bottom should naturally understand the file's structure and business flow. Keep related code together; high-level logic before implementation details.
Separate functional sections with divider comments. First check if the project already uses a divider style (scan existing files for patterns like // ---, // ===, #region, etc.) and adopt that style. If no existing convention is found, use a simple comment divider appropriate for the language.
Check for duplicate code patterns within the file being processed (do not modify files outside the target scope):
// TODO, placeholder // xxx)Run compilation and test checks on modified files. Detect build/test commands from the project:
go build ./... then go test ./...cargo check then cargo testtsc --noEmit then npm testpython -m py_compile then pytestIf any check fails, fix the issue and re-check. Max 3 attempts.
After each file is processed, briefly report what was done and the build/test result. After all files, output summary:
REORGANIZE COMPLETE
Files processed: {N}
Files split: {list, or "none"}
Build: {PASS / FAIL}
Tests: {PASS / FAIL / no tests found}