Claude Skill

simplifying-code

Simplifies, polishes, and declutters code without changing behavior. Use when asked to "simplify code", "clean up code", "polish code", "refactor", "declutter", "reduce complexity", "remove dead code", "remove AI slop", "improve readability", or "tighten up this file".

LLM Mart · 0 points · 10 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download iliaal-whetstone-distillery_generated-skills_simplifying-code-bccd699.zip · 2 KB
Part of iliaal/whetstone — 62 skills

Install

skills CLI npx skills add https://github.com/iliaal/whetstone/tree/master/distillery/generated-skills/simplifying-code
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install iliaal-whetstone@llmmart
Git git clone https://github.com/iliaal/whetstone.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole iliaal/whetstone collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Simplifying Code

Principles

Principle Rule
Preserve behavior Output must do exactly what the input did — no silent feature additions or removals. Specifically preserve: async/sync boundaries, error propagation paths, and logging side effects
Explicit over clever Prefer explicit variables over nested expressions. Readable beats compact
Simplicity over cleanliness Prefer straightforward code over pattern-heavy "clean" code. Three similar lines beat a premature abstraction
Surgical changes Touch only what needs simplifying. Match existing style, naming conventions, and formatting of the surrounding code
Surface assumptions Before changing a block, identify what imports it, what it imports, and what tests cover it. Edit dependents in the same pass

Process

  1. Read first — understand the full file and its dependents before changing anything
  2. Identify invariants — what must stay the same? Public API, return types, side effects, error behavior
  3. Identify targets — find the highest-impact simplification opportunities (see Smell → Fix table)
  4. Apply in order — control flow → naming → duplication → data shaping → types. Structural changes first, cosmetic last
  5. Verify — confirm no behavior change: tests pass, types check, imports resolve

Smell → Fix

Smell Fix
Deep nesting (>2 levels) Guard clauses with early returns
Long function (>30 lines) Extract into named functions by responsibility
Too many parameters (>3) Group into an options/config object
Duplicated block (3+ occurrences) Extract shared function. Two copies = leave inline; wait for the third
Magic numbers/strings Named constants
Complex conditional Extract to descriptively-named boolean or function
Dead code / unreachable branches Delete entirely — no commented-out code
Unnecessary else after return Remove else, dedent

AI Slop Removal

When simplifying AI-generated code, specifically target:

  • Redundant comments that restate the code (// increment counter above counter++) — delete them
  • Unnecessary defensive checks for conditions that cannot occur in context — remove the guard
  • Gratuitous type casts (as any, as unknown as T) — fix the actual type or use a proper generic
  • Over-abstraction (factory for 2 objects, wrapper around a single call, util file with 1 function) — inline the code
  • Inconsistent style that drifts from the file's existing conventions — match the file

Constraints

  • Only simplify what was requested — do not add features, expand scope, or introduce new dependencies
  • Leave unchanged code untouched — do not add comments, docstrings, or type annotations to lines that were not simplified
  • If a simplification would make the code harder to understand, skip it
  • When unsure whether a block is dead code, ask instead of deleting
Files (whetstone)
  • manifest.json 983 B
    {
      "query": "simplifying / polishing code",
      "search_queries": [
        "simplify code",
        "clean code",
        "code refactoring",
        "code polish"
      ],
      "generated": "2026-02-17",
      "token_count": 861,
      "sources": [
        {
          "id": "brianlovin/claude-config/simplify",
          "installs": 2017,
          "sha1": "940d5fcddd55d4b5a99bfcec7a9a0aa1ae328fd0"
        },
        {
          "id": "sickn33/antigravity-awesome-skills/clean-code",
          "installs": 1743,
          "sha1": "b3f01e8afdb919b29d1167a2eded9f088aec6812"
        },
        {
          "id": "forrestchang/andrej-karpathy-skills/karpathy-guidelines",
          "installs": 1341,
          "sha1": "ecea16804429c4b712e2d096fcabb629909161c3"
        },
        {
          "id": "skillcreatorai/ai-agent-skills/code-refactoring",
          "installs": 325,
          "sha1": "254762c318f760fb9d5542938d996535ae59cd59"
        },
        {
          "id": "brianlovin/claude-config/deslop",
          "installs": 214,
          "sha1": "14b730d7e14b4b1177d4786be5ee167f3608aaa8"
        }
      ]
    }
    
  • SKILL.md 3.3 KB
    ---
    name: simplifying-code
    description: >-
      Simplifies, polishes, and declutters code without changing behavior. Use when
      asked to "simplify code", "clean up code", "polish code", "refactor",
      "declutter", "reduce complexity", "remove dead code", "remove AI slop",
      "improve readability", or "tighten up this file".
    ---
    
    # Simplifying Code
    
    ## Principles
    
    | Principle | Rule |
    |-----------|------|
    | **Preserve behavior** | Output must do exactly what the input did — no silent feature additions or removals. Specifically preserve: async/sync boundaries, error propagation paths, and logging side effects |
    | **Explicit over clever** | Prefer explicit variables over nested expressions. Readable beats compact |
    | **Simplicity over cleanliness** | Prefer straightforward code over pattern-heavy "clean" code. Three similar lines beat a premature abstraction |
    | **Surgical changes** | Touch only what needs simplifying. Match existing style, naming conventions, and formatting of the surrounding code |
    | **Surface assumptions** | Before changing a block, identify what imports it, what it imports, and what tests cover it. Edit dependents in the same pass |
    
    ## Process
    
    1. **Read first** — understand the full file and its dependents before changing anything
    2. **Identify invariants** — what must stay the same? Public API, return types, side effects, error behavior
    3. **Identify targets** — find the highest-impact simplification opportunities (see Smell → Fix table)
    4. **Apply in order** — control flow → naming → duplication → data shaping → types. Structural changes first, cosmetic last
    5. **Verify** — confirm no behavior change: tests pass, types check, imports resolve
    
    ## Smell → Fix
    
    | Smell | Fix |
    |-------|-----|
    | Deep nesting (>2 levels) | Guard clauses with early returns |
    | Long function (>30 lines) | Extract into named functions by responsibility |
    | Too many parameters (>3) | Group into an options/config object |
    | Duplicated block (**3+** occurrences) | Extract shared function. Two copies = leave inline; wait for the third |
    | Magic numbers/strings | Named constants |
    | Complex conditional | Extract to descriptively-named boolean or function |
    | Dead code / unreachable branches | Delete entirely — no commented-out code |
    | Unnecessary `else` after return | Remove `else`, dedent |
    
    ## AI Slop Removal
    
    When simplifying AI-generated code, specifically target:
    
    - **Redundant comments** that restate the code (`// increment counter` above `counter++`) — delete them
    - **Unnecessary defensive checks** for conditions that cannot occur in context — remove the guard
    - **Gratuitous type casts** (`as any`, `as unknown as T`) — fix the actual type or use a proper generic
    - **Over-abstraction** (factory for 2 objects, wrapper around a single call, util file with 1 function) — inline the code
    - **Inconsistent style** that drifts from the file's existing conventions — match the file
    
    ## Constraints
    
    - Only simplify what was requested — do not add features, expand scope, or introduce new dependencies
    - Leave unchanged code untouched — do not add comments, docstrings, or type annotations to lines that were not simplified
    - If a simplification would make the code harder to understand, skip it
    - When unsure whether a block is dead code, ask instead of deleting
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related