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

code-simplifier

Skill15 starsChanged 58 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

42 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use comment-analyzer, performance 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.
  • lin30Skill

    comment-analyzer

    微博评论抓取与深度分析,生成可视化HTML报告。Use when user asks to analyze weibo comments, analyze social media comments, or requests sentiment analysis from weibo posts

    Also in 3 projects that use this

  • pluginagentmarketplaceSkill

    performance

    Optimize application performance through caching strategies, load balancing, database scaling, and monitoring. Build systems handling thousands of concurrent users.

    Also in 3 projects that use this

  • AWSSkill

    setup-matt-pocock-skills

    Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.

    Also in 3 projects that use this

  • OpenAISkill

    verification-before-completion

    Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

    Also in 4 projects that use this

  • AWSSkill

    to-spec

    Turn the current conversation into a spec and publish it to the project issue tracker: no interview, just synthesis of what you've already discussed.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 9 projects that use this

  • +2 more from aws

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