agentleFS
louisbrulenaudetlouisbrulenaudet/monorepo-template/.cursor/rules/quality/simplicity.mdc

monorepo-template / quality

Cursor rule19 starsChanged 16 days agoApache-2.0View on GitHub

Simplicity - smallest correct diff; reuse, platform, installed deps before new code; no speculative abstraction

The file

We split this simplicity.mdc into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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:

    Read the task and every file the change touches, and trace the real flow end to end before choosing a solution: the smallest change in the …

    line 11
  2. Distinctive:

    Stop at the first rung that holds:

    line 16
  3. Distinctive:

    Only then: write the minimum code that works.

    line 22
  4. Distinctive:

    Prefer deletion over addition and boring over clever.

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule 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
simplicity.mdc
---
description: "Simplicity - smallest correct diff; reuse, platform, installed deps before new code; no speculative abstraction"
alwaysApply: true
---
# Simplicity

The best diff is the smallest one that fully solves the problem. Agents over-build - a layer, a helper, a fallback, a dependency "for later"; later can build for itself. Writing less code never means understanding less.

## Understand first

- Read the task and every file the change touches, and trace the real flow end to end before choosing a solution: the smallest change in the wrong place is a second bug.
- A bug report names a symptom. Grep every caller of the function you are about to touch and fix the shared function once, not only the reported path.

## The ladder

Stop at the first rung that holds:

1. **Does it need to exist?** Skip a speculative need and say so in one line.
2. **Is it already in the repo?** Reuse the `@repo/*` package, helper, schema, or pattern a few files over; re-implementing what exists is the most common agent slop.
3. **Does the platform do it?** Web and Workers APIs (`URL`, `URLSearchParams`, `Intl`, `crypto.randomUUID`, `structuredClone`, `AbortSignal.timeout`, `Response.json`), CSS over JS, a native element over a widget, a database constraint over app code.
4. **Does an installed dependency do it?** Hono helpers and middleware, Zod, TanStack Query and Router features. Never add a dependency for what a few lines do; a justified one goes through the catalog.
5. **Only then** write the minimum code that works.

Between two options of the same size, take the one correct on edge cases: less code, not a flimsier algorithm.

## Do not generate

- An interface, factory, generic, or strategy with one implementation; a wrapper that only delegates; a layer with one caller.
- Options, parameters, flags, or config nobody sets. A value that never changes is a `const`.
- A new file for a helper with one caller, or a barrel that re-exports one thing.
- Defensive code the types already rule out: a null check on a non-nullable value, re-parsing data a Zod schema already parsed, a `try`/`catch` that only rethrows or that logs and swallows.
- Fallbacks, retries, or caches no observed failure or measurement asked for.
- Back-compat aliases, shims, or re-exports for code with no external caller - update the callers and delete the old name.
- Stubs, TODO scaffolding, and extension points "for later".

Prefer deletion over addition and boring over clever. Fewer lines is not a goal on its own: clarity wins a tie with brevity, so no nested ternaries and no dense one-liners.

## Never simplify away

Validation at trust boundaries, error handling that prevents data loss, security and sensitive-data handling ([guardrails.mdc](../core/guardrails.mdc)), accessibility basics, and anything explicitly requested. If the user asks for the full version, build it without re-arguing. Non-trivial logic still gets one test at its owning boundary ([testing.mdc](testing.mdc)).

## Deliberate ceilings

A shortcut with a known limit - linear scan, global lock, naive heuristic, in-memory cap - carries one comment naming the limit and the trigger to revisit it: `// ceiling: linear scan over all rows; index when the table passes ~10k`. It records a why, so it meets [comments.mdc](comments.mdc). A `ceiling:` without a trigger is not allowed. `/review simplicity` collects them into a ledger.

## Reporting

For a large request, ship the smallest version that covers it and add one line: "Skipped X; add when Y." Do not stall on a question a sensible default answers, and do not write paragraphs defending a simplification.

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.