caliber-conventions — Claude Code rule for TypeScript projects
The caliber-conventions rule sets conventions for Caliber TypeScript CLI development. Use it to guide an agent working on project code, tests, and commits.
MIT ★ 1,319 updated 2026-09-24
.cursor/rules/caliber-conventions.mdcWhat caliber-conventions does
The rule sets import and typing practices: ESM imports use .js extensions, including in TypeScript sources, and unknown is preferred to any because ESLint warns about explicit any. Tests belong in __tests__/ directories beside their source files; shared test setup lives at src/test/setup.ts.
Commit messages use the Conventional Commits prefixes feat:, fix:, refactor:, and chore:. The rule also locates constants and specifies resolveCaliber() for resolving the CLI binary path. File-language detection is driven by an LLM through src/ai/detect.ts; collectFingerprint() runs asynchronously and includes LLM enrichment. The project requires Node.js 20 or later.
What it helps with
- use
.jsextensions in ESM imports - replace explicit
anytypes withunknown - put tests in adjacent
__tests__/directories - format commit messages with Conventional Commits prefixes
- check the Node.js requirement and CLI binary path resolution
Example prompts for the agent
- Review this Caliber TypeScript code and align its imports and types with the project conventions.
- Add tests for this module in a nearby
__tests__/directory and account forsrc/test/setup.ts. - Write a Conventional Commits message for this change with the appropriate prefix.
How to install caliber-conventions
Manually: put the files in place
.cursor/rules/caliber-conventions.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/caliber-conventions.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/caliber-conventions.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/caliber-conventions.mdManually: put the files in place
.clinerules/caliber-conventions.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about caliber-conventions
How do I install caliber-conventions in Claude Code?
Save the rule as .claude/rules/caliber-conventions.md in your project.
What does caliber-conventions do?
It defines conventions for Caliber TypeScript CLI work, including ESM imports, tests, commit prefixes, and file-language detection.
Which Node.js version does caliber-conventions require?
The project requires Node.js 20 or later.
Source text
caliber-conventions.mdc · MIT
--- description: Caliber project conventions for TypeScript CLI development alwaysApply: true --- - ESM imports with `.js` extensions (even for `.ts` sources) - `unknown` over `any` — ESLint warns on explicit any - Tests in `__tests__/` dirs next to source, global setup in `src/test/setup.ts` - Conventional commits: `feat:`, `fix:`, `refactor:`, `chore:` - No hardcoded file→language mappings — detection is LLM-driven via `src/ai/detect.ts` - `collectFingerprint()` in `src/fingerprint/index.ts` is async with internal LLM enrichment - Constants in `src/constants.ts` and `src/scoring/constants.ts` - `resolveCaliber()` from `src/lib/resolve-caliber.ts` for CLI binary path resolution - Dev branch: `next` · Stable: `master` · Node >= 20
© caliber-ai-org · MIT · caliber-ai-org/ai-setup