4-step AST-first code discovery runbook using MicroIndex MCP (search_code and get_code_chunk) to minimize token usage before analyzing, exploring, editing, or debugging code.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Templates?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ingvar-soloma-templates)
---
name: microindex-code-discovery
description: 4-step AST-first code discovery runbook using MicroIndex MCP (search_code and get_code_chunk) to minimize token usage before analyzing, exploring, editing, or debugging code.
---
# MicroIndex Code Discovery Runbook
Execute these 4 steps before analyzing, auditing, writing code, fixing bugs, or proposing architectural changes:
## Step 1: Semantic & Symbol AST Lookup
Run `search_code(query="<describe behavior, error, or symbol>", top_k=5)` on the MicroIndex MCP server.
- Inspect the returned `file_path`, `start_line..end_line`, `node_type`, and `score`.
- For cross-stack tasks (e.g., frontend component -> backend API -> worker), run 1 focused `search_code` per layer.
## Step 2: Narrow File Inspection (`get_code_chunk`)
If a promising indexed file (> 120 lines) needs additional context (e.g., another method in the same class or Vue `<template>` + `<script>`):
- Call `get_code_chunk(file_path="<exact/relative/path>", node_type="")` first instead of reading the whole file.
- Filter with `node_type` (for example `method`, `function`, `class`, or `vue_script`) whenever you only need specific constructs.
- Small files (≤ 120 lines) and non-indexed files (`.md`, `.json`, `.toml`, `.sh`, `Makefile`) may be read directly.
## Step 3: Targeted Line-Range Verification
If you must inspect lines not covered by `get_code_chunk` (e.g., top-level imports/constants) or surrounding context before editing:
- For targeted tasks, read **only** the `start_line..end_line` slice (with at most ±10–20 lines of margin).
- If a task explicitly requires a line-by-line full-file audit and `get_code_chunk` is insufficient, read the file once rather than slicing it into multiple 100-line `read_file` calls.
- Use targeted `grep` inside that single file only if verifying exact call sites or literals.
## Step 4: Implement & Keep Index Fresh
Make minimal, well-scoped edits based on the verified AST slices. If you add or substantially refactor files, refresh the incremental index (`make index TARGET=<project>`) so subsequent queries stay accurate.