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

whatwhy

v0.2.1

Published

PRDs say what, ADRs say why: a process for agentic repositories, enforced by one dependency-free script.

Readme

whatwhy

PRDs say what, ADRs say why. A formal product development process for repositories that agents work in, enforced by one dependency-free script.

Agents decide as they go, and the reasons vanish with the session. whatwhy makes the reasons a precondition of the commit, and gives agents one command for every step so they never number, index or restatus a document by hand.

Use it

In any git repository, new or existing:

npx whatwhy init --name "Acme" --description "Invoicing for freelancers."

This copies the script to scripts/whatwhy.mjs, adds the process to AGENTS.md, and sets up the templates, config, commit hook and pull request workflow. Files you already have are left alone. From then on the repository runs its own copy, offline:

node scripts/whatwhy.mjs status

npx whatwhy upgrade brings the script and the process section of AGENTS.md up to the latest version. Requires Node 20 or later and git. Nothing is installed.

Already keeping ADRs? Point whatwhy at them and convert them where they are:

npx whatwhy init --adr-dir docs/decisions
node scripts/whatwhy.mjs import

import gives each ADR frontmatter from its filename, heading and Status: and Date: lines. Numbers, filenames and extra sections stay as they are, and a file it cannot read exactly is skipped with the reason. Plain init stops if it finds ADRs in a folder it was not pointed at, so you never end up with two sets.

Starting from nothing? You can also create a repository from this template, which brings the ADRs that explain the process, and follow ADOPT.md.

Make it yours

  • House sections. Add them to the TEMPLATE.md in each document folder, and new puts them in every document from then on. upgrade never overwrites a template. The check requires the standard sections and allows any others.
  • Folders. directories in whatwhy.config.json says where ADRs and PRDs live. Set it with init --adr-dir <path> --prd-dir <path>, or move the folders and edit the config.
  • Other files. Every .md in a document folder must be a numbered document, apart from INDEX.md, TEMPLATE.md and README.md. Keep longer or older documents that do not fit in a different folder.
  • Severities. rules in the config sets each rule to error, warn or off.

Commands

| Command | Does | | --- | --- | | init, upgrade, doctor | set up, refresh, and report what is not wired up. init --adr-dir <path> --prd-dir <path> puts the documents somewhere other than docs/adr and docs/prd | | import | converts ADRs written before whatwhy, in place | | new adr\|prd "<title>" | creates the next document: number, frontmatter, index. --prd <ID> links an ADR to its PRD; --supersedes <ID> also marks the old ADR | | accept\|reject\|deprecate <ADR> | moves an ADR to a new status | | approve\|ship\|abandon <PRD> | moves a PRD to a new status | | status | open PRDs, accepted ADRs, and the specs the current branch references | | list [adr\|prd] [--status <status>] | the index as data | | show <ID> [--section <name>] | a document, or one section of it | | check [--fix] [--errors-only] | applies the rules; --fix repairs the mechanical findings; --errors-only leaves out warnings | | index | regenerates the indexes |

Built for agents: every command takes --json and returns { data, changes[], warnings[] }, or { code, message, retryable } on failure. Nothing prompts. Commands that write take --dry-run, and running one twice changes nothing the second time.

The rules

| Rule | Default | What it stops | | --- | --- | --- | | structure | error | malformed, misnumbered or unindexed documents | | immutability | error | rewriting a merged decision instead of superseding it | | traceability | warn | changes that reference no PRD or ADR and give no reason | | architecture | warn | architectural changes with no ADR and no reason |

The first two are mechanical, so they block. The last two depend on judgment about scope, so they warn and offer an escape hatch (no-spec: <reason>, no-adr: <reason>). Set any rule to error, warn or off in whatwhy.config.json. The commit hook prints errors only; warnings show on the pull request and when you run check yourself.

The script does not judge whether a document is any good. That stays with you.

Why it is built this way

whatwhy is built with its own process, so the reasoning is in its documents. Run node scripts/whatwhy.mjs list, or start with:

To work on whatwhy itself, read AGENTS.md.