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

docs-sentinel

v0.1.1

Published

Keep your AI context docs in sync with source code

Readme

📄 docs-sentinel 🐶

Keep your AI context docs (./docs/) in sync with source code — so AI coding tools always work with accurate, up-to-date context.

banner-docs-sentinel-compressed

docs-sentinel scans the markdown files that AI tools like Claude Code and Cursor rely on for project context, extracts source file references, and warns you when those files change — so your AI docs never silently go stale.

Features

  • Reference extraction — Detects source file paths referenced in your AI docs (backtick-wrapped, bare paths, markdown links)
  • Frontmatter management — Adds YAML frontmatter with status, category, references, and verification date to each doc
  • Staleness detection — Uses git history to flag AI docs whose referenced source files have changed
  • Health audit — Computes a health score (0–100) across your AI docs for CI gating
  • Tool integrations — Plugs directly into Claude Code hooks, Cursor rules, and VS Code tasks
  • Language-agnostic — Works with any codebase (JS/TS, Go, Rust, Python, Ruby, PHP, etc.)

Installation

# pnpm
pnpm add -D docs-sentinel

# npm
npm install -D docs-sentinel

Quick Start

# In your project root (must have a ./docs/ directory with AI context files)
npx docs-sentinel init

# Check which AI docs reference a changed source file
npx docs-sentinel check --file src/auth/auth.service.ts

# Audit the health of your AI docs
npx docs-sentinel audit

Commands

init

Scans your AI docs, adds frontmatter, and configures tool integrations.

npx docs-sentinel init [options]

Options:
  --dry-run          Preview changes without modifying files
  --no-tools         Skip tool integration setup
  --no-frontmatter   Skip frontmatter generation
  --docs-dir <path>  AI docs directory (default: ./docs)

check

Find which AI docs reference a given source file.

npx docs-sentinel check --file <path> [options]

Options:
  --quiet           Only output if there are matches
  --format <fmt>    Output format: terminal, json (default: terminal)

audit

Audit the health of all your AI docs.

npx docs-sentinel audit [options]

Options:
  --format <fmt>    Output format: terminal, json, markdown (default: terminal)
  --no-git          Skip git history, use filesystem timestamps

Exit code 1 if health score < 50 (useful for CI gating).

Configuration

Create .docs-sentinel.json in your project root (auto-created by init):

{
  "docsDir": "./docs",
  "ignore": [],
  "staleThresholdDays": 30,
  "archiveThresholdDays": 90,
  "pathPrefixes": ["src/", "apps/", "libs/"],
  "sourceExtensions": [".ts", ".tsx", ".js"],
  "frontmatterKey": null,
  "maxFileSize": 1048576
}

| Option | Default | Description | |--------|---------|-------------| | docsDir | ./docs | AI docs directory | | ignore | [] | Glob patterns to ignore | | staleThresholdDays | 30 | Days before a doc is considered stale | | archiveThresholdDays | 90 | Days before a completed/deprecated doc is archivable | | pathPrefixes | (auto-detected) | Path prefixes to recognize as source file references | | sourceExtensions | (comprehensive set) | Source file extensions to track | | frontmatterKey | null | Namespace key for frontmatter (e.g. "docs_sentinel") | | maxFileSize | 1048576 | Max file size in bytes (skip larger files) |

Frontmatter namespacing

If your AI docs already use frontmatter, set frontmatterKey to avoid conflicts:

{ "frontmatterKey": "docs_sentinel" }

This nests docs-sentinel fields under a key:

---
title: My Doc
layout: default
docs_sentinel:
  status: active
  references: [src/auth.ts]
  last_verified: 2025-01-15
---

Integrations

Claude Code

init creates a PostToolUse hook that runs check after every Write/Edit operation, surfacing affected AI docs directly in the conversation.

Cursor

init creates .cursor/rules/docs-sentinel.mdc instructing the AI to check doc freshness when editing referenced source files.

VS Code

init adds a "docs-sentinel: audit" task to .vscode/tasks.json.

Programmatic API

import {
  scanDocs,
  checkFile,
  auditDocs,
  extractReferences,
  parseFrontmatter,
} from 'docs-sentinel';

// Scan all AI docs
const docs = await scanDocs('/path/to/project', config);

// Check which AI docs reference a source file
const result = await checkFile('src/auth.ts', '/path/to/project', config);

// Audit AI docs health
const audit = await auditDocs('/path/to/project', config);
console.log(`Health score: ${audit.healthScore}/100`);

License

MIT