knowledge-graphlisted
Install: claude install-skill Latescalcarifertshiluba176/kgai
# kgai knowledge graph
`kg` is on your PATH (a shim; the engine lives in `~/.kgai`). Every command prints JSON.
**Mental model.** The live graph is a small set of **Elements** (domain things) joined
by **links** (PART_OF, DEPENDS_ON, RENDERS, …). It is NOT a pile of decision records.
A **Decision** is an immutable event that *mutates* that graph — adds an element, adds
or retires a link, sets a property — and records who/why/when. The chain of decisions
is the **history**; the live graph is always just the current shape.
## 1. READ before you change code
```bash
kg search "how is invoice rendering structured" # free-text, relevance-ranked — pass a phrase or task description; tolerant to word forms and typos
kg context --about "Invoice" # the element + its current links + decisions that shaped it
kg context --paths "src/billing/*" # elements whose `paths` property matches what you're editing
kg history "feature:Invoice" # full decision chain that shaped one element (the why, over time)
kg as-of 2026-01-01 # the whole graph at a past date (end of that day; exact, via replay)
kg conflicts --about "Invoice" # elements with two competing head decisions (unresolved)
```
`kg context` returns, per matched element: its current **links** and its **head
decision(s)** — the ones currently governing it, with rationale (superseded ones live
in `kg history`). If a decision constrains what you're about to do, respect it — or
supersede it w