Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/humanspeak/svelte-markdown/sveltegit clone --depth 1 https://github.com/humanspeak/svelte-markdownWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/humanspeak/svelte-markdown/svelte)<a href="https://agentmods.dev/rules/humanspeak/svelte-markdown/svelte"><img src="https://agentmods.dev/badge/rules/humanspeak/svelte-markdown/svelte.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.02208 | $0.02208 |
| Opus 5 | $0.01104 | $0.01104 |
| Sonnet 5 | $0.00442 | $0.00442 |
| Haiku 4.5 | $0.00221 | $0.00221 |
Grade A, and why
svelte scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 255 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert in Svelte 5, SvelteKit, TypeScript, and modern web development.
Key Principles
- Write concise, technical code with accurate Svelte 5 and SvelteKit examples.
- Leverage SvelteKit's server-side rendering (SSR) and static site generation (SSG) capabilities.
- Prioritize performance optimization and minimal JavaScript for optimal user experience.
- Use descriptive variable names and follow Svelte and SvelteKit conventions.
- Organize files using SvelteKit's file-based routing system.
- When exporting functions from Svelte components, always use arrow functions. This ensures lexical
thisbinding, avoids confusion, and is the recommended style for Svelte 5 component APIs. - When writing JSDoc for exported functions, always provide a realistic, copy-pastable Svelte usage example. Use the following template for guidance:
/**
* Scrolls the virtual list to the item at the given index.
*
* @function scrollToIndex
* @param index The index of the item to scroll to.
* @param smoothScroll (default: true) Whether to use smooth scrolling.
* @param shouldThrowOnBounds (default: true) Whether to throw an error if the index is out of bounds.
*
* @example
* // Svelte usage example:
* <script lang="ts">
* import SvelteVirtualList from '$lib/index.js';
* let virtualList;
* const items = Array.from({ length: 10000 }, (_, i) => ({ id: i, text: `Item ${i}` }));
* </script>
*
* <button onclick={() => virtualList.scrollToIndex(5000)}>
* Scroll to 5000
* </button>
* <div style="height: 500px; border: 1px solid pink; padding: 10px; border-radius: 10px;">
* <SvelteVirtualList {items} bind:this={virtualList}>
* {#snippet renderItem(item)}
* <div>{item.text}</div>
* {/snippet}
* </SvelteVirtualList>
* </div>
*
* @returns {void}
* @throws {Error} If the index is out of bounds and shouldThrowOnBounds is true
*/
Code Style and Structure
- Write concise, technical TypeScript or JavaScript code with accurate examples.
- Use functional and declarative programming patterns; avoid unnecessary classes except for state machines.
- Prefer iteration and modularization over code duplication.
- Structure files: component logic, markup, styles, helpers, types.
- Follow Svelte's official documentation for setup and configuration: https://svelte.dev/docs
Naming Conventions
- Use lowercase with hyphens for component files (e.g.,
components/auth-form.svelte). - Use PascalCase for component names in imports and usage.
- Use camelCase for variables, functions, and props.
TypeScript Usage
- Use TypeScript for all code; prefer interfaces over types.
- Avoid enums; use const objects instead.
- Use functional components with TypeScript interfaces for props.
- Enable strict mode in TypeScript for better type safety.
Svelte Runes
$state: Declare reactive statelet count = $state(0);$derived: Compute derived valueslet doubled = $derived(count * 2);$effect: Manage side effects and lifecycle$effect(() => { console.log(`Count is now ${count}`); });$props: Declare component propslet { optionalProp = 42, requiredProp } = $props();$bindable: Create two-way bindable propslet { bindableProp = $bindable() } = $props();$inspect: Debug reactive state (development only)$inspect(count);
UI and Styling
- Use Tailwind CSS for utility-first styling approach.
- Leverage Shadcn components for pre-built, customizable UI elements.
- Import Shadcn components from
$lib/components/ui. - Organize Tailwind classes using the
cn()utility from$lib/utils. - Use Svelte's built-in transition and animation features.
Shadcn Color Conventions
- Use
backgroundandforegroundconvention for colors. - Define CSS variables without color space function:
--primary: 222.2 47.4% 11.2%; --primary-foreground: 210 40% 98%; - Usage example:
<div class="bg-primary text-primary-foreground">Hello</div> - Key color variables:
--background,--foreground: Default body colors--muted,--muted-foreground: Muted backgrounds--card,--card-foreground: Card backgrounds--popover,--popover-foreground: Popover backgrounds--border: Default border color--input: Input border color--primary,--primary-foreground: Primary button colors--secondary,--secondary-foreground: Secondary button colors--accent,--accent-foreground: Accent colors--destructive,--destructive-foreground: Destructive action colors--ring: Focus ring color--radius: Border radius for components
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 255 lines · 2,208 tokens per session scan A 220987f68350
svelte is a cursor rule published in the GitHub repository humanspeak/svelte-markdown (134 stars, last pushed 2d ago), licensed MIT. It adds 2,208 tokens to every session, about $0.0110 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
testing
Comprehensive Testing Best Practices for Svelte 5 + vitest-browser-svelte.
cursorrules
Comprehensive Testing Best Practices for Svelte 5 + vitest-browser-svelte.
neverthrow
When handling errors, use the neverthrow library to handle errors.
svelte
When writing code for svelte (.svelte or .svelte.ts files) make sure to do the following.
project
Open Electricity project rules.
cursorrules
Read and follow AGENTS.md before making changes. It is the canonical, model-neutral source for project commands, Svelte 5 conventions, testing, API design, and git safety. Task-specific procedures are in docs/agent-workflows/.