|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +## Build/Run Commands |
| 4 | +- Build: `pnpm run build` (uses tsc) |
| 5 | +- Dev mode: `pnpm run dev` (tsx watch) |
| 6 | +- Run tests: `pnpm run test` (vitest) |
| 7 | +- Run single test: `pnpm run test <test-file-pattern>` |
| 8 | +- Test watch mode: `pnpm run test:watch` |
| 9 | +- Lint: `pnpm run lint` (eslint) |
| 10 | +- Lint fix: `pnpm run lint:fix` |
| 11 | +- Typecheck: `pnpm run typecheck` (tsc --noEmit) |
| 12 | +- Format: `pnpm run format` (prettier) |
| 13 | +- Format check: `pnpm run format:check` |
| 14 | + |
| 15 | +## Code Style Guidelines |
| 16 | +- Use double quotes for strings |
| 17 | +- No semicolons |
| 18 | +- Use tabs for indentation (TSConfig sets this) |
| 19 | +- Strict TypeScript with all strict flags enabled |
| 20 | +- No unused locals/parameters |
| 21 | +- Exact optional property types |
| 22 | +- No implicit returns/fallthrough cases |
| 23 | +- No unchecked indexed access |
| 24 | +- Use ESNext target and modules |
| 25 | +- Import paths use `@/*` alias for src/ |
| 26 | +- Declaration files and source maps generated |
| 27 | +- Resolve JSON modules enabled |
| 28 | + |
| 29 | +## Naming Conventions |
| 30 | +- Files: kebab-case |
| 31 | +- Types: PascalCase |
| 32 | +- Functions/variables: camelCase |
| 33 | +- Constants: UPPER_SNAKE_CASE |
| 34 | +- Test files: *.test.ts |
| 35 | + |
| 36 | +## Error Handling |
| 37 | +- Use custom error classes from utils/errors.ts |
| 38 | +- Always provide meaningful error messages |
| 39 | +- Use logger.ts for consistent logging |
| 40 | +- Handle dry-run mode in all mutating operations |
| 41 | + |
| 42 | +## Testing |
| 43 | +- Use vitest with globals |
| 44 | +- Place tests alongside source files |
| 45 | +- Use .test.ts extension |
| 46 | +- Mock filesystem with memfs where needed |
0 commit comments