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.
Alternatives
Section titled “Alternatives”1. pi-lens
Section titled “1. pi-lens”Real-time code feedback for Pi: LSP, linters, formatters, type-checking, structural analysis, and more, surfaced as the agent edits.
pi install npm:pi-lensBenefits
- 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.
2. pi-posher
Section titled “2. pi-posher”Helps the agent “keep code prim and proper” by running linters, formatters, and security tools.
pi install npm:pi-posherBenefits
- 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.
3. pi-simplify (review-oriented)
Section titled “3. pi-simplify (review-oriented)”Rather than running tools, this reviews recently changed code for clarity, consistency, and maintainability — a readability pass on top of mechanical linting.
pi install npm:pi-simplifyBenefits
- 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.
Which should I pick?
Section titled “Which should I pick?”- 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.