Agent rules
- TypeScript —
moduleResolution: NodeNext; imports use.jsextensions. - CLI orchestration — parse argv into typed options, build
ContextwithresolveContext(), keep command files thin. - Output contract — respect
RunOptionsgates (json/quiet/silent), useloggerfor terminal output, keep JSON payloads structured and stable. - Non-interactive safety —
--jsonand CI/non-TTY flows must not prompt; fail fast with actionable errors. - Types location — move reusable/public type contracts to
packages/cli/src/types/**and re-export from nearest type barrel andpackages/cli/src/types/index.tswhere needed. - No runtime-owned exported types — if a type is exported from a runtime module, move it to
packages/cli/src/types/**and import it back asimport type. - Core APIs — prefer richer shared functions over wrappers (example:
resolveKeyPlaceholdersWithTrace()); avoid duplicate logic paths. - Extractor robustness — parse and bound translation call spans (
t(...)) before key inspection; support multiline calls and inline/block comments. - Tests — colocated unit tests in
packages/cli/src/**/__tests__/; CLI behavior coverage intests/integration/.