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

nuvanta-context-guard

v0.3.0

Published

A developer tool that identifies relevant project files for AI coding agents

Readme

Nuvanta Context Guard

A developer tool that scans a software project, identifies files relevant to a task, and produces a context report for AI coding agents.

Installation

npm install -g nuvanta-context-guard

Commands

nuvanta scan

Scans a project and returns the most relevant files for a given task within a token budget.

nuvanta scan <path> --task <task> [--budget <tokens>] [--output <format>] [--no-ai]

| Flag | Description | Default | | ---------- | ------------------------------------------- | ------------ | | --task | The task you are working on | (required) | | --budget | Max token budget | 10000 | | --output | Output format: report, json, markdown | report | | --no-ai | Skip Gemini AI scoring | false |

nuvanta init

Generates a nuvanta.config.json in the target directory.

nuvanta init <path>
nuvanta init .

Configuration

Create a nuvanta.config.json at your project root to set defaults. CLI flags always override config values.

{
  "task": "fix login bug",
  "budget": 10000,
  "ignore": ["*.test.ts", "scripts/"],
  "output": "report",
  "ai": true
}

| Field | Type | Description | | -------- | -------- | ------------------------------------------------------ | | task | string | Default task for this project | | budget | number | Default token budget | | ignore | string[] | Additional ignore rules (merged with .nuvantaignore) | | output | string | Default output format | | ai | boolean | Enable or disable Gemini AI scoring |

Examples

Scan with a task:

nuvanta scan ./my-project --task "fix login button"

Scan with a token budget:

nuvanta scan ./my-project --task "fix login button" --budget 5000

Output as JSON (pipe to file or another tool):

nuvanta scan ./my-project --task "fix login button" --output json > context.json

Output as Markdown (paste into AI chat):

nuvanta scan ./my-project --task "fix login button" --output markdown

Skip AI scoring for faster local-only scan:

nuvanta scan ./my-project --task "fix login button" --no-ai

Generate a config file:

nuvanta init ./my-project

Example Output

report (default)

════════════════════════════════════════════════
  Nuvanta Context Guard
════════════════════════════════════════════════
  Task     : fix login button
  Keywords : login, button
  Budget   : 10,000 tokens
────────────────────────────────────────────────
  Scanned  : 24 files
  Relevant : 5 files
  Selected : 4 files
════════════════════════════════════════════════

  src/auth/login.ts
    score   : 2.60
    tokens  : 820
    reason  : filename matches "login" | content contains "login" | AI flagged as relevant (1.00)

  src/components/LoginButton.tsx
    score   : 2.10
    tokens  : 612
    reason  : filename matches "login" | filename matches "button" | AI flagged as relevant (0.90)

────────────────────────────────────────────────
  Tokens used : 1,432 / 10,000
  Remaining   : 8,568
════════════════════════════════════════════════

json

{
  "task": "fix login button",
  "keywords": ["login", "button"],
  "budget": 10000,
  "tokensUsed": 1432,
  "tokensRemaining": 8568,
  "totalFiles": 24,
  "relevantFiles": 5,
  "selectedFiles": [
    {
      "path": "src/auth/login.ts",
      "score": 2.6,
      "tokens": 820,
      "reason": ["filename matches \"login\"", "AI flagged as relevant (1.00)"]
    }
  ]
}

markdown

Renders a formatted report with a summary table and file sections — paste directly into Claude, ChatGPT, or any AI chat.

How It Works

  1. Config — loads nuvanta.config.json from the project root if present; CLI flags override
  2. Scanner — recursively discovers all files, respects .nuvantaignore, skips binaries and build artifacts
  3. Secret Guard — detects hardcoded credentials and excludes those files from context
  4. Relevance Engine — scores each file by filename, directory path, and content against your task keywords
  5. AI Scoring — Gemini re-ranks candidates for deeper relevance judgment (disable with --no-ai)
  6. Budget Selector — picks the highest-scored files that fit within the token limit
  7. Report — outputs in your chosen format with score, token count, and reason per file

Ignoring Files

Create a .nuvantaignore file at your project root to exclude files, directories, or extensions. Supports wildcards.

# directories
private/
infra/

# specific files
config.local.ts

# extensions
.test.ts

# wildcard patterns
*.pem
*.key
.env.*

The ignore field in nuvanta.config.json adds rules on top of .nuvantaignore.

Secret Detection

Files containing hardcoded credentials are automatically skipped and a warning is printed:

[WARN] Skipped (secrets detected): src/config/keys.ts
       Line 3 - API Key (generic): api_key = sk-abc123...

Detected patterns include API keys, passwords, tokens, private key headers, AWS credentials, database URLs, and Bearer tokens.

.env and .env.* files (.env.local, .env.production, etc.) are always excluded regardless of ignore rules.

Requirements

  • Node.js 18+
  • A Gemini API key (for AI scoring) — set GEMINI_API_KEY in your environment or a .env file

License

MIT