Catalogue / symbol-index-navigator
symbol-index-navigator
Older skill: source not recordedSignedConsults a repository's .codemap structural index to locate classes, functions, methods, interfaces, type aliases and enums, then reads only the recorded line ranges instead of whole files. Covers outline-first exploration, exact and type-filtered name lookup, fuzzy search, verification of cached sp…--- name: symbol-index-navigator description: > Consults a repository's .codemap structural index to locate classes, functions, methods, interfaces, type aliases and enums, then reads only the recorded line ranges instead of whole files. Covers outline-first exploration, exact and type-filtered name lookup, fuzzy search, verification of cached spans and signatures with or without the codemap CLI, and fallback search when the index misses. Use when asked where a symbol is declared, what its signature is, or for a low-token map of a file in an already-indexed repository. Not for editing code, tracing runtime behavior, or finding call sites, since the index records declarations only. allowed-tools: Read, Grep, Glob, Bash license: MIT ---
Pinpoint declarations with a structural index
A .codemap directory at the repository root is a lookup table of declarations. For each class, function, method, interface, type alias and enum it stores the declaring file, the start and end lines, the kind, and usually the signature. Answering "where is this defined?" from the index costs a handful of tokens; answering it by scanning a 4,000-line module costs thousands. Every route below ends in a Read of one narrow range, so spend tracks the question, not the file size.
The loop at a glance
Four moves, always in this order:
- Locate — the CLI find command, or a Grep across the manifest tree.
- Confirm freshness — a tool verdict, or, without the CLI, one check for the span and a *separate* check for the signature.
- Read — the span only, padded by about five lines each side.
- Report — file, lines, kind, signature, and whether that signature was verified.
The rest of this skill fills in each move and the decisions between them.
First decision: is an index present?
Glob for .codemap/**/*.json. Any hit means an index exists — continue below. If nothing comes back, do two things.
Keep working. Grep and Glob over the source tree answer every question regardless; an index only makes them cheaper. A missing index slows you down, it never blocks you.
Offer setup as the user's decision, executed by their hands. If they want an index built, give the steps in words: they need Python 3.10 or newer with a working pip; they install the indexer from the azidan/codemap GitHub repository, and because an unrelated project publishes a same-named package on the public Python registry they should name the GitHub source explicitly; at the repository root they run the init command (codemap init .); optionally they follow with the hook installer (codemap install-hooks) so future commits refresh the index automatically. This skill deliberately omits the remote install command — downloading and running network-delivered software stays in human hands. Do not install, download, or fetch anything, and never run an installer on anyone's behalf.
Second decision: executable or manifest files
Check whether a codemap executable is on PATH. If it is, prefer it. If it is not, read the JSON manifests directly — every workflow here runs unchanged on either path.
Read-only commands, safe at any time:
| Command | Effect | |---|---| | codemap find NAME | Case-insensitive exact-name search. Each hit prints as path:start-end [kind] Name, with the recorded signature on the next line | | codemap find NAME --type KIND | Same search restricted to one kind, such as class, method, interface | | codemap find WORDS --fuzzy | Word-level matching that survives typos, also scans docstrings, and can return whole-file hits | | codemap show FILE | The file's outline: a header with content hash, total line count and language, then every symbol indented beneath its parent, each with range and signature | | codemap validate FILE | Prints exactly up to date or stale for one file. The FILE argument is optional — omit it and the entire index is checked | | codemap stats | Index size and coverage at a glance |
Three commands write to disk and belong to the user: codemap init DIR builds the index tree, codemap update regenerates the manifests of files changed since the last run, and codemap install-hooks wires commit-time refresh. One narrow exception for update is granted under freshness below.
Locate the symbol
With the CLI, run find. With manifests, learn the layout first: the .codemap tree mirrors the project, each mirrored directory holds a manifest named .codemap.json, and files sitting directly in the project root live in a root-level manifest (_root.codemap.json). So the symbols of src/mail/digest.ts are recorded in .codemap/src/mail/.codemap.json. Each manifest holds one record per source file — path, content hash, symbol list:
{
"path": "src/mail/digest.ts",
"hash": "4c7aa012",
"symbols": [
{"name": "DigestBuilder", "kind": "class", "start": 22, "end": 130,
"signature": "(theme: ThemeOptions)"},
{"name": "render", "kind": "async_method", "start": 58, "end": 97,
"signature": "(subscriber: string): Promise<Digest>"}
]
}Open one manifest and read it before querying — field names have shifted across indexer versions, so trust what is on disk over the example above. Then Grep the .codemap tree for the name with case ignored; every hit arrives with path, span, kind and signature attached, far cheaper than scanning source text.
If the question stops at what a function accepts or returns, the recorded signature can answer it outright with no source read — but the labeling rule in the next section applies before you call it current.
Skim the outline before committing to a read
When the task names a file but no symbol, pull the outline first — codemap show FILE, or the file's record in its manifest. Treat it as a table of contents: pick the one or two symbols that matter and read roughly 60 lines instead of 600.
Freshness: two facts, two separate checks
The index is a snapshot, and files edited since the last run have drifted. Crucially, a span and a signature are independent facts: the line range can be exactly right while the parameter list inside it was rewritten in place.
| Claim you want to make | CLI present | CLI absent | |---|---|---| | "These line numbers are current" | validate verdict | Inspect both boundaries in the live source text | | "This signature is current" | validate verdict | Compare the live declaration, element by element |
Verifying a span without the CLI
Open the recorded range and confirm both boundaries from the text itself.
- Start: the recorded start line — or, where decorators or annotations sit above it, the declaration line beneath them — declares the expected name and kind.
- End: the recorded end line is the declaration's genuine syntactic endpoint: in a brace language, the closing brace that returns the file to the declaration's own nesting depth; in an indentation language, the block's last line before indentation relaxes to the enclosing level.
The next symbol's start in the manifest is not evidence about this end. Nested entries, comments, blank stretches and module-level statements can all sit between a declaration's true endpoint and the next recorded start, so adjacency proves nothing. If either boundary cannot be established — unfamiliar syntax, generated or minified lines, ambiguous depth — treat the whole span as unverified and do not guess: Grep the live file for the name and use line numbers that are real right now.
Manifests carry a per-file hash precisely so the tool detects edits itself. Leave hash comparison to the tool; never recompute hashes by hand.
Verifying a signature without the CLI
A boundary check is a verdict about lines, not about text between them. Someone can add a parameter, retype a return value, or reorder arguments without moving the start line, the end line, or the nesting depth one millimeter — the span stays verified while the signature rots. Therefore:
- Before presenting a recorded signature as current, open the live declaration and compare it element by element: every parameter's name, order, type and optional marker, plus the return type. For a multi-line signature, read until the parameter list closes.
- Full match: you may state the signature as current.
- Any difference, or any element you cannot confidently check: the live text is the answer. Report that, and if the recorded signature is worth mentioning, mark it superseded.
- No comparison performed: you may still quote the recorded signature, but only with an explicit label such as "as recorded at the last indexing pass, not checked against the file".
This live comparison is the only CLI-free route to calling a cached signature current. Never let a passing boundary check stand in for it.
When a check fails
With the CLI, an up to date verdict covers both span and signature for that file; stale rejects both. On any failure: say the file has drifted, Grep that file for the name to get present-day line numbers, read those, and suggest the user run the refresh. If the user explicitly asks you to run codemap update on their already-installed CLI you may, since it rewrites only generated manifest files locally. Until the applicable check passes, never quote cached line numbers or cached signatures as though they were current.
When the exact name misses
- Retry loosely —
--fuzzywith the CLI, or in the manifests a distinctive fragment such as "digest" when "DigestBuilder" returned nothing. Fuzzy matching works by words, tolerates typos, and reads docstrings too. - Grep the manifests for signature text — a recurring parameter or return type such as "ThemeOptions" clusters related entries and narrows the neighborhood.
- Fall back to a plain Grep across the source tree. Files created after the last indexing run are simply absent from the index; absence there is not absence in the repository.
Kinds recorded by the indexer
| Kind | Marks | |---|---| | class | Class declaration; members nest beneath it in outlines | | function | Top-level function | | async_function | Top-level async function | | method | Class-attached function | | async_method | Async class-attached function | | interface | Named structural contract | | type | Type alias | | enum | Enum declaration |
Filter by kind whenever one name is overloaded — a repository can hold "Digest" as a class, an interface and a type alias at once, and the kind tells you which hit you meant.
When the whole file is the right unit
The index records where, never what unfolds inside. Read the complete file when preparing an edit, when following an implementation end to end, when imports and module-level state matter, or when the file postdates the index. Call sites and runtime behavior are outside what the index stores, full stop.
Worked example: a signature that drifted inside stable boundaries
The user asks where the weekly digest total is computed and what it returns. No codemap executable is on PATH.
- Grep
.codemapfor "buildDigest". The manifest.codemap/src/mail/.codemap.jsonrecordssrc/mail/digest.ts, afunctionnamedbuildDigest, lines 40–73, signature(entries: LedgerEntry[]): number. - Span check: Read lines 35–78. Line 40 opens
function buildDigest; line 73 is its closing brace at the right depth. Span verified. - Signature check: the parameter list lives on lines 41–42, and the live text reads
(entries: LedgerEntry[], rounding: RoundingMode): Decimal. The record omits the second parameter and claims anumberreturn. The boundaries held; the signature did not — precisely the drift a boundary check cannot see. - Report:
buildDigestsits atsrc/mail/digest.ts:40–73; its current signature takes the ledger entries plus a rounding mode and returnsDecimal, while the index's older record is stale on both points. Roughly 45 lines read.
Hard limits
Preview shortened. The full SKILL.md is in the pack.
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 12.8 kB | b113679c108d |
| THIRD_PARTY_NOTICES.md | 1.3 kB | f414b1398584 |
| examples.json | 2.1 kB | 37cab55150f5 |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 1.0.0 Current | Not recorded | 12 Oct 2026 |
Locking a skill to one version needs Pro.