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

@gsft/piflux

v1.0.0

Published

A human-in-the-loop coding workflow for Pi Coding Agent: plan, implement, review, and ship across focused agent sessions.

Readme

Piflux

This package implements a coding workflow for Pi Coding Agent. This workflow presumes a human in the loop.

Why?

Pi's selling point to me was the idea of a minimalistic agent harness that I could adapt to my workflows, by having it customize itself to my needs. I created this mostly for myself, and made it public in case others find it useful.

I like to work collaboratively with AI. Sometimes I use agents as a code assistant when I am the one implementing. Other times agents are implementing under my oversight. This workflow is for the latter; I envisioned a simple process leveraging Pi's flexibility in managing sessions:

basic workflow

How does it work?

Each step in the diagram above happens in a new session. That session has only the context it needs to work, and no context beyond that. This brings some benefits:

  • Reduced token usage: A coding session does not need the planning conversation where ideas were still in a state of flux; a reviewing session does not need the intermediate steps that happened in the coding session.
  • Improved implementation quality: As a consequence of the previous point, the implementation tends to be more focused and concise; of course this is nothing new, a separation of planning and implementation has been used in AI-assisted programming for a while. This extension leverages Pi's session management capabilities to make this process as simple and concise as possible, while extending this philosophy for AI reviews as well.
  • Multiple models: Each step can be configured to a different model; I find that different models have different blind spots and different ways to solve problems. This, too, is something this workflow streamlines.

Usage

The workflow provides a set of commands that are expected to be used in order:

1. /start <branch-name>

Creates a new branch for the workflow. The workflow ends with this branch being merged back into the base branch or abandoned.

2. /plan <description>

Creates a new planning session for the workflow. Description is optional, and is meant to be a brief description to initiate the planning work. Keep it to one line, more complex instructions can be provided in follow-up messages.

The purpose of planning is to nail down requirements, guardrails, and scope of the change to be implemented. The result of a planning session is a planning artifact with detailed implementation instructions that serves as input for later steps.

3. /code

Creates a new coding session for the workflow. The coding session reads the planning artifact and makes changes to the codebase. The plan may be deviated from (as is the nature of software development), and if necessary the user can provide further guidance in follow-up messages. The result of a coding session is unstaged changes and a coding report artifact.

4. /review

Creates a new reviewing session for the workflow. The reviewing session takes as input the planning artifact, the coding report, and the code changes retrieved from git in order to review the code changes based on the following criteria:

  • Correctness: Whether the code does what it is supposed to do.
  • Suitability: How well the code fits the plan it is meant to implement.
  • Maintainability: Whether the code is well-structured for the codebase and easy to maintain.
  • Performance: Whether the code performs well. But, unless otherwise specified, performance should not take precedence over the first three criteria.
  • Test Coverage: Evaluates how well the code is tested if a test suite is available and if changes can be reasonably tested.

The output of the reviewing session is a review report artifact, listing review findings per severity (Critical, Warning, Suggestions, Test Coverage). If there are no findings, the user may skip to /ship. Plan deviations may be accepted if the reasoning provided by the coding report is sound. Stages the code already reviewed.

5. /icode

Unlike /code, this resumes the existing coding session rather than starting fresh, as the prior session state is valuable here. Takes both the plan artifact and the review report artifact as input, and attempts to resolve all review findings. A new coding report artifact is generated.

6. /ireview

Resumes the review session, as the prior state is valuable here. Takes the plan artifact and the coding report artifact as input, as well as the previous review report. Evaluates the new unstaged code changes to determine if previous findings are resolved, and whether there are any new findings. Stages the code already reviewed.

/icode and /ireview are meant to be executed iteratively until the reviewing session comes out clean and the code is ready to be shipped.

7. /ship

Commits with a user-approved message, and squashes the code changes back to the base branch (may merge if the plan dictates it to instead), and pushes the changes to the remote base branch. It may also tag the commit depending on the planning decisions.

8. /done

Finishes the workflow by cleaning up workflow artifacts, workflow sessions, and the workflow branch. Can only be executed after /ship, and presumes that git state is the same as it was on the previous /ship call.

9. /abandon

Drops an unfinished workflow by restoring the git state to how it was prior to the workflow, and by removing the underlying artifacts and sessions that are used to manage it. Slightly more aggressive than /done, and can be used at any time during an active workflow to signal that the work should be thrown away.

Meta workflow commands

A few subcommands under /piflux provide helping functionality:

/piflux state

Prints the current workflow state, including current step and valid next commands.

/piflux view

Here the user can view the work in progress. Can be used while a step is currently running without impacting its execution. The plan artifact, coding and review reports; those can be consulted if the user needs to intervene, or if adjustments must be made.

The viewer is read-only and in-app; there is no need to open workflow artifacts in external editors, and there is no chance of accidental edits that may affect implementation.

/piflux settings

Allows the user to pick which model and thinking level should be used for each step.

Settings are stored in a single global file: ~/.pi/agent/piflux/settings.json. /piflux settings opens an interactive TUI overlay to edit the settings in three steps (pick step, pick model, pick thinking level). This allows the user to, for example, pick more powerful models and higher thinking levels for planning steps, or more specialized models for coding and reviewing. Other steps can be delegated to less powerful models and lower thinking levels.

Install

npm

pi install npm:@gsft/piflux

Git

pi install git:github.com/gruntsoft/piflux

Development

When working in this repo, the package auto-loads via .pi/settings.json. Use /reload after making changes to pick them up live.

Any global installation of piflux must be removed first; the package auto-loads via .pi/settings.json and a duplicate global install would cause conflicts.