Skill Detail

NPM Package API Surface Extractor

Extracts and documents public API surfaces from NPM packages using TypeScript Compiler API (ts.createProgram) and API Extractor from @microsoft/api-extractor. Generates .api.md report files and .d.ts rollups.

Library & API ReferenceClaude Code
Library & API Reference Claude Code Security Reviewed
โฌ‡ 17.1M/wk npm
INSTALL WITH ANY AGENT
npx skills add agentskillexchange/skills --skill npm-package-api-surface-extractor Copy
Works best when you want a reusable capability, not another fragile one-off prompt.
At a glance
Tools required
Node.js, TypeScript
Install & setup
npm install -D @microsoft/api-extractor
Author
Microsoft
Last updated
Mar 20, 2026
Quick brief

The NPM Package API Surface Extractor skill automates the extraction and documentation of public API surfaces from TypeScript and JavaScript NPM packages. It leverages the TypeScript Compiler API (ts.createProgram, ts.createSourceFile) for AST analysis and Microsoft API Extractor (@microsoft/api-extractor) for generating standardized API reports.

How it works

What this skill actually does

The skill parses package entry points defined in package.json exports, main, module, and types fields to identify all public API surfaces. Using the TypeScript type checker (ts.TypeChecker), it resolves exported types, interfaces, classes, functions, and constants with their full type signatures, JSDoc comments, and deprecation notices.

API Extractor integration produces three key outputs: .api.md files for human-readable API documentation, .d.ts rollup files that bundle all public type declarations, and .api.json files for programmatic API analysis. The skill detects breaking changes by comparing API reports across versions, categorizing changes as major (removed exports, changed signatures), minor (new exports), or patch (documentation updates). It also generates compatibility matrices showing which API features are available across package version ranges.