Boundary Discipline
Enforces clean architecture by concentrating validation at system boundaries and keeping core business logic in pure, framework-free functions.
Boundary Discipline provides architectural guidelines for structuring applications around the functional core and imperative shell pattern. By concentrating input validation, type narrowing, and defensive error handling strictly at system boundaries—such as CLI inputs, configuration loaders, and external network APIs—it ensures internal domain logic can trust its types unconditionally. This approach eliminates redundant defensive checks deep in call chains, insulates core domain rules from framework dependencies, and produces pure, easily testable business logic.
Key Features
01Concentrates validation and defensive guards at external system boundaries
02Parses raw external data into strongly-typed domain models upon entry
03Eliminates redundant nil checks and defensive validation within internal call chains
04Prevents leakage of transport, storage, and wire types into internal domain code
05Encourages business logic implementation using pure, framework-agnostic functions
060 GitHub stars
Use Cases
01Refactoring backend request handlers and API adapters for cleaner data flow
02Designing CLI applications and configuration parsers with pure transform logic
03Simplifying test suites by eliminating external mocks in business logic tests