[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7827CQY3R2YWGSMRTYSXBQG":3,"skill-same:01M7827CQY3R2YWGSMRTYSXBQG":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7827CQY3R2YWGSMRTYSXBQG","diagnosing-bugs",null,"Diagnosis loop for hard bugs and regressions. Use when the user says diagnose or debug this, or reports something broken, throwing, failing, or slow.","stainless-code\u002Fpersist","stainless-code","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F188862219?v=4","01M7826VYMCF2NTQWQZRWQ454T","STAINLESS CODE","01M7826VZKNC149Y9ZNK0F93N7",5,"MIT","https:\u002F\u002Fgithub.com\u002Fstainless-code\u002Fpersist\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdiagnosing-bugs\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: diagnosing-bugs\ndescription: Diagnosis loop for hard bugs and regressions. Use when the user says diagnose or debug this, or reports something broken, throwing, failing, or slow.\n---\n\n# Diagnosing Bugs\n\nA discipline for hard bugs. Skip phases only when explicitly justified.\n\nWhen exploring, read `docs\u002Farchitecture.md` (seam model + hydration lifecycle) for module vocabulary before forming hypotheses.\n\n**Feedback loops (prefer in order):**\n\n1. **Failing `bun test`** — co-located `src\u002F**\u002F*.test.ts` at the unit\u002Fcodec\u002Fbackend seam (fastest; no DOM)\n2. **`bun run test:dom`** — `tests-dom\u002F**\u002F*.test.tsx` for `useHydrated` rerender \u002F unmount-detach \u002F `useSyncExternalStore` reactivity\n3. **Isolated storage-codec harness** — construct a `PersistStorage` over an in-memory `StateStorage` and drive `persistSource` against a fake source to reproduce cross-tab \u002F throttle \u002F migrate paths without a real browser\n4. **Real backend in a DOM runner** — `localStorage` (sync) or `idb-keyval` (async) inside the vitest jsdom suite when the bug only shows against a real storage backend\n5. **Captured trace replay** — a recorded `CrossTabStorageEvent` payload or a `getState` sequence replayed through the isolated harness\n\n## Phase 1 — Build a feedback loop\n\n**This is the skill.** Spend disproportionate effort here. A tight pass\u002Ffail signal for **this bug** beats staring at code.\n\nDone when you can name **one command** that is red-capable, deterministic, fast, and agent-runnable (`bun test \u003Cfile>` or `bun run test:dom -- \u003Cpattern>`). No red-capable command → no Phase 2.\n\n## Phase 2 — Reproduce + minimise\n\nRun the loop; shrink to the smallest scenario that still goes red. Every remaining element must be load-bearing — one codec, one backend, one source, one `setState` sequence.\n\n**Done when:** minimal repro documented; non-load-bearing steps removed.\n\n## Phase 3 — Hypothesise\n\nGenerate **3–5 ranked, falsifiable hypotheses**. Show the list to the user before testing. Bias toward the seams: sync-vs-async `getItem` branch, hydration gate ordering, throttle trailing edge, `migrate` version mismatch, cross-tab `raw` identity compare, codec `encode`\u002F`decode` asymmetry.\n\n**Done when:** user has seen ranked list before any fix attempt.\n\n## Phase 4 — Instrument\n\nOne variable at a time. Tag debug logs `[DEBUG-xxxx]` for cleanup. Perf bugs (write loop, cross-tab listener, hydrate read path): measure first, then bisect.\n\n**Done when:** one hypothesis confirmed or all falsified with evidence.\n\n## Phase 5 — Fix + regression test\n\nRegression test **before** the fix when a correct seam exists — co-locate under `src\u002F` (`bun test`) or `tests-dom\u002F` (`test:dom`) per the test matrix in `docs\u002Farchitecture.md`. If no seam exists to test through, document that as an architectural finding (a shallow module worth deepening behind a smaller interface) and track it in `docs\u002Froadmap.md`.\n\n**Done when:** loop is green; regression test added or gap documented.\n\n## Phase 6 — Cleanup + post-mortem\n\nRemove `[DEBUG-...]` logs, delete throwaway harnesses, state the winning hypothesis in the commit message. If prevention needs an architecture change, record specifics in `docs\u002Froadmap.md`.\n\n**Done when:** no debug sediment; commit message states root cause.\n\n## Reference\n\n- [`tracer-bullets`](..\u002F..\u002Frules\u002Ftracer-bullets.md) · [`verify-after-each-step`](..\u002F..\u002Frules\u002Fverify-after-each-step.md) · [`harden-pr`](..\u002Fharden-pr\u002FSKILL.md) (lite on the fix commit)\n- [`docs\u002Farchitecture.md`](..\u002F..\u002F..\u002Fdocs\u002Farchitecture.md) — seam model, hydration lifecycle, test matrix\n","# Diagnosing Bugs\n\nA discipline for hard bugs. Skip phases only when explicitly justified.\n\nWhen exploring, read `docs\u002Farchitecture.md` (seam model + hydration lifecycle) for module vocabulary before forming hypotheses.\n\n**Feedback loops (prefer in order):**\n\n1. **Failing `bun test`** — co-located `src\u002F**\u002F*.test.ts` at the unit\u002Fcodec\u002Fbackend seam (fastest; no DOM)\n2. **`bun run test:dom`** — `tests-dom\u002F**\u002F*.test.tsx` for `useHydrated` rerender \u002F unmount-detach \u002F `useSyncExternalStore` reactivity\n3. **Isolated storage-codec harness** — construct a `PersistStorage` over an in-memory `StateStorage` and drive `persistSource` against a fake source to reproduce cross-tab \u002F throttle \u002F migrate paths without a real browser\n4. **Real backend in a DOM runner** — `localStorage` (sync) or `idb-keyval` (async) inside the vitest jsdom suite when the bug only shows against a real storage backend\n5. **Captured trace replay** — a recorded `CrossTabStorageEvent` payload or a `getState` sequence replayed through the isolated harness\n\n## Phase 1 — Build a feedback loop\n\n**This is the skill.** Spend disproportionate effort here. A tight pass\u002Ffail signal for **this bug** beats staring at code.\n\nDone when you can name **one command** that is red-capable, deterministic, fast, and agent-runnable (`bun test \u003Cfile>` or `bun run test:dom -- \u003Cpattern>`). No red-capable command → no Phase 2.\n\n## Phase 2 — Reproduce + minimise\n\nRun the loop; shrink to the smallest scenario that still goes red. Every remaining element must be load-bearing — one codec, one backend, one source, one `setState` sequence.\n\n**Done when:** minimal repro documented; non-load-bearing steps removed.\n\n## Phase 3 — Hypothesise\n\nGenerate **3–5 ranked, falsifiable hypotheses**. Show the list to the user before testing. Bias toward the seams: sync-vs-async `getItem` branch, hydration gate ordering, throttle trailing edge, `migrate` version mismatch, cross-tab `raw` identity compare, codec `encode`\u002F`decode` asymmetry.\n\n**Done when:** user has seen ranked list before any fix attempt.\n\n## Phase 4 — Instrument\n\nOne variable at a time. Tag debug logs `[DEBUG-xxxx]` for cleanup. Perf bugs (write loop, cross-tab listener, hydrate read path): measure first, then bisect.\n\n**Done when:** one hypothesis confirmed or all falsified with evidence.\n\n## Phase 5 — Fix + regression test\n\nRegression test **before** the fix when a correct seam exists — co-locate under `src\u002F` (`bun test`) or `tests-dom\u002F` (`test:dom`) per the test matrix in `docs\u002Farchitecture.md`. If no seam exists to test through, document that as an architectural finding (a shallow module worth deepening behind a smaller interface) and track it in `docs\u002Froadmap.md`.\n\n**Done when:** loop is green; regression test added or gap documented.\n\n## Phase 6 — Cleanup + post-mortem\n\nRemove `[DEBUG-...]` logs, delete throwaway harnesses, state the winning hypothesis in the commit message. If prevention needs an architecture change, record specifics in `docs\u002Froadmap.md`.\n\n**Done when:** no debug sediment; commit message states root cause.\n\n## Reference\n\n- [`tracer-bullets`](..\u002F..\u002Frules\u002Ftracer-bullets.md) · [`verify-after-each-step`](..\u002F..\u002Frules\u002Fverify-after-each-step.md) · [`harden-pr`](..\u002Fharden-pr\u002FSKILL.md) (lite on the fix commit)\n- [`docs\u002Farchitecture.md`](..\u002F..\u002F..\u002Fdocs\u002Farchitecture.md) — seam model, hydration lifecycle, test matrix\n",{"name":5,"description":7},"main","29ca2183c92cd13e04ce6c14fb431fd6993862cd",".agents\u002Fskills\u002Fdiagnosing-bugs",0,"https:\u002F\u002Fgithub.com\u002Fstainless-code\u002Fpersist","https:\u002F\u002Fgithub.com\u002Fstainless-code","https:\u002F\u002Fstainless-code.com\u002F","Open-source tooling for JS\u002FTS and AI agents.","2026-11-01 20:56:20",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add stainless-code\u002Fpersist --skill diagnosing-bugs",{"tool":39,"command":40},"bunx","bunx skills add stainless-code\u002Fpersist --skill diagnosing-bugs",{"tool":42,"command":43},"pnpm","pnpm dlx skills add stainless-code\u002Fpersist --skill diagnosing-bugs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstainless-code\u002Fpersist\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdiagnosing-bugs\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M782D4ZQGJPNT470FSKDB6A8","vue-persist","Gate Vue 3 UI on Persist hydration with useHydrated (shallowRef). Use in setup\u002FeffectScope when avoiding flash of default state on async backends.","https:\u002F\u002Fgithub.com\u002Fstainless-code\u002Fpersist\u002Fblob\u002Fmain\u002Fskills\u002Fvue-persist\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M782D1GJRWNQ3458F3H1FK2F","svelte-store-persist","Gate Svelte store-based UI on Persist hydration with hydratedStore (Readable). Use for Svelte 3–4 or Svelte 5 apps that still use stores; runes UI → svelte-persist.","https:\u002F\u002Fgithub.com\u002Fstainless-code\u002Fpersist\u002Fblob\u002Fmain\u002Fskills\u002Fsvelte-store-persist\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M782CWBTRWAQ52TBNQ8665CC","svelte-persist","Gate Svelte 5 runes UI on Persist hydration with hydratedRune (.current). Use for Svelte 5; for stores \u002F Svelte 3–4 use svelte-store-persist.","https:\u002F\u002Fgithub.com\u002Fstainless-code\u002Fpersist\u002Fblob\u002Fmain\u002Fskills\u002Fsvelte-persist\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M782CR8Z2V3SJW661RTMWY2F","solid-persist","Gate Solid UI on Persist hydration with useHydrated (Accessor). Use when avoiding flash of default state on async backends; read hydrated() in reactive scopes.","https:\u002F\u002Fgithub.com\u002Fstainless-code\u002Fpersist\u002Fblob\u002Fmain\u002Fskills\u002Fsolid-persist\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M782CJQGP7739WA9BS801HZP","react-persist","Gate React UI on Persist hydration with useHydrated + toHydrationSignal. Use when avoiding flash of default state on async backends (IndexedDB), SSR snapshot true, or wiring HydrationSignal into React 18\u002F19.","https:\u002F\u002Fgithub.com\u002Fstainless-code\u002Fpersist\u002Fblob\u002Fmain\u002Fskills\u002Freact-persist\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M782CF96RMXCDETM5TF2JDRV","preact-persist","Gate Preact UI on Persist hydration with useHydrated (preact\u002Fcompat useSyncExternalStore). Use when avoiding flash of default state on async backends or wiring HydrationSignal into Preact.","https:\u002F\u002Fgithub.com\u002Fstainless-code\u002Fpersist\u002Fblob\u002Fmain\u002Fskills\u002Fpreact-persist\u002FSKILL.md",[],[]]