From nexus-agents
Reduces nesting, extracts names, and eliminates redundancy while preserving exact behavior. Applies after features work and tests pass, triggered by readability concerns or code review.
How this skill is triggered — by the user, by Claude, or both
Slash command
/nexus-agents:code-simplificationThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<!--
Apply when:
Skip when:
test-driven-development skill).rules/ directory and CLAUDE.md describe what's canonical here."Don't remove a fence in the middle of a field until you understand why it was put there."
Before deleting code, comment, or guard clause:
git log -S "term" --all, git blame)..rules/typescript.md) — split by concerndata, tmp, result) — rename to describe role in this scope| Excuse | Counter |
|---|---|
| "It's working — leave it" | Working ≠ maintainable. Today's working-but-confusing code is tomorrow's bug-fix nightmare. |
| "Fewer lines = simpler" | Line count is a proxy, not a goal. A 5-line clever expression is often less readable than 12 obvious lines. |
| "I'll refactor while I add features" | This is how regressions arrive. Mixing refactor + feature changes makes the diff impossible to review and the regression impossible to bisect. |
| "Types are self-documenting" | Types describe shape, not intent. function process(x: User): Result says nothing about what process does. |
| "Just one tiny drive-by cleanup" | Drive-by edits in unrelated files inflate the diff and hide regressions in unrelated systems. Open a follow-up PR. |
| "I don't need to understand it to refactor it" | Yes you do. See Chesterton's Fence. |
pnpm lint && pnpm typecheck && pnpm testtry/catch removed unless replaced with explicit non-erroring pathdata/tmp/result introducednpx claudepluginhub nexus-substrate/nexus-agentsSimplifies code for clarity by reducing complexity while preserving exact behavior. Use when refactoring functional but hard-to-read code, during reviews, or for maintenance.
Refines existing code for clarity, readability, and maintainability without changing behavior, interfaces, or outputs. Use for simplify, clean up, refactor for readability requests.
Simplifies recently modified code for clarity, consistency, and maintainability while preserving functionality. Auto-invokes or runs on demand.