
Code Simplification
FreeEnhance code clarity and efficiency without altering behavior.
Free · Opens the source repo
What Code Simplification does
The Code Simplification skill is designed to improve the readability and efficiency of recently modified code while ensuring that its original functionality remains intact. This tool is particularly useful for developers who have just implemented changes and want to prepare their code for review. By focusing on clarity, reuse, quality, and efficiency, the skill encourages developers to write explicit and understandable code instead of compact, less readable lines. This approach helps maintain high code quality standards and fosters better collaboration among team members.
When using this skill, the process begins by determining the scope of the code that needs simplification. It intelligently identifies the relevant code changes based on user input or git diffs, ensuring that only the necessary sections are reviewed. Once the scope is established, the skill launches three parallel review agents, each focusing on different aspects: code reuse, code quality, and efficiency. This multi-faceted review process allows for a comprehensive analysis of the code, providing valuable feedback that can be directly applied to improve the codebase.
The skill operates within a Node.js environment and utilizes bash for its execution, making it compatible with various development setups. It is particularly beneficial for teams that prioritize code quality and maintainability, as it systematically addresses potential issues and suggests improvements. By using this skill, developers can streamline their code review process, ensuring that their code not only functions correctly but is also easy to understand and maintain in the long run.
Overall, the Code Simplification skill serves as an essential tool for developers looking to enhance their coding practices, making it a valuable addition to any development workflow.
When to use it
Use this skill after implementing changes to your code and before submitting it for review to ensure clarity and maintainability.
When not to use it
This skill may not be suitable for code that is already well-structured or for scenarios where the code is not intended for review or collaboration.
What you can build with it
Pre-Review Code Cleanup
Use this skill to simplify your code just before submitting it for review, ensuring clarity and maintainability.
Improving Legacy Code
Apply the skill to recently modified legacy code to enhance its readability and efficiency without altering its functionality.
Collaborative Development
In a team setting, use this skill to prepare code for collaboration, making it easier for others to understand and build upon.
How to install Code Simplification
View source1. Install with the skills CLI
npx skills add everyinc/compound-engineering-plugin/ce-simplify-code --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by everyincSimplify recently changed code for clarity, reuse, quality, and efficiency while preserving exact behavior. Prioritize readable, explicit code over compact code — fewer lines is not the goal.
Setup
Run this once at the start of this invocation, before any subagent dispatch, and follow the directives it prints — except where one conflicts with this skill's own rules on asking the user questions, whether those rules are scoped to a non-interactive mode or apply in every mode, in which case this skill's rules win and no blocking question is asked. Run the fence exactly as written, as its own command: do not pipe or filter it (no head, tail, or grep), do not truncate its output, and do not bundle it into a batch with other commands. Its output opens with a === skill context header and ends with CE_CONTEXT_END; if you received one of those lines without the other, the output was truncated — rerun the fence verbatim once. That recovery is the only rerun: otherwise do not rerun it within the same invocation; a later invocation of this or any other skill runs its own. If no Node runtime is available the skill proceeds unchanged.
SKILL_DIR="<absolute path of the directory containing the SKILL.md you just read>";
NODE="$(for c in node nodejs; do command -v "$c" >/dev/null 2>&1 && "$c" -e '' >/dev/null 2>&1 && { echo "$c"; break; }; done)";
if [ -n "$NODE" ]; then
"$NODE" "$SKILL_DIR/scripts/context.mjs" || echo "context script failed; continue with the skill's normal behavior";
else
echo "no Node runtime; continue with the skill's normal behavior";
fi
Step 1: Identify scope
Resolve the simplification scope in this order:
- User-named scope is authoritative; do not widen it.
- Otherwise, in git, use the current branch versus its base. Without a usable base, use staged and unstaged changes (
git diff HEAD). - Outside git or without a diff, use files the user named or that were edited earlier in the conversation.
If none of the above produces a non-empty scope, stop and ask the user what to simplify rather than guessing. Use the platform's blocking question tool: AskUserQuestion in Claude Code (call ToolSearch with select:AskUserQuestion first if its schema isn't loaded), request_user_input in Codex, ask_question in Antigravity CLI (agy), ask_user in Pi (requires the pi-ask-user extension). Fall back to numbered options in chat only when no blocking tool exists in the harness or the call errors (e.g., Codex edit modes) — not because a schema load is required. Never silently skip the question.
Preflight. If the scope has no substantive human-authored code — only documentation, generated or vendored files, dependencies or lockfiles, or mechanical churn — report that there is nothing to simplify and stop without reviewers. For mixed scopes, retain only the code. This is a kind gate, never a size gate: explicit small scopes still run, and callers own any size or cost threshold.
When the platform's task-tracking capability is available, show the review, apply, and verification outcomes without creating one task per reviewer. Otherwise continue without simulating a task list in chat.
Step 2: Launch 3 review agents in parallel
Dispatch three generic subagents — code-reuse, code-quality, and efficiency reviewers — via the platform's subagent primitive (Agent/Task in Claude Code, spawn_agent in Codex) where available; otherwise run the reviews inline or serially. For each reviewer, read its prompt asset from this skill's directory and pass the full file content as the subagent's prompt, together with the resolved scope (the full diff or file set) so it has complete context:
references/personas/code-reuse-reviewer.mdreferences/personas/code-quality-reviewer.mdreferences/personas/efficiency-reviewer.md
Do not paraphrase these rubrics from memory — read each file and pass it verbatim, or the reviewer loses the gating rules that keep the pass behavior-preserving.
Bounded dispatch. Queue the three reviewers and launch only as many as the harness accepts at once; treat a concurrency/active-agent-limit error as backpressure (leave the reviewer queued and retry after a slot frees), not as reviewer failure. If a dispatch fails for any other reason, run that reviewer's pass inline in the parent context using the same prompt asset, and disclose the substitution in one line.
Model selection. Use the platform's balanced mid-tier model for these reviewers when the current harness exposes a known override. In Claude Code this is the Sonnet class. In Codex, apply this tier only when the active dispatch primitive exposes an explicit model or custom-agent selector; task wording alone does not select a different model. Otherwise omit the override and inherit the parent model -- a working pass on the parent model beats a broken dispatch.
Permission mode. Omit the mode parameter on the dispatch call so the user's configured permission settings apply.
Step 3: Fix issues
Proceed only after all three review outcomes are complete, whether returned by subagents or produced inline. Apply worthwhile findings directly; record false positives and low-value findings as skipped without asking the user.
Inspect beyond the resolved scope when needed to evaluate a finding, but edit only that scope and its necessary import/export seams. For a user-named file or directory scope, those seams must also be inside it; skip any fix that would edit outside the mutation boundary.
Each fix must preserve outputs, errors, side effects, and ordering. If that cannot be established, skip it.
An interface or data shape that existed only in an earlier iteration of the current unshipped scope is not protected behavior once you verify it has no deployed, persisted, public, external, dependent-branch, or in-repo caller outside the resolved scope. Remove that compatibility path only when every required caller update fits the existing mutation boundary; otherwise preserve it.
Never simplify away a safety check. Preserve trust-boundary validation, data-loss protection, security checks, and accessibility affordances. Skip any finding that would thin or remove one.
Honor caller-passed structure pins. A plan path passed with the structure-pin constraint is context, not scope. Preserve its session-settled: Key Technical Decisions, including deliberate duplication or separation.
Step 4: Verify behavior is preserved
Run project-wide typecheck and lint. Run tests matched to blast radius: scoped tests for local changes, broader tests for shared or wide-reach changes, and the full suite when the runner cannot scope tests.
Report failures with the check name and relevant output. Fix simplification-caused failures or revert the responsible change; never relax assertions, weaken types, or skip tests.
If no test suite, lint, or typecheck is configured, state that explicitly in the summary; do not silently skip verification.
Step 5: Summarize
Summarize what was already sound and what improved. Report applied counts by reuse, quality, and efficiency; skipped count; and check outcomes. If nothing changed, say so. Do not use net lines removed as the success metric.
Frequently asked questions about Code Simplification
Similar skills
Quality Playbook Generator
Run comprehensive quality audits on any codebase.
PR Draft Summary
Automate PR summary generation for openai-agents-python.
Final Release Review
Streamline your release candidate audits with ease.
Unit Test Vue Pinia
Efficiently write and review unit tests for Vue 3 applications.
Slang Shader Expert
Optimize and integrate Slang shaders with ease.
Telemetry Standards
Ensure consistent event tracking in Supabase Studio.
