# Setup Caliber

Sets up Caliber for automatic AI agent context sync.

- Repository: https://github.com/caliber-ai-org/ai-setup (1310 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-09-24
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add caliber-ai-org/ai-setup --skill setup-caliber -g -a claude-code -y`
Codex: `npx skills add caliber-ai-org/ai-setup --skill setup-caliber -g -a codex -y`
Cursor: `npx skills add caliber-ai-org/ai-setup --skill setup-caliber -g -a cursor -y`
Gemini CLI: `npx skills add caliber-ai-org/ai-setup --skill setup-caliber -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add caliber-ai-org/ai-setup`

## Description

Sets up Caliber for automatic AI agent context sync. Installs pre-commit hooks so CLAUDE.md, Cursor rules, and Copilot instructions update automatically on every commit. Use when Caliber hooks are not yet installed or when the user asks about keeping agent configs in sync.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Setup Caliber

Dynamic onboarding for Caliber, automatic AI agent context sync.
Run all diagnostic steps below on every invocation to determine what's already
set up and what still needs to be done.

## Instructions

Run these checks in order. For each step, check the current state first,
then only act if something is missing.

### Step 1: Check if Caliber is installed

```bash
command -v caliber >/dev/null 2>&1 && caliber --version || echo "NOT_INSTALLED"
```

- If a version prints → Caliber is installed globally. Set `CALIBER="caliber"` and move to Step 2.
- If NOT_INSTALLED → Install it globally (faster for daily use since the pre-commit hook runs on every commit):
  ```bash
  npm install -g @rely-ai/caliber
  ```
  Set `CALIBER="caliber"`.

  If npm fails (permissions, no sudo, etc.), fall back to npx:
  ```bash
  npx @rely-ai/caliber --version 2>/dev/null || echo "NO_NODE"
  ```
  - If npx works → Set `CALIBER="npx @rely-ai/caliber"`. This works but adds ~500ms per invocation.
  - If NO_NODE → Tell the user: "Caliber requires Node.js >= 20. Install Node first, then run /setup-caliber again." Stop here.

### Step 2: Check if pre-commit hook is installed

```bash
grep -q "caliber" .git/hooks/pre-commit 2>/dev/null && echo "HOOK_ACTIVE" || echo "NO_HOOK"
```

- If HOOK_ACTIVE → Tell the user: "Pre-commit hook is active, configs sync on every commit." Move to Step 3.
- If NO_HOOK → Tell the user: "I'll install the pre-commit hook so your agent configs sync automatically on every commit."
  ```bash
  $CALIBER hooks --install
  ```

### Step 3: Detect agents and check if configs exist

First, detect which coding agents are configured in this project:
```bash
AGENTS=""
[ -d .claude ] && AGENTS="claude"
[ -d .cursor ] && AGENTS="${AGENTS:+$AGENTS,}cursor"
[ -d .agents ] || [ -f AGENTS.md ] && AGENTS="${AGENTS:+$AGENTS,}codex"
[ -f .github/copilot-instructions.md ] && AGENTS="${AGENTS:+$AGENTS,}github-copilot"
echo "DETECTED_AGENTS=${AGENTS:-none}"
```

The rest: https://github.com/caliber-ai-org/ai-setup/blob/HEAD/.agents/skills/setup-caliber/SKILL.md
