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.
git clone --depth 1 https://github.com/BetterTyped/hype-stackWrote 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.
[](https://agentmods.dev/rules/bettertyped/hype-stack/module-design)<a href="https://agentmods.dev/rules/bettertyped/hype-stack/module-design"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/module-design/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/bettertyped/hype-stack/module-design"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/module-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00575 |
| Opus 5.5 | $0.00000 | $0.00230 |
| Sonnet 5.5 | $0.00000 | $0.00115 |
| Haiku 4.5 | $0.00000 | $0.00057 |
Grade A, and why
module-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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Module Design
The structure rules say where files go. This rule says what a good module looks like once it's there.
Deep modules
Prefer deep modules: a lot of behavior behind a small interface.
- Fewer functions with real behavior beat many thin pass-through helpers.
- A module is shallow when its interface is nearly as complex as its implementation — a wrapper that only renames or forwards arguments adds cost, not value.
- Deletion test: if deleting a helper would just inline one line at each call site, delete it. If deleting it would scatter real complexity across callers, it's earning its place.
- Routes stay thin because the feature module is the deep part — push logic down into the module, not up into the handler.
No speculative generality
Build for the requirements that exist, not the ones you imagine.
- No parameters, options, generics, or hooks for needs the current feature does not have.
- No abstraction until there are at least two real call sites that want it.
- YAGNI applies to files too: don't scaffold empty
helpers/,types/,constants/folders "for later" — create them when the first file needs a home.
Vertical slices
Implement features as thin end-to-end slices, not layer by layer.
- One slice = one route + one module + the UI state that consumes it, types flowing through the Hono-to-HyperFetch bridge.
- Finish and verify a slice before starting the next — never "all backend first, then all frontend."
- Each slice is a checkpoint the user can review and redirect.
Self-review smells
Before declaring work done, scan your own diff for these. Each is a judgement call, not a hard violation — but if you leave one in, be able to say why.
- Mysterious name — a function, variable, or type whose name doesn't say what it does. Rename it; if no honest name comes, the design is murky.
- Duplicated code — the same logic shape in more than one place in the change. Extract the shared shape.
- Data clumps — the same few fields traveling together through signatures. Bundle them into one type.
- Primitive obsession — a raw string/number standing in for a domain concept. Give the concept its own type (or Zod schema).
- Speculative generality — see above. Delete it.
- Middle man — a function that mostly delegates onward. Cut it, call the real target.
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.
- 1mo ago First seen · 46 lines · 0 tokens per session scan A 9d08c9498e84
module-design is a cursor rule published in the GitHub repository BetterTyped/hype-stack (12 stars, last pushed 15d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 575 tokens. 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-31.
Other cursor rules, from other repositories
windsurfrules
Create detailed components with these requirements.
backend
Backend development rules for TT Studio - AI model management backend.
tanstack-start-guide
TanStack Start best practices emphasizing client-first architecture, type safety, and modern React patterns.
new-component
Workflow for creating new React components.
tanstack-react-router_routing
TanStack Router: Routing.
project-structure
Folder layout for Next.js App Router and Vite + React variants.