1 svelte rules available
One Claude rule matches svelte: a Svelte developer rule covering SvelteKit and TypeScript. Svelte 5 changed the component syntax to runes, so the file makes Claude Code check the installed version before writing any reactive code.
Claude Code loads persistent project instructions from CLAUDE.md files and from Markdown rules in .claude/rules/. Rules can be scoped to file paths with a paths frontmatter field, and CLAUDE.md can import other files with @path syntax. The rules in this directory are written as plain instruction prompts: in Claude Code, save them as CLAUDE.md or .claude/rules/ content; in Claude.ai or the Claude API, use the same text as project instructions or a system prompt instead.
.claude/rules/svelte.mdStarting point, not a tested configuration for your repository. Loaded when Claude Code works with files matching paths. Review the instructions, adapt the file paths and run your project's existing checks.
--- paths: - "**/*.svelte" - "**/*.svelte.ts" - "**/*.svelte.js" - "src/routes/**/*.ts" --- # Svelte instructions for Claude Code ## Focus for this project - State which Svelte major version you found in package.json before writing component code. - Validate form action input on the server and return fail(400, ...) with field errors. - Run svelte-check in the shell and report the actual output. ## Svelte conventions - Check the svelte version in package.json. On Svelte 5 use runes ($state, $derived, $props, $effect); on Svelte 4 keep export let and $: and do not mix the two styles in one component. - Prefer $derived over $effect for values computed from state; use $effect only to synchronize with something outside Svelte. - In SvelteKit, load data in +page.server.ts or +page.ts load functions and handle form posts with form actions, not ad-hoc fetch calls in onMount. - Put reusable reactive state in .svelte.ts modules so runes are available there. ## Before you finish - Run npx svelte-check (or the project's check script) and the test script and report the actual output. If you cannot run them, say so and list the exact commands instead of saying they pass. - Summarize which of the rules above affected the change. - You have shell access: run the checks yourself instead of asking the user to, unless a command needs credentials or would deploy.
Create your own Claude rules for Svelte and share with the community.
Ask for a small change to one matching file. Check the tool's loaded context or instruction view, inspect the diff for the requested convention, and run the relevant build or test. A well-formatted file does not guarantee the model follows every instruction.
Imports with @path can nest up to four hops deep, according to the docs. Claude Code can read AGENTS.md as project instructions without extra configuration, but by default only when there is no CLAUDE.md in the working directory or above it. The docs list this behavior for version 2.1.277 and later and describe a setting (claude-md-and-agents-md) that loads both files. If you maintain AGENTS.md for other tools, you can also import it from CLAUDE.md with @AGENTS.md.
Documentation checked 2026-11-05: Claude Code docs: Manage Claude's memory
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
You ask Claude Code to add a SvelteKit page with a form and want runes on Svelte 5, server-side loading and form actions.
Add a /contact page with a form that stores messages via a form action.
src/routes/contact/+page.svelte using the right syntax for the installed version, +page.server.ts exporting actions with validation and fail(400), and real svelte-check output.
Content reviewed 2026-11-05. Confirm instruction activation in your installed client before relying on it.