Skills

Map

Structural codebase index generator.

Install

npx skills add SethGammon/Citadel --skill map -g -a claude-code -y
Repository
SethGammon/Citadel927
Category
AI and agents
Updated
5d ago
License
MIT
Context cost
Mediumabout 1,661 tokens
Runs scripts
No, instructions only

What it does

Structural codebase index generator. Builds a compact JSON map of files, exports, imports, dependency graph, and roles. Queryable by keyword. Injected into fleet agents as context slices to reduce token usage on code navigation.

/map -- Codebase Intelligence

Orientation

Use /map when:

  • Starting work on an unfamiliar codebase (build the index first)
  • A fleet or archon campaign needs agents to know "what files matter for X"
  • You want a quick structural overview (stats, roles, dependency graph)
  • You need to find files related to a keyword without exploratory reads

Do not use /map for:

  • Reading file contents (use Read)
  • Searching for string patterns inside files (use Grep)
  • Single-file edits where you already know the path

Commands

CommandBehavior
/mapGenerate or refresh the index (skips if cache is fresh)
/map --forceRebuild the index even if cache is fresh
/map query <terms>Search the index for files matching keywords
/map statsPrint summary statistics (files, lines, languages, roles)
/map slice <terms>Output a compact context slice for agent injection
/map staleDetect added, changed, or removed indexed source files

Protocol

Step 1: GENERATE INDEX

Run the index generator:

node scripts/map-index.js --generate --root .

Add --force if the user requested a fresh rebuild or if the index is stale.

The generator:

  1. Walks the project tree (respects .gitignore, skips node_modules, dist, etc.)
  2. Extracts exports, imports, and symbols from each source file
  3. Infers a role for each file (component, hook, store, route, test, config, etc.)
  4. Builds a dependency graph from resolved import paths
  5. Records per-file SHA-256 hashes plus a whole-index source signature
  6. Extracts route-like paths and package verification scripts
  7. Writes the index to .planning/map/index.json

Supported languages: TypeScript, JavaScript, Python, Go, Rust.

Cache behavior: The index is cached for 5 minutes. Subsequent runs within that window exit immediately unless --force is passed.

If .planning/map/ does not exist, the generator creates it automatically.

Read the whole SKILL.md on GitHub

More in AI and agents