r1-tauriweb-runtime-v1 Cursor Rules — Cursor Rules | Neura Market
    Neura MarketNeura Market/Cursor
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsBlogVideosGuidesCoursesCommunityExtensionsTrendingGenerate
    CursorRulesr1-tauriweb-runtime-v1 Cursor Rules
    Back to Rules
    Systems Programming

    r1-tauriweb-runtime-v1 Cursor Rules

    12errh April 15, 2026
    0 copies 0 downloads

    R1 is a browser-native runtime for Tauri apps. It compiles Rust backends to

    Rule Content
    # R1 TauriWeb Runtime — Cursor Rules
    
    ## What This Project Is
    
    R1 is a browser-native runtime for Tauri apps. It compiles Rust backends to
    WebAssembly and runs them in the browser. The developer adds one line to
    vite.config.ts and deploys a static folder — end users get the full Tauri
    app at a URL with no installer.
    
    ## Before Making Any Change
    
    Read `.agent/skills/R1_SKILL.md` completely. It contains the architecture,
    the Rust JSON contract, supported APIs, and every known error pattern.
    Do not make changes based on assumptions — always check the skill file first.
    
    ## The 3 Rules That Matter Most
    
    1. WASM never runs on the main thread. All execution goes through the Kernel Worker.
    2. All JS↔WASM data travels as JSON strings. No raw pointers, no raw types.
    3. Every edit to packages/* requires rebuilding R1 before the app sees the change:
       `cd r1-tauriweb-runtime-v1 && npm run build`
    
    ## Never Do These Things
    
    - Never change `@tauri-apps/api` import statements in the frontend
      (the Vite plugin rewrites them automatically)
    - Never change `invoke()` calls in the frontend
      (the IPC bridge routes them automatically)
    - Never add SQLite to a Rust backend (not supported until v0.3)
    - Never load `app.js` — always load `app_bg.wasm` (the binary)
    - Never use `.unwrap()` in WASM functions without error handling
    
    ## Package Boundaries
    
    - `@r1/kernel` must never import from `@r1/core`
    - `@r1/core` must never import from `@r1/apis`
    - `@r1/apis` imports from `@r1/kernel` for VFS access only
    - `@r1/vite-plugin` has no runtime imports — build tooling only
    
    ## When Adding a New API
    
    Every API module needs TWO things:
    1. A `KernelPlugin` class with `getCommands()` — handles `invoke()` calls
    2. Top-level named exports — handles `import { fn } from '@tauri-apps/api/x'`
    
    Missing either one will cause either runtime errors or build-time errors.
    Use `packages/apis/src/fs.ts` as the template for both patterns.
    
    ## Rust JSON Contract
    
    Every `#[wasm_bindgen]` function must:
    - Take `payload: &str` as input
    - Return `String` as output
    - Use `serde_json::from_str` to decode input
    - Use `serde_json::to_string` to encode output
    - Return `{ "error": "message" }` on failure — never panic
    
    ## Build Verification
    
    A successful R1 build produces:
    ```
    [R1] Found Rust source at ./src-tauri. Building WASM...
    [INFO]: :-) Done in Xs
    ✓ built in Xs
    ```
    
    The `dist/` folder must contain `sw.js`, `r1-boot.js`, and `wasm/<app>_bg.wasm`.
    The browser console on load must show `[R1] Boot complete.`
    

    Tags

    rust

    Comments

    More Rules

    View all
    Web Development

    Next.js 15 + TypeScript Cursor Rules

    Comprehensive .cursorrules file for Next.js 15 App Router projects with TypeScript, enforcing server components by default, proper use of "use client" directive, and App Router conventions.

    C
    Community
    Backend Development

    Python FastAPI Best Practices Rules

    Cursor rules for Python FastAPI projects enforcing async patterns, Pydantic v2 models, dependency injection, and proper error handling.

    C
    Community
    Frontend Development

    React + TypeScript Component Rules

    Rules for consistent React component development with TypeScript interfaces, proper hook patterns, and component composition.

    C
    Community
    AI/ML

    Cursor Agent Mode Configuration

    Rules optimizing Cursor Agent mode behavior including multi-file editing context, session management, and autonomous task completion patterns.

    C
    Cursor Team
    Frontend Development

    Tailwind CSS + shadcn/ui Rules

    Cursor rules for projects using Tailwind CSS with shadcn/ui component library, enforcing consistent utility class usage and component patterns.

    C
    Community
    Backend Development

    Go Backend Service Rules

    Rules for Go backend services enforcing idiomatic Go patterns, proper error handling, and clean architecture conventions.

    C
    Community

    Stay up to date

    Get the latest Cursor prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Cursor and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.