@arhen/pi-add-code-diagnostic1.0.4
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
@arhen/pi-add-code-diagnostic
Install
Requires the pi coding agent — install it first: npm install -g @earendil-works/pi-coding-agent.
pi install npm:@arhen/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, one message per session. Repo has no config yet → the agent is asked to inspect the repo, propose a
check/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 — the nearest config wins, and a nested repo with no config inherits its parent's (up to 3 roots up):
{ "check": "tsc --noEmit", "fileCheck": "eslint ${file}", "enabled": true }
Commands with no shell operators are split on whitespace; anything with &&, a pipe, or a redirect runs through bash -lc. Both run from the repo root — 120s for check, 30s per file for fileCheck.
Commands
/diagnostic— status: root, check cmd, fileCheck, enabled, testedAt, lastExit (statusis the explicit form)/diagnostic run— run the global check now/diagnostic clear— delete the repo config; discovery re-runs
License
MIT.