Skip to main content

Build Patterns

Live

Frontend and shared patterns

  • Build hooks in packages/shared, not in client/admin.
  • Use centralized queryKeys, toasts, and date utilities.
  • Use strict typing (unknown + guards, discriminated unions, as const).
  • Keep UI packages thin: views/components only.

Contract patterns

  • Checks-Effects-Interactions and explicit visibility.
  • Custom errors + events for all state changes.
  • Fuzz/invariant tests for adversarial behavior.
  • Upgrade/deploy through wrapper scripts, not raw broadcast by default.

Review checklist

  1. Is logic duplicated instead of reused?
  2. Are package boundaries respected?
  3. Are tests focused on behavior regressions?
  4. Is deletion of this code straightforward?

Next best action

After aligning coding patterns, validate integration points and data surfaces.

Open integrations