---
tags: ["architecture", "typescript", "monorepo"]
lifecycle: nursery
---

## Lesson — Manual re-implementation of domain object transformations

**Tags:** architecture, typescript, monorepo
**Scope:** packages/cli/src/commands/**/*.ts, !**/*.test.ts, !**/*.spec.ts

Manual re-implementation of domain object transformations (e.g., mapping internal Violations to TotemFindings) creates maintenance risk and logic drift. Use canonical transformation functions from core packages instead of local mapping logic. In CLI contexts, use dynamic imports (await import) to bridge package boundaries while maintaining performance and a single source of truth.
