---
name: prime
description: Orient on a brain-tracked project fast instead of grepping the codebase — loads the architecture map + project index, and for a given topic the matching subsystem note(s) plus the actual source files they point to. Use when starting a feature or when you want the mental model up front. Optional arg is a topic/subsystem (e.g. "restore", "manifest", "notifications").
---

# /prime — load project context from the brain

Pulls a project's curated knowledge (and the real code it references) into the
session so you start oriented. Read-only with respect to the vault. The architecture
map is also auto-injected at session start by the `prime.sh` hook — use this skill to
go **deeper** than that map, especially on a specific subsystem.

## 1. Resolve vault + project
- `VAULT = ${BRAIN_VAULT:-$HOME/brain}`.
- `slug` = git toplevel basename, lowercased, non-alphanumerics → `-` (same as /save, /resume).
- Project dir = `$VAULT/Projects/<slug>`. If it doesn't exist, tell the user there's
  no brain for this project and stop.

## 2. Always load the map
- Read `$VAULT/Projects/<slug>/notes/architecture.md` and `$VAULT/Projects/<slug>/index.md`.

## 3. If a topic argument was given (e.g. `/prime restore`)
- Find the best-matching note(s) in `$VAULT/Projects/<slug>/notes/` — match the topic
  against filenames first, then note contents. List candidates if ambiguous.
- Read the matching note(s). Then **Read the actual source files they reference** — the
  `source:` frontmatter field and any `path/to/file` mentions in the body — so the real
  code is in context, not just the summary.
- Treat the note as a map, not gospel: if a referenced symbol/path has drifted from the
  code, say so and trust the code.

## 4. If no topic was given
- Summarise the architecture map in a few lines, then list the notes available in
  `notes/` and offer to load any of them (or a named subsystem).

## 5. Brief the user
- Give a tight orientation: what the project is, which subsystem(s) and exact source
  files are now loaded, and flag anything in the notes that looks stale vs the code.
- Do not paste whole files back — just confirm what's in context and surface gaps.
