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

@ganderbite/flow-codebase-discovery

v0.1.1

Published

Explores a codebase and produces an HTML report covering packages, entities, services, and architecture.

Downloads

192

Readme

codebase-discovery

●─▶●─▶●─▶● codebase-discovery

The canonical reference flow. Point it at any repository and it produces a single self-contained HTML report describing the code that lives there — which packages exist, which entities and services they expose, and how the pieces fit together.

What it does

Four prompt steps, arranged as a fan-out over a shared inventory. The first step (inventory) walks the repository and emits a JSON handoff listing every package, its language, and its top-level structure. Two steps then run in parallel against that inventory: entities enumerates the data shapes (types, schemas, database tables) and services enumerates the runtime components (HTTP endpoints, background jobs, CLI commands). The final step (report) consumes all three handoffs and writes an HTML artifact that combines them into a single browsable document.

The flow is designed as a worked example of the Appendix A shape — one upstream node, two parallel branches, one downstream synthesis — and as a useful tool for onboarding a new engineer or PM onto an unfamiliar codebase.

Sample output

See examples/sample-output.html for a minimal skeleton of the report format. After a real run, artifacts/report.html contains:

  • A header with the repository name and the date of the run.
  • A "Packages" section listing every package with its purpose and primary language.
  • An "Entities" section grouping the data shapes by package.
  • A "Services" section grouping the runtime components by package.
  • A closing "Architecture" section summarizing how the packages depend on each other.

The exact content varies per run because the summaries are generated by the model.

Estimated cost and duration

  • Cost: $0.20 to $0.80 per run on the default sonnet model. Billed to your Claude subscription on Pro or Max — the dollar figure is an API-equivalent estimate, not a charge.
  • Duration: 5 to 20 minutes, dominated by the two parallel discovery steps and the final report synthesis.

Both ranges match the relay metadata block in package.json and appear in the pre-run banner.

Install

From a clone of the Relay monorepo:

pnpm install
pnpm --filter @ganderbite/flow-codebase-discovery build

The build step compiles flow.ts to dist/flow.js, which is the artifact the CLI loads. When this flow is published to the catalog, users will instead run:

relay install codebase-discovery

Run

From the repo root:

relay run ./packages/flows/codebase-discovery --repoPath=./ --audience=dev

The path form (./packages/flows/codebase-discovery) tells the CLI to resolve the flow from a local directory. When the run completes, the generated report lands in .relay/runs/<runId>/artifacts/report.html.

Configuration

The flow accepts two inputs:

| Field | Type | Default | Notes | |---|---|---|---| | repoPath | string | (required) | Absolute or relative path to the repository to explore. | | audience | 'pm' \| 'dev' \| 'both' | 'both' | Controls the tone and depth of the generated report. |

There are no per-step model overrides. All four steps run on whichever model your ClaudeProvider selects by default.

Environment

This flow runs on your Claude subscription. Run claude /login once to authenticate before your first run.

Run relay doctor before your first run to confirm Node, the claude binary, auth state, and the .relay directory are all in order.

Customization

Fork the flow by copying the directory:

cp -r packages/flows/codebase-discovery ./my-flow
cd ./my-flow

Then edit:

  • prompts/01_inventory.md — change how the walker enumerates packages.
  • prompts/02_entities.md and prompts/03_services.md — change the parallel discovery prompts.
  • prompts/04_report.md — change the HTML template or the sectioning.
  • schemas/*.ts — change the shape of the handoffs the steps exchange.
  • flow.ts — add a fifth step, add an input, or swap the artifact extension.

Rebuild with pnpm --filter my-flow build after any change to flow.ts or a schema file.

License

MIT. Copyright Ganderbite.