api-audit

Audits public API surfaces for type safety, encapsulation, and naming coherence.

10|2|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/nrdxp/predicate --skill api-audit-nrdxp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-audit
Source: https://github.com/nrdxp/predicate/tree/main/skills/api-audit
Command: npx skills add https://github.com/nrdxp/predicate --skill api-audit-nrdxp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Reviewing a large codebase's public API surface for design flaws is error-prone when done ad hoc, and agents lose coherence over long reviews. This protocol structures the audit into phased, checkpointed passes so every exported type, function, and trait is evaluated against consistent quality dimensions with human approval at each stage. ## Core Features & Use Cases - Surface Discovery: Enumerates all exported types, functions, constants, re-exports, and traits into a structured surface map before any analysis begins. - Six-Dimension Component Audit: Rates each component on minimal surface, type safety, composability, monosemicity, naming, and error handling with PASS/WARN/FAIL grades and remediation patterns. - Language-Specific Checklists: Provides dedicated audit checklists for Rust, Go, TypeScript, and Python covering idioms like newtypes, discriminated unions, and error wrapping. - Use Case: Before shipping a library, run the audit to produce a prioritized P0-P3 remediation plan identifying type safety gaps, redundant methods, and inconsistent naming across modules. ## Quick Start Ask the agent to run an API coherence audit on your repository's public modules and present the surface map for approval.

Frequently Asked Questions about api-audit

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

FAQPage Schema
How do I audit a public API surface for design quality?

Start by enumerating all exported types, functions, and traits into a surface map, then rate each component against dimensions like minimal surface, type safety, and naming. This protocol structures that process into phases with human checkpoints between components.

What makes an API type-safe and well-designed?

A well-designed API uses newtypes instead of raw primitives, exhaustive enums over magic strings, and Result/Option instead of null returns. It hides implementation details, offers one canonical path per concern, and makes invalid states unrepresentable at compile time.

Does this API audit support Rust, Go, TypeScript, and Python?

Yes, the protocol includes language-specific checklists for all four. Rust checks cover non_exhaustive enums and unwrap usage, Go covers error wrapping and zero values, TypeScript covers strict mode and branded types, and Python covers type hints and dataclasses.

When should I run an API coherence audit?

Run it before publishing a library, during major refactors, or when no deterministic test can verify API design correctness. It suits cases where human judgment about elegance, naming, and composability is required rather than automated linting.

What are the limitations of a manual API audit protocol?

The audit depends on iterative human checkpoints and does not modify code itself; it only produces findings and a remediation plan. Large codebases require multiple sessions since components are reviewed one at a time to maintain reviewer coherence.