Skip to Content
AgentsAgent rules

Agent rules

  • TypeScriptmoduleResolution: NodeNext; imports use .js extensions.
  • CLI orchestration — parse argv into typed options, build Context with resolveContext(), keep command files thin.
  • Output contract — respect RunOptions gates (json/quiet/silent), use logger for terminal output, keep JSON payloads structured and stable.
  • Non-interactive safety--json and 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 and packages/cli/src/types/index.ts where 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 as import 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 in tests/integration/.