---
trigger: glob
globs: "**/*.ts, **/*.tsx, **/*.js, **/*.py, **/*.go, **/*.java, **/*.rs"
---

# Software Design Book Principles

- Design deep modules (A Philosophy of Software Design): simple interfaces hiding substantial functionality; complexity is the enemy, so pull it downward into implementations.
- Respect the dependency rule (Clean Architecture): source dependencies point inward toward business rules; keep the domain independent of frameworks, UI, and databases.
- Keep functions small and names honest (Clean Code / Code Complete): a function does one thing at one level of abstraction, and names say exactly what things are and do.
- Refactor in safe, small, behavior-preserving steps (Refactoring): tests green before and after each step; never mix refactoring with feature changes in one move.
- In legacy code (Working Effectively with Legacy Code), get the code under test before changing it: find seams, break dependencies, then modify.
- Model the domain with a ubiquitous language and bounded contexts (Domain-Driven Design): code, tests, and docs use the domain experts' terms, and context boundaries are explicit.
- Don't repeat yourself and avoid premature cleverness (The Pragmatic Programmer): every piece of knowledge has one authoritative representation.
- For data-intensive systems (Designing Data-Intensive Applications), design for reliability, scalability, and maintainability explicitly; state your consistency and failure assumptions.
