Skip to content

Linting & formatting

The fastest way to keep AI-written code clean is to give the agent real-time feedback from your existing linters, formatters, type-checkers, and LSP — and to have it review its own changes for clarity. Several packages do exactly that.

Real-time code feedback for Pi: LSP, linters, formatters, type-checking, structural analysis, and more, surfaced as the agent edits.

Terminal window
pi install npm:pi-lens

Benefits

  • Broadest coverage — LSP + linters + formatters + types in one package.
  • Catches issues immediately, not after a separate run.

Drawbacks

  • Needs your project’s tools/LSP servers installed and configured.
  • Lots of feedback can be noisy on messy codebases.

Helps the agent “keep code prim and proper” by running linters, formatters, and security tools.

Terminal window
pi install npm:pi-posher

Benefits

  • Bundles formatting + linting + security checks.
  • Good “tidy up after yourself” guardrail.

Drawbacks

  • Overlaps with pi-lens; you usually want one, not both.
  • Relies on the underlying tools being present.

Rather than running tools, this reviews recently changed code for clarity, consistency, and maintainability — a readability pass on top of mechanical linting.

Terminal window
pi install npm:pi-simplify

Benefits

  • Targets readability/maintainability, which linters don’t measure.
  • Focuses on recent changes, so feedback stays relevant.

Drawbacks

  • Subjective; complements but doesn’t replace linters/formatters.
  • Uses model calls (cost) to review.
  • Want live tool/LSP feedback while editing: pi-lens.
  • Want a formatting + lint + security tidy pass: pi-posher.
  • Want a human-style readability review of changes: pi-simplify.