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

@nklisch/pi-legible

v0.1.0

Published

Rewrites assistant prose through a second model for legibility, with configurable rules, context depth, and model choice.

Readme

@nklisch/pi-legible

Rewrites assistant prose through a second model for legibility. The original message streams live as usual; once it completes, a rewriter model rewrites each text block and the clearer version swaps into the chat.

You see the rewrite. The agent keeps the original. Before each LLM call, pi-legible swaps the original text back into the context the agent sees, so the rewriter can simplify aggressively without degrading the agent's memory of its own work. Originals are also restored into compaction input, so summaries are generated from full-fidelity text.

Known limit: originals live in memory. After restoring a session from disk, older messages are covered only if they were rewritten in this process — new messages always are.

Install

pi install npm:@nklisch/pi-legible

How it works

  • Hook: message_end replacement (pi has no mid-stream rewrite hook, so the swap happens after each message finishes streaming).
  • The rewriter sees: your rules + a small slice of recent conversation (originals, never rewrites) + the message to rewrite. It does not see the full conversation.
  • Rewrite failures are non-fatal: the original message is shown, with one warning notification per session. Each rewrite has a 30-second timeout so a hung rewriter cannot stall the agent loop.
  • A configured rewriter model that cannot be resolved (typo, expired auth) fails safe — originals are shown — rather than silently billing rewrites to the session model.
  • Latency: one extra model call per assistant text block (blocks in a message are rewritten concurrently). Pick a fast model — see below.

Project trust

Project-level settings (.pi/pi-legible.json and LEGIBLE.md) shape prompts sent to an authenticated model, so they are honored only when the project is trusted in pi. In untrusted projects, only your global config and rules apply.

Commands

| Command | Effect | | --- | --- | | /legible | Show status (enabled, model, depth, rules source) | | /legible on / /legible off | Enable/disable rewriting | | /legible model <spec> | Set rewriter model, e.g. openai/gpt-5.6-mini or a bare model id | | /legible model default | Reset to the session model | | /legible depth <n> | How many recent messages the rewriter sees (0–20, default 6) | | /legible tools on / /legible tools off | Include tool calls/results in the rewriter's context (default on) | | /legible rules | Show which rules file is in effect | | /legible reload | Reload config and rules from disk |

Rewrite rules: LEGIBLE.md

The rewriter's instructions come from the first of:

  1. LEGIBLE.md in the project root (AGENTS.md-style, project-specific rules)
  2. ~/.pi/agent/LEGIBLE.md (your global rules)
  3. Built-in defaults (plain language, lead with the outcome, keep paths/code/ errors verbatim, don't add or drop information)

Edit the file and run /legible reload (or restart) to apply.

Configuration

Settings persist to ~/.pi/agent/pi-legible.json; a project can override any key with <project>/.pi/pi-legible.json (project wins):

{
  "enabled": true,
  "model": "openai/gpt-5.6-mini",
  "contextDepth": 6,
  "includeToolCalls": true
}

Note: because a project file wins on merge, keys it sets mask later /legible command writes (which go to the global file).