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

orangerail-docs-gen

v0.1.5

Published

Generate the AGENTS.md an AI agent reads to learn which data tools and approval-gated write actions exist, deterministically, with a Mermaid diagram.

Readme

orangerail-docs-gen

The prompt rail of orangerail: walk an ontology registry and deterministically generate the agent-facing domain document — AGENTS.md sections plus an embedded Mermaid classDiagram — that describes the runtime rail truthfully.

The point is that the document an agent reads and the MCP server it calls come from the same declaration, so they cannot drift apart. Nobody hand-maintains a markdown file that says which writes need approval.

Most users never install this directly: the orangerail CLI depends on it and orangerail docs is the command that writes the file.

npx orangerail docs --out ./docs

Install

npm install orangerail-docs-gen

orangerail-core is a dependency; zod is a peer dependency (^3.23 || ^4). mermaid and jsdom are dev-only — they back the tests that parse the generated diagram to prove it is valid, and nothing at runtime imports them.

Use

Two pure functions, zero I/O. File writing lives only in the CLI command.

import { generateDocs, generateMermaid } from 'orangerail-docs-gen';

const markdown = generateDocs({ registry });
const diagram = generateMermaid({ registry });
  • generateDocs({ registry, preset? }) — the complete document: the agent-usage guide, the domain map, the MCP tool list, and the object / link / action type sections.
  • generateMermaid({ registry }) — just the classDiagram body, if you are embedding it somewhere of your own.
  • deriveTools({ registry, preset? }) — the tool list as data rather than markdown.

preset mirrors the MCP server's exposure and defaults to 'approval-for-writes', exactly as createMcpServer does, so the document claims the tools the server actually serves. 'sandbox' and 'readonly' render the guide and tool list those presets produce.

Output is byte-deterministic

Entities are sorted alphabetically and nothing carries a timestamp or a random id, so regenerating an unchanged registry produces a byte-identical file and an empty git diff. That is what makes the generated document safe to commit and to check in CI.

The output opens with <!-- Generated by \orangerail docs`. DO NOT EDIT — regenerate instead. -->`.

Governance facts are truthful

An action's approval gate, approver roles and where guard are rendered from the registry, not from a description someone typed. A declarative guard renders as condition: only when status neq "soldout"; a functional predicate renders as custom code predicate — evaluated at runtime, not representable here, because its body is opaque to this package exactly as it is to the action signature hash. The document never claims to state a condition it cannot read.

License

MIT