pi-roam-code

Roam compile/verify hooks for pi — injects pre-computed plan context before agent turns and auto-fixes post-edit findings

Packages

Package details

extension

Install pi-roam-code from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-roam-code
Package
pi-roam-code
Version
1.0.0
Published
Jun 19, 2026
Downloads
not available
Author
avnsiva
License
MIT
Types
extension
Size
7.8 KB
Dependencies
0 dependencies · 2 peers
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

pi-roam-code

Pi extension that wires roam compile/verify hooks into every agent turn.

  • Compile — before each turn, runs roam compile on 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-only on 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-code

Or add to your project's .pi/settings.json:

{
  "packages": ["npm:pi-roam-code"]
}

How it works

  1. Before the agent starts (before_agent_start): classifies your prompt, runs roam --json compile, and injects the envelope as an invisible context message.
  2. After the agent finishes (agent_end): runs roam --json verify --auto --diff-only. If violations exist, sends [roam-verify-auto-fix] ... as a followUp message — 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