@nicknisi/pi-adr
Injects the repo's ADR index (docs/decisions/) into the system prompt as a steering veto list
Package details
Install @nicknisi/pi-adr from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@nicknisi/pi-adr- Package
@nicknisi/pi-adr- Version
0.3.1- Published
- Oct 22, 2026
- Downloads
- 213/mo · 30/wk
- Author
- nicknisi
- License
- MIT
- Types
- extension
- Size
- 12.4 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@nicknisi/pi-adr
Injects the repo's ADR index (docs/decisions/) into the system prompt as a steering veto list, so the agent knows which directions are already settled before it proposes anything.
What it adds
before_agent_starthook — walks up from cwd, stopping at the repo root (the first directory with.git), to the nearest ancestor withdocs/decisions/, and puts a framing sentence plus the sorted ADR paths (relative to cwd, so they resolve from a subdirectory) in adecision_recordssystem prompt section (event.systemPromptOptions.sections), so pi records a small transcript delta instead of replacing the whole prompt and prompt caching keeps working. Filenames only (~10 tokens per ADR); full files are read on demand by the agent. Recomputed per prompt, so it's never stale. No-ops when nodocs/decisions/exists.
No slash commands, tools, keybindings, widgets, or config.
Pairs with a user-level prompt template (~/.pi/agent/prompts/adr.md, not part of this package) that writes the next numbered ADR from the current conversation on /adr.
Conventions
- ADRs are
NNNN-kebab-title.mddirectly indocs/decisions/. The filename is the veto — make titles descriptive ("no package service primitive", not "refactor approach"). - Superseded ADRs move to
docs/decisions/superseded/, which drops them out of the injected list (the readdir is non-recursive; no status parsing). - Template files (
0000-*) are excluded.
Install
pi install npm:@nicknisi/pi-adr
Dependencies
Peer dep on @earendil-works/pi-coding-agent (provided by the pi runtime). No runtime dependencies.