cairn-adopt-components

cairn-adopt-components is a skill for Claude Code from isaacriehm/cairn. It costs 26 tokens per session (3,339 once invoked), scanned A, original, MIT.

A migration procedure for adding Cairn’s component store to a project that adopted Cairn before the store existed. It adds registry information to component files and builds the store’s index.

In plain words
What is it for?
Updating an existing Cairn project so its components have registry headers, its derived index is built, and singleton components are recorded as invariants.
Why use it?
Older adopted projects may be missing the metadata and index that the component store needs. This procedure fills in those missing pieces and asks for consent at the required points.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents; names the AskUserQuestion tool; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the cairn plugin — 5 skills, 4 commands, 5 agents, 5 hooks, 1 MCP server shipped together

Good fit Updating an existing Cairn project so its components have registry headers, its derived index is built, and singleton components are recorded as invariants.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add isaacriehm/cairn
Claude Code
/plugin install cairn

Made for: Claude Code.

Or install cairn, the plugin that ships this one along with the rest of its 5 skills, 4 commands, 5 agents, 5 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cairn-adopt-components

README.md
[![agentmods](https://agentmods.dev/badge/skills/isaacriehm/cairn/cairn-adopt-components/github.svg)](https://agentmods.dev/skills/isaacriehm/cairn/cairn-adopt-components)
Your own site
<a href="https://agentmods.dev/skills/isaacriehm/cairn/cairn-adopt-components"><img src="https://agentmods.dev/badge/skills/isaacriehm/cairn/cairn-adopt-components/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cairn-adopt-components

Your own site · 80×15
<a href="https://agentmods.dev/skills/isaacriehm/cairn/cairn-adopt-components"><img src="https://agentmods.dev/badge/skills/isaacriehm/cairn/cairn-adopt-components.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,339 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00026 $0.03339
Opus 5 $0.00013 $0.01670
Sonnet 5 $0.00005 $0.00668
Haiku 4.5 $0.00003 $0.00334

Measured 9d ago against content hash d4e6bd3ca44d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

cairn-adopt-components scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

const cp=require("node:child_process");
packages/cairn-plugin/skills/cairn-adopt-components/SKILL.md · 281 lines

How it starts

The opening of the file, as written. The whole thing — 281 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: cairn-adopt-components

Host portability

This skill is shared by Claude Code, Cursor, and Codex. Use the host's structured question UI when available; otherwise ask the same concise A/B/C question in chat and pause. Named subagent briefs live under ../../agents/: dispatch by name where supported, or read the brief and pass it to the host's native subagent tool. Execute inline only when no subagent tool exists.

You are backfilling Cairn's component store into an already-adopted project — the one-time work the adoption pipeline does for fresh repos, applied to a repo that predates the store. The goal: every component file carries a @cairn registry header, the derived index is built, and @singleton headers become §INVs. Spec: docs/PLUGIN_ARCHITECTURE.md §6 (the component trio 9d→9e→9f) and docs/COMPONENT_STORE_PLAN.md.

This skill drives the bundled dist/cli.mjs internally using the plugin-root variable supplied by the active host (PLUGIN_ROOT, CURSOR_PLUGIN_ROOT, or CLAUDE_PLUGIN_ROOT). Never surface a CLI subcommand to the operator (Plugin spec §11) — the chat shows progress + consent gates, not commands.

Step 0 — classify the repo

Run this single probe to decide whether backfill applies. It is ghost-aware: a ghost-adopted repo has no in-repo .cairn/ — its state lives out-of-repo at ~/.cairn/state/<root-commit>/. The probe resolves the effective state home (in-repo when present, else the out-of-repo ghost dir keyed on the repo's root-commit) and prints <mode> <verdict> <home>:

node -e '
  const fs=require("node:fs");
  const os=require("node:os");
  const path=require("node:path");
  const cp=require("node:child_process");
  const root=process.cwd();
  let mode="committed";
  let home=path.join(root,".cairn");
  if(!fs.existsSync(home)){
    // No in-repo .cairn — may be ghost-adopted. Ghost state lives at
    // ~/.cairn/state/<repo-id>; repo-id is the move-stable root-commit SHA
    // (matches registerGhostRepo). Resolve it and probe there instead.
    let rc="";
    try{rc=cp.execFileSync("git",["-C",root,"rev-list","--max-parents=0","HEAD"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim().split(/\s+/)[0]||"";}catch{}
    if(rc){const g=path.join(os.homedir(),".cairn","state",rc);if(fs.existsSync(g)){home=g;mode="ghost";}}
  }
  const cfg=path.join(home,"config.yaml");
  const idx=path.join(home,"ground","components");
  if(!fs.existsSync(home)||!fs.existsSync(cfg)){console.log(mode+" not-adopted "+home);process.exit(0);}
  let hasBlock=false;
  try{hasBlock=/^components:/m.test(fs.readFileSync(cfg,"utf8"));}catch{}
  const hasIndex=fs.existsSync(idx)&&fs.readdirSync(idx).length>0;
  console.log(mode+" "+(hasBlock&&hasIndex?"has-store":"backfill")+" "+home);'

Read the full file on GitHub · 281 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 281 lines · 26 tokens per session scan A d4e6bd3ca44d

Subscribe to this mod's changes

cairn-adopt-components is a skill published in the GitHub repository isaacriehm/cairn (6 stars, last pushed 1mo ago), licensed MIT. It adds 26 tokens to every session and 3,339 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

reverse-architecture

Reverse-engineer a system's architecture from what already exists — a code repo, Terraform / CloudFormation / Pulumi / Bicep, Kubernetes manifests, docker-compose, a database schema, an OpenAPI spec, or a package manifest — and produce a renderable diagram (Mermaid / C4 / PlantUML) plus a written description suitable…

sananthanarayan/skilldrop · 121 tokens

api-contract-draft

Draft an OpenAPI 3.1 contract from a feature brief or story — resource-oriented paths, a full error catalog (RFC 9457), pagination/idempotency/versioning decided not deferred, examples on every operation, plus a decisions log so review argues choices instead of YAML. Use when the user wants to design an API, draft an…

sananthanarayan/skilldrop · 99 tokens

stripe-projects

Provision SaaS services + sync creds via Stripe Projects.

NousResearch/hermes-agent · 15 tokens

version-bump

Automated semantic versioning and release workflow for Claude Code plugins. Handles version increments across package.json, marketplace.json, plugin.json manifests, build verification, git tagging, GitHub releases, and changelog generation. NPM publishing is the final human-required handoff because the maintainer…

thedotmack/claude-mem · 64 tokens

cloud-sync

Set up or check claude-mem cloud sync with cmem.ai Pro. Use when the user says "set up cloud sync", "sync my memories", "cmem pro", "cloud backup", "sync status", or wants their memory database backed up or synced to their cmem.ai account.

thedotmack/claude-mem · 64 tokens

event-store-design

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

wshobson/agents · 33 tokens