Svelte Store Debugger skill for Claude and Codex
Finds the cause of a misbehaving Svelte store and returns the corrected store and component code with a reason for every change, in a ticket-ready markdown…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when a Svelte store is not updating, a derived store shows a stale value, or a subscription fires at the wrong time and you need the cause and the fix. Do not use for writing a new store from scratch, documenting a working store, or Svelte 5 rune-only state that never touches a store. Related topics: coding, svelte.
What it will ask you for
- Store name (free text, e.g. "cartStore")
- Store type (choose one: writable, readable, derived, custom)
- Store code and the component that uses it (longer free text)
- Expected behavior (longer free text)
- Observed behavior (longer free text)
- Svelte version (choose one: Svelte 5 with runes, Svelte 4, Svelte 3, Not sure)
- Debugging depth (choose one: Quick check, Standard, Deep dive with runtime tracing)
How it works
- Trace every read of the store in the supplied code and classify it as auto-subscription, manual subscribe, or one-off get, so each read's update behavior is known.
- Trace every write and mark any direct mutation or same-reference set that never notifies subscribers; the list of faulty writes is complete.
- For derived and custom stores, confirm the inputs, the return or set on every path, and the subscribe contract; each gap is recorded as an issue.
- Rank the candidate causes by how well they explain the observed behavior and pick one as primary, with the check that would confirm it.
- Write the corrected store and component code with imports, and note any Svelte version difference that changes the answer.
- Assemble the five-section markdown report and remove anything that is not needed to reproduce or fix the problem.
What you get
A markdown document with Overview, Summary Table, Current State (code block with faulty lines marked), Identified Issues (bullets), and Recommendations (numbered fixes with code blocks), and nothing else.
What it watches out for
- Blaming reactivity when the store is read once with get() at mount, which never updates by design.
- Suggesting set(obj) with the same object reference, which still skips the notification Svelte relies on.
- Fixing the store while leaving a manual subscribe without onDestroy cleanup, which leaks and fires after unmount.
- Giving Svelte 4 store advice to a Svelte 5 runes codebase where $state would replace the store entirely.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.