corpus-chain

Traverse the pg-claude knowledge graph to map PostgreSQL source files, idioms, and scenarios.

Updated Jun 1, 2026
One-click install
npx skills add https://github.com/matejformanek/postgres-claude --skill corpus-chain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: corpus-chain
Source: https://github.com/matejformanek/postgres-claude/tree/main/.claude/skills/corpus-chain
Command: npx skills add https://github.com/matejformanek/postgres-claude --skill corpus-chain

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill solves the difficulty of understanding how specific features, files, or patterns relate to the broader PostgreSQL codebase, preventing fragmented knowledge and ensuring consistent implementation.

Core Features & Use Cases

  • Knowledge Graph Traversal: Maps relationships between scenarios, idioms, source files, and subsystems to provide a holistic view of the codebase.
  • Evidence-Based Planning: Seeds feature plans with existing file lists and invoked idioms, reducing the risk of missing dependencies or violating established conventions.
  • Use Case: When planning a new PostgreSQL feature, use this skill to identify which files to touch, which memory management idioms to respect, and which past features serve as the best implementation references.

Quick Start

Use the corpus-chain skill to generate a dependency map for the add-new-wal-record scenario.

Frequently Asked Questions about corpus-chain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I trace PostgreSQL source file relationships for feature planning?

Trace PostgreSQL source file relationships by traversing a knowledge graph that maps scenarios, idioms, and subsystems to provide a holistic codebase view. This surfaces analogous past work and identifies required implementation patterns for consistent feature development.

What is a knowledge graph approach for PostgreSQL codebase refactoring?

A knowledge graph approach for PostgreSQL refactoring maps relationships between development scenarios, source files, and memory management idioms. It queries a scenario-idiom-file matrix to prevent fragmented knowledge and ensure established conventions are respected during code changes.

How do I find which PostgreSQL files to modify when adding a new WAL record?

Find which PostgreSQL files to modify by querying the knowledge graph for the add-new-wal-record scenario. It generates a dependency map identifying relevant source files, invoked idioms, and analogous past features that serve as implementation references.

Can I identify required PostgreSQL memory management idioms before starting backend development?

Yes, you can identify required PostgreSQL memory management idioms by traversing the knowledge graph before backend development. It seeds feature plans with established file lists and invoked patterns, reducing the risk of violating existing conventions.

Does this code analysis tool generate structured documentation for PostgreSQL internals?

Yes, this code analysis tool executes internal Python scripts to query the scenario-idiom-file matrix and outputs structured markdown documentation. This documentation details the relationships between PostgreSQL source files, idioms, and development scenarios.

What are the limitations of using a knowledge graph for PostgreSQL subsystem investigation?

Limitations include relying entirely on the pre-existing pg-claude knowledge graph data and requiring internal Python script execution. It cannot analyze code relationships or patterns outside of its mapped scenario-idiom-file matrix scope.