singularity-forge/docs/dev/context-and-hooks/README.md
Jeremy 872b0adb48 docs: reorganize into user-docs/ and dev/ subdirectories
Split flat docs/ into user-docs/ (guides, config, troubleshooting) and
dev/ (ADRs, architecture, extension guides, proposals). Updated
docs/README.md index to reflect new paths.
2026-04-10 09:25:31 -05:00

1.5 KiB

Context & Hooks — Deep Reference

How context flows through pi, how to intercept and shape it, and advanced patterns for extension authors.

These documents fill gaps between the high-level extending-pi docs and the actual source implementation. Read the extending-pi docs first for fundamentals, then use these for precision work.

Documents

# Document When to read
01 The Context Pipeline Understanding the full journey of a user prompt through every transformation stage to the LLM
02 Hook Reference Complete behavioral specification of every hook — timing, chaining, return shapes, edge cases
03 Context Injection Patterns Practical recipes for injecting, filtering, transforming, and managing context
04 Message Types and LLM Visibility How every message type is converted for the LLM, what it sees, what it doesn't
05 Inter-Extension Communication pi.events, shared state patterns, and multi-extension coordination
06 Advanced Patterns from Source Production patterns extracted from the pi codebase and built-in extensions
07 The System Prompt Anatomy How the system prompt is built, every input source, when it's rebuilt, and every lever to shape it