@arhen/pi-add-code-diagnostic

pi extension: repo-scoped typecheck/lint diagnostics for coding agents (LSP-equivalent, no servers).

Packages

Package details

extension

Install @arhen/pi-add-code-diagnostic from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@arhen/pi-add-code-diagnostic
Package
@arhen/pi-add-code-diagnostic
Version
1.0.3
Published
Aug 17, 2026
Downloads
599/mo · 7/wk
Author
arhen
License
MIT
Types
extension
Size
17.7 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@arhen/pi-add-code-diagnostic

npm version license

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 check command (e.g. tsc --noEmit) once per session, then after any agent edit. Errors surface as a followUp message; triggerTurn re-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. off or enabled: 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 are split on whitespace (no shell pipes/&&) and run with a 120s timeout from the repo root.

Commands

  • /diagnostic — status: root, check cmd, fileCheck, enabled, testedAt, lastExit
  • /diagnostic run — run the global check now
  • /diagnostic clear — delete the repo config; discovery re-runs

License

MIT.