Simplifies code files or hunks by removing noise and duplication while strictly preserving current behavior.

Install

mkdir -p .claude/skills/simplify-lordmacu && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16336" && unzip -o skill.zip -d .claude/skills/simplify-lordmacu && rm skill.zip

Installs to .claude/skills/simplify-lordmacu

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Bounded simplification pass for a file or hunk that preserves behavior while reducing complexity.
97 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Remove dead code and unreachable branches
  • Collapse redundant guards and repeated conditionals
  • Deduplicate copy-paste logic into local helpers
  • Improve naming for intent clarity
  • Replace ad-hoc logic with existing utilities
  • Run targeted checks (lint/test/build) for verification

How it works

The skill performs bounded simplification passes on a target file or hunk, applying high-signal improvements like dead code removal, redundant guard collapsing, and naming improvements, while preserving behavior unless explicitly instructed otherwise.

Inputs & outputs

You give it
File path or hunk identifier to simplify
You get back
Simplified code with a bullet list of changes and verification outcomes

When to use Simplify

  • Refactoring messy code hunks
  • Removing dead code
  • Cleaning up project file structure

About this skill

Simplify

Simplify code in a bounded, evidence-driven way: smaller, clearer, and easier to maintain while preserving behavior unless the user explicitly asks otherwise.

Use when

  • User asks for refactor/cleanup without adding new features.
  • A file or hunk looks noisy (duplication, dead code, redundant guards).
  • You need clearer names and tighter structure with minimal risk.

Do not use when

  • User is requesting new behavior or a product-level redesign.
  • You do not have a concrete target file/hunk.
  • The change would require broad API/contract breakage without approval.

Input contract

  • target (required): file path or hunk identifier to simplify.
  • scope (optional): file or hunk (default file).
  • max_passes (optional): default 2, clamp to [1, 4].
  • preserve_behavior (optional): default true.
  • focus (optional): subset of reuse, dead_code, redundant_guards, naming, duplication, efficiency.

Parsing rules (priority order)

  1. If structured args are provided, use them directly.
  2. Else infer from user language:
    • "this file", explicit path, or pasted diff -> target
    • "just this block/hunk" -> scope=hunk
    • "two passes/max 3 rounds" -> max_passes
    • "don't change behavior" -> preserve_behavior=true
    • keywords like "remove dead code", "rename", "dedupe" -> focus
  3. Defaults:
    • scope=file, max_passes=2, preserve_behavior=true
  4. If target is still missing, ask for one concrete file or hunk.

Canonical workflow

  1. Understand baseline
    • Read the target and identify purpose, invariants, and public interfaces.
  2. Run bounded simplify passes (1..max_passes)
    • Apply only high-signal improvements:
      • remove dead code / unreachable branches
      • collapse redundant guards and repeated conditionals
      • deduplicate copy-paste logic into local helpers where appropriate
      • improve naming for intent clarity
      • replace ad-hoc logic with existing utilities when available
  3. Behavior safety check
    • If preserve_behavior=true, avoid interface/semantic changes.
    • If a behavior change seems necessary, stop and ask for confirmation.
  4. Verification
    • Run targeted checks (lint/test/build scope relevant to changed files).
  5. Stop when:
    • no further meaningful simplification remains (status=already_simple), or
    • simplification applied safely (status=simplified), or
    • blocked by missing context/approval (status=needs_user_input), or
    • pass budget reached (status=max_passes_reached).

Guardrails

  • Never run unbounded refactor loops.
  • Do not introduce speculative abstractions with no local payoff.
  • Do not touch unrelated files "while here".
  • Prefer small, reviewable edits over sweeping rewrites.
  • Keep comments only for non-obvious WHY; remove narrative noise.

Output format

Always return:

  • status: simplified | already_simple | needs_user_input | max_passes_reached
  • passes_run: number of simplify passes executed
  • target: normalized file/hunk target
  • focus_used: normalized focus dimensions
  • changes: concise bullet list of concrete simplifications
  • behavior_safety: why behavior is preserved (or what approval is needed)
  • verification: checks run + outcomes
  • next_action: required unless status=simplified or already_simple

Examples

  • target="crates/core/src/agent/mod.rs" max_passes=2 focus="dead_code,redundant_guards"
  • target="src/main.rs#L120" scope="hunk" preserve_behavior=true
  • target="diff:latest" focus="reuse,duplication,naming" max_passes=3

When not to use it

  • When the user is requesting new behavior or a product-level redesign
  • When a concrete target file or hunk is not provided
  • When the change would require broad API/contract breakage without approval

Limitations

  • Never run unbounded refactor loops
  • Do not introduce speculative abstractions with no local payoff
  • Do not touch unrelated files 'while here'

How it compares

This skill provides a bounded, evidence-driven approach to code simplification, focusing on preserving behavior and minimizing risk through targeted passes, unlike an unbounded or speculative refactoring process.

Compared to similar skills

Simplify side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
Simplify (this skill)03moNo flagsIntermediate
effective-go3239moNo flagsBeginner
solid-principles579moNo flagsIntermediate
typescript-review392moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

effective-go

openshift

Apply Go best practices, idioms, and conventions from golang.org/doc/effective_go. Use when writing, reviewing, or refactoring Go code to ensure idiomatic, clean, and efficient implementations.

323536

solid-principles

SmidigStorm

Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.

57236

typescript-review

metabase

Review TypeScript and JavaScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing TypeScript/JavaScript code.

39178

ast-grep

ast-grep

Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.

17135

serena

massgen

This skill provides symbol-level code understanding and navigation using Language Server Protocol (LSP). Enables IDE-like capabilities for finding symbols, tracking references, and making precise code edits at the symbol level.

1597

typescript

lobehub

TypeScript code style and optimization guidelines. Use when writing TypeScript code (.ts, .tsx, .mts files), reviewing code quality, or implementing type-safe patterns. Triggers on TypeScript development, type safety questions, or code style discussions.

2877

Search skills

Search the agent skills registry