solid-architecture

A set of coding rules based on SOLID, a guide for keeping software responsibilities clear, and clean architecture, which separates business decisions from technical details.

In plain words
What is it for?
Use it when designing or reviewing modules, classes, functions, and TypeScript APIs. It guides you toward smaller responsibilities, clearer types, and easier-to-change code.
Why use it?
It helps prevent tangled code that is difficult to change, test, or understand. It flags oversized files, long functions, loose data types, and code that mixes unrelated jobs.

Cursor rule

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/jterratsdev/ableton-live-mcp/solid-architecture
Clone the repo
git clone --depth 1 https://github.com/jterratsdev/ableton-live-mcp
Per session 410 This file is loaded in full into every session.
When invoked 410 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.00410 $0.00410
Opus 5 $0.00205 $0.00205
Sonnet 5 $0.00082 $0.00082
Haiku 4.5 $0.00041 $0.00041

Measured yesterday against content hash 9e9a6ae4b3e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

solid-architecture 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 yesterday.

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.

rules/solid-architecture.mdc · 33 lines

What it actually says

SOLID & Clean Architecture

Single Responsibility (SRP)

  • One module = one reason to change. If a file mixes UI rendering with business logic, data access with orchestration, or config with behavior — split it.
  • Max 300 lines per file. Max 30 lines per function. Max 5 parameters (use options object beyond that).
  • Template literals embedding >20 lines of CSS, JS, or HTML must be extracted to separate files.

Open/Closed (OCP)

  • Prefer data-driven designs over per-variant functions. Use config maps + one generic function instead of N nearly-identical functions.
  • Use handler/strategy maps (Record<EventType, Handler>) instead of switch statements with >5 cases.

Liskov Substitution (LSP)

  • Subclasses/implementations must honor the contract of their parent. Never override a method to throw "not supported" — redesign the hierarchy instead.

Interface Segregation (ISP)

  • No Record<string, unknown>, any, or object in public APIs. Define narrow, purpose-specific types.
  • Use TypeScript generics (<T>) instead of loose types + inline as casts.

Dependency Inversion (DIP)

  • Import from barrel exports (index.ts), not deep internal paths. Every public symbol must be re-exported from the package barrel.
  • Use static import statements. Never use require() in TypeScript unless technically justified and documented.
  • Depend on abstractions (interfaces/types), not concrete implementations, when crossing module boundaries.

Separation of Concerns

  • View layer: layout and event binding only. No business logic, no data fetching.
  • Service layer: orchestration, external calls, state mutations.
  • Data layer: queries, I/O, serialization. No UI references.
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. yesterday First seen · 33 lines · 410 tokens per session scan A 9e9a6ae4b3e1

Subscribe to this mod's changes

solid-architecture is a cursor rule published in the GitHub repository jterratsdev/ableton-live-mcp (0 stars, last pushed 8d ago), licensed MIT. It adds 410 tokens to every session, about $0.0020 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-31.