check-library-build

check-library-build is a command for Claude Code from TheBeardedBearSAS/claude-craft. It costs 18 tokens per session (1,371 once invoked), scanned A, original, MIT.

A build audit for a Vite library, checking its generated JavaScript files, TypeScript declaration files, and package metadata. Vite is a tool for building frontend projects, while a library is code intended for other projects to install and use.

In plain words
What is it for?
Use it to inspect library configuration, build output, public types, external dependencies, and support for both ESM and CommonJS consumers.
Why use it?
It catches packaging mistakes that can make a published library fail for JavaScript or TypeScript users.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

Part of the claude-craft plugin — 58 skills, 96 commands, 58 agents, 5 hooks shipped together

Good fit Use it to inspect library configuration, build output, public types, external dependencies, and support for both ESM and CommonJS consumers.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/thebeardedbearsas/claude-craft/check-library-build
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craft

Made for: Claude Code.

Or install claude-craft, the plugin that ships this one along with the rest of its 58 skills, 96 commands, 58 agents, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for check-library-build

README.md
[![agentmods](https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/check-library-build/github.svg)](https://agentmods.dev/commands/thebeardedbearsas/claude-craft/check-library-build)
Your own site
<a href="https://agentmods.dev/commands/thebeardedbearsas/claude-craft/check-library-build"><img src="https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/check-library-build/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for check-library-build

Your own site · 80×15
<a href="https://agentmods.dev/commands/thebeardedbearsas/claude-craft/check-library-build"><img src="https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/check-library-build.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,371 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.01371
Opus 5.5 $0.00007 $0.00548
Sonnet 5.5 $0.00004 $0.00274
Haiku 4.5 $0.00002 $0.00137

Measured 1mo ago against content hash d8432fc94f47, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

check-library-build scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/vite/check-library-build.md · 167 lines

How it starts

The opening of the file, as written. The whole thing — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Vite Library Build Audit

You are an expert in Vite library authoring. Validate that a library project's build.lib configuration and vite-plugin-dts output are correct and consumable.

This command is specific to the library shape (Shape 2 in 02-architecture-vite.md). For app/MPA/worker shapes, use check-architecture.md instead.

MISSION

Confirm the library builds to ES + CJS + .d.ts, peer dependencies are correctly externalized, and the published package is actually importable by a consumer under both module systems.

Plan Mode

Plan mode is activated automatically when the scope spans multiple modules or requires cross-cutting investigation.

AUDIT AREAS

1. build.lib Configuration

[ ] build.lib.entry points to the single public entry (src/index.ts)
[ ] build.lib.formats includes both 'es' and 'cjs' (unless the library is genuinely ESM-only by design)
[ ] build.lib.fileName produces predictable, versioned-free output names
[ ] build.lib.name set if a 'umd'/'iife' global build is also required

2. vite-plugin-dts Configuration

[ ] vite-plugin-dts included in the plugins array
[ ] rollupTypes: true (or equivalent) used to roll up declarations into a single .d.ts, avoiding leaked internal type paths
[ ] tsconfigPath points at the correct tsconfig (declaration-friendly settings)
[ ] Generated dist/*.d.ts actually matches the runtime public API (no stale/missing exports)

3. Dependency Externalization

[ ] Every peer dependency appears in BOTH package.json "peerDependencies" AND build.rolldownOptions.external
[ ] No peer dependency's code is present in the built dist/ bundle (verify by inspecting dist/ output or the bundle-visualizer report)
[ ] Regular (non-peer) dependencies are intentionally bundled, not accidentally externalized

4. package.json Exports Map

[ ] "type": "module" set (or intentionally omitted for a CJS-first library)
[ ] "exports" maps both "import" and "require" conditions to the correct files
[ ] "main"/"module"/"types" fields kept in sync with "exports" for older tooling
[ ] "files": ["dist"] restricts the published tarball to build output only
[ ] "sideEffects": false set, unless specific modules have genuine side effects (then list them explicitly)

Read the full file on GitHub · 167 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +26 lines scan B → A d8432fc94f47
  2. 1mo ago Changed 88f754f999a7
  3. 3mo ago First seen · 141 lines · 18 tokens per session scan B 2dccedd713cf

Subscribe to this mod's changes

check-library-build is a command published in the GitHub repository TheBeardedBearSAS/claude-craft (108 stars, last pushed 19d ago), licensed MIT. It adds 18 tokens to every session and 1,371 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

check-library-build compared with commands from other repositories

check-library-build next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
check-library-buildTheBeardedBearSAS/claude-craftCommand10819d agoMITA18Claude Code
checklistgithub/spec-kitCommand154kyesterdayMITA13Claude Code
clarifygithub/spec-kitCommand154kyesterdayMITA27Claude Code
specifygithub/spec-kitCommand154kyesterdayMITA13Claude Code
analyzegithub/spec-kitCommand154kyesterdayMITA26Claude Code
convergegithub/spec-kitCommand154kyesterdayMITA35Claude Code
implementgithub/spec-kitCommand154kyesterdayMITA14Claude Code