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-refactor-loop

v0.1.1

Published

Iterative refactoring pipeline for pi. Runs analyze → refactor → verify cycles with a TUI progress widget, git commit-and-push per pass, and a bundled SKILL.md guide.

Downloads

206

Readme

♻️ Refactor Loop

Iterative refactoring pipeline for pi. Runs analyze → refactor → verify cycles with a TUI progress widget, optional git commit-and-push per completion, and a bundled skill that guides the model through each pass.

Install

pi install npm:pi-refactor-loop

What it does

Registers a /refactor command that walks you through a setup dialog, then drives the agent through up to N simplification passes on a target (file, function, module, etc.). Each pass the agent:

  1. Analyses the target and identifies one focused simplification
  2. Applies the change
  3. Runs your test command (if provided)
  4. Calls the refactor_pass tool to report results and continue

The loop stops when the agent declares the code clean (done: true) or the pass limit is reached.

Commands

| Command | Description | |---|---| | /refactor [target] | Start a refactoring pipeline. Prompts for target, test command, pass limit, and auto-commit if no args given | | /refactor-stop | Stop the active pipeline immediately |

Setup dialog

On /refactor, you are prompted for:

| Prompt | Description | |---|---| | Target | File path, function name, or module to refactor | | Test command | Shell command to run after each pass (e.g. bun test, pytest) — leave empty to skip | | Max passes | 3 / 5 / 10 / 20 | | Auto commit & push | Automatically git commit and git push when the pipeline completes |

Tool: refactor_pass

The agent calls this after each pass to report what changed.

| Parameter | Type | Description | |---|---|---| | change | string | What was changed in this pass | | reason | string | Why this simplification improves the code | | remaining | string | What simplification opportunities remain (empty if done) | | done | boolean | true if the code is clean and no more passes are needed |

Bundled skill

The extension ships with a SKILL.md that is automatically loaded into the session. It provides detailed instructions on the analyze → refactor → verify cycle, what counts as a good simplification, and when to stop.

TUI widget

While the pipeline is active, a widget shows the current pass, target, and completed changes.