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

@cooper-zygao/pwa-mystery

v0.1.2

Published

LLM-powered mystery novel writing agent. 5-phase pipeline (truth → world → plan → write → review) with hard file-system isolation, per-chapter AI-pattern scanning, paragraph-level polishing, and targeted revision mode. Built on pi-agent-core.

Readme

PWA-mystery v0.1.2

LLM-powered mystery novel writing agent. Five-phase pipeline (truth → world → plan → write → review) with hard file-system isolation to prevent spoiler leaks. Built on pi-agent-core.

Core invariant: the Writer agent never reads truths/. Access is enforced at the tool level — not prompt etiquette.


Features

  • 5-phase pipeline: truth design → world-building → chapter planning → prose generation → final review
  • Hard file-system isolation: access matrix prevents each agent from reading forbidden directories
  • reviewPolish v3: per-chapter AI-pattern scanning (scan_ai_patterns, scan_repetition, scan_density), paragraph-level rewriting via apply_patch with staging + atomic rename
  • Targeted revision: /phase:write --revise reads finalReview.fixes[] and applies precise patches across chapters without full rewrites
  • Self-reflection: every phase runs a consistency check after generation (name cross-references, timeline coherence, spoiler leakage prevention)
  • Batch final review: processes chapters in batches of 3 to avoid context overflow; 70% reader perspective + 30% editor
  • Snapshot-based rollback: /rewind N --force resets drafts/state from chapter N onward
  • TUI with pi logo: gradient ASCII art header, model selector, phase-aware footer

Install

npm install -g @cooper-zygao/pwa-mystery

Requires Node.js 20+. Dependencies (@mariozechner/pi-*, chalk, yaml) auto-installed.


Quick Start

mkdir my-novel && cd my-novel
PWA-mystery .

Describe your novel in the TUI:

I want an English short mystery, ~20,000 words, 4 chapters.
Setting: Shanghai + New York, 2025, cyberpunk.

The assistant creates config.md. Then run phases:

/phase:truth     # Design the mystery
/phase:world     # Build reader-facing world
/phase:plan      # Per-chapter outlines
/phase:write     # Write prose + auto-polish
/phase:review    # Full-book review → fixes[]

Or: /auto --confirm

After review: /phase:write --revise to apply fixes. Repeat review → revise until satisfied.


Commands

| Command | Purpose | |---|---| | /phase:truth | Design killer, motive, method, clues | | /phase:world | Build reader-facing world (no spoilers) | | /phase:plan | Per-chapter plan JSON | | /phase:write [N] [M] [--revise] | Write chapters or apply review fixes | | /phase:review | Full-book review → structured fixes[] | | /auto [--from X] [--through Y] [--confirm] | Run phases sequentially | | /interrogate | Independent reviewer session | | /rewind N --force | Roll back from chapter N | | /model <spec> | Set/view writer model | | /model-reviewer <spec> | Set/view reviewer model | | /status | Project state | | /help | All commands |


Project Layout

my-novel/
├── config.md                  ← Author brief (deleted after /phase:truth)
├── .pwa-mystery/state.json    ← Phase state
├── truths/                    ← God's-eye view (WRITER CANNOT READ)
├── world/
│   ├── meta.json              ← language, title, chapterCount, wordsPerChapter
│   ├── language.md / scene.md
│   └── structure/chapter-N.md
├── plan/chapter-N.json
├── drafts/chapter-N.md
├── state/chapter-N-state.json
├── reviews/final.json
└── sessions/<role>/messages.jsonl

Model Configuration

~/.pwa-mystery/models.json:

{
  "schemaVersion": 2,
  "writer": "minimax/MiniMax-M3-highspeed",
  "reviewer": "deepseek-v4-flash",
  "providers": {
    "opencode-go-minimax": {
      "baseUrl": "https://opencode.ai/zen/go/v1",
      "apiKey": "sk-...",
      "api": "anthropic-messages",
      "models": [{ "id": "MiniMax-M3-highspeed", "name": "MiniMax M3" }]
    }
  }
}

Share with coding-agent: ln -s ~/.pi/agent/models.json ~/.pwa-mystery/models.json


Architecture

See overview.md for detailed architecture documentation (tools, access matrix, rendering pipeline, test suite).