agentleFS
ValorVieValorVie/custom-skills/.agents/skills/code-simplifier/SKILL.md

code-simplifier

Skill5 starsChanged 33 days agoMITView on GitHub

Use when user asks to simplify, clean up, or refactor recently modified code for readability, consistency, or maintainability without changing behavior, especially after implementation and before broader review.

59 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use tdd-rust, type-design-analyzer and 9 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

    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

  • 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

  • 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

  • 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 3 projects that use this

  • tossSkill

    pr-triage

    Classify and summarize a PR for efficient review

    Also in 3 projects that use this

  • +1 more from PaulKinlan

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. 0 are common, 16 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 54 edited versions we read keep these.

  • 16

    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:

    Do not use this skill for:

    line 19
  2. Distinctive:

    Use user-specified files or ranges if provided

    line 29
  3. Distinctive:

    Default to touched code only.

    line 31
  4. Distinctive:

    Check project instructions first such as AGENTS.md, local skill rules, and repo conventions

    line 35
  5. Distinctive:

    Follow existing naming, formatting, and structure in the touched files

    line 36
  6. Distinctive:

    If local conventions conflict with generic cleanup preferences, local conventions win

    line 37
  7. Distinctive:

    Remove duplication that is truly local and obvious

    line 42
  8. Distinctive:

    Prefer straightforward control flow over dense one-liners

    line 44
  9. Very specific:

    Avoid nested ternaries; use if/else or switch for multi-branch logic

    line 45
  10. Distinctive:

    Remove comments that only restate the code.

    line 46
  11. Distinctive:

    Do not add features, options, or speculative generalization

    line 51
  12. Distinctive:

    Do not broaden API surface or change data contracts

    line 52
  13. Distinctive:

    Do not rewrite untouched modules for style consistency alone

    line 53
  14. Distinctive:

    Do not claim "no behavior change" without verification

    line 54
  15. Distinctive:

    Run the narrowest meaningful verification for the changed area

    line 58
  16. Distinctive:

    Prefer targeted tests first, then broader lint/build checks if appropriate

    line 59
  17. Distinctive:

    If no automated verification exists, state that explicitly and mention residual risk

    line 60

“Common” is measured: kept by at least 6 in 10 of the 54 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

Overview

Simplify touched code without changing behavior. Prefer explicit, readable code over clever or overly compact rewrites, and keep scope limited to the files or sections the user just changed unless they request broader cleanup.

When to Use

  • The user asks to "simplify", "clean up", "tidy", or "refactor without changing behavior"
  • Recently modified code works, but has duplication, deep nesting, noisy comments, or inconsistent naming
  • A feature is complete and you want a maintainability pass before formal review
  • You want one focused simplification pass, not a multi-agent review workflow

Do not use this skill for:

  • Behavior changes, feature work, or bug fixes that alter requirements
  • Large architectural redesigns across untouched modules
  • Spec alignment review, security review, or performance review
  • Three-reviewer cleanup workflows; use simplify for that

Workflow

1. Define the Scope

  • Use user-specified files or ranges if provided
  • Otherwise inspect recent changes with git diff, git diff --name-only, or git status
  • Default to touched code only; do not expand into unrelated cleanup

2. Read Local Standards

  • Check project instructions first such as AGENTS.md, local skill rules, and repo conventions
  • Follow existing naming, formatting, and structure in the touched files
  • If local conventions conflict with generic cleanup preferences, local conventions win

3. Simplify Without Changing Semantics

  • Reduce unnecessary nesting
  • Remove duplication that is truly local and obvious
  • Rename variables or helpers only when clarity improves and the rename is safe
  • Prefer straightforward control flow over dense one-liners
  • Avoid nested ternaries; use if/else or switch for multi-branch logic
  • Remove comments that only restate the code; keep comments that explain intent or constraints
  • Preserve helpful abstractions; do not flatten structure just to reduce line count

4. Guardrails

  • Do not add features, options, or speculative generalization
  • Do not broaden API surface or change data contracts
  • Do not rewrite untouched modules for style consistency alone
  • Do not claim "no behavior change" without verification

5. Verify

  • Run the narrowest meaningful verification for the changed area
  • Prefer targeted tests first, then broader lint/build checks if appropriate
  • If no automated verification exists, state that explicitly and mention residual risk

Quick Reference

GoalPreferAvoid
ReadabilityClear names, explicit branches, small coherent helpersDense one-liners, clever tricks
Scope controlTouched files, recent diff, user-specified pathsRepo-wide cleanup without request
SafetyTargeted verification after editsAssuming refactor is safe
CommentsIntent and constraintsNarrating obvious code

Common Mistakes

  • Turning simplification into redesign
  • Extracting abstractions too early
  • Renaming broadly across unrelated files
  • Optimizing for fewer lines instead of easier maintenance
  • Skipping verification because the change "looks mechanical"

Upstream Reference

This Codex skill is adapted from Anthropic's code-simplifier plugin agent. See references/upstream-agent.md for the source location and adaptation notes.

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.