CLAUDE.md
CLAUDE.mdCLAUDE.mdroot
Quality
97/100
Scores the file, not the repository.Length
783 words
9 headings · 2 code blocksRepository
1.2k
— · pushed 7 days agoLast changed
3 days ago
First indexed 3 days ago.1# Caliber23## What Is This45`@rely-ai/caliber` — CLI that keeps AI agent configs in sync with your codebase. Generates and refreshes `CLAUDE.md`, `.cursor/rules/`, `AGENTS.md`, `.github/copilot-instructions.md`, and skills across Claude Code, Cursor, Codex, OpenCode, and GitHub Copilot. Supports Anthropic, OpenAI, Google Vertex AI, OpenAI-compatible endpoints, Claude Code CLI, and Cursor ACP.67## Commands89```bash10npm run build # tsup → dist/11npm run dev # watch mode12npm run test # vitest run13npm run lint # eslint src/14npx tsc --noEmit # type check15npx vitest run src/scoring/__tests__/accuracy.test.ts # single test16```1718## Architecture1920**Entry**: `src/bin.ts` → `src/cli.ts` (Commander.js) · **Config**: `tsconfig.json` · `tsup.config.ts` · `vitest.config.ts` · `eslint.config.js` · `.prettierrc`2122**Commands** (`src/commands/`): `init.ts` · `score.ts` · `refresh.ts` · `regenerate.ts` · `config.ts` · `hooks.ts` · `insights.ts` · `learn.ts` · `recommend.ts` · `sources.ts` · `publish.ts` · `undo.ts` · `status.ts` · `bootstrap.ts` · `uninstall.ts` · Helpers: `init-helpers.ts` · `init-prompts.ts` · `init-display.ts` · `setup-files.ts` · `interactive-provider-setup.ts`2324**LLM** (`src/llm/`): `anthropic.ts` · `vertex.ts` · `openai-compat.ts` · `cursor-acp.ts` · `claude-cli.ts` · `types.ts` · `config.ts` · `utils.ts` · `usage.ts` · `model-recovery.ts` · `seat-based-errors.ts` · `index.ts`2526**AI** (`src/ai/`): `generate.ts` · `refine.ts` · `refresh.ts` · `detect.ts` · `learn.ts` · `score-refine.ts` · `prompts.ts` · `stream-parser.ts` · `index.ts`2728**Fingerprint** (`src/fingerprint/`): `index.ts` · `file-tree.ts` · `code-analysis.ts` · `existing-config.ts` · `sources.ts` · `git.ts` · `cache.ts`2930**Scoring** (`src/scoring/`): `index.ts` · `display.ts` · `constants.ts` · `utils.ts` · `history.ts` · `dismissed.ts` · Checks (`src/scoring/checks/`): `existence.ts` · `quality.ts` · `grounding.ts` · `accuracy.ts` · `freshness.ts` · `bonus.ts` · `sources.ts`3132**Writers** (`src/writers/`): `index.ts` · `claude/index.ts` · `cursor/index.ts` · `codex/index.ts` · `opencode/index.ts` · `github-copilot/index.ts` · `refresh.ts` · `staging.ts` · `backup.ts` · `manifest.ts` · `pre-commit-block.ts`3334**Scanner** (`src/scanner/`): `index.ts` — detects local `.mcp.json`, `.cursor/mcp.json` MCP servers, rules, and skills across platforms3536**Lib** (`src/lib/`): `hooks.ts` · `learning-hooks.ts` · `state.ts` · `resolve-caliber.ts` · `builtin-skills.ts` · `sanitize.ts` · `notifications.ts` · `git-diff.ts` · `lock.ts` · `debug-report.ts` · `config-discovery.ts` · `terminal.ts`3738**Utils** (`src/utils/`): `parallel-tasks.ts` · `spinner-messages.ts` · `editor.ts` · `review.ts` · `prompt.ts` · `version-check.ts` · `dependencies.ts` · `waiting-content.ts` · `waiting-cards.json`3940**Telemetry** (`src/telemetry/`): `index.ts` · `config.ts` · `events.ts` · **Learner** (`src/learner/`): `writer.ts` · `storage.ts` · `attribution.ts` · `roi.ts` · `utils.ts` · `stdin.ts`4142**Other**: `github-action/action.yml` · `github-action/index.js` · `assets/video/` (Remotion) · `scripts/` · `docs/FLOW.md` · `src/constants.ts` · `src/test/setup.ts` · `CHANGELOG.md` · `TODOS.md`4344**Workspaces**: `packages/shared/` · `packages/mcp-server/` (MCP server) · `apps/web/` · `apps/api/`4546@./CONTRIBUTING.md4748## Conventions4950- ESM with `.js` import extensions · Tests in `__tests__/` dirs · Setup: `src/test/setup.ts`51- `unknown` over `any` · Conventional commits (`feat:`, `fix:`, `refactor:`)52- Dev: `next` branch · Stable: `master` · Node >= 2053- Config: `~/.caliber/config.json` (mode `0600`) · Constants: `src/constants.ts`54- `package.json` scripts: `build`, `dev`, `test`, `lint`, `lint:fix`, `format`, `format:check`5556## Key Patterns5758- **Providers**: implement `LLMProvider` from `src/llm/types.ts` (`call()`, `stream()`)59- **Writers**: `src/writers/claude/index.ts` · `src/writers/cursor/index.ts` · `src/writers/codex/index.ts` · `src/writers/opencode/index.ts` each return `string[]`60- **Scoring**: checks in `src/scoring/checks/` return `Check[]`, constants in `src/scoring/constants.ts`61- **No hardcoded mappings**: detection is LLM-driven via `src/ai/detect.ts`62- `collectFingerprint()` in `src/fingerprint/index.ts` — async with LLM enrichment63- `resolveCaliber()` from `src/lib/resolve-caliber.ts` for CLI binary resolution64- Cursor provider: `agent --print --trust --workspace /tmp` in `src/llm/cursor-acp.ts`65- `getFastModel()` in `src/llm/config.ts`: `ANTHROPIC_SMALL_FAST_MODEL` scoped to anthropic/vertex66- `validateModel()` skips seat-based providers (`isSeatBased()` in `src/llm/types.ts`)67- Scoring: deterministic, no LLM · Backups via `src/writers/backup.ts`68- Scanner: `src/scanner/index.ts` detects local MCP servers, rules, skills for state comparison69- MCP server workspace: `packages/mcp-server/` · Config discovery: `src/lib/config-discovery.ts`70- Builtin skills (`src/lib/builtin-skills.ts`): `find-skills`, `save-learning`, `setup-caliber`7172<!-- caliber:managed:pre-commit -->73## Before Committing7475**IMPORTANT:** Before every git commit, you MUST ensure Caliber syncs agent configs with the latest code changes.7677First, check if the pre-commit hook is already installed:78```bash79grep -q "caliber" .git/hooks/pre-commit 2>/dev/null && echo "hook-active" || echo "no-hook"80```8182- If **hook-active**: the hook handles sync automatically — just commit normally. Tell the user: "Caliber will sync your agent configs automatically via the pre-commit hook."83- If **no-hook**: run Caliber manually before committing:84 1. Tell the user: "Caliber: Syncing agent configs with your latest changes..."85 2. Run: `caliber refresh && git add CLAUDE.md .claude/ .cursor/ .cursorrules .github/copilot-instructions.md .github/instructions/ AGENTS.md CALIBER_LEARNINGS.md .agents/ .opencode/ 2>/dev/null`86 3. After it completes, briefly tell the user what Caliber updated. Then proceed with the commit.8788If `caliber` is not found, tell the user: "This project uses Caliber for agent config sync. Run /setup-caliber to get set up."89<!-- /caliber:managed:pre-commit -->9091<!-- caliber:managed:learnings -->92## Session Learnings9394Read `CALIBER_LEARNINGS.md` for patterns and anti-patterns learned from previous sessions.95These are auto-extracted from real tool usage — treat them as project-specific rules.96<!-- /caliber:managed:learnings -->9798<!-- caliber:managed:sync -->99## Context Sync100101This project uses [Caliber](https://github.com/caliber-ai-org/ai-setup) to keep AI agent configs in sync across Claude Code, Cursor, Copilot, and Codex.102Configs update automatically before each commit via `caliber refresh`.103If the pre-commit hook is not set up, run `/setup-caliber` to configure everything automatically.104<!-- /caliber:managed:sync -->105
Also in caliber-ai-org/ai-setup
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| caliber-ai-org/ai-setup.cursor/rules/caliber-conventions.mdc · 1.2k | Cursor rules | lint-formatgit | 20/100 | 3 days ago | |
| caliber-ai-org/ai-setup.cursor/rules/caliber-pre-commit.mdc · 1.2k | Cursor rules | no sections | 16/100 | 3 days ago | |
| caliber-ai-org/ai-setup.cursor/rules/llm-layer.mdc · 1.2k | Cursor rules | no sections | 24/100 | 3 days ago | |
| caliber-ai-org/ai-setup.cursor/rules/testing.mdc · 1.2k | Cursor rules | testtesting-strategy | 43/100 | 3 days ago | |
| caliber-ai-org/ai-setupAGENTS.md · 1.2k | AGENTS.md | buildtestlint-formatstyle+1 | 97/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| livewire/livewireCLAUDE.md · 24k | CLAUDE.md | setupbuildteststyle+4 | 100/100 | 3 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| filamentphp/filamentCLAUDE.md · 32k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 950 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 950 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | 3 days ago |
