swr
Pass
Audited by Gen Agent Trust Hub on Mar 17, 2026
Risk Level: SAFE
Full Analysis
- [Library Guidance]: The skill provides comprehensive instructions for implementing the SWR (stale-while-revalidate) pattern in React applications. It correctly identifies the core API, including
useSWR,useSWRMutation, anduseSWRInfinite. - [Dependency Management]: The skill references the official
swrpackage and standard installation commands (npm install swr). This is consistent with the intended purpose of providing guidance for a well-known library. - [Data Fetching Patterns]: The code examples demonstrate standard use of the
fetchAPI and WebSocket subscriptions (useSWRSubscription) for data synchronization. These patterns are implemented using best practices for React hooks, such as proper cleanup functions and conditional key handling. - [Configuration and Best Practices]: It includes guidance on global configuration via
SWRConfigand optimistic UI updates, which are standard features of the SWR library used to improve user experience.
Audit Metadata