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

@taylorsatula/pi-prepare

v0.3.0

Published

Read-only prepare mode for Pi with clarifying questions, structured plan approval, tracked execution, and clean-workspace implementation dossiers.

Downloads

149

Readme

@taylorsatula/pi-prepare

Read-only prepare mode for Pi with clarifying questions, structured plan approval, tracked execution, and clean-workspace orientation recaps.

Overview

A three-phase linear workflow extension for Pi:

  1. Preparing — Read-only exploration phase. The agent reads code, asks clarifying questions via an interactive TUI questionnaire, writes a structured plan, and submits it via propose_completed_plan.
  2. Executing — Full editing tools restored. The agent executes the approved plan step-by-step, tracking progress with plan_todo.
  3. Idle — Default state when prepare mode is off.

Installation

# Via pi packages
pi add github.com/taylorsatula/pi-prepare

Or install locally by placing this directory under ~/.pi/packages/prepare/.

Usage

Start Prepare Mode

  • Run /prepare or press Ctrl+Alt+P to toggle prepare mode on/off.
  • Pass --prepare flag to start directly in preparing phase:
    pi --prepare "implement feature X"

Preparing Phase

During preparation, the agent operates in read-only mode:

  • Allowed tools: read, bash (allowlist-gated), grep, find, ls, questionnaire, propose_completed_plan
  • Blocked: edit, write, mutating bash commands (git mutations, npm install, sed -i, find -exec, curl -o, etc.)
  • Bash safety gate: Commands are validated against an allowlist with per-command subcommand checks for git, npm/pnpm/yarn, sed/awk, find/fd, and curl/wget. Unquoted command substitution ($(), `) and output redirection to real files are also rejected.

The agent should:

  1. Explore the codebase using read/grep/find/ls
  2. Ask clarifying questions via questionnaire when requirements are ambiguous
  3. Write a complete plan following the prescribed format (Decisions → Types → Architecture → Implementation Steps)
  4. Submit the plan by calling propose_completed_plan() as the final action

Plan Review Dialog

After submission, the user sees four options:

| Choice | Behavior | |--------|----------| | Clean Workspace & Implement | Asks the model to PAUSE and recap what it knows so far as if briefing a newcomer, captures that full recap as the orientation document, then starts execution with a clean context window | | Implement | Starts execution without compaction — full planning history remains in context | | Keep Refining | Returns to chat for further discussion before resubmitting | | Cancel | Exits prepare mode entirely |

Executing Phase

During execution, the agent has full editing capabilities:

  • Allowed tools: read, bash, edit, write, plan_todo, questionnaire
  • Progress is tracked via plan_todo: use action: "list" to review steps, action: "complete" with stepId: "step-N" to mark done, or action: "cancel" to abandon the plan
  • A HUD section displays the current step being executed
  • Status bar shows completion progress (e.g., prepare 2/5)

Commands

| Command | Description | |---------|-------------| | /prepare | Toggle prepare mode on/off | | /todos | Show current plan progress | | /recap | Generate an orientation recap of the conversation so far (optionally focused with an argument) |

Architecture

File Structure

extensions/prepare/
├── index.ts          # Main extension entry point — flags, commands, shortcuts, event hooks, phase transitions
├── types.ts           # Core type definitions (PreparePhase, PlanStep, PreparedPlan, QuestionnaireResult)
├── identity.ts        # Constants — custom type strings for context messages and compaction markers
├── prompts.ts         # Prompt builders for planning/execution instructions + step formatters
├── bash-safety.ts     # Read-only bash command validation gate with per-command allowlists
├── dossier.ts         # Clean-workspace compaction — asks the model to recap what it knows so far; the full recap becomes the orientation document. Also powers the on-demand `/recap` command.
├── plan-todo.ts       # plan_todo tool — tracks step completion during execution
├── questionnaire.ts   # Interactive TUI widget for multi-question surveys with radio + free-text input
└── submit-plan.ts     # propose_completed_plan tool — signals plan readiness for user review

Key Design Decisions

  • Tool swapping over blocking: Instead of intercepting every tool call, the extension swaps active tools at phase boundaries — edit/write are removed during preparing, and propose_completed_plan/questionnaire are added back during executing.
  • Structured plan parsing: Plans are parsed from markdown using ### Step N — Title headers with bullet fields (What, Files, Details, Acceptance Criteria, Dependencies). Falls back to a single catch-all step if no numbered steps are found.
  • Clean workspace compaction: When selected, the entire planning conversation is serialized and sent to the active model with a single instruction — pause and recap what it knows so far as if bringing a third party up to speed. The model's full recap output, following a standardized section rubric (The system, The problem, What's there today, What's good and should survive, The journey of our discussion, The ideal scenario, Decisions locked, The delineation, What I verified in code, Open before plan-writing), becomes the orientation document that replaces all previous entries in the context window.
  • Bash safety gate: Allowlist-based command checking with granular subcommand rules for git (blocks mutating operations like commit/push/rebase), package managers (blocks install/add/remove), sed/awk (blocks -i), find/fd (blocks -exec/-delete), and curl/wget (blocks writes). Unquoted command substitution and output redirection to real files are also rejected.

Development

# Type-check
npm run check

License

MIT