corpus-chainlisted
Install: claude install-skill matejformanek/postgres-claude
# corpus-chain — walk the knowledge graph
The pg-claude corpus is a graph. **This skill is the query engine.**
```
scenario ──(§Files)──> file ──(backlinks:auto)──> subsystem
│ │
│ (§Idioms invoked) │ (idiom Call sites)
▼ ▼
idiom ──(Call sites)──> file
▲
└──(Scenarios that use me)── scenario
```
## When to use
- **Before a brainstorm** — resolve keywords into candidate scenarios + idioms + past runs before framing.
- **Before `pg-feature-plan` §3** — a scenario chain gives you the initial file list, invoked idioms, adjacent scenarios (things you might also need), and past features with analogous file footprints.
- **When you land on an unfamiliar file** — see which idioms apply, which scenarios touch it, which subsystems own it.
- **When investigating a pattern** — start from an idiom, see its call sites + which scenarios invoke it + sibling idioms sharing files.
- **When the user asks "have we done anything like this before?"** — keyword mode surfaces past planning + sessions.
## Skip when
- The task is a one-file bug fix at a known location.
- You've already loaded and internalized the chain for this area in the current session.
- The task is non-PG (frontend, DevOps, other databases).
## How to invoke
```
scripts/corpus-chain.py --scenario <slug> # e.g. add-new-wal-record
scripts/corpus-chain.py --idiom <slug> # e.g. memory-contexts
scripts/corpus-chain.py --file <src-path> # e.g. src/backend/