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

@pissmaa/contextforge

v0.1.6

Published

Headless Context Graph Engine for AI coding agents. Never let your AI forget your architecture again.

Readme

ContextForge 🚀

Give your AI coding agent architectural memory.

ContextForge builds a living knowledge graph of your full-stack application so AI agents can understand your architecture before they modify your code.


Why ContextForge?

Modern AI coding agents are excellent at generating code.

They are not good at understanding your application's architecture.

Imagine asking an AI to rename a Prisma model, modify an Express route, or refactor a React component.

Without understanding the relationships between your frontend, backend, and database, the AI may unknowingly break dozens of files.

ContextForge solves this problem by creating a living architectural knowledge graph of your project.

Instead of guessing, your AI agent can query the graph to understand exactly what depends on what before making any changes.


What ContextForge Does

ContextForge analyzes your project and builds a local graph containing relationships between every major part of your application.

React Component
      │
      │ calls_api
      ▼
Express Route
      │
      │ depends_on
      ▼
Prisma Model

Your AI agent can then ask questions like:

  • What components call this API?
  • Which routes depend on this model?
  • What will break if this field changes?
  • What files are affected by this refactor?
  • Which parts of the application depend on this database table?

Instead of searching hundreds of files, the AI receives a precise dependency graph in milliseconds.


Features

Prisma Schema Parser

  • Parses models
  • Parses fields
  • Parses enums
  • Detects one-to-one, one-to-many and many-to-many relationships

Express Route Parser

  • Detects API endpoints
  • Maps routes to business logic
  • Connects routes to database models

React Parser

  • Parses React components
  • Detects Axios requests
  • Detects custom Axios instances
  • Maps frontend requests to backend routes

Knowledge Graph Engine

  • Local SQLite database
  • Stores Nodes and Relationships
  • Extremely fast graph lookups
  • No cloud dependency

REST Query API

Query your architecture using HTTP.

Perfect for:

  • Claude Code
  • Cursor
  • Cline
  • Roo Code
  • OpenHands
  • Codex
  • Gemini CLI
  • Any AI coding agent

Why Not RAG?

Traditional RAG systems index files.

ContextForge indexes architecture.

| Capability | Traditional RAG | ContextForge | | ------------------------ | --------------- | ------------ | | Search source code | ✅ | ✅ | | Understand relationships | ❌ | ✅ | | Dependency analysis | ❌ | ✅ | | Architecture awareness | ❌ | ✅ | | Local knowledge graph | ❌ | ✅ | | AI agent integration | ⚠️ | ✅ |

ContextForge doesn't replace RAG.

It complements it.

Use RAG to retrieve code.

Use ContextForge to understand architecture.


Installation

Install globally:

npm install -g @pissmaa/contextforge

Or install inside your project:

npm install @pissmaa/contextforge

Quick Start

1. Build the Knowledge Graph

contextforge extract \
  --schema ./apps/api/prisma/schema.prisma \
  --app ./apps/api/src/app.ts \
  --frontend ./apps/web/src

Output:

Scanning Prisma schema...
✓ 12 models
✓ 26 relationships

Scanning Express...
✓ 41 routes

Scanning React...
✓ 83 components
✓ 56 API calls

Building Knowledge Graph...
✓ 218 nodes
✓ 347 edges

Saved to:

contextforge.db

2. Start the Query Engine

contextforge serve

Output:

ContextForge Query Engine

Database:
./contextforge.db

Listening on:

http://localhost:4001

3. Query the Graph

List every node:

curl http://localhost:4001/api/nodes

Get complete dependency context:

curl "http://localhost:4001/api/context?node_id=prisma:model:User"

Example response:

{
  "target_node": {
    "id": "prisma:model:User",
    "type": "PrismaModel",
    "name": "User"
  },
  "dependencies": [],
  "dependents": [
    {
      "id": "api:route:GET:/me",
      "relation": "depends_on"
    },
    {
      "id": "react:component:AuthProvider",
      "relation": "calls_api"
    }
  ]
}

AI Agent Integration

Before modifying code, instruct your AI agent to query ContextForge.

Example workflow:

User

↓

Rename User.id

↓

AI Agent

↓

Query ContextForge

↓

Analyze Dependencies

↓

Generate Impact Report

↓

Safely Modify Code

↓

Done

Example prompt for your AI agent:

# ContextForge Agent Protocol

You have access to ContextForge.

Never guess architectural relationships.

Whenever you modify:

- Prisma models
- Database schema
- API routes
- React components

Always:

1. Identify the target node.
2. Query ContextForge.
3. Analyze dependencies.
4. Produce an impact report.
5. Modify every affected file.

Never skip dependency analysis.

CLI Reference

Extract

contextforge extract

| Option | Description | Default | | ------------ | ---------------------- | ------------------- | | --schema | Prisma schema | ./schema.prisma | | --app | Express entry file | ./app.ts | | --frontend | React source directory | — | | --db | SQLite database | ./contextforge.db |


Serve

contextforge serve

| Option | Description | Default | | -------- | ---------------- | ------------------- | | --port | HTTP server port | 4001 | | --db | SQLite database | ./contextforge.db |


Architecture

                 Your Project

        Prisma      Express      React
           │            │           │
           └──────┬─────┴───────────┘
                  │
                  ▼
        contextforge extract
                  │
                  ▼
          SQLite Knowledge Graph
                  │
                  ▼
          contextforge serve
                  │
        REST Query Engine
                  │
                  ▼
          AI Coding Agent

Roadmap

Core Engine

  • [x] Prisma parser
  • [x] Express parser
  • [x] React parser
  • [x] Axios request mapping
  • [x] SQLite knowledge graph
  • [x] REST query engine

Next Releases

  • [ ] TypeScript interface extraction
  • [ ] Next.js App Router support
  • [ ] NestJS support
  • [ ] Fastify support
  • [ ] Drizzle ORM support
  • [ ] OpenAPI / Swagger importer
  • [ ] GraphQL resolver extraction
  • [ ] File watcher mode
  • [ ] Incremental graph updates
  • [ ] Model Context Protocol (MCP) server
  • [ ] VS Code extension
  • [ ] Dependency visualization UI

Contributing

Contributions are welcome.

Whether you're fixing bugs, improving parsers, adding framework support, or enhancing AI integrations, every contribution helps make ContextForge a better architectural companion for AI-assisted development.


License

MIT License


ContextForge gives AI coding agents something they never had before: architectural memory.

Build once. Query forever.