← ClaudeAtlas

corpus-chainlisted

Traverse the pg-claude knowledge graph to answer "what does this feature/file/pattern touch across the corpus?" — pulls scenarios, idioms, call-site file examples, sibling patterns, subsystem ownership, and analogous past features from planning/ + sessions/ into a single chain map. Uses the graph edges built by `scripts/populate-idiom-callsites.py` (idiom → files) and `scripts/build-scenario-idiom-matrix.py` (scenario ↔ idiom bidirectional). Use proactively when brainstorming a new PG feature, planning §3 file table, investigating an unfamiliar subsystem, or trying to find "have we touched something like this before?". Also use inside `pg-feature-brainstorm` step 1 (subsystem framing) and `pg-feature-plan` before §3 to seed the file list from existing evidence rather than pure grep. Skip when you already have the anchor's downstream chain memorized, when the task is a one-file bug fix, or when the ask is about non-PG code.
matejformanek/postgres-claude · ★ 0 · AI & Automation · score 70
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/