build-index

Generates 7_Agent/index.md: one line per note in the live vault — path | title | tags | description. The index is what an agent greps instead of running blind Glob/Grep over ~6k files. vault-tree gives folder shape; this gives file-level content hints.

When to use

  • Before searching for a note by topicgrep -i <topic> 7_Agent/index.md is one cheap call over the whole live vault.
  • As a reconcile step — regenerate weekly so the index never drifts more than a week.
  • After a large routing/refactor session — e.g. process-inbox drained many items, or a folder moved.
  • User asks to “rebuild the index”, “update the vault index”.

When NOT to use

  • Reading a note’s actual content — the index has a 120-char description, not the body. Read the path it gives you.
  • Folder-level orientation — that’s vault-tree.
  • Searching archived or Japanese-helper content — those are excluded (see Scope); Grep them directly with intent.

How

From the vault root:

python3 7_Agent/skills/build-index/build-index.py

Regenerates 7_Agent/index.md in place (~1s). The file is committed like everything else, so scheduled/cloud runs get the last generated version even without re-running.

Scope — what’s excluded and why

  • 5_Archive/ — ~1.4k stale files; search deliberately if a task needs history.
  • 3_Resources/Japanese/ — ~3.9k generated vocab helper notes.
  • 6_Private/shinkansen-n2/ — copyrighted course content, self-indexed via its own _index.md tree.
  • 0_Inbox/ — transient by definition.
  • Templates/, 7_Agent/, dotfolders — not knowledge content.

Private notes (rest of 6_Private/) are indexed — the index lives in 7_Agent/ which never publishes, and agents need to find private notes too.

Line format

2_Areas/Photography/_index.md | Photography — area | index, photography, area | Ongoing photography practice and technique development.
  • title — first # heading, else filename stem.
  • tags — frontmatter tags:, comma-joined.
  • description — frontmatter description: if present (preferred; see AGENTS.md schema), else the first body paragraph line, truncated to 120 chars.

Rules

  • Never edit index.md by hand — it’s generated output; changes get overwritten.
  • Don’t parse the index as ground truth for link resolution — it’s a discovery aid. Resolve wikilinks against the filesystem.
  • Read-only apart from 7_Agent/index.md.

Verification

  • Script prints Wrote … N notes indexed. with N in a plausible range (hundreds, not thousands or single digits).
  • head 7_Agent/index.md shows today’s date in the header.