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

@razroo/iso-context

v0.1.0

Published

Deterministic context bundle planning for AI-agent workflows: select files, estimate tokens, check budgets, and render prompt context without model calls.

Downloads

573

Readme

@razroo/iso-context

Deterministic context bundles for AI-agent workflows.

Agents often burn tokens because the question "which files should this role load?" lives in prose. iso-context moves context selection into local JSON policy: resolve bundle inheritance, read the declared files, estimate tokens, check per-file and per-bundle budgets, and render a compact context pack without model calls.

It is local-only, dependency-free, and MCP-free. Use it for mode runbooks, reference files, project facts, or any other context set where "load only these files for this task" should be executable policy instead of repeated prompt instructions.

Install

npm install -D @razroo/iso-context

CLI

iso-context list --policy context.json
iso-context explain apply --policy context.json

iso-context plan apply \
  --policy context.json \
  --root /path/to/project

iso-context check apply \
  --policy context.json \
  --root /path/to/project \
  --budget 12000

iso-context render apply \
  --policy context.json \
  --root /path/to/project \
  --target markdown

Every command accepts --json for machine-readable output.

Policy Shape

{
  "defaults": {
    "tokenBudget": 9000,
    "charsPerToken": 4
  },
  "bundles": [
    {
      "name": "base",
      "description": "Always-loaded workflow contract.",
      "files": [
        { "path": "iso/instructions.md", "maxTokens": 3500 }
      ]
    },
    {
      "name": "apply",
      "extends": "base",
      "description": "Application form-fill context.",
      "tokenBudget": 12000,
      "files": [
        "modes/apply.md",
        "modes/reference-geometra.md",
        { "path": "modes/reference-portals.md", "required": false }
      ]
    }
  ]
}

Accepted top-level input can be { "bundles": [...] }, an array of bundles, or one bundle object.

Semantics

  • extends supports one parent or an array of parents.
  • Parent files and notes are inherited before child values.
  • Re-declaring the same file path in a child overrides scalar file fields while preserving the original file order.
  • required defaults to true; missing optional files do not fail checks.
  • tokenBudget may be set globally or per bundle.
  • maxTokens may be set per file.
  • Token estimates are deterministic and local: ceil(characters / charsPerToken), with charsPerToken defaulting to 4.

Library API

import {
  loadContextPolicy,
  planContext,
  renderContextPlan,
} from "@razroo/iso-context";

const policy = loadContextPolicy(JSON.parse(rawPolicy));
const plan = planContext(policy, "apply", {
  root: process.cwd(),
  includeContent: true,
});

if (!plan.ok) process.exit(1);
console.log(renderContextPlan(plan, "markdown"));

Fit With The iso Stack

  • iso-context defines which files should enter context for a task.
  • isolint makes the prose inside those files safer for smaller models.
  • iso-harness emits the harness files where those contexts are referenced.
  • iso-route defines which model a role should use.
  • iso-capabilities defines what a role may do.
  • iso-contract defines artifact shape.
  • iso-ledger records domain events about those artifacts.
  • iso-guard audits whether the actual run obeyed policy.

For JobForge, context bundles can represent the difference between apply, scan, batch, and tracker mode loads without repeatedly telling every agent to remember the full context-loading matrix.