Skip to content

mra analyze — Project Knowledge Base

Distil a project into reusable knowledge documents instead of re-reading the whole codebase every session.

bash
mra analyze my-api               # generate
mra analyze my-api --model haiku # cheaper for module summaries

What it generates

DocumentContent
identity.mdName, type, one-line purpose (~50 tokens)
sitemap.mdFile tree + module purpose index
architecture.mdPatterns, data flow, tech stack
conventions.mdCoding style, [CONVENTION]/[PATTERN]/[DECISION] tags
api-surface.mdEndpoints, exports, event contracts
tunnels.mdCross-module entity references (auto-detected)
modules/*.mdPer-module deep summaries

4-layer memory stack

Inspired by mempalace.

LayerContentTokensLoaded
L0 IdentityName + type + purpose~50Always
L1 EssentialTagged conventions + patterns~200Always
L2 Room RecallSitemap + architecture + relevant modules~500On review/ask
L3 Deep SearchFull API surface + all modules~800+On orchestrator launch

Result: review wake-up cost drops from ~150K tokens to ~250.

Auto-update

After every review:

  • Changed modules get updated summaries (background, haiku)
  • New files update the sitemap
  • CRITICAL/HIGH findings captured as [DECISION] tags in conventions.md
  • Tunnel links regenerated

mtime detection skips unchanged modules.

Released under the MIT License.