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

@benchcutlogic/repo-checks

v0.2.2

Published

Typed repository contract, boundary, token, web SEO, and prose checks via the bench-check CLI.

Downloads

1,514

Readme

@benchcutlogic/repo-checks

Static checks for a repository's docs, agent instructions, lockfiles, Effect boundaries, Svelte theme tokens, Storybook catalog, built website output, and prose. Run them with the bench-check CLI or call them from code.

Install

npm install --save-dev @benchcutlogic/repo-checks

Requirements

  • Node.js 20.19 or later. The package is ESM; CommonJS callers can require() it on Node versions that support require(esm) (20.19+, 22.12+).
  • git on PATH (optional). Inside a git work tree the checks read the files git ls-files reports, so git-ignored paths are skipped. Without git, or outside a work tree, they walk the directory.
  • bash on PATH for the snippets part of the web check, which runs bash -n on shell code blocks.

CLI

npx bench-check run
npx bench-check doc-paths --root .
npx bench-check agent-contracts --json
npx bench-check web --build-dir build
npx bench-check prose --strict
npx bench-check --version

run runs the checks listed in checks in bench-check.json, or the core checks below when there is no config file. Any check name runs that check alone.

| Option | Meaning | | ------------------- | -------------------------------------------------------------------------- | | --root <dir> | Repository root to check. Defaults to the current directory. | | --json | Print the full RunSummary as JSON instead of text. | | --strict | Report warnings (AGENTS.md size warning, prose phrase warnings) as errors. | | --build-dir <dir> | Built site directory for web. Overrides web.buildDir. | | --version, -v | Print the installed package version. | | --help, -h | Print usage. |

Exit codes: 0 when no check reports an error, 1 when at least one does, 2 for a usage or configuration error (unknown command, missing root, invalid bench-check.json).

Checks

Core checks (run by run when no config file selects others):

| Check | What it reports | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | doc-paths | Relative markdown links and backticked file paths in docs that do not exist on disk. | | agent-contracts | .agents/skills/*/SKILL.md frontmatter, parity between the AGENTS.md skills table and .agents/skills/, unknown ast-grep rule IDs, Effect v3 API names in an Effect v4 repo, and missing scripts or paths under a "Repo facts" heading. | | agents-budget | AGENTS.md above the byte budget, and a missing or mismatched CLAUDE.md or .claude/skills. | | lockfile-registry | pnpm-lock.yaml or package-lock.json entries that point at localhost, loopback, private LAN, *.ts.net, .local, .lan or .internal hosts. | | unique-error-tags | Schema.TaggedError or Data.TaggedError tags declared twice, and the same inline pgEnum tuple declared in two files. | | effect-boundaries | Platform imports inside configured pure packages, and Effect.run* calls outside configured runtime entry points. | | svelte-tokens | Raw Tailwind palette classes, bg-white/bg-black/text-white/text-black, hex colors in .svelte files, 50vw/100vw, and bg-destructive* paired with text-foreground. | | storybook-catalog | Stories missing from a catalog file and catalog entries with no story, or duplicate story names in one directory when there is no catalog. |

Opt-in checks (list them in checks or run them by name):

| Check | What it reports | | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | web | In a built site, or a live site when web.baseUrl is set: sitemap shape and https locations, favicon.ico bytes, <text> in favicon.svg, title and description length, https og:image and canonical URLs, JSON-LD shape, and shell snippets that fail bash -n. | | prose | Frontmatter title, description and tag limits, code fences without a language, configured banned terms, and stock filler phrases (warnings unless --strict or prose.slopMode is error). |

A line containing bench-check-ignore: svelte-tokens is skipped by svelte-tokens.

Configuration

Put an optional bench-check.json at the repository root. Every key is optional; omitted keys keep the defaults shown here.

{
	"checks": ["doc-paths", "agents-budget", "lockfile-registry", "web"],
	"files": {
		"exclude": ["vendor/**"],
		"respectGitignore": true
	},
	"docPaths": {
		"files": [
			"AGENTS.md",
			"CLAUDE.md",
			"README.md",
			"CONTRIBUTING.md",
			".agents/skills/*/SKILL.md"
		],
		"ignorePaths": []
	},
	"agentContracts": { "knownRuleIds": [] },
	"agentsBudget": { "warnBytes": 18000, "maxBytes": 20000 },
	"effectBoundaries": {
		"purePackages": ["packages/core"],
		"forbiddenImports": [
			"cloudflare:",
			"alchemy",
			"better-auth",
			"node:fs",
			"node:http",
			"node:https",
			"apps/"
		]
	},
	"svelteTokens": {
		"globs": ["**/*.svelte", "apps/*/src/**/*.css", "packages/ui/src/**/*.svelte"],
		"ignores": ["**/*.stories.svelte", "**/app.css", "**/tokens.css", "**/theme.css"]
	},
	"storybook": { "catalogFile": ".storybook/catalog.json" },
	"web": {
		"buildDir": "build",
		"checks": ["sitemap", "favicon", "meta-jsonld", "snippets"],
		"unpublishedPackages": [],
		"titleMax": 60,
		"descriptionMax": 160
	},
	"prose": {
		"globs": ["docs/**/*.md"],
		"allowedTags": ["engineering", "release"],
		"bannedTerms": [{ "pattern": "\\bOldName\\b", "reason": "Renamed to NewName." }],
		"slopMode": "warn"
	}
}

Notes on the less obvious keys:

  • files.exclude removes matching paths from every check, including the fixed paths some checks read directly (AGENTS.md, CLAUDE.md, .agents/skills, .claude/skills and lockfiles). Excluding a directory, with or without /**, excludes everything in it. An excluded skill is not checked, but a skills-table entry that names it still counts as existing. Inputs a check reads to know what to check, such as package.json, sgpack.json, ast-grep/rules, a configured Storybook catalog and built web output, are always read. files.respectGitignore: false reads git-ignored files too.
  • agentContracts.knownRuleIds adds rule IDs to the ones the check already accepts: the IDs shipped by @benchcutlogic/sgpack-packs, the id of every rule in ast-grep/rules/*.yml, and the keys of overrides in sgpack.json. agentContracts.effectV4 forces the Effect v4 check on or off instead of reading effect versions from package.json files.
  • effectBoundaries.allowedRuntimeEntries lists globs where Effect.run* is allowed. The default allows runtime.ts, client-runtime.ts, worker.ts, cli.ts, main.ts, hooks.server.ts, tests, and scripts/.
  • storybook.catalogFile is a JSON array of story paths, { "stories": [...] }, { "visualEntries": [...], "excluded": [...] }, or a TS/JS file that names the story files. Without it, the check looks for .storybook/catalog.json, storybook-catalog.json and stories-catalog.json.
  • web.buildDir defaults to the first of apps/web/build, build and dist that exists. web.baseUrl checks a live site over HTTP instead of a build directory. web.snippetFiles lists the markdown files whose shell blocks are checked. web.unpublishedPackages names packages that must not appear in npx <name> snippets.

API

@benchcutlogic/repo-checks

import { formatSummaryText, runChecks } from '@benchcutlogic/repo-checks';

const summary = await runChecks({ root: process.cwd(), checks: ['doc-paths', 'agents-budget'] });
console.log(formatSummaryText(summary));
process.exitCode = summary.passed ? 0 : 1;

runChecks(options) resolves to a RunSummary with results, a flat findings list, errorCount, warningCount and passed. Options:

  • root (required): repository root.
  • checks: check names to run. Defaults to checks from the config.
  • config: a ResolvedBenchCheckConfig. Defaults to loadConfig(root).
  • strict, buildDir: same as the CLI flags.
  • fetchFn: a fetch-like function for web.baseUrl requests, for tests or custom HTTP clients.

The package also exports loadConfig, DEFAULT_CONFIG, CORE_CHECKS, ALL_CHECKS, runSingleCheck, one function per check (checkDocPaths, checkWeb, and so on), and the types BenchCheckConfig, ResolvedBenchCheckConfig, CheckName, Finding, CheckResult, RunSummary and FetchLike.

@benchcutlogic/repo-checks/cli

import { runCli } from '@benchcutlogic/repo-checks/cli';

const code = await runCli(['doc-paths', '--root', '.', '--json'], {
	stdout: (text) => console.log(text),
	stderr: (text) => console.error(text)
});
process.exitCode = code;

runCli(argv, io?) runs the CLI in process and resolves to its exit code. Importing this module does not start the CLI. It also exports parseCliArgs and packageVersion.

License

Apache-2.0. See LICENSE.