ck-refs-lookup
Look up reference repos (read-only) through the condensed contract index instead of reading the whole repo. Run: /ck-refs-lookup <topic/type/endpoint>
Files1
View on GitHubSKILL.md.claude/skills/ck-refs-lookup/SKILL.md
GitHubck-refs-lookup
Answers questions about the reference repos from the condensed index at $CK_ROOT/.claude/contextkit/cache/references/<repo>.md — without reading the whole repo.
If
.claude/contextkit/is missing (script orcontextkit.config.jsonnot found) → ContextKit is not installed here: stop, and install via/ck-setupin the hub.
Resolve project root
CK_ROOT="${CLAUDE_PROJECT_DIR:-}"; [ -d "$CK_ROOT/.claude/contextkit" ] || CK_ROOT="$(d="$PWD"; while [ "$d" != "/" ] && [ ! -d "$d/.claude/contextkit" ]; do d="$(dirname "$d")"; done; echo "$d")"; [ -d "$CK_ROOT/.claude/contextkit" ] || { echo "ContextKit not found: no .claude/contextkit in this directory or any parent"; exit 1; }
echo "$CK_ROOT"
Paths in the config are relative to $CK_ROOT.
Flow
- Read the index files:
$CK_ROOT/.claude/contextkit/cache/references/*.md. - Find the matching entry (sections: Contracts / API-Specs / Parity ({platform} <-> {repo})).
- Check freshness from the frontmatter (
sha,indexed,status). Compare with the repo:CK_ROOT="${CLAUDE_PROJECT_DIR:-}"; [ -d "$CK_ROOT/.claude/contextkit" ] || CK_ROOT="$(d="$PWD"; while [ "$d" != "/" ] && [ ! -d "$d/.claude/contextkit" ]; do d="$(dirname "$d")"; done; echo "$d")"; [ -d "$CK_ROOT/.claude/contextkit" ] || { echo "ContextKit not found: no .claude/contextkit in this directory or any parent"; exit 1; } git -C "$CK_ROOT/<references.path>/<repo>" rev-parse --short HEAD- SHA matches and
status: indexed→ answer from the index, and cite the source asrepo@sha. - SHA differs or
status: needs-extraction→ the index is stale: recommend/ck-refs-syncAND, for this question, read only the relevant files in the reference repo (not the whole repo). If the live fact goes beyond the question itself (a new contract signature, endpoint, or parity note) → add it to the matching section of the existing stub (afile:linereference, terse, as inck-refs-sync). Leavestatusatneeds-extraction, so the finding is kept.
- SHA matches and
- A question outside contracts / API / parity → say so: not indexed. Read it live.
Paths come from .claude/contextkit/contextkit.config.json (references.path + repos). Keep answers short, with a file:line reference into the reference repo when you can. Reference repos are read-only — write only in the project. The cache stub under $CK_ROOT/.claude/contextkit/cache/ belongs to the project and may be patched.