For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /packs/shared/engineering/functional-design.md.
Quick start

Functional design

Make domain behavior a transformation of values. Keep effects at deliberate boundaries.

Composition and capabilities

Why

Choosing a destination should not require a filesystem or logger. Separating that choice from execution makes it independently testable.

Rules

  • MUST keep domain transformations independent of I/O, logging, environment access, clocks, and randomness. [review]
  • MUST supply required external values as explicit inputs. [review]
  • MUST inject resource capabilities rather than hide them in globals. [review]
  • MUST compose small named operations with one responsibility. [review]
  • MUST prefer functions and value composition over mutable application inheritance. [review]
  • MUST keep third-party stateful clients inside the adapter that owns their lifecycle. [review]
  • MUST bound concurrent work that accesses external resources. [review]
  • MAY use native data types, constructors, and trait or protocol contracts prescribed by the language pack. [review]

[review]

Pure unit tests and real resource integration tests verify the separation. Review checks hidden dependencies and capability ownership.

Enforcement

Pure unit tests and real resource integration tests verify the separation. Review checks hidden dependencies and capability ownership.