auditing-api-surface

Identifies and classifies unused package exports by severity for a GitHub repo.

125|42|Updated May 19, 2025
One-click install
npx skills add https://github.com/SocketDev/socket-mcp --skill auditing-api-surface
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: auditing-api-surface
Source: https://github.com/SocketDev/socket-mcp/tree/main/.claude/skills/fleet/auditing-api-surface
Command: npx skills add https://github.com/SocketDev/socket-mcp --skill auditing-api-surface

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Audits a library's published export surface to identify dead or unconsumed subpaths. For each package.json#exports subpath, it checks whether any other fleet repo imports it and whether the lib's own src/ references it, then classifies every subpath (dead / single-consumer / internal-only / consumed) into a ranked report. Read-only — reports prune candidates, never deletes. Use weekly (the audit-api-surface.lock.yml gh-aw cron drives it), before a major version bump, or when trimming bundle size on an infra lib.

Core Features & Use Cases

  • Cross-repo export surface auditing across fleet libraries to surface dead exports.
  • Classifies subpaths into dead, single-consumer, internal-only, or consumed with a concise report.
  • Read-only workflow designed for governance, version-bump planning, and bundle trimming.

Quick Start

Run the audit-api-surface tool on your repository to generate a ranked report of dead, single-consumer, internal-only, and consumed exports.

Frequently Asked Questions about auditing-api-surface

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find dead or unused exports in a library's package.json?▼

To find dead exports in a package.json, analyze the exports map and cross-reference internal src usage and external consumers. This classifies subpaths as dead, single-consumer, internal-only, or consumed for governance and pruning.

What is the best way to audit API surface area across multiple repositories?▼

Auditing API surface area across repositories requires cross-referencing each package.json exports entry with internal src usage and external consumers. This produces a ranked report classifying subpaths to identify prune candidates across the fleet.

When should I audit my library's export surface for dead code?▼

You should audit your library's export surface before a major version bump, when trimming bundle size on an infra lib, or weekly via cron. Regular reporting identifies unconsumed subpaths suitable for pruning decisions.

Can I automatically delete dead exports found during an API surface audit?▼

No, the API surface audit is a read-only workflow designed for governance. It generates a ranked report of dead, single-consumer, internal-only, and consumed exports to inform manual pruning decisions, but never deletes code.

Does the export surface audit work with monorepos or fleet repositories?▼

Yes, the export surface audit is designed to work across fleet repositories. It analyzes each package.json exports entry and cross-references internal src usage and external consumers across the fleet to classify subpaths.