Engineering API Design Code Review

API Review Checklist Prompt

Architecture review for the public surface: abstractions that earn their place, dependency direction, seams, and the patterns the codebase already has.

Overview

An API surface is a promise — every exposed type and method is something callers will depend on and you will maintain. This setup reviews a client SDK's public surface under the architecture focus: layer violations, responsibilities in the right modules, abstractions earned by real variation rather than speculation, dependency direction from volatile toward stable, interface seams for testing, and consistency with the codebase's established patterns — with the TypeScript pack watching for any-leaks and assertion-hidden errors at the boundary.

How to use this resource

  1. Review the surface, not the internals

    Paste the public types and signatures — the architecture focus judges what callers see and depend on.

  2. Challenge every abstraction

    "Earned by real variation, or speculative generality?" — the question that shrinks APIs before they ship.

  3. Hold new code to the old patterns

    Consistency findings matter most at the surface: callers learn the API's patterns once and expect them everywhere.

Why This Works

  • Architecture focus reviews position and responsibility, which surface-level style review misses
  • The earned-abstraction test prevents the speculative generality that bloats public APIs
  • Pattern-consistency checks protect the API's learnability — its real usability metric

Best for

  • Client SDKs and shared libraries with real consumers
  • Public surfaces about to be frozen by semver
  • Teams whose API grew endpoint by endpoint without a review

Not for

  • Writing the API documentation — that's the Markdown Output Builder's api-documentation setup
  • Reviewing endpoint performance — switch focus to Performance

Use cases

  • Reviewing an SDK's public surface before the first external release
  • Catching speculative abstractions before they become permanent API
  • Checking that new endpoints follow the API's established patterns

FAQ

What does the API review checklist produce?

It reviews the public API surface for architectural soundness and returns findings only — layer violations, unearned abstractions, wrong dependency direction, missing interface seams, pattern breaks, and TypeScript any-leaks or unsafe assertions. Each finding is tagged [CRITICAL], [MAJOR], [MINOR], or [NIT] with the exact line or symbol, grouped critical-first, and it ends in a verdict: APPROVED, APPROVED WITH COMMENTS, or CHANGES REQUIRED.

How do I use this API review checklist with my code?

Paste the TypeScript file's public surface — the exported types and signatures callers depend on — and run the prompt in your own AI tool. It works through the fourteen checklist items but reports only the ones that fail, judging where the code sits in the system rather than rewriting it. Because it reviews only, you decide which findings to act on before you freeze the surface.

Does this replace a security review or a performance test?

No — its focus is architecture: position, responsibility, earned abstractions, and pattern consistency on the public surface. It doesn't run your code, load-test endpoints, or do a dedicated security audit; performance is a separate review you run by switching the focus. Treat the findings and the APPROVED / CHANGES REQUIRED verdict as a structured architecture read, not a guarantee the API is secure or fast.

More resources from Code Review Prompt Generator

Resources that pair well

Related tools

Projects that use this resource

Workflows that use this resource

Tip: Save time by exploring related resources and tools that integrate with this resource.