The LegalWork Atlas LegalWork's documentation, bound to the code it describes
17 documents

Orient: what LegalWork is and how it's built

The fastest path from "never seen this repo" to knowing what the product does, the rules you build under, and how the UI is structured.

Dependency rules (enforced, all verified by madge --circular: zero cycles)

  1. src/app/ and src/i18n/ never import from src/react-app/ or src/components/. If something in the agnostic layer needs UI behavior, invert it (callback registration) or move the primitive down.
  2. Leaf modules (runtime-env, desktop-types, den-types, extensions) import nothing (or types-only from other leaves). Low-level clients (opencode, legalwork-server, den) import leaves — never the utils/ barrel (it drags in i18n).
  3. kernel/ and infra/ sit below domains/: they must not import domain code. Shared query/state infrastructure lives in infra/.
  4. shell/ sits on top and may import everything.
  5. Wire contracts shared with other processes live in packages/types (e.g. WorkspaceWire); producer types assert assignability against them.

Toasts are rendered with sonner (@/components/ui/sonner), mounted once via <Toaster /> in shell/providers.tsx, driven imperatively with toast().