LeandroBenjaminL/lend-ai / skills/frontend-api-integration
frontend-api-integration
VerifiedConsumo de APIs en el frontend — TanStack Query, fetch, Axios. Caché, refetch, optimistic updates y manejo de errores. Trigger: Cuando necesitás consumir APIs desde el frontend, cachear respuestas, o manejar estados de carga/error.
Skill: frontend-api-integration
APIs en el frontend. Que los datos lleguen sin romper la UI.
Trigger
- Un componente necesita traer datos de una API
- Las llamadas se repiten sin cachear
- Querés hacer optimistic update (cambiar la UI antes de la respuesta)
- Hay que manejar loading, error y retry
Workflow LEND
-
ANALIZAR ├── Stack: ¿TanStack Query ya está en el proyecto? ├── Tipo: ¿GETs, POSTs, suscripciones? ¿REST o GraphQL? ├── Caché: ¿los datos cambian seguido? ¿pueden ser stale? └── Errores: ¿cómo se muestran? ¿toast, inline, página de error?
-
OFRECER (Menú del Senior) ├── A) TanStack Query — caché, refetch, paginación, mutations ├── B) fetch nativo — sin dependencias, para apps chicas └── C) SWR — liviano, stale-while-revalidate, si no necesitás mutations complejas
-
ELEGIR → confirmación
-
HACER ├── TanStack Query: useQuery + useMutation con queryClient central ├── Caché: staleTime configurado (no dejar defaults de 0) ├── Errores: onError global + retry con backoff ├── Optimistic updates: onMutate actualiza caché, onError rollback ├── Loading: useQuery isLoading vs isFetching (la primera carga vs refetch) └── Tipado: respuesta tipada con genéricos (useQuery)
-
VERIFICAR ├── Las llamadas se cachean correctamente (Network tab) ├── Los errores se muestran al usuario └── El refetch funciona después de una mutación (invalidateQueries)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |