pi-roam-code
v1.0.0
Published
Roam compile/verify hooks for pi — injects pre-computed plan context before agent turns and auto-fixes post-edit findings
Readme
pi-roam-code
Pi extension that wires roam compile/verify hooks into every agent turn.
- Compile — before each turn, runs
roam compileon your prompt and injects a pre-computed plan (procedure, files, facts) into the model context. Cuts navigation turns by ~80%. - Verify — after each agent turn, runs
roam verify --auto --diff-onlyon changed lines. If findings surface, queues an auto-fix follow-up message so the agent resolves them before moving on.
Everything is fail-open: a broken roam install never blocks a turn. If roam is missing, you get one warning notification at session start and the extension silently skips.
Prerequisites
- roam CLI installed and on
PATH - In your repo:
roam init(one-time indexing)
Install
pi install npm:pi-roam-codeOr add to your project's .pi/settings.json:
{
"packages": ["npm:pi-roam-code"]
}How it works
- Before the agent starts (
before_agent_start): classifies your prompt, runsroam --json compile, and injects the envelope as an invisible context message. - After the agent finishes (
agent_end): runsroam --json verify --auto --diff-only. If violations exist, sends[roam-verify-auto-fix] ...as afollowUpmessage — delivered only after the agent is fully idle, preventing loops.
Configure
Environment variables (optional):
| Variable | Effect |
|----------|--------|
| ROAM_COMPILE_TIMEOUT | Compile timeout in ms (default: 6000) |
| ROAM_VERIFY_TIMEOUT | Verify timeout in ms (default: 90000) |
License
MIT
