@lukisxyz/pi-add-code-diagnostic1.1.0
pi extension: repo-scoped typecheck/lint diagnostics for coding agents (LSP-equivalent, no servers).
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@lukisxyz/pi-add-code-diagnostic
Install
Requires the pi coding agent — install it first: npm install -g @earendil-works/pi-coding-agent.
pi install npm:@lukisxyz/pi-add-code-diagnostic
LSP-equivalent diagnostics for coding agents — no language servers, no JSON-RPC, no server lifecycle. One configured command per repo, run by the agent loop itself.
How it works
- Tier 1 — per-file lint on write/edit. If the repo config has
fileCheck(e.g.eslint ${file}), it runs silently in the background after each agent write/edit. Never blocks. - Tier 2 — global check at agent settle. Runs the repo's
checkcommand (e.g.tsc --noEmit) once per session, then after any agent edit. Errors surface as afollowUpmessage;triggerTurnre-engages the agent to fix them, so the agent keeps working until the tree is clean. - Discovery is opt-in. Repo has no config yet → you get one UI notice per session (no agent turn, no context pollution). Nothing happens until you run
/diagnostic init, which asks the agent to inspect the repo, propose acheck/fileCheck, self-test it, confirm with you, and write the config.offorenabled: false= silent forever. - Fail-open everywhere. A broken command never blocks the agent. 3 crashing runs auto-disable the config. Aborted agent runs skip the check.
- Loop guard. The same error report with no edits since → shown only, no re-trigger.
Config
Per repo root at ~/.pi/repos/<root-sanitized>.json:
{ "check": "tsc --noEmit", "fileCheck": "eslint ${file}", "enabled": true }
Commands run with a 120s timeout from the repo root. A command is split on whitespace and run argv-direct, unless it contains a shell operator (& | ; > < backtick ( )) — then it is wrapped in bash -lc. So PATH="$HOME/.foundry/bin:$PATH" bun run build breaks (assignment spawned as a program name), while export PATH="…"; bun run build works.
Commands
/diagnostic— status: root, check cmd, fileCheck, enabled, testedAt, lastExit/diagnostic run— run the global check now/diagnostic init— ask the agent to discover and write the config for this repo (opt-in)/diagnostic clear— delete the repo config;/diagnostic initre-runs discovery
License
MIT.