Paradigm
Authored TypeScript uses functions and immutable values. Resource access is a boundary capability, not a reason to introduce an application class hierarchy.
Factories and composition
Why
A source reader should reveal which filesystem or Git capability it needs. A factory can provide that capability without attaching behavior to this.
Rules
MUST construct reusable resource capabilities with factories that capture injected dependencies.[review]
MUST assemble behavior by combining functions and plain capabilities rather than inheriting from application classes.[review]
MUST exclude authored classes, class expressions, custom Error subclasses, class-dependent decorators, andthis-based application behavior.[review]
MAY create an instance required by a third-party library inside the adapter that owns it.[review]
MAY wrap required third-party inheritance in a dedicated adapter when that API leaves no alternative.[review]
MUST prefer a collection transform or named function over an equivalent loop or immediately invoked function.[review]
[review]
Typechecks and configured lint rules establish their supported contracts. Tests and review verify effect isolation, capability ownership, and unconfigured syntax prohibitions.
Pure logic and effects
Why
Choosing a content group can be tested from values alone. Reading its files requires a resource adapter; mixing those jobs forces every selection test to account for I/O.
Rules
MUST keep domain transformations independent of I/O, log output, and clock access.[review]
MUST place effects in CLI handlers or the resource-owning adapter.[review]
MUST supply time and other external inputs as values to the logic that needs them.[review]
MUST declare authored bindings withconst, without later reassignment.[review]
Read State for ownership rules and Errors for failure contracts.
[review]
Typechecks and configured lint rules establish their supported contracts. Tests and review verify effect isolation, capability ownership, and unconfigured syntax prohibitions.
Enforcement
Typechecks and configured lint rules establish their supported contracts. Tests and review verify effect isolation, capability ownership, and unconfigured syntax prohibitions.