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

contextforge-cli-harshil

v1.0.0

Published

Automatically scan a repository and generate AI-ready project context in context.md

Readme

⚡ ContextForge

Automatic AI memory generation for repositories.

Run one command → automatically generate reusable AI-ready project context.


What It Does

ContextForge scans your repository, analyzes its architecture and stack, and generates a context.md file that you can paste into any AI assistant (ChatGPT, Claude, Gemini, Cursor, etc.) to give it deep, accurate knowledge of your codebase — instantly.

No backend. No cloud. No magic. Just fast, local analysis.


Installation

npm install -g contextforge

Usage

1. Add your OpenAI API key

Create a .env file in your project root (the repo you want to analyze):

OPENAI_API_KEY=sk-your-api-key-here

2. Run ContextForge

contextforge init

That's it. ContextForge will:

  1. 🔍 Scan your repository (using fast-glob + .gitignore rules)
  2. 🧠 Analyze your architecture, stack, patterns, and auth
  3. 📁 Identify important files with heuristic scoring
  4. Generate AI-ready context using GPT-4o-mini
  5. 📝 Write context.md to your project root

CLI Options

contextforge init [options]

Options:
  -o, --output <path>   Output file path (default: "context.md")
  --model <model>       OpenAI model to use (default: "gpt-4o-mini")
  --no-ai               Skip OpenAI, generate structural context only
  -v, --version         Output the current version
  -h, --help            Display help

Examples

# Standard usage
contextforge init

# Use a more powerful model
contextforge init --model gpt-4o

# Offline / no API key — structural context only
contextforge init --no-ai

# Custom output path
contextforge init --output docs/ai-context.md

Output Format

# Project Context

> Express.js REST API with Prisma ORM and JWT authentication.

## Stack
- Express.js
- Node.js
- Prisma ORM
- JWT (jsonwebtoken)
- Zod

## Architecture
- Route-based API structure
- MVC / Controller pattern
- Service layer pattern
- Middleware-based request handling

## Important Modules
### `src/`
- `src/app.js`
- `src/routes/`
- `src/controllers/`
- `src/services/`
- `src/middleware/auth.js`

## Coding Patterns
- async/await pattern
- ES Modules (import/export)
- try/catch error handling
- Schema validation (Zod)

## AI Instructions
- This is a JavaScript project using ES Modules
- Backend: Express.js — follow route/controller/service layering
- Database: Prisma ORM — use existing query patterns
- Auth: JWT — never bypass the auth middleware
- Validate all inputs with Zod schemas
- Use async/await for all async operations

How File Importance Is Scored

ContextForge uses lightweight heuristic scoring — no embeddings, no vectors:

| Signal | Score | |---|---| | Filename matches known important files | +10 | | Directory matches (auth, routes, services, etc.) | +7 | | Filename contains keywords (auth, route, controller...) | +5 | | Content patterns (router.get, prisma., jwt.sign...) | +2 each | | File extension (JS/TS > JSON/YAML > MD) | +1–3 |


Architecture Detection

ContextForge detects:

  • Frameworks: Express, Fastify, NestJS, Next.js, React, Vue, Svelte, Astro, Remix...
  • Databases: Prisma, Mongoose, TypeORM, Drizzle, Sequelize, PostgreSQL, MySQL, Redis...
  • Auth: JWT, Passport.js, NextAuth, Clerk, Supabase, Firebase, bcrypt...
  • State: Zustand, Jotai, Redux Toolkit, TanStack Query, SWR...
  • Validation: Zod, Joi, Yup, class-validator...
  • Testing: Jest, Vitest, Playwright, Cypress...
  • Patterns: Service layer, Repository, MVC, Middleware, RBAC, File-system routing...

Privacy

Everything runs locally on your machine. Your code is only sent to OpenAI when AI generation is enabled (the default). Use --no-ai to keep everything fully local.


Requirements

  • Node.js ≥ 18
  • OpenAI API key (optional with --no-ai)

License

MIT