tauri

A set of Cursor rules for building Tauri 2 desktop applications, which combine a web-based interface with a Rust backend running on the user’s computer.

In plain words
What is it for?
It helps structure React or Vue-style frontend files, Rust files in `src-tauri`, shared components and utilities, backend calls through Tauri’s `invoke` API, and asynchronous data fetching.
Why use it?
It explains how to organize frontend and backend code, connect them safely, handle errors, and limit resource use across different desktop machines.

Cursor rule

Install

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.

agentmods
npx agentmods add rules/chand1012/cursorrules/tauri
Clone the repo
git clone --depth 1 https://github.com/chand1012/cursorrules
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,251 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01251
Opus 5 $0.00000 $0.00626
Sonnet 5 $0.00000 $0.00250
Haiku 4.5 $0.00000 $0.00125

Measured 2d ago against content hash 848ed4ec9a74, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tauri 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 2d 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.

frameworks/tauri.mdc · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tauri 2.0 Best Practices

Project Structure

  • Separate Frontend and Backend: Organize your project with a clear distinction between frontend (webview) and backend (Rust) code.
  • Frontend Directory: Place frontend code in a src directory (or a similar convention based on your frontend framework, e.g., React, Vue).
    • Use subdirectories for route-specific components if using a router (e.g., src/routes).
    • Place shared components in src/components.
    • Place utilities and helpers in src/lib.
  • Backend Directory: Place Rust backend code in the src-tauri directory.
    • Follow Rust’s module system for organizing backend code (e.g., src-tauri/src/main.rs, src-tauri/src/lib.rs).
  • Naming Convention: Use lowercase with dashes for directories (e.g., components/auth-wizard).

Components

  • Efficiency: Design components to minimize resource usage, as Tauri apps run on desktop environments with varying hardware capabilities.
  • Backend Interaction: Use Tauri’s API (invoke) to call Rust backend functions from the frontend.
  • Error Handling: Implement proper error handling for backend calls to ensure a robust user experience.
  • Asynchronous Operations: Consider using Suspense or similar patterns in your frontend framework for handling asynchronous backend interactions.
  • File Organization: Place static content (e.g., constants) and interfaces at the end of files for better readability.

Performance

  • Asset Optimization: Optimize images and assets by using appropriate formats (e.g., WebP), compressing them, and implementing lazy loading when possible.
  • Minimize Frontend Load: Offload heavy computations to the Rust backend instead of the frontend to reduce resource demands.
  • State Efficiency: Use efficient state management to avoid unnecessary re-renders in the frontend (e.g., React’s useMemo, useCallback).
  • Lazy Loading: Implement lazy loading for non-critical components or features to improve startup time.
  • Resource Monitoring: Monitor and optimize the app’s memory and CPU usage, leveraging tools like Tauri’s debugging capabilities.

Read the full file on GitHub · 75 lines

Changes

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.

  1. 2d ago First seen · 75 lines · 0 tokens per session scan A 848ed4ec9a74

Subscribe to this mod's changes

tauri is a cursor rule published in the GitHub repository chand1012/cursorrules (13 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,251 tokens. 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.