npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-mono-auto-fix

v0.3.1

Published

Pi extension that runs language-appropriate fixers (eslint, black, prettier, ...) on files touched during a turn

Downloads

508

Readme

pi-mono-auto-fix

End-of-turn formatter/linter dispatcher for pi. Collects every file written during a turn and applies language-appropriate fixers (eslint, black, prettier, …) in one batch once the agent stops talking.

What it does

  • Subscribes to tool_result for the built-in edit and write tools, plus the context-guard:file-modified event that multi-edit and other writers emit.
  • Buffers absolute paths of touched files in a per-turn Set.
  • On agent_end, groups paths by matching fixer, runs each fixer once per group (parallel up to concurrency).
  • After each run, re-emits context-guard:file-modified for any file whose mtime actually changed, so downstream read caches evict.
  • Emits a single notification at the end (auto-fix: N/M files updated).

Fixers are invoked silently — stdout/stderr are swallowed. Failures are reported in the summary notification but never surfaced into the LLM context.

Built-in fixer rules

| Extensions | Command | | ------------------------------------------------- | -------------------------------------------------------------- | | .ts .tsx .js .jsx .mjs .cjs | npx --no-install eslint --fix --no-error-on-unmatched-pattern {files} | | .py | black -q {files} | | .json .md .yml .yaml .css .scss .html | npx --no-install prettier --write --log-level=warn {files} |

{files} is replaced with shell-quoted, space-separated absolute paths. If the token is missing, files are appended to the end of the command.

Commands run with shell: true, cwd = ctx.cwd, and a per-invocation timeout (default 60s).

Configuration

Resolution order (first hit wins):

  1. PI_AUTO_FIX=0 → extension is fully disabled (no listeners registered)
  2. ~/.pi/agent/auto-fix.json
  3. built-in defaults

Example ~/.pi/agent/auto-fix.json:

{
  "enabled": true,
  "timeoutMs": 90000,
  "concurrency": 2,
  "ignore": ["node_modules/", "dist/", ".git/", "vendor/"],
  "fixers": [
    {
      "label": "biome",
      "extensions": [".ts", ".tsx", ".js", ".jsx"],
      "command": "npx --no-install biome check --write --no-errors-on-unmatched {files}"
    },
    {
      "label": "ruff",
      "extensions": [".py"],
      "command": "ruff check --fix {files} && ruff format {files}"
    }
  ]
}

All fields are optional; anything omitted falls back to the built-in default.

Install

pi install npm:pi-mono-auto-fix

Or load directly for testing:

pi -e /path/to/pi-extensions/extensions/auto-fix/index.ts

Notes

  • Paths outside ctx.cwd are skipped for safety.
  • Paths matching any substring in ignore are skipped.
  • Files deleted during the turn are skipped (existence is re-checked at flush time).
  • The mtime diff catches fixers that are no-ops on already-clean files, so the summary reflects real changes rather than just invocations.