simple-design

simple-design is a cursor rule for Cursor from marcoemrich/mad-tdd-mob-ai-driven. It costs 992 tokens per session, scanned A, original, MIT.

A set of four rules for keeping code simple and maintainable: make tests pass, show intent clearly, avoid duplication, and remove unnecessary parts. TDD, or test-driven development, means using tests to guide code design.

In plain words
What is it for?
Use it during coding and refactoring to improve names and structure, remove repeated logic, reduce unnecessary abstractions, and keep tests passing.
Why use it?
It gives developers a priority order for deciding what to fix or simplify without sacrificing working behavior.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it during coding and refactoring to improve names and structure, remove repeated logic, reduce unnecessary abstractions, and keep tests passing.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/marcoemrich/mad-tdd-mob-ai-driven/simple-design
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/marcoemrich/mad-tdd-mob-ai-driven

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for simple-design

README.md
[![agentmods](https://agentmods.dev/badge/rules/marcoemrich/mad-tdd-mob-ai-driven/simple-design.svg)](https://agentmods.dev/rules/marcoemrich/mad-tdd-mob-ai-driven/simple-design)
Your own site
<a href="https://agentmods.dev/rules/marcoemrich/mad-tdd-mob-ai-driven/simple-design"><img src="https://agentmods.dev/badge/rules/marcoemrich/mad-tdd-mob-ai-driven/simple-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 992 This file is loaded in full into every session.
When invoked 992 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00992 $0.00992
Opus 5 $0.00496 $0.00496
Sonnet 5 $0.00198 $0.00198
Haiku 4.5 $0.00099 $0.00099

Measured 7d ago against content hash 3c0ec83baadb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

simple-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/simple-design.mdc · 134 lines

How it starts

The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rules of Simple Design

Description

Kent Beck's Four Rules of Simple Design - fundamental principles for writing clean, maintainable code. These rules are applied in priority order and work synergistically with TDD.

The Four Rules (in priority order)

1. Tests Pass

  • All tests must pass
  • The code must work correctly
  • This is the highest priority rule - never compromise working code
  • If tests don't pass, fix them before applying other rules

2. Reveals Intent

  • Code should clearly express what it does
  • Use meaningful names for variables, functions, and classes
  • Structure code to be self-documenting
  • Prefer explicit over clever code
  • Comments should explain "why", not "what"

3. No Duplication (DRY)

  • Don't repeat yourself
  • Extract common functionality into reusable components
  • Look for both obvious duplication and conceptual duplication
  • Knowledge should have a single, unambiguous representation

4. Fewest Elements

  • Minimize the number of classes, methods, and other code elements
  • Remove unnecessary abstractions
  • Keep it simple - don't over-engineer
  • Only add complexity when it serves a clear purpose

Application Guidelines

Priority Order

  • Apply rules in order: 1 → 2 → 3 → 4
  • Never violate a higher-priority rule to satisfy a lower-priority one
  • If rule #3 conflicts with rule #2, choose clarity over DRY

Integration with TDD

  • Red Phase: Focus on rule #1 (make tests pass)
  • Green Phase: Still focus on rule #1 (minimal working code)
  • Refactor Phase: Apply rules #2, #3, #4 while preserving #1

Examples

Rule 2: Reveals Intent

// Bad
function calc(w: string[]): boolean {
  return w.every((x, i) => i === 0 || diff(x, w[i-1]) === 1);
}

// Good
function isValidWordChain(words: string[]): boolean {
  return words.every((word, index) =>
    index === 0 || differsByOneLetter(word, words[index - 1])
  );
}

Rule 3: No Duplication

// Bad
function differsByOneLetter(word1: string, word2: string): boolean {
  if (word1.length !== word2.length) return false;
  let differences = 0;
  for (let i = 0; i < word1.length; i++) {
    if (word1[i] !== word2[i]) differences++;
  }
  return differences === 1;
}

function isAdjacent(a: string, b: string): boolean {
  if (a.length !== b.length) return false;
  let diffs = 0;
  for (let i = 0; i < a.length; i++) {
    if (a[i] !== b[i]) diffs++;
  }
  return diffs === 1;
}

// Good - Extract common logic
function countDifferences(word1: string, word2: string): number {
  if (word1.length !== word2.length) return Infinity;
  return word1.split('').reduce((count, char, i) =>
    char !== word2[i] ? count + 1 : count, 0
  );
}

function differsByOneLetter(word1: string, word2: string): boolean {
  return countDifferences(word1, word2) === 1;
}

Read the full file on GitHub · 134 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 134 lines · 992 tokens per session scan A 3c0ec83baadb

Subscribe to this mod's changes

simple-design is a cursor rule published in the GitHub repository marcoemrich/mad-tdd-mob-ai-driven (33 stars, last pushed 10mo ago), licensed MIT. It adds 992 tokens to every session, about $0.0050 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.