home / skills / shaul1991 / shaul-agents-plugin / frontend-api

frontend-api skill

/skills/frontend-api

This skill helps you implement a robust frontend API client and data fetching with error handling and caching strategies.

npx playbooks add skill shaul1991/shaul-agents-plugin --skill frontend-api

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
517 B
---
name: frontend-api
description: API 통합 에이전트. API 클라이언트와 데이터 페칭을 구현합니다.
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
---

# Frontend API Agent

## 역할
API 클라이언트와 데이터 페칭을 구현합니다.

## 담당 업무
- API 클라이언트 구현
- 데이터 페칭 로직
- 에러 핸들링
- 캐싱 전략

## 트리거 키워드
API, fetch, 데이터, endpoint, 클라이언트

## 산출물 위치
- API: `src/api/`
- Services: `src/services/`

Overview

This skill implements a frontend API agent that builds API clients and handles data fetching for web apps. It provides structured patterns for requests, error handling, and caching. Outputs are organized under src/api/ and src/services/ for easy integration.

How this skill works

The agent scaffolds API client modules and service-layer fetch logic that call endpoints, parse responses, and surface errors. It adds retry and timeout handling, configurable caching strategies, and clear error shapes for UI components to consume. Developers import generated clients from src/api/ and higher-level data flow lives in src/services/.

When to use it

  • Building or standardizing API clients across a frontend codebase
  • Implementing data fetching for React/Vue/Svelte components
  • Introducing consistent error handling and retry policies
  • Adding caching to reduce network load and improve UX
  • Creating a service layer that separates network concerns from UI logic

Best practices

  • Define typed request and response shapes in api modules to avoid runtime surprises
  • Centralize base URL, auth, and timeout configuration in a single client factory
  • Use service-layer functions for orchestration, retries, and composition of multiple endpoints
  • Implement cache invalidation rules tailored to your data (stale-while-revalidate, TTL, or manual purge)
  • Surface normalized error objects to the UI and avoid leaking HTTP details into components

Example use cases

  • Generate a user API client and service that fetches profiles with caching and retry logic
  • Implement a product list endpoint with pagination support and optimistic UI updates
  • Create an auth-aware client that injects tokens and refreshes them on 401 responses
  • Compose multiple endpoints in a service to build a dashboard payload with parallel fetches and error aggregation

FAQ

Where are outputs placed in the project?

API client files are placed under src/api/ and higher-level services live under src/services/.

How does caching work with this agent?

The agent supports pluggable caching strategies such as TTL, stale-while-revalidate, and manual invalidation, configurable per service or endpoint.