--- description: "TypeScript and ESM coding conventions for seal-use codebase" globs: "src/**/*.ts" trigger: "manual" --- # TypeScript & ESM Conventions When modifying or adding TypeScript files in `src/`: 1. **Module System & Import Extensions**: - Use ES modules exclusively. - Local file imports MUST include explicit `.js` extensions (e.g. `import { foo } from "./bar.js"`). 2. **Validation & Typing**: - Validate external inputs, environment variables, and API responses with Zod or narrow TypeScript types. - Avoid `any`. Prefer precise domain types. 3. **Code Style**: - 2-space indentation. - Double quotes (`"`). - Omitted trailing semicolons where possible. - `camelCase` for functions/variables, `PascalCase` for classes/types/interfaces. - Kebab-case filenames (e.g. `token-store.ts`). 4. **Architecture**: - Prefer small, cohesive domain functions over large generic utility files.