← Catalog

@nicknisi/pi-adr

Injects the repo's ADR index (docs/decisions/) into the system prompt as a steering veto list

Package

Install

Install with PiG

pig install npm:@nicknisi/pi-adr

Install with Pi

pi install npm:@nicknisi/pi-adr
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.3.3 (README.md). PiG does not review it.

@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_start hook — walks up from cwd, stopping at the repo root (the first directory with .git), to the nearest ancestor with docs/decisions/, and puts a framing sentence plus the sorted ADR paths (relative to cwd, so they resolve from a subdirectory) in a decision_records system 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 no docs/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.md directly in docs/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.