agentleFS
DulajDilDulajDil/claude-skills-manager/skills/code-simplifier/SKILL.md

code-simplifier

Skill1 starsChanged 19 days agoMITView on GitHub

Simplify and refine code for clarity, consistency, and maintainability while preserving all functionality. Use this skill when the user asks to "simplify this", "clean this up", "tidy this code", "make this more readable", or "refactor for clarity". Focuses on recently modified code unless told otherwise.

62 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use tdd-rust, comment-analyzer and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • FlorianBruniauxSkill

    tdd-rust

    Also in 3 projects that use this

  • PaulKinlanSkill

    comment-analyzer

    Analyzes code comments for accuracy, completeness, and long-term maintainability. Identifies misleading comments, comment rot, and documentation gaps.

    Also in 4 projects that use this

  • PaulKinlanSkill

    type-design-analyzer

    Analyzes type design quality focusing on encapsulation, invariant expression, usefulness, and enforcement. Provides quantitative ratings (1-10) for each dimension.

    Also in 3 projects that use this

  • ufodev-ioSkill

    security-guardian

    Comprehensive security layer for all interactions with Claude: audits code, dependencies, commands, configs, and AI-generated output for vulnerabilities. Protects against prompt injection, data leaks, unsafe advice, and social engineering. Works in Cursor, Claude Code, claude.ai, and API contexts. Use always as a background security protocol in any Claude-powered environment.

    Also in 3 projects that use this

  • AJBcodingSkill

    sql-optimization-patterns

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.

    Also in 5 projects that use this

  • SentrySkill

    find-bugs

    Find bugs, security vulnerabilities, and code quality issues in local branch changes. Use when asked to review changes, find bugs, security review, or audit code on the current branch.

    Also in 4 projects that use this

  • +1 more from PaulKinlan

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 58 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default to code that was recently written or modified — the current diff or the files touched this session.

    line 18
  2. Distinctive:

    Only widen the scope if the user asks.

    line 20
  3. Distinctive:

    Do not simplify code you were not asked about.

    line 22
  4. Very specific:

    Before changing anything, read the surrounding code and any CLAUDE.md, .editorconfig, or linter config in the repo.

    line 35
  5. Distinctive:

    Remove redundant code, dead branches, and abstractions with a single caller that only obscure the logic.

    line 50
  6. Distinctive:

    Delete comments that restate the code.

    line 55
  7. Distinctive:

    Read enough of the surrounding code to learn the local conventions.

    line 72
  8. Distinctive:

    Run the project's tests and linter if they exist.

    line 76
  9. Distinctive:

    If the code is already clear, say so and change nothing.

    line 80

“Common” is measured: kept by at least 6 in 10 of the 58 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Simplifier

Improve the clarity and consistency of code without changing what it does. Readable and explicit beats short and clever, every time.

Scope

Default to code that was recently written or modified — the current diff or the files touched this session. Run git diff and git diff --staged to find it. Only widen the scope if the user asks.

Do not simplify code you were not asked about. A sprawling refactor buried in an unrelated change is hard to review and easy to get wrong.

The one hard rule

Behaviour must not change. Same inputs, same outputs, same side effects, same error cases, same public API. If a change would alter behaviour — even to fix what looks like a bug — stop and raise it with the user instead. Fixing bugs is a separate task from simplifying, and mixing them makes both harder to review.

Follow the project, not your preferences

Before changing anything, read the surrounding code and any CLAUDE.md, .editorconfig, or linter config in the repo. Match:

  • Module and import style, and how imports are ordered.
  • Function declaration style, and whether return types are annotated.
  • Component and props conventions.
  • Error-handling patterns already in use.
  • Naming conventions for variables, functions, files, and types.

Where the project has a convention, it wins over your default — even if you'd write it differently on a blank page.

What to simplify

  • Reduce nesting: early returns and guard clauses instead of deep if pyramids.
  • Remove redundant code, dead branches, and abstractions with a single caller that only obscure the logic.
  • Give things names that say what they are; replace magic values with named constants.
  • Consolidate logic that is duplicated verbatim a few lines apart.
  • Delete comments that restate the code. Keep comments explaining why.
  • Replace nested ternaries with if/else chains or a switch.

What not to do

Over-simplification is a real failure mode. Avoid changes that:

  • Trade clarity for fewer lines — dense one-liners are not an improvement.
  • Produce clever code that the next reader has to decode.
  • Collapse separate concerns into one function that now does too much.
  • Strip a helpful abstraction just because it is small.
  • Make the code harder to debug, extend, or step through.
  • Reformat whole files, burying the real change in whitespace noise.

Process

  1. Find the recently modified code.
  2. Read enough of the surrounding code to learn the local conventions.
  3. Apply the simplifications that clearly help; skip the marginal ones.
  4. Confirm behaviour is unchanged — re-read the diff specifically asking "could this produce a different result for any input?"
  5. Run the project's tests and linter if they exist.
  6. Summarise only the changes that affect how the code reads or works. A list of trivial edits is noise.

If the code is already clear, say so and change nothing. That is a valid result.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.