agentleFS
JBSommelingJBSommeling/claude-config/.agents/skills/code-simplification/SKILL.md

code-simplification

Skill0 starsChanged 29 days agoMITView on GitHub

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be.

86 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use constraint-driven-development, performance-optimization 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.
  • MrCipherSmithSkill

    constraint-driven-development

    Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.

    Also in 16 projects that use this

  • barisariburnuSkill

    performance-optimization

    Complete performance optimization guide for Next.js applications including frontend, backend, database, caching, and general optimization strategies. Use when improving performance, reducing bundle size, optimizing queries, or implementing caching.

    Also in 47 projects that use this

  • GSA-TTSSkill

    architecture-decision-records

    Load when a user wants architecture decision records (ADRs) drafted from requirements or a design discussion, asks which decisions need an ADR, or wants an ADR draft reviewed for one-sided trade-offs, weak alternatives or missing requirement links. Not for setting up a project's whole documentation system (project-documentation-system).

    Also in 4 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 3 projects that use this

  • OpenAISkill

    security-best-practices

    Perform language and framework specific security best-practice reviews and suggest improvements. Trigger only when the user explicitly requests security best practices guidance, a security review/report, or secure-by-default coding help. Trigger only for supported languages (python, javascript/typescript, go). Do not trigger for general code review, debugging, or non-security tasks.

    Also in 3 projects that use this

  • GitHubSkill

    conventional-commit

    Prompt and workflow for generating conventional commit messages using a structured XML format. Guides users to create standardized, descriptive commit messages in line with the Conventional Commits specification, including instructions, examples, and validation.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 80 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before removing anything, understand why it exists.

    line 52

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

Reduce complexity while preserving exact behavior. The goal is not fewer lines — it's code that is easier to read, understand, modify, and debug.

Five Principles

  1. Preserve behavior exactly — same outputs, same errors, same side effects. If unsure, don't change it.
  2. Follow project conventions — match the codebase style, not your preferences. Inconsistency is not simplification.
  3. Prefer clarity over cleverness — explicit > compact when compact requires mental parsing.
  4. Maintain balance — don't over-simplify. Removing a well-named helper makes call sites harder to read.
  5. Scope to what changed — simplify recently modified code. Avoid drive-by refactors of unrelated code.

Simplification Patterns

Structural:

PatternSimplification
Deep nesting (3+ levels)Guard clauses or extract helper functions
Long functions (50+ lines)Split into focused functions
Nested ternariesReplace with if/else or lookup objects
Boolean parameter flagsOptions objects or separate functions
Repeated conditionalsExtract to named predicate function

Naming:

PatternSimplification
Generic names (data, result, temp)Rename to describe content
Comments explaining "what"Delete — code is clear enough
Comments explaining "why"Keep — they carry intent code can't express
Misleading namesRename to reflect actual behavior

Redundancy:

PatternSimplification
Duplicated logic (5+ lines)Extract to shared function
Dead code, commented-out blocksRemove (after confirming truly dead)
Wrapper that adds no valueInline it
Over-engineered patternsReplace with direct approach

Process

1. Understand Before Touching (Chesterton's Fence)

Before removing anything, understand why it exists. Check git blame. If you can't answer why it was written this way, you're not ready to simplify.

2. Apply Changes Incrementally

One simplification at a time. Run tests after each. Submit refactoring separately from feature or bug fix changes.

3. Verify

  • Is the simplified version genuinely easier to understand?
  • Is the diff clean and reviewable?
  • Did any tests need modification? (If yes, you likely changed behavior.)

Red Flags

  • Simplification that requires modifying tests to pass
  • "Simplified" code that is longer or harder to follow
  • Renaming to match your preferences rather than project conventions
  • Removing error handling because "it makes the code cleaner"
  • Simplifying code you don't fully understand
  • Refactoring code outside the current task scope without being asked

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.