| name | simplify-code |
| description | Review a diff for clarity and safe simplifications, then optionally apply low-risk fixes. |
| type | skill |
| created | 2026-02-27T00:00:00.000Z |
| domain | productivity |
| category | developer-experience |
| risk | unknown |
| source | community |
| tags | ["skill","productivity","developer-experience","simplify","code"] |
Simplify Code
Review changed code for reuse, quality, efficiency, and clarity issues. Use Codex sub-agents to review in parallel, then optionally apply only high-confidence, behavior-preserving fixes.
When to Use
- When the user asks to simplify, clean up, refactor, or review changed code.
- When you want high-confidence, behavior-preserving improvements on a scoped diff.
Modes
Choose the mode from the user's request:
review-only: user asks to review, audit, or check the changes
safe-fixes: user asks to simplify, clean up, or refactor the changes
fix-and-validate: same as safe-fixes, but also run the smallest relevant validation after edits
If the user does not specify, default to:
review-only for "review", "audit", or "check"
safe-fixes for "simplify", "clean up", or "refactor"
Step 1: Determine the Scope and Diff Command
Prefer this scope order:
- Files or paths explicitly named by the user
- Current git changes
- Files edited earlier in the current Codex turn
- Most recently modified tracked files, only if the user asked for a review but there is no diff
If there is no clear scope, stop and say so briefly.
When using git changes, determine the smallest correct diff command based on the repo state:
- unstaged work:
git diff
- staged work:
git diff --cached
- branch or commit comparison explicitly requested by the user: use that exact diff target
- mixed staged and unstaged work: review both
Do not assume git diff HEAD is the right default when a smaller diff is available.
Before reviewing standards or applying fixes, read the repo's local instruction files and relevant project docs for the touched area. Prefer the closest applicable guidance, such as:
AGENTS.md
- repo workflow docs
- architecture or style docs for the touched module
Use those instructions to distinguish real issues from intentional local patterns.
Step 2: Launch Four Review Sub-Agents in Parallel
Use Codex sub-agents when the scope is large enough for parallel review to help. For a tiny diff or one very small file, it is acceptable to review locally instead.
When spawning sub-agents: