← Back to list

resilience
by jmgomezdev
Mobile store code testing
⭐ 0🍴 0📅 Jan 22, 2026
SKILL.md
name: resilience description: > Standardizes how the application handles asynchronous states, errors, and feedback using TanStack Query/Router patterns. Trigger: Apply when building async UIs to implement Suspense, Skeletons, and Error Boundaries instead of manual loading states. license: Apache-2.0 metadata: author: jmgomezdev version: '1.0'
🧠 implementation Patterns
1. Data Loading (Read Operations)
- Pattern: Suspense.
- Rule: Components must NOT handle
isLoadingexplicitly. - Action:
- Wrap Route Components (or parts of them) in
<Suspense fallback={<Skeleton />}>. - Create granular Skeletons matching the UI layout (e.g.,
ProductCardSkeleton).
- Wrap Route Components (or parts of them) in
2. Route Errors (Page Level)
- Pattern: Error Boundaries.
- Rule: Loaders should usually throw errors to trigger the boundary.
- Action:
- Define
errorComponentincreateRoute. - Handle
404 Not Found(Typed errors) vs500 Server Error(Generic). - Provide "Retry" buttons using
router.invalidate().
- Define
3. Mutation Errors (Write Operations)
- Pattern: Side Effects (Toasts).
- Rule: Do not crash the page on a failed form submission.
- Action:
- Use
onErrorinuseMutationhook. - Trigger a Toast Notification (e.g.,
toast.error("Failed to update product")). - Keep the form data (do not reset) so the user can retry.
- Use
4. Code Example (Route Error)
// interface/router/routes/products/detail.route.ts
export const productDetailRoute = createRoute({
// ...
errorComponent: ({ error, reset }) => {
if (error.message.includes('404')) return <NotFoundPage />;
return <ErrorPage error={error} retry={reset} />;
},
loader: async ({ context }) => {
try {
await context.queryClient.ensureQueryData(...);
} catch (e) {
// Transform API 404 to explicit error
if (isAxios404(e)) throw new Error('404');
throw e;
}
}
});
Keywords
suspense, error-boundary, skeletons, loading-state, 404, 500, toast, mutation-error.
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon