frontend-api-connector

Generate typed API clients connecting Next.js App Router pages to backend endpoints with loading and error states.

37|5|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/BellaBe/lean-os --skill frontend-api-connector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-api-connector
Source: https://github.com/BellaBe/lean-os/tree/main/.claude/skills/engineering-frontend-api-connector
Command: npx skills add https://github.com/BellaBe/lean-os --skill frontend-api-connector

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables type-safe data fetching for frontend pages by generating API client code and wiring server/client components.

Core Features & Use Cases

  • Type-safe API client: Generate TS types and client wrappers.
  • Server/Client Integration: Connect server components to API data with loading/error states.
  • Example: Fetch metrics data from /api/metrics and render on a dashboard.

Quick Start

Provide API specification artifacts/backend/api-spec.yaml and connect pages as shown in the examples.

Frequently Asked Questions about frontend-api-connector

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

FAQPage Schema
How do I connect a Next.js frontend to a backend API with type safety?

Type-safe API connection generates TypeScript types and client wrappers from your API specification, then wires them into Next.js server and client components. Provide an API spec (e.g., api-spec.yaml), set up your API client, and the Skill handles data fetching with loading and error states for protected endpoints.

Can I use Next.js App Router pages with server components to fetch API data?

Yes. The Skill connects App Router pages to APIs by default through server components, with optional client component support. It automatically handles authenticated access, loading states, and error handling for your data retrieval layer.

What do I need to start fetching data from an API in my frontend?

You need an API specification artifact (such as api-spec.yaml), TypeScript typings, and an API client setup. The Skill generates type-safe client code and integrates it into your pages to enable end-to-end data fetching with authentication and error handling.

How do I handle loading and error states when fetching from protected API endpoints?

The Skill automatically generates and wires loading and error state handling into your server and client components when connecting to protected endpoints. It integrates these states directly into your page rendering logic without manual setup.

What's the difference between using server components versus client components for API fetching?

Server components are the default for secure, type-safe data fetching without exposing credentials to the browser. Client components are optional when you need browser-side interactivity. The Skill supports both, letting you choose based on your authentication and user interaction needs.

Do I need existing TypeScript typings to connect my API to the frontend?

TypeScript typings are required to enable the type-safety that the Skill provides. Combined with your API specification, they allow code generation of type-safe client wrappers that catch errors at build time and enable IDE autocompletion.