agentleFS
Vix0007Vix0007/vixero-skills/skills/simplicity-audit/SKILL.md

simplicity-audit

Skill1 starsChanged 7 months agoMITView on GitHub

Review code for premature abstraction, speculative features, and over-engineering. Use when the user asks "is this overcomplicated", "simplify this", "does this need all these layers", "review for over-engineering", "flatten this", or pastes a file asking for a complexity review. Returns a complexity ratio, flagged patterns, and a flattened rewrite for the worst offender.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    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:

    Never simplify code whose purpose you cannot read.

    line 91
  2. Distinctive:

    If complexity ratio > 70%, return "lean" and stop.

    line 92
  3. Distinctive:

    If the file is a library / framework / SDK, apply looser thresholds — generalization there may be earned.

    line 93
  4. Distinctive:

    If the file is under 30 lines, skip and say "too small to overbuild".

    line 95
  5. Distinctive:

    When proposing a rewrite, preserve public signatures.

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

simplicity-audit

Flag complexity not earned by a stated requirement.

Trigger on

  • "is this overcomplicated"
  • "simplify this"
  • "does this need X"
  • "review for over-engineering"
  • "flatten this"
  • "too many layers"

Universal patterns to flag

patternflag when
single-use abstractionABC / Protocol / Strategy used in exactly one place
speculative parametersflags / options never called from anywhere
defensive error handlingtry/except for conditions that cannot occur
premature generalizationgeneric machinery serving one concrete case
config theatresettings file holding values that never change
wrapper theatrewrapper whose only method calls the underlying
dataclass theatreclass with 2 fields, no methods, used once
builder theatrebuilder pattern when a constructor has 3 args
factory theatrefactory returning one concrete type 100% of the time
manager theatreXManager / XHandler wrapping a function that could be the function
enum-for-twoEnum with exactly two values used as bool
indirection for mockabilityinterface existing only to let tests mock
premature asyncasync/await on code that never actually awaits anything
generic-for-onegeneric type parameter only ever instantiated with one concrete type

Language-specific patterns

languagepattern
PythonUnion[X, X], bare Any on parameters, unused TypeVar, __init__ that only assigns, ABC with one implementation
TypeScriptany spreading through signatures, interface I { x: T } + class C implements I (used once), enum when literal union works
Javagetter/setter on every field with no logic, factory class returning one concrete type, XxxService + XxxServiceImpl pair with no second impl
Gointerface satisfied by one struct, empty struct wrapping one field, constructor returning &T{} with no logic
Rusttrait with one impl, wrapping Arc<Mutex<T>> when Arc<T> works, Builder for 2-field structs

Process

  1. Scan file for each pattern.
  2. For each hit, estimate lines saved by flattening.
  3. Compute complexity ratio: (lines serving stated purpose) / (total lines).
  4. Pick the worst offender by savings. Write its minimal equivalent.
  5. Rank all flags by absolute line savings.

Output

file: {name}
language: {lang}
total lines: {n}
lines serving stated purpose: {n}
complexity ratio: {pct}

flagged patterns (ranked by savings):
1. {pattern} at line {n}: {description} — save ~{n} lines
2. {pattern} at line {n}: {description} — save ~{n} lines
3. ...

worst offender — minimal rewrite:
```{lang}
{the flattened version}

verdict: {lean | minor overbuild | significant overbuild | rewrite from scratch} reasoning: {one line}


## Verdict thresholds

| complexity ratio | verdict |
|------------------|---------|
| ≥ 70% | lean (may still have minor flags) |
| 50–69% | minor overbuild (apply top 2 flags) |
| 30–49% | significant overbuild (apply all flags) |
| < 30% | rewrite from scratch (bones are wrong) |

## Hard rules
- Complexity is suspect, not forbidden. If user states a requirement needing it, accept.
- Tests and fixtures never flag — test scaffolding is not production complexity.
- Type hints do not flag unless they are theatre (Union[X,X], unused TypeVar, bare Any on parameters).
- Never simplify code whose purpose you cannot read. Ask first.
- If complexity ratio > 70%, return "lean" and stop. Do not invent flags to fill output.
- If the file is a library / framework / SDK, apply looser thresholds — generalization there may be earned.
- Abstractions explicitly marked as extension points (`# extension point` comments, plugin interfaces) do not flag.
- If the file is under 30 lines, skip and say "too small to overbuild".
- When proposing a rewrite, preserve public signatures. The caller's code must not change.

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.