This is the light consumer of an ultraindex build. Instead of reading a
large repo into context, you ask the prebuilt index where to look and open only
what the task needs. The same zero-dependency bundle ships here:
node scripts/ultraindex.mjs <command>. No npm install, no keys.
The core rule: load the minimum. Use
findto get the exact files, open those entries/files one at a time, and answer. Do not readgraph.jsonor the wholeencyclopedia/directory — that defeats the purpose.
Workflow
-
Locate the index. Look for
.ultraindex/(default) ordocs/ultraindex/at the repo root. Then check freshness:node scripts/ultraindex.mjs check --out <index-dir>- Missing (no index dir): tell the user to build it first —
node scripts/ultraindex.mjs build --repo <repo>(the ultraindex skill) — and stop. Do not auto-build; building also expects a light enrichment pass. - Stale (
checkreports changed files): proceed, but warn the results may be slightly out of date and suggest a rebuild. - Fresh: continue.
- Missing (no index dir): tell the user to build it first —
-
Orient (once, cheap).
node scripts/ultraindex.mjs map --out <index-dir>printsINDEX.md— the project summary, hub modules, and module table. Read it to understand the shape of the repo. -
Find the relevant files for the task.
node scripts/ultraindex.mjs find "<task keywords>" --out <index-dir>It returns the top modules with their exact source files to open, the matched terms, and graph neighbours. Use
neighbors <file|module>to expand along the graph ("what else touches this"). -
Load only those. Open the listed
encyclopedia/<module>.mdentries (for the business + code overview) and the specific source files — one at a time, stopping as soon as you have what the task needs. -
Act and answer, citing the concrete files. If you discover the index was wrong or stale enough to mislead, say so and recommend re-running the generator's
build.
Answering a question (grounded mode)
When the user asks a question about the codebase (not "do a task"), answer it from real code, not memory — and prove it:
- Assemble evidence.
This finds the relevant modules and prints their real source (with line numbers) plus which files to open. Read it; open more files from the listed ones if a thread is thin.node scripts/ultraindex.mjs ask "<the question>" --out <index-dir> - Write the answer to
ANSWER.md, citing every claim with the evidence it rests on, in bare brackets:[file],[file:line], or[file:start-end](e.g.Retries use exponential backoff [src/util.ts:2-4]). A markdown link[text](path), or a citation inside a code fence/inline-code, does not count — write the citation in the prose. Every answer needs at least one citation. - Verify grounding.
It fails if the answer has no citations or any citation doesn't resolve to a real file/line. Fix and re-run until it passes, then give the user the answer with its citations. Never present an answer that hasn't passed this check.node scripts/ultraindex.mjs check --answer ANSWER.md --out <index-dir>
Notes
- The index is read-only here — this skill never writes to it (apart from your
ANSWER.mdscratch file). Refreshing/enriching the index is the ultraindex (generator) skill's job. find/neighbors/map/askprint only the slice you asked for, so each call is cheap. Chaining a few is still far less context than reading the repo.