Simplify
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.zipInstalls 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.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
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):fileorhunk(defaultfile).max_passes(optional): default2, clamp to[1, 4].preserve_behavior(optional): defaulttrue.focus(optional): subset ofreuse,dead_code,redundant_guards,naming,duplication,efficiency.
Parsing rules (priority order)
- If structured args are provided, use them directly.
- 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
- "this file", explicit path, or pasted diff ->
- Defaults:
scope=file,max_passes=2,preserve_behavior=true
- If
targetis still missing, ask for one concrete file or hunk.
Canonical workflow
- Understand baseline
- Read the target and identify purpose, invariants, and public interfaces.
- 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
- Apply only high-signal improvements:
- Behavior safety check
- If
preserve_behavior=true, avoid interface/semantic changes. - If a behavior change seems necessary, stop and ask for confirmation.
- If
- Verification
- Run targeted checks (lint/test/build scope relevant to changed files).
- 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).
- no further meaningful simplification remains (
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_reachedpasses_run: number of simplify passes executedtarget: normalized file/hunk targetfocus_used: normalized focus dimensionschanges: concise bullet list of concrete simplificationsbehavior_safety: why behavior is preserved (or what approval is needed)verification: checks run + outcomesnext_action: required unlessstatus=simplifiedoralready_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=truetarget="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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| Simplify (this skill) | 0 | 3mo | No flags | Intermediate |
| effective-go | 323 | 9mo | No flags | Beginner |
| solid-principles | 57 | 9mo | No flags | Intermediate |
| typescript-review | 39 | 2mo | No flags | Intermediate |
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.
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.
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.
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.
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.
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.