From codemap
Scan the Python codebase and build a structural JSON index (import graph + blast-radius metrics).
npx claudepluginhub borda/ai-rig --plugin codemapThis skill is limited to using the following tools:
<objective>
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Analyzes BMad project state from catalog CSV, configs, artifacts, and query to recommend next skills or answer questions. Useful for help requests, 'what next', or starting BMad.
Python only — uses ast.parse to extract the import graph across all .py files; non-Python files are not indexed. Writes .cache/scan/<project>.json. No external dependencies required.
Agents and develop skills query this index via scan-query to understand module dependencies, blast radius, and coupling before editing code.
NOT for: querying an existing index (use /codemap:query).
# timeout: 360000
${CLAUDE_PLUGIN_ROOT}/bin/scan-index
If --root was passed as an argument, forward it:
# timeout: 360000
${CLAUDE_PLUGIN_ROOT}/bin/scan-index --root <path>
The scanner writes to .cache/scan/<project>.json and prints a summary line:
[codemap] ✓ .cache/scan/<project>.json
[codemap] N modules indexed, M degraded
After the scan completes, read the index and report a compact summary:
# Note: $(...) inside the double-quoted python3 -c "..." string is shell-expanded before Python sees it.
# basename/git rev-parse resolve the project name at call time — intentional shell substitution.
python3 -c "
import json, sys
with open('.cache/scan/\$(basename \$(git rev-parse --show-toplevel)).json') as f:
d = json.load(f)
ok = [m for m in d['modules'] if m.get('status') == 'ok']
deg = [m for m in d['modules'] if m.get('status') == 'degraded']
top = sorted(ok, key=lambda m: m.get('rdep_count', 0), reverse=True)[:5]
print(f\"Modules: {len(ok)} indexed, {len(deg)} degraded\")
print(f\"Most central (by rdep_count):\")
for m in top:
print(f\" {m.get('rdep_count', 0):>3} {m['name']}\")
"
If degraded files exist: list them with their reason. Do not treat degraded files as a failure — the index is still useful.
Index ready. Query it with:
/codemap:query central --top 10
/codemap:query deps <module>
/codemap:query rdeps <module>
/codemap:query coupled --top 10