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

@numbered/docs-to-context

v0.5.15

Published

Generate project docs (component APIs, design system, architecture) and inject index into CLAUDE.md

Downloads

2,153

Readme

@numbered/docs-to-context

Extract component APIs, design system docs, best practices, and architecture specs into structured references and inject a compact index into CLAUDE.md — so AI agents always know what's available without hallucinating.

Usage

bunx @numbered/docs-to-context

Run from the project root. Auto-detects platform (Next.js or Shopify).

Options

bunx @numbered/docs-to-context [project_root] [options]

--platform nextjs|shopify   Force platform detection
--dirs dir1 dir2            Custom scan directories (Next.js only)
--output path               Custom output directory

Output

  @numbered/docs-to-context
  ─────────────────────

  Extract
  ● Platform: nextjs
  ✓ Extracted 74 components
    /path/to/project/.context/components

  Inject
  ✓ Copied 1 best practice doc(s)
  ● Found 15 core doc(s)
  ✓ Injected index into CLAUDE.md

  Done.

What it does

  1. Extracts component APIs from source files into per-component docs at .context/components/
  2. Copies platform-specific best practice docs to .context/best-practices/
  3. Discovers core docs if present (design system, grid system, architecture specs)
  4. Injects a compact index between <!-- PROJECT_DOCS_START --> / <!-- PROJECT_DOCS_END --> markers in CLAUDE.md
  5. Adds .context/ to .gitignore

Injected format

Follows the Vercel compressed folder path convention. Files are grouped by directory to minimize token usage:

<!-- PROJECT_DOCS_START -->

## Project Docs

|[Frontend]|root: ./docs
|frontend:{design-system.md,grid-system.md}
|[Best Practices]|root: ./.context
|best-practices:{react-rules.md}
|IMPORTANT: Read best practice docs before writing code
[Component Index]|root: ./.context/components
|IMPORTANT: Read component docs before using any component
|components:{Button.md,Carousel.md,Container.md}
|If ./.context/components is missing, run: bunx @numbered/docs-to-context
|[Entities]|root: ./docs
|specs/architecture:{README.md,entities.md,entity-relationship-diagram.md}
|specs/architecture/entities:{about.md,journal.md,happening.md}

<!-- PROJECT_DOCS_END -->

Four sections:

  • Frontend — design tokens, grid/layout (read before styling)
  • Best Practices — platform-specific coding rules (read before writing code)
  • Components — per-component docs with props, variants, defaults
  • Entities — content architecture (read before schema/data work)

Best practices

The package bundles best-practice docs per platform:

| Platform | Folder | Source | Contents | | -------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | | Next.js | docs/react/ | vercel-labs/agent-skills + custom rules | React rules (re-renders, effects, etc.) | | Shopify | docs/liquid/ | internal | Liquid rules (performance, Alpine.js) |

These are copied to .context/best-practices/ at generation time. More docs can be added to each folder.

To update from upstream: bun run sync react-best-practices (see scripts/sync.d/).

Supported platforms

Next.js

Scans packages/ui/components/**/*.tsx and extracts:

  • Component name, Props interface/type, JSDoc
  • Default values, tv() variants (tailwind-variants)
  • 'use client' directive, forwardRef usage
  • Sub-exports, local dependencies

Shopify

Scans snippets/*.liquid and extracts:

  • {% doc %}...{% enddoc %} blocks
  • @param tags (type, required/optional, defaults)
  • @example usage blocks

Core docs discovery

The following files are automatically included in the index when present:

| Section | Path | Purpose | | -------- | --------------------------------- | ----------------------------------------- | | Frontend | docs/design-system.md | Design tokens, typography, colors | | Frontend | docs/grid-system.md | Grid system, breakpoints, fluid utilities | | Entities | docs/specs/architecture/**/*.md | Document types, ER diagrams, entity specs |

Fresh clone

Since .context/ is gitignored, agents on a fresh clone will see:

|If ./.context/components is missing, run: bunx @numbered/docs-to-context

No plugin install, no auth — just bun and the public npm package.

Publishing

cd packages/docs-to-context
npm login --scope=@numbered
bun run publish:dry       # preview
bun run publish:patch     # bump patch + publish
bun run publish:minor     # bump minor + publish