agentleFS
yeisonrestrepoyeisonrestrepo/code-conductor/skills/code-simplifier/SKILL.md

code-simplifier

Skill17 starsChanged 37 days agoMITView on GitHub

Always-active simplicity rules: no speculative abstractions, one job per function, max 30 lines, flat over nested with early returns, descriptive names, comments explain why

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 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

    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

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 54 edited versions we read keep these.

  • 8

    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:

    Add a layer only when it carries real logic — not to "separate concerns" theoretically.

    line 30
  2. Distinctive:

    Don't create an interface for a type that will only ever have one implementation.

    line 48
  3. Distinctive:

    If a function needs a comment to describe what a section does, that section should be its own function.

    line 54
  4. Distinctive:

    Don't validate inputs that can't be wrong (internal calls, typed parameters, framework guarantees).

    line 57
  5. Distinctive:

    Use a pattern only when it solves a specific pain you have today.

    line 75
  6. Distinctive:

    Use guard clauses and early returns instead of nesting.

    line 78
  7. Distinctive:

    When you see any of these, stop and refactor before adding more code:

    line 116
  8. Distinctive:

    Only add abstraction when:

    line 126

“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

Always active. Apply these rules to every piece of code written or reviewed.

Rules

1. No Speculative Abstractions

Solve today's problem. Do not build for hypothetical future requirements.

❌ Bad:

interface DataProcessor<T, R> {
  process(data: T): R;
  validate(data: T): boolean;
}

✅ Good:

function parseUserInput(raw: string): User { ... }

2. No Premature Layers

Add a layer only when it carries real logic — not to "separate concerns" theoretically.

❌ Bad:

class UserRepository {
  constructor(private db: UserDataAccessLayer) {}
  findById(id: string) { return this.db.findById(id); }
}

✅ Good:

async function getUserById(db: Database, id: string): Promise<User> {
  return db.query('SELECT * FROM users WHERE id = ?', [id]);
}

3. No Single-Implementation Interfaces

Don't create an interface for a type that will only ever have one implementation.

❌ Bad: interface Logger { log(msg: string): void } ✅ Good: Use the class directly, or a plain function.

4. Functions Do One Thing (Max 30 Lines)

If a function needs a comment to describe what a section does, that section should be its own function.

5. No Defensive Code for Impossible Cases

Don't validate inputs that can't be wrong (internal calls, typed parameters, framework guarantees).

❌ Bad:

function add(a: number, b: number): number {
  if (typeof a !== 'number') throw new Error('a must be a number');
  return a + b;
}

✅ Good:

function add(a: number, b: number): number {
  return a + b;
}

6. No Design Patterns by Default

Use a pattern only when it solves a specific pain you have today.

7. Flat Over Nested

Use guard clauses and early returns instead of nesting.

❌ Bad:

function process(user: User | null) {
  if (user) {
    if (user.isActive) {
      if (user.hasPermission) {
        doWork(user);
      }
    }
  }
}

✅ Good:

function process(user: User | null) {
  if (!user) return;
  if (!user.isActive) return;
  if (!user.hasPermission) return;
  doWork(user);
}

8. Descriptive Names

No Base, Abstract, Generic, Manager, Handler, Service, Helper, Util.

9. Constants Only When Used 2+ Places or Have Domain Meaning

❌ Bad: const ONE = 1 ✅ Good: const MAX_RETRY_ATTEMPTS = 3

10. Comments Explain Why, Never What

❌ Bad: // increment counter ✅ Good: // retry limit matches SLA from the payments contract

Complexity Signals — Stop and Simplify

When you see any of these, stop and refactor before adding more code:

  • Class with 5+ constructor dependencies
  • Function over 30 lines
  • 3+ levels of nesting
  • A layer that only delegates to the layer below
  • A name containing Base, Abstract, Generic, Manager, or Handler

When Complexity IS Justified

Only add abstraction when:

  • Multiple real implementations exist today (not "might exist someday")
  • Domain rules are genuinely complex and need encapsulation
  • A documented performance constraint requires it
  • The pattern prevents a bug class that has already occurred in this codebase

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.