実際の製品を操作して、利用者が確認できる動作証拠を集め、検証計画に沿った受け入れレポートとして公開するスキルです。
- 変更後の製品動作を実地で検証したいとき
- 画面キャプチャなどの証拠を集めたいとき
- 検証計画とレポートを作成したいとき
SWRを使うデータ取得の設計や、読み込み・エラー表示、キャッシュ更新、既存のuseEffect fetchの移行方法を案内する開発スキルです。
Use for client APIs, SWR hooks, cache invalidation, async errors, useEffect migration, home first paint and persistent caches.
実行スコア 未検証
インストール方法を見るクライアント側のデータ取得を、サービス、ストアのフック、コンポーネントに分けて設計する方法を案内します。読み取りには useClientDataSWR を使い、API呼び出しはサービスに置きます。キャッシュキーの共有、書き込み後の更新、保留中の状態管理、初回読み込み・空データ・エラーの区別も扱います。useEffect 内での取得やコンポーネント状態への重複保存を、ストアフックとセレクターを使う形に移行する際にも利用できます。ローカルコピーから表示する一覧・詳細にはReplicaの同期方法を示します。
取得後の表示が古い、読み込み中のままになる、初回エラーが空表示に見えるといった問題を調べるときや、取得処理の置き場所を整理したいときに役立ちます。
LobeHubの既存ラッパーやコード構成に沿って実装します。SWRの既定動作を前提にせず、実際のラッパー設定を確認します。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
SKILL.md の記述から、注意が要る操作と導入の前提を AI が確認しました。点数は実際に動かした結果(実行検証)だけで付けています。
点数には入れていません。 2026年10月26日 時点で AI(OpenAI Codex)が判定しました。目安なので、入れる前に原文も確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Component → Store useFetchXxx hook → Service → lambdaClient
← SWR request state + store data ← response
src/services/ own API calls: .query() for reads, .mutate() for writes.
Export a service instance per domain; components and stores do not call lambdaClient directly.useClientDataSWR and return its SWR response, including error
and mutate. Sync successful results into the store through the wrapper's supported
callback (onSuccess, or onData for the sync wrapper).@/libs/replica
instead: the store's useFetchXxx returns slice.useSync(params) (flags only) and
the engine writes the store. See the Replica section of zustand.useEffect or duplicate server data in component useState.useFetchXxx for read hooks and refreshXxx for cache invalidation.When changing home/sidebar first paint or persisted display data, read
references/home-first-paint.md. It covers
avoiding flicker, reusing persistence, and the user displaySnapshot.ts boundary.
Reuse the domain key factory in src/libs/swr/keys.ts; define a shared key if the
domain has none. Include every parameter that changes the response: entity or parent
id, filters, sort, and pagination. Read and refresh must construct the same key.
Import useClientDataSWR and mutate from @/libs/swr, keeping the application's
workspace/cache handling. Return a null key when a required id is absent; passing
undefined to a store hook only disables fetching if that hook maps it to null.
For example, inside an action class:
useFetchBenchmarks = () =>
useClientDataSWR(evalKeys.benchmarks(), () => agentEvalService.listBenchmarks(), {
onSuccess: (data) => {
this.#set({ benchmarkList: data, benchmarkListInit: true });
},
});
refreshBenchmarks = async () => {
await mutate(evalKeys.benchmarks());
};
Read the current benchmark action for store wiring and the SWR wrappers for their actual options. These links locate implementation; they do not make every existing call site a template to copy unchanged.
Hooks that share a known parent id can run together. If one request needs a value
returned by another, keep its key null until that value exists. Do not assume the
application wrapper uses upstream SWR's default deduplication interval.
For lists cached separately under multiple parents, see parent-keyed lists. Ordinary flat lists need no extra layer.
finally. Use per-id state for
row updates/deletes so unrelated rows remain usable; create can use a separate flag
because no persistent id exists yet.slice.optimistic / entity.optimistic;
a rejected call rolls back on its own, deletes included.finally block clears pending state
but does not by itself recover an optimistic write.Consume the read hook's SWR response. Success-only flags such as isInit, missing
map entries, and data ?? [] cannot distinguish an initial request failure from
loading or empty results.
Use AsyncBoundary for standard loading/error/empty/data surfaces; use AsyncError
for custom layouts and inline failures. Pass the original SWR data to the boundary:
undefined means no successful result, whereas [] is a settled empty result.
Replica useSync returns no data. Feed AsyncBoundary its error and a settled
signal from the store entry (data={isListInit || undefined}, where the selector is
entry !== undefined); see src/features/Pages/PageLayout/Body/index.tsx.
const BenchmarkList = () => {
const useFetchBenchmarks = useEvalStore((s) => s.useFetchBenchmarks);
const benchmarks = useEvalStore((s) => s.benchmarkList);
const { data, error, isLoading, mutate } = useFetchBenchmarks();
return (
<AsyncBoundary
data={data}
empty={<EmptyState />}
error={error}
isEmpty={data?.length === 0}
isLoading={isLoading}
onRetry={() => {
void mutate();
}}
>
<BenchmarkCards items={benchmarks} />
</AsyncBoundary>
);
};
The example's EmptyState and BenchmarkCards stand for the surface's existing
renderers. Follow these distinctions when adapting it:
NotFound / zero-value defaults. Do not put
an error branch after if (!map[id]) return <Skeleton />; failure may never fill the map.loadMoreError and show an inline Retry row.
Suspend observer-triggered retries while that error is unresolved.Move the API call into its service and the request into a store SWR hook. Reuse the
existing state shape and action organization unless they need to change for the task.
Replace the component's effect/local fetch state with that hook and selectors, then
connect error, retry, and pending feedback. Refresh the same cache key after writes.
Check initial failure, retry, settled-empty results, background failure, and switching ids against the surface being changed. For stale data, compare read/refresh keys and the store bucket they update; for stuck loading, inspect rejected requests as well as success callbacks. Do not add a second fetch or another loading flag to mask the cause.
まだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
実際の製品を操作して、利用者が確認できる動作証拠を集め、検証計画に沿った受け入れレポートとして公開するスキルです。
LobeHubにAIモデルプロバイダーを追加し、実行時連携からモデル表示、設定、ブランド表記、文書化、動作確認まで進めるスキルです。
ユーザー設定の初期値をサーバー側の環境変数で切り替えるため、型定義や設定の組み立て、ユーザーストアへの反映、環境変数の例と説明書きを追加する手順です。
エージェント実行中の各段階をフックで監視し、ツール呼び出しの模擬・制御や人の承認、圧縮、サブエージェント処理に介入する仕組みを扱います。
イベントを起点にエージェントのバックグラウンド処理を組み立て、ソース・シグナル・アクション・ポリシーの役割分担や非同期連携を実装するためのスキルです。
DiscordやSlackなどの実際のチャットアプリでボットにメッセージを送り、応答を画面で確認する受け入れテストを行うスキルです。