agentleFS
HighwayofLifeHighwayofLife/agent-kaizen/skills/code-map/SKILL.md

code-map

Skill1 starsChanged 32 days agoMITView on GitHub

Build a local SQLite code map (symbols, settings keys, ids, scenes) so agents find code in one query instead of grep-and-read loops.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Not in Claude Code?: Read docs/hosts.md in the plugin root first.

    line 11
  2. Distinctive:

    Use the standard library where possible (sqlite3, regex or tree-sitter if already installed).

    line 41
  3. Distinctive:

    After it works, add a rule to the instructions and agent context: "find code with tools/codemap first, then read only the ranges it prints".

    line 45

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code map: a symbol index for agents

Plugin root: ${CLAUDE_PLUGIN_ROOT}. If that is still a ${...} placeholder, use the folder that contains skills/ (this file is skills/<name>/SKILL.md), and substitute that path, in quotes, wherever this skill uses CLAUDE_PLUGIN_ROOT. Not in Claude Code? Read docs/hosts.md in the plugin root first. Skip steps that only work in Claude Code, and follow its propose-only rule before changing any host configuration.

Agents find code with one indexed query that gives exact line ranges, instead of grep → read → grep loops. This is usually the single biggest saving for planners and engineers in a large codebase.

Changes: adds a tool under tools/ with tests, plus an instruction rule, after you approve.

Autonomy: follow ${CLAUDE_PLUGIN_ROOT}/docs/autonomy.md. The mode comes from the skill argument (propose, safe, auto or yolo), else docs/kaizen/config.json, else agent-kaizen.json in your Claude config dir ($CLAUDE_CONFIG_DIR or ~/.claude), else propose. In safe and auto, read every "wait for my OK" below as: apply it yourself if the mode allows (backup, verify, roll back on failure, ledger row), otherwise list it as a proposal. Hard stops always ask. At most maxChangesPerRun changes (default 3). End with a summary of what was applied, skipped and rolled back.

Task

Plan first, then build: a tools/codemap command, a local SQLite index of this repository.

Requirements:

  • Index only git-tracked files and store the database under out/ (git-ignored). Rebuild incrementally whenever a query runs and files have changed. A full build should take seconds, a query under about 1 s.
  • Contents: types and members with line ranges for my languages (for example C#, GDScript, C++, TypeScript); scene, prefab and resource files; config and settings keys with their values; localisation ids and their text; shaders; shell and Python scripts; doc headings.
  • Commands:
    • find <name|regex> [--kind ...] [--in <path>]: where something is defined.
    • outline <file>: the file's types and members with line ranges.
    • refs <name>: textual usages, grouped by file.
    • setting <key> and lang <id>: the line and value, plus code references.
    • tests <fragment>: matching test methods, for building test filters.
    • tree [<dir>] [--depth N]: files, lines and top types per directory.
    • brief <file>: reads a task or brief and prints the code locations it names, as a "Code locations" block to paste into a prompt.
    • --json and --limit N on every query.
  • Use the standard library where possible (sqlite3, regex or tree-sitter if already installed). Don't add heavy dependencies without asking.
  • Tests: a fixture repo with one file per language. Timing checks for build and query.

After it works, add a rule to the instructions and agent context: "find code with tools/codemap first, then read only the ranges it prints". If I have a dispatch script for another coding agent, make it run codemap brief on the brief and insert the result into the prompt automatically. Re-run the usage audit after a week and fill in the ledger row.

Done when

planners and engineers use noticeably fewer exploration calls. The audit should show codemap calls replacing grep and read calls. If it doesn't, the rule isn't reaching the agents. Check the agent context files and the dispatch preamble.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.