How it works
The five intelligence layers Repowise computes and how they fit together.
Repowise's index is a single artifact built from five passes over your repo. Each pass produces something the next one consumes; the final shape is what the MCP tools query.
1. Dependency graph
Language-aware resolvers under packages/core/src/repowise/core/ingestion/resolvers/
parse each file, extract symbols, and emit import edges. Symbols are nodes,
imports are edges, and PageRank + community detection run once at the end to
surface the architectural skeleton.
2. Git history
A second pass walks the git log and records, per file: commit count, last-touched date, primary owner, co-change pairs (files that move together), and churn percentile. This is what powers hotspots, bus-factor, and the "who can review this PR" queries.
3. Generated wiki
For each non-trivial file and every module, an LLM writes a short Markdown page
that names the symbol's purpose, cites callers, and flags anything weird. The
wiki is the substrate get_answer and get_context retrieve from — the LLM
is reasoning over Repowise's prose, not raw source.
4. Architectural decisions
Decisions are first-class. You write them by hand (repowise decision add) or
let the agent capture them from chat (update_decision_records). They link
to the files they constrain, so get_why can answer "why is this code
structured this way" with citations.
5. Code health
A final deterministic pass scores every file 1–10 from 25 biomarkers —
reusing the graph (centrality) and git signals (ownership, churn, co-change)
the earlier passes produced, plus structural complexity and duplication. No
LLM calls. The weights are calibrated against a real defect corpus, so the
score predicts where bugs will land — and get_health exposes it to your agent.
The five layers are computed once, then refreshed incrementally on every push (or every git commit, if you install the post-commit hook). See Auto-sync for the five sync mechanisms.