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

@context-forge/core

v0.5.1

Published

Core context generation engine for Context Forge — template processing, project state, prompt assembly

Readme

@context-forge/core

The context generation engine that powers Context Forge. Handles template processing, project state management, prompt parsing, section building, and the full context assembly pipeline.

Overview

This package contains the core logic shared by both the MCP server and the Electron desktop app. It has no Electron dependency and can be used by any Node.js consumer.

Key capabilities:

  • Context pipeline — assembles structured context prompts from project configuration, templates, and statements
  • Template processing — variable substitution ({{projectName}}, {{fileSlice}}, {fileArch}, {archIndex}, etc.) with conditional sections and artifact aliases
  • Statement management — loads and resolves default statements (project intro, tool intro, instruction blocks)
  • Prompt parsing — reads prompt.ai-project.system.md files and extracts named template sections
  • Project storage — filesystem-backed CRUD for project configuration with backup and migration support

Export Paths

The package provides two entry points to separate browser-safe code from Node.js-dependent code.

@context-forge/core — Types, interfaces, and browser-safe services

import type { ProjectData, UpdateProjectData } from '@context-forge/core';
import type { IProjectStore, IStorageService } from '@context-forge/core';
import { TemplateProcessor, SectionBuilder } from '@context-forge/core';
import { ContextGenerator, ContextIntegrator } from '@context-forge/core';
import { PROMPT_FILE_RELATIVE_PATH, DEFAULT_STATEMENTS } from '@context-forge/core';

This entry point contains no fs or path dependencies and is safe for browser/renderer contexts.

@context-forge/core/node — Node.js implementations

import { FileProjectStore, FileStorageService } from '@context-forge/core/node';
import { createContextPipeline } from '@context-forge/core/node';
import { StatementManager, SystemPromptParser } from '@context-forge/core/node';
import { ProjectPathService } from '@context-forge/core/node';
import { getStoragePath } from '@context-forge/core/node';

// Artifact introspection
import { ArtifactIntrospector } from '@context-forge/core/node';
import { buildModel, scanDirectory } from '@context-forge/core/node';
import { parseFrontmatter, parseSlicePlan } from '@context-forge/core/node';
import { parseTaskItems, parseTaskFile } from '@context-forge/core/node';
import { parseFutureWork, detectDocuments } from '@context-forge/core/node';
import { FutureWorkCollector } from '@context-forge/core/node';

This entry point includes filesystem-dependent services. Use it in main processes, CLI tools, MCP servers, and tests. Do not import from browser/renderer code.

Key Services

| Service | Entry Point | Description | |---------|-------------|-------------| | FileProjectStore | ./node | Filesystem-backed project CRUD (read, create, update, delete) | | createContextPipeline | ./node | Factory that wires up all services for a project path and returns a ready-to-use ContextIntegrator | | StatementManager | ./node | Loads and parses default-statements.md from a project directory | | SystemPromptParser | ./node | Parses prompt.ai-project.system.md into named template sections | | ProjectPathService | ./node | Resolves file paths relative to a project root (task files, slice designs, guides) | | ContextIntegrator | . | Orchestrates full context generation from a ProjectData object | | TemplateProcessor | . | Handles {{variable}} substitution in template strings, including artifact aliases ({arch}, {plan}, {hld}, {spec}) and index extraction ({archIndex}, {planIndex}) | | SectionBuilder | . | Assembles individual context sections (statements, instructions, tools) | | ArtifactIntrospector | ./node | Parses methodology documents: slice plans, task files, frontmatter, future work, document detection | | buildModel | ./node | Builds a full ProjectModel from a project root path — foundation, initiatives, slices, tasks, future work | | FutureWorkCollector | ./node | Aggregates future work items across all slice plans; groups by initiative; supports status filtering |

Usage in the Monorepo

packages/
  core/         ← this package
  mcp-server/   depends on @context-forge/core (workspace:*)
  electron/     depends on @context-forge/core (workspace:*)

Both the MCP server and Electron app import types from @context-forge/core and Node.js services from @context-forge/core/node. The Electron renderer uses only the browser-safe entry point, with IPC bridges to access Node.js services from the main process.

License

MIT