From role-fullstack
Integrate APIs with frontend applications using type-safe patterns: tRPC for end-to-end type safety, REST client generation (openapi-typescript, orval), TanStack Query / SWR for data fetching, optimistic updates, and error handling.
npx claudepluginhub rnavarych/alpha-engineer --plugin role-fullstackThis skill is limited to using the following tools:
Activate when connecting a backend API to a frontend application, setting up data-fetching patterns, implementing optimistic updates, or establishing type-safe API contracts.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Designs, implements, and audits WCAG 2.2 AA accessible UIs for Web (ARIA/HTML5), iOS (SwiftUI traits), and Android (Compose semantics). Audits code for compliance gaps.
Activate when connecting a backend API to a frontend application, setting up data-fetching patterns, implementing optimistic updates, or establishing type-safe API contracts.
| Approach | Type Safety | Setup Cost | Best For |
|---|---|---|---|
| tRPC | Full E2E | Low | Monorepos, same-team ownership |
| OpenAPI codegen | Generated | Medium | REST APIs, multi-team |
| GraphQL + codegen | Generated | Medium | Complex relational data queries |
| Manual fetch + Zod | Runtime | Low | Simple APIs, third-party services |
packages/api/src/routers/ with input validation via Zod.AppRouter type -- never the runtime object -- to the frontend.httpBatchLink or httpSubscriptionLink.trpc.Provider and QueryClientProvider.trpc.useQuery() and trpc.useMutation() -- types flow automatically.openapi-fetch for typed fetch calls."codegen": "orval --config orval.config.ts".// Query with proper typing, stale time, and error handling
const { data, isLoading, error } = useQuery({
queryKey: ['users', filters],
queryFn: () => api.users.list(filters),
staleTime: 5 * 60 * 1000,
retry: 3,
retryDelay: (attempt) => Math.min(1000 * 2 ** attempt, 10000),
});
onMutate to snapshot previous data and apply the optimistic change.onError to rollback to the snapshot on failure.onSettled to invalidate queries and refetch the authoritative state.{ code, message, details? }). Parse with Zod on the client.useEffect without cancellation -- always use TanStack Query or SWR.data -- always handle the error path.