01-software-design-guidelines

A set of guidelines for designing and refactoring software so that its code is easier to understand and maintain. It covers how to divide responsibilities, hide complexity, and make important design decisions.

In plain words
What is it for?
Use it when planning modules, shaping APIs, splitting large classes or functions, choosing between designs, and polishing code after a feature works.
Why use it?
It helps reduce the mental effort needed to read, change, and extend a codebase as it grows.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/dafthunk-com/dafthunk/01-software-design-guidelines
Clone the repo
git clone --depth 1 https://github.com/dafthunk-com/dafthunk

Made for: Cursor.

Per session 258 This file is loaded in full into every session.
When invoked 258 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00258 $0.00258
Opus 5 $0.00129 $0.00129
Sonnet 5 $0.00052 $0.00052
Haiku 4.5 $0.00026 $0.00026

Measured 2d ago against content hash 91019aed2eb5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

01-software-design-guidelines 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 2d 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/01-software-design-guidelines.mdc · 17 lines

What it actually says

Software design and refactoring guidelines

  • Minimize complexity: Treat every design choice as a cost measured in future cognitive load. Eliminate unnecessary state and conditionals.
  • Prefer deep modules: expose a small, simple API that hides rich internal logic; avoid “wide” interfaces that mirror implementation details.
  • Pull complexity downward: if high-level code feels intricate, move that intricacy into a lower abstraction layer.
  • One purpose per abstraction: any class or function that can't be described in a single sentence should be split.
  • Optimize for read-time, not write-time: it's worth extra effort now to make future maintenance obvious.
  • Capture the why: use comments to record design intent and trade-offs; leave how to the code.
  • Design it twice: prototype at least two distinctly different solutions before settling on one.
  • Working ≠ finished: once the feature runs, refactor and polish interfaces until they're as simple as possible.
  • Decide big things early, small things late: lock in module boundaries or concurrency models first; postpone naming tweaks or parameter tuning.
  • Example-driven APIs: write the calling code you wish you had, then shape the real interface to match it.
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. 2d ago First seen · 17 lines · 258 tokens per session scan A 91019aed2eb5

Subscribe to this mod's changes

01-software-design-guidelines is a cursor rule published in the GitHub repository dafthunk-com/dafthunk (119 stars, last pushed 6d ago), licensed MIT. It adds 258 tokens to every session, about $0.0013 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.