
Ce Simplify Code
Refine code you just wrote on a feature branch—clarity, reuse, and efficiency—then prove behavior unchanged with the project test suite.
Overview
ce-simplify-code is an agent skill most often used in Ship (also Build, Operate) that simplifies diff-scoped code for clarity and maintainability while preserving behavior verified by tests.
Install
npx skills add https://github.com/everyinc/compound-engineering-plugin --skill ce-simplify-codeWhat is this skill?
- Resolves scope in priority order: user-named target, then branch vs base diff, else staged/unstaged changes
- Treats user-named scope as authoritative and forbids widening it
- Focuses on clarity, consistency, maintainability, and reuse—not overly compact one-liners
- Requires running the project test suite to verify behavior is preserved
- Optional argument hint for blank (branch changes) or explicit simplify target description
- Three-step scope resolution order: explicit user scope, branch base diff, then HEAD staged/unstaged
Adoption & trust: 1.4k installs on skills.sh; 20.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your feature branch grew messy helper logic and duplication, but you need a safe cleanup pass before merge without guessing what changed.
Who is it for?
Developers on a git feature branch who want an agent-guided refactor of only their changes with mandatory regression checks.
Skip if: Greenfield generation from scratch or large architectural rewrites—scope stays on recent or user-named changes only.
When should I use this skill?
User wants to simplify recently changed code, current branch vs base, or names a specific file or function to refine.
What do I get? / Deliverables
Scoped files are simplified to project best practices and the test suite passes, leaving you ready for PR or the next ship-phase skill.
- Simplified code within resolved scope
- Test run confirmation that behavior is preserved
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Ship is the canonical shelf because simplification is a pre-merge quality gate: you tighten diff-scoped code before PR without changing semantics. Review matches diff-scoped critique, best-practice alignment, and explicit preservation of behavior verified by tests.
Where it fits
Default to origin/main... diff and simplify new helpers before requesting human review.
User names a component file after a UI spike to strip duplication while keeping props behavior.
Simplify this morning’s production hotfix changes and re-run the suite before deploy.
How it compares
Structured simplify-and-test workflow on a git diff, not a linter-only pass or a brainstorming session before coding.
Common Questions / FAQ
Who is ce-simplify-code for?
Solo builders and small teams using coding agents who want pre-PR simplification tied to branch diffs and existing tests.
When should I use ce-simplify-code?
In Ship before opening a PR on your branch diff; in Build after finishing a module you want cleaned up; in Operate when simplifying a hotfix you just landed—always with tests run afterward.
Is ce-simplify-code safe to install?
It instructs agents to edit code and run shell/git commands; review Security Audits on this page and ensure tests and backups cover your repo before use.
SKILL.md
READMESKILL.md - Ce Simplify Code
You are an engineer that is an expert at simplifying code with a specific focus on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying project-specific best practices to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions. Review the changed code for reuse, quality, and efficiency. Fix any issues found. Then verify behavior is preserved by running the project's test suite. ## Step 1: Identify scope Resolve the simplification scope in this order: 1. **If the user explicitly named a scope** (a file, a directory, "the function I just wrote", "the changes from this morning"), use that scope. Treat user-named scope as authoritative — do not widen it. 2. **Otherwise, in a git repository**, default to the diff between the current branch and its base branch (e.g., `git diff origin/main...` or against the configured upstream). This covers the common case of "simplify everything I've added on this feature branch before opening a PR." If the branch has no upstream or base ref, fall back to staged + unstaged changes (`git diff HEAD`). 3. **Outside a git repository or when no diff is available**, review the most recently modified files mentioned by the user or edited earlier in this conversation. If none of the above produces a non-empty scope, stop and ask the user what to simplify rather than guessing. ## Step 2: Launch 3 review agents in parallel Spawn the three reviewer agents below in a single message via the platform's subagent dispatch primitive — `Agent`/`Task` in Claude Code, `spawn_agent` in Codex, `subagent` in Pi via the `pi-subagents` extension. Pass each agent the full diff (or the resolved file set) so it has the complete context. **Model selection.** Use the platform's mid-tier model for these reviewers: `model: "sonnet"` in Claude Code, the equivalent mid-tier on Codex (`gpt-5.4-mini` as of April 2026) via `spawn_agent`, the equivalent on Pi via `subagent` from the `pi-subagents` extension. On platforms where the model-override parameter is unavailable or the model name is unrecognized, omit the override — 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. ### Agent 1: Code Reuse Reviewer For each change: 1. **Search for existing utilities and helpers** that could replace newly written code. Look for similar patterns elsewhere in the codebase — common locations are utility directories, shared modules, and files adjacent to the changed ones. 2. **Flag any new function that duplicates existing functionality.** Suggest the existing function to use instead. 3. **Flag any inline logic that could use an existing utility** — hand-rolled string manipulation, manual path handling, custom environment checks, ad-hoc type guards, and similar patterns are common candidates. ### Agent 2: Code Quality Reviewer Review the same changes for hacky patterns: 1. **Redundant state**: state that duplicates existing state, cached values that could be derived, observers/effects that could be direct calls 2. **Parameter sprawl**: adding new parameters to a function instead of generalizing or restructuring existing ones 3. **Copy-paste with slight variation**: near-duplicate code blocks that should be unified with a shared abstraction 4. **Leaky abstractions**: exposing internal details that should be encapsulated, or breaking existing abstraction boundaries 5. **Stringly-typed code**: using raw strings where constants, enums (string unions), or branded types already exist in the codebase 6. **Unnecessary wrapper ele