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

@repositories-wiki/repository-wiki

v1.0.1

Published

Generate a wiki from a source code repository using LLMs

Readme

@repositories-wiki/repository-wiki

Generate comprehensive, structured wiki documentation from any source code repository using LLMs.

npm License: MIT

This package provides a CLI and programmatic API that reads a repository's source code, parses it with Tree-sitter, uses LLMs to plan a wiki structure, and generates detailed markdown documentation with architecture diagrams, source citations, and cross-references.

See it in action

https://github.com/user-attachments/assets/cdfa1f13-7725-4d91-829d-ae418a0cbc0c

What It Produces

Running the tool on a repository generates:

  • repository-wiki/ — A directory of structured markdown pages organized by sections, with an INDEX.md listing all pages, their importance levels, and relevant source files
  • AGENTS.md — Instructions added to the repo root that tell AI coding agents how to consult the wiki and when to update it

Installation

npm install -g @repositories-wiki/repository-wiki

CLI Usage

repository-wiki [options]

Required Options

| Flag | Description | |------|-------------| | --provider-id <id> | LLM provider ID (openai, anthropic, azure_openai, google-genai, bedrock, sap-ai-core) | | --planer-model <id> | Model for the planning LLM (recommended: Opus-class) | | --exploration-model <id> | Model for the exploration LLM (recommended: Haiku-class) | | --builder-model <id> | Model for the builder LLM (recommended: Sonnet-class) |

You must also provide one of:

| Flag | Description | |------|-------------| | --repo-url <url> | GitHub repository URL to clone (requires --github-token) | | --local-repo-path <path> | Path to a local git repository |

Optional Flags

| Flag | Description | Default | |------|-------------|---------| | --github-token <token> | GitHub token (required with --repo-url or --push-to-github) | — | | --commit-id <id> | Specific commit ID to generate wiki from | HEAD | | --output-dir <path> | Output directory for generated wiki files | repository-wiki | | --push-to-github | Push generated wiki to a GitHub branch | false | | --wiki-branch <branch> | Branch name for the wiki push | repository-wiki-<timestamp> |

Examples

Generate wiki from a local repository using Anthropic:

export ANTHROPIC_API_KEY=sk-...

repository-wiki \
    --provider-id anthropic \
    --planer-model claude-opus-4-6 \
    --exploration-model claude-haiku-4-5 \
    --builder-model claude-sonnet-4-6 \
    --local-repo-path /path/to/my-project

Generate wiki from a GitHub repository URL:

export ANTHROPIC_API_KEY=sk-...

repository-wiki \
    --provider-id anthropic \
    --planer-model claude-opus-4-6 \
    --exploration-model claude-haiku-4-5 \
    --builder-model claude-sonnet-4-6 \
    --repo-url https://github.com/owner/repo \
    --github-token ghp_xxxxxxxxxxxx

Programmatic API

The package also exports a programmatic API for use in your own tools:

import { WikiGeneratorPipeline } from "@repositories-wiki/repository-wiki";

const pipeline = WikiGeneratorPipeline.create();
const result = await pipeline.execute({
  localRepoPath: "/path/to/my-project",
  providerConfig: { providerID: "anthropic" },
  llmPlaner: { modelID: "claude-opus-4-6" },
  llmExploration: { modelID: "claude-haiku-4-5" },
  llmBuilder: { modelID: "claude-sonnet-4-6" },
});

console.log(result.wikiStructure.title);
console.log(result.wikiStructure.sections);
console.log(result.commitId);

Exports

| Export | Description | |--------|-------------| | WikiGeneratorPipeline | The main pipeline class — call .create() for the default pipeline, or build a custom one with .addStep() |

How the Pipeline Works

flowchart TD
    A["<b>Setup Repository</b> <br>Clone from URL or<br>alidate local repo"] --> B["<b>Infer Files</b><br>Tree-sitter parsing +<br>exploration LLM"]
    B --> C["<b>Generate Structure</b><br>Planner LLM designs<br>sections & pages"]
    C --> D["<b>Generate Pages</b><br>Builder LLM writes each<br>page with source citations"]
    D --> E["<b>Write to Local</b><br>Markdown files +<br>INDEX.md + AGENTS.md"]
    E --> F["<b>Push to GitHub</b><br>Optional: commit &<br>push to a branch"]

| Step | What It Does | |------|--------------| | Setup Repository | Clones from a URL (with optional token/commit) or validates a local git repo | | Infer Files | Walks the repo file tree, reads the README, uses Tree-sitter to extract code signatures, and asks the exploration LLM to identify the most important files | | Generate Structure | Sends the file tree and enriched file data to the planner LLM, which designs the full wiki structure — sections, pages, importance levels, and relevant source files | | Generate Pages | Generates all wiki pages concurrently (up to 100 in parallel) using the builder LLM, with pre-loaded source files injected into each prompt for accurate citations | | Write to Local | Writes markdown files organized by section, generates INDEX.md, and creates/updates AGENTS.md at the repo root | | Push to GitHub | If enabled, creates a new branch, commits the wiki and AGENTS.md, and pushes to the remote |

Supported LLM Providers

Before running, export the environment variables required by your LLM provider:

| Provider | Env Variable | Setup Guide | |----------|-------------|-------------| | anthropic | ANTHROPIC_API_KEY | LangChain docs | | openai | OPENAI_API_KEY | LangChain docs | | azure_openai | AZURE_OPENAI_API_KEY | LangChain docs | | google-genai | GOOGLE_API_KEY | LangChain docs | | bedrock | AWS credentials | LangChain docs | | sap-ai-core | SAP AI Core config | SAP AI SDK docs |

Tree-sitter Language Support

The exploration step uses Tree-sitter to extract code signatures (functions, classes, interfaces) for richer context. Currently supported languages:

| Language | Extensions | |----------|-----------| | TypeScript | .ts | | TSX | .tsx | | JavaScript | .js, .jsx, .mjs, .cjs | | Python | .py, .pyw | | Java | .java | | Go | .go |

Files in other languages are still included in the wiki — they're just processed as plain text without signature extraction.

Want better results for your language? You can add your own Tree-sitter grammar by implementing a language query in src/tree-sitter/language-queries/ and placing the corresponding .wasm grammar file in assets/grammars/. See the existing language queries for reference.

Keeping the Wiki Updated

The wiki generation is a one-time step. To keep it current as your code evolves, install the update-wiki agent skill included in the monorepo. The generated AGENTS.md tells your agent when to update the wiki; the skill teaches it how.

Claude Code:

cp -r skills/update-wiki ~/.claude/skills/update-wiki

OpenCode:

cp -r skills/update-wiki ~/.config/opencode/skills/update-wiki

Cursor:

cp -r skills/update-wiki ~/.cursor/skills/update-wiki

Once installed, your AI agent will automatically update affected wiki pages whenever it modifies code that's referenced in the wiki — no manual re-generation needed.

Related

License

MIT