Skip to content
eventually-consistent-code-orgPublic

About

Cairn 2.0 β€” converged work management

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

1,303 Commits

Folders and files

Repository files navigation

cairn 2.0

Converged work management for AI coding agents β€” one tool where deep planning, durable memory, tracker truth, and session continuity meet in a single deterministic engine. First-class as a Claude Code plugin; one-command installers wire the same server and verbs into seven other AI CLI harnesses (Grok Build, Copilot CLI, Codex, Gemini CLI, Cursor, OpenCode, Zed).

What makes it different β€” mechanism, not vocabulary:

Server-validated lifecycle Plan↔tracker drift is computed math, verify gates work goal-backward from the phase goal, and checkpoint markers are parsed by a real server β€” correctness is code, not prompt discipline.
Tracker-first Eight write-through backends (GitHub, GitLab, Jira, Asana, Azure Boards, ClickUp, Linear, local files) hold the single source of truth for work, mirrored in plain language a non-engineer can read.
Cross-vendor adversarial review peers seats codex, grok, antigravity, opencode, and copilot as reviewers β€” five seats, four labs β€” and their claims are verified against source before they count. (Install the CLIs you want seated.)
Memory with provenance Git-committed memory cards record their source commit; recall serves a STALE flag when the code moved β€” and the cards feed plan, work, and verify.

This repo is the cairn 2.0 rebuild; the earlier 1.x plugin lives in the claude-plugins marketplace repo. Full docs index: docs/README.md.

What it is

Cairn 2.0 is a Claude Code plugin backed by a real TypeScript MCP server. External work trackers are the single source of truth for work items, git owns all prose (plans, memory cards), and the server owns every mechanism with a wrong answer β€” state transitions, mirroring, drift math, staleness checks β€” while skills own judgment. No prompt-glue, no sync engine, no sidecar processes.

plugin (thin)     commands + skills + hooks β€” policy and judgment
      β”‚ typed MCP tools
cairn-server      tracker/ Β· planning/ Β· memory/ Β· core/   (one process)
      β”‚
tracker API (work truth) Β· git repo (prose truth) Β· ~/.cairn/ (disposable cache)

The full code relationship map β€” verb layer, MCP server, and the three subsystems underneath (sources in docs/diagrams/):

cairn code relationships β€” verb layer to MCP server to tracker/memory/docs subsystems

Features (shipped β€” P0–P4)

Tracker layer β€” eight adapters behind one normalized interface: GitHub, GitLab, Jira, Asana, Azure Boards, ClickUp, Linear (native issue links + dependency graph), and a zero-credential local backend that stores issues as plain files in your repo (links and graph included). Capability matrix per backend (declare, don't flatten), write-through with cached reads, shared HTTP core with retry/backoff, and a single contract test suite every adapter must pass β€” fixtures in CI, live sandboxes before release.

Docs connectors β€” publish repo documentation outward through the same pluggable-adapter pattern: /cairn:docs publish mirrors README + docs/ into Confluence (per-project folder, landing page + child-page tree, generated contents sections, space-wide title-conflict handling) or into a local Docusaurus site checkout (markdown + _category_.json, native sidebar, optional auto-commit β€” never push). Idempotent re-publish on both. The SPI is product-neutral β€” Confluence and Docusaurus ship today, and new targets slot in behind the same contract suite on demand, not roadmapped ahead of need.

Planning engine β€” GSD-depth planning on native Claude Code muscles. Git-owned artifacts (PROJECT.md, roadmap.md, per-phase CONTEXT.md/RESEARCH.md/PLAN.md/VERIFICATION.md), tracker mirroring (phase β†’ milestone/epic/list, requirement β†’ issue), a quick/standard/deep depth dial, model routing for agent fan-out, and drift detection when plans reference missing or unverified-closed issues.

Memory module β€” two tiers engineered against context rot. Tier 1: a disposable SQLite FTS5 index outside the repo (bulk tool output, research dumps β€” searchable, rebuildable, never in context wholesale). Tier 2: git-committed memory cards, one fact each, with provenance + staleness checking β€” recall diffs each card's source files against the recorded commit and serves a STALE flag when the code moved. Memory can be wrong; it can never silently lie.

Collaboration β€” the tracker's multi-user machinery, made lifecycle-aware: unplanned-work surfacing (tracker issues no plan references), import (reverse-mirror an existing epic/milestone/list into a cairn project), assignee-aware claiming, and plans/cards that collaborate through ordinary git PRs.

**Verbs (39 live):** `audit` `auto` `backtrack` `basecamp` `brief` `distill`

do docs draft fast help import map mark medic new outlook peers plan probe profile recall remember resync retro review route scout ship status summit survey thread trace triage tune verify waypoint work β€” each a /cairn:<verb> command, generated from the routing table. The routing table is complete: the reserved verb set is now empty.

Server: 87 typed MCP tools, 3408 passing tests β€” counts move with each tier and are measured in CI (env-gated live-backend suites skip without creds) β€” four dependencies (@modelcontextprotocol/client, @modelcontextprotocol/server, better-sqlite3, zod). Fail loud, never fake state.

Agents (2 live): the plugin's first agents/ dir β€” specialist roles dispatched by existing verbs, zero new tools or verbs.

Agent Role Dispatched by
cairn-designer Turns a design question into a decided direction with artifacts β€” wireframes, design tokens (themes/default.css + tokens.json, always both), coded prototypes β€” inside a draft session, recording implements/decided-in map edges as it goes draft (non-trivial design questions)
cairn-uat Proves shipped flows meet requirements, platform-aware β€” walks each flow as a user on a named viewport matrix, sweeps requirement traceability via map edges, hands fidelity divergence off to audit ui audit uat (acceptance walks), audit ui (fidelity checks)

Install

In Claude Code 2.1.275 or later, one step:

/plugin install cairn --marketplace eventually-consistent-code-org/cairn2

The marketplace entry pins a release tag, so the install (and claude plugin update) fetches a released tree, never main β€” see Dev mode vs installed plugin. Then the quickstart: credentials, cairn.json, first phase.

Try it

Four prompts that exercise the core loop, in a repo with a cairn.json:

  • /cairn:new "my-service" β€” interview, roadmap, tracker milestones and issues for the first phase.
  • /cairn:plan 1 then /cairn:work 1 β€” research the phase, write PLAN.md, claim each issue, do the work, close on verified done.
  • /cairn:status β€” phases, issue states, plan↔tracker drift, unplanned commits, in one view.
  • /cairn:remember "the retry budget is 3 because the GitHub API throttles at 4" then /cairn:recall "retry budget" β€” a memory card with a source commit, and a recall that says STALE when that code moves.

Beyond Claude Code

The server speaks plain MCP over stdio and the verbs are markdown β€” cairn runs anywhere an MCP-capable harness does. One installer wires a project:

node setup/cairn-setup.mjs grok      # Grok Build β€” reads .mcp.json + AGENTS.md directly
node setup/cairn-setup.mjs copilot   # Copilot CLI β€” mcp-config.json, instructions, /cairn-* prompts
node setup/cairn-setup.mjs codex     # Codex β€” config.toml merged, ~/.codex/prompts/cairn-* installed
node setup/cairn-setup.mjs gemini    # Gemini CLI β€” settings.json + GEMINI.md + /cairn:* TOML commands
node setup/cairn-setup.mjs cursor    # Cursor β€” .cursor/mcp.json + AGENTS.md + hooks port
node setup/cairn-setup.mjs opencode  # OpenCode β€” opencode.json + /cairn-* commands
node setup/cairn-setup.mjs zed       # Zed β€” .zed/settings.json context server + AGENTS.md

Installs are stamped (.cairn-manifest.json: source version + date), and node setup/cairn-setup.mjs <harness> --check compares every installed surface against this clone's version β€” read-only, per-surface table, non-zero exit when anything lags, so it can gate.

Every install gets the full 87-tool surface, the generated AGENTS.md verb registry (from scripts/gen-agents.mjs, drift-checked in CI), and the verb subroutines copied to .cairn/harness/ so any harness can execute them by name ("run cairn status"). Honest capability table:

Harness Tools (87) Verbs Slash commands Continuity/cost/observe hooks
Claude Code (plugin) βœ… βœ… βœ… /cairn:* βœ…
Grok Build βœ… βœ… by name via its Claude-compat layer untested β€” claims hook compat
Copilot CLI βœ… βœ… by name βœ… /cairn-* prompt files β€”
Codex βœ… βœ… by name βœ… /cairn-* prompts β€”
Gemini CLI βœ… βœ… by name βœ… /cairn:* TOML commands β€”
Cursor βœ… βœ… by name β€” βœ… continuity/leak-guard/observe (cost tracker Claude-only)
OpenCode βœ… βœ… by name βœ… /cairn-* commands β€”
Zed βœ… βœ… by name β€” β€”

How it compares

The nearest substitutes are GSD/Buildomator-class planning flows, Superpowers, gstack, and claude-mem β€” file-based planning or memory layers for a single harness. Cairn covers the same ground with a server holding the mechanism and an external tracker holding work truth. Agent IDEs (Cursor, Copilot Workspace, Devin) are adjacent but do a different job β€” they are the coding environment; cairn is the work-management layer that rides along in it.

The full mechanism-by-mechanism table β€” with a last-verified date on every competitor claim β€” is maintained at docs/comparison.md. The evidence behind the review claims lives in the council case study.

Roadmap

GSD-class planning depth behind a per-verb /cairn:<verb> surface with a trail-themed vocabulary β€” plus tracker truth and provenance-checked memory the file-based flows can't hold, and the highest-value ideas from GSD's community backlog and a five-competitor gap analysis. See the parity roadmap and gap analysis (both on the evals-archive branch, where the planning history lives).

Stage Scope Status
P0–P4 Server core: tracker, planning, memory, collaboration βœ… shipped
Tier 0 Trailhead β€” /cairn entrypoint + routing skill βœ… shipped
Tier A0 Continuity β€” crash-proof auto-resume + recall index/timeline βœ… shipped
Tier A Planning depth β€” scout auto fast resync route summit, TDD gates, stage-aware model routing βœ… shipped
Tier B mark waypoint retro distill brief tune, leak guard βœ… shipped
Tier C1 trace β€” persistent debugging sessions βœ… shipped
Tier C2 probe draft β€” spike/sketch sessions, session_landscape βœ… shipped
Tier C3 Audits & review governance β€” audit review, plan_check, audit_record βœ… shipped
Tier D triage β€” tracker-loop triage βœ… shipped
Tier E map thread profile medic backtrack, audit docs, status --stats βœ… shipped
Tier F1 basecamp β€” workspace awareness, focus switch, dispatch board βœ… shipped
Tier F2 peers β€” cross-AI review/plan convergence, adversarial judgment, outbound leak gate βœ… shipped
Tier F3 Frontend quality loop β€” cairn-designer + cairn-uat agents, design-token discipline, requirements traceability βœ… shipped
P5β€² Dogfood gate β†’ 1.x cutover β†’ publish βœ… shipped (2.0.0 β€” live dogfood + community-marketplace submission)
P5β€³ Per-verb surface β€” plugin cairn, 36 generated /cairn:<verb> shims, conformance check (f) βœ… shipped (2.0.0)
Fidelity Tracker-mirror fidelity β€” inbound PM-delta ingest (plan_tracker_delta), outbound paper trail + Jira worklog (classic and scoped ATCTT tokens both auth cleanly β€” scoped tokens auto-route through Atlassian's cloud gateway, #49) βœ… shipped
Eng. mode user.mode vibe/engineer β€” work pairing, no-self-merge gate, decision surfacing βœ… shipped

P5β€² status: the seven transition shims are gone, P5β€³ replaced the single /cairn2:cairn router with per-verb commands β€” the plugin is named cairn and each live verb is a generated /cairn:<verb> shim (scripts/gen-commands.mjs, enforced by check-surface) β€” and the tracker-mirror fidelity + engineer-mode features are in (semi-live drill records in VERIFICATION.md). Two gates remain, both owner actions: (1) the live dogfood pass β€” a real session with the plugin installed, running the Tier 0 drill (/cairn:new β†’ plan β†’ work β†’ verify β†’ ship, /cairn:do, a typo'd verb, one waypoint resume) plus the fidelity and engineer-mode checklists in VERIFICATION.md; (2) publish β€” swapping cairn 1.x (and its /cairn:gsd passthrough) for cairn 2.0 in the plugin marketplace. 2.0.0 follows both.

Development

cd server
npm ci
npm test          # unit + contract (no network)
npm run test:live # live contract vs a real backend (env-gated)
npm run build

Adapter live-status, tool reference, and artifact layout: server/README.md. What the tests and guards cannot check β€” what an agent actually does with a verb β€” lives in the behavioral eval suite (claude plugin eval ., early access): docs/EVALS.md.

Dev mode vs installed plugin (release integrity, #83)

Two ways to run cairn, deliberately different:

  • Installed (released). The marketplace entry in .claude-plugin/marketplace.json is a github source pinned to the release tag ("ref": "vX.Y.Z") β€” installs and claude plugin update fetch that released tree, never a mutable clone of main. The pin is the fourth surface scripts/release.mjs bumps, and scripts/check-versions.mjs fails CI when it disagrees with the version files. Consequence: an installed plugin only moves when a release tag exists β€” installed = released, by design.
  • Dev (this repo). .mcp.json launches server/dist/index.js straight from the working tree with server/node_modules from npm ci β€” edits land on the next session restart, no release needed.

Why a root lockfile, not a bundle. Claude Code's plugin installer runs npm install into the versioned plugin cache only when the plugin root has package.json plus a lockfile β€” without one the cache gets no node_modules and the MCP server dies at startup (ERR_MODULE_NOT_FOUND, the 2026-08-13 incident). So the root package.json declares the server's three runtime deps and package-lock.json pins them (~37 MB installed). The bundle alternative was measured and rejected: esbuild collapses server/dist (772 KB) to a single 881 KB file, but better-sqlite3 is a native addon (better_sqlite3.node, ~12 MB) that can't be inlined β€” npm install is required either way, so bundling buys complexity, not self-containment. If you add a server runtime dep, mirror it in the root package.json and refresh the root lockfile (npm install --package-lock-only) β€” CI enforces the mirror.

Repository layout

server/     TypeScript MCP server (tracker adapters, planning, memory, core)
commands/   per-verb /cairn:<verb> shims β€” generated by scripts/gen-commands.mjs
skills/     cairn-planning, cairn-memory (policy; mechanism lives in the server)
templates/  cairn.json.example
docs/       quickstart, runbook, ADRs, architecture β€” see docs/README.md
            (specs, plans, research and the eval suite: the evals-archive branch)
.mcp.json   launches cairn-server for the plugin

Documentation

The index is docs/README.md β€” architecture, ADRs, design specs (umbrella design, parity roadmap, tier specs), implementation plans, and competitive research. The spec/plan/research history and the behavioral eval suite live on the orphan evals-archive branch, so the tree the marketplace ships is the plugin alone (#403).

Data handling

Local-first: the server and hooks run on your machine, and data leaves it only to the tracker, docs connector, and peer CLIs you configure. No telemetry, no analytics, no account. What runs, what is stored where, what is sent, and how to remove it: PRIVACY.md.

Support and troubleshooting

License

MIT β€” same posture as 1.x: local-first, env-var-name-only secrets, data goes only to the tracker you configure.

About

Cairn 2.0 β€” converged work management

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages