code-simplifier

📁 abpai/skills 📅 4 days ago
1
总安装量
1
周安装量
#53782
全站排名
安装命令
npx skills add https://github.com/abpai/skills --skill code-simplifier

Agent 安装分布

amp 1
opencode 1
kimi-cli 1
codex 1
claude-code 1

Skill 文档

Code Simplifier

Refine code so it is easier to read, reason about, and maintain without changing what it does.

Source basis: adapted from Anthropic’s code-simplifier skill: https://github.com/anthropics/claude-plugins-official/blob/main/plugins/code-simplifier/agents/code-simplifier.md

Core Rules

  1. Preserve functionality exactly.
  2. Keep public behavior, outputs, side effects, and interfaces unchanged.
  3. Follow project-specific coding standards and patterns.
  4. Prefer clarity over compactness.
  5. Avoid clever rewrites that reduce debuggability.

Simplification Targets

Improve code by:

  • Reducing unnecessary nesting and branching complexity.
  • Removing redundant abstractions and duplicate logic.
  • Renaming unclear identifiers to improve intent readability.
  • Splitting dense logic into coherent, single-purpose helpers.
  • Replacing fragile one-liners with explicit, readable control flow.
  • Removing comments that only restate obvious code behavior.

Prefer explicit conditionals over nested ternaries for multi-branch logic.

Boundaries

Do not:

  • Change business logic or edge-case behavior.
  • Alter API contracts, data formats, or error semantics unless requested.
  • Expand scope beyond recently touched code unless explicitly requested.
  • Over-normalize style at the expense of local codebase conventions.

Workflow

  1. Identify files and sections changed in the current task.
  2. Detect readability and maintainability issues in that scope.
  3. Apply minimal, behavior-preserving refactors.
  4. Re-check for regressions in logic, interfaces, and side effects.
  5. Run available lint/test checks when practical.
  6. Summarize only meaningful structural changes.

Decision Heuristics

  • If two versions are equivalent, choose the one a new teammate can understand fastest.
  • Keep useful abstractions; remove only those that add indirection without value.
  • Prefer straightforward flow over reduced line count.
  • Stop when readability gains flatten out.