tauri2-react-rust

A development guide for Tauri 2 desktop apps, combining React and TypeScript for the interface with Rust for the application backend.

In plain words
What is it for?
Use it to build or debug cross-platform desktop apps, implement Rust-to-React communication, research websites to clone, and verify local or packaged interfaces.
Why use it?
It gives one workflow for connecting the desktop interface and backend while keeping data types, communication, testing, and input handling consistent.

Skill for Claude CodeCodex

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 skills/tincopper/neeko/tauri2-react-rust
Any agent
npx skills add tincopper/neeko --skill tauri2-react-rust
Clone the repo
git clone --depth 1 https://github.com/tincopper/neeko

Made for: Claude Code, Codex.

Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,797 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.00114 $0.02797
Opus 5 $0.00057 $0.01399
Sonnet 5 $0.00023 $0.00559
Haiku 4.5 $0.00011 $0.00280

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

Security

Grade A, and why

tauri2-react-rust 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 3d 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.

.claude/skills/tauri2-react-rust/SKILL.md · 217 lines

How it starts

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

Tauri 2 + React + Rust 跨平台开发

基于 Tauri 2、TypeScript、React、Rust 技术栈的跨平台桌面应用开发指引。整合架构、IPC、后端与前端最佳实践。

何时使用本 Skill

  • 设计或实现 Tauri 应用架构、IPC 通信
  • 编写 Rust 后端命令、状态、错误处理
  • 编写 TypeScript/React 前端、类型与 invoke 封装
  • 新建项目、实现功能、异步/复杂类型场景
  • 配置安全(allowlist)、构建与调试
  • 调研目标网站:克隆/仿站时,自动打开网站并查看页面元素、结构、交互,指导实现
  • 验证开发效果:开发完成后,自动打开本地开发站点或打包前端,验证元素与交互是否按预期完成

开发流程建议

  1. 先设计后编码:brainstorming → 架构设计 → 实现
  2. 测试驱动:先写测试再写实现
  3. 类型一致:Rust 模型与 TypeScript 类型严格对应
  4. 异步优先:I/O 用 async/await;CPU 密集用 spawn_blocking
  5. 安全第一:配置 allowlist、校验并规范化输入(如路径)

项目结构

project/
├── src-tauri/                 # Rust 后端
│   ├── src/
│   │   ├── main.rs            # 入口,注册 commands、manage state
│   │   ├── lib.rs             # 模块导出
│   │   ├── commands/          # IPC 命令(按域拆分)
│   │   ├── models/            # 与前端共享的数据结构
│   │   ├── db/                # 数据库访问(Repository 模式)
│   │   ├── state.rs           # AppState
│   │   └── error.rs           # 统一可序列化错误类型
│   ├── Cargo.toml
│   └── tauri.conf.json
├── src/                       # 前端 React + TypeScript
│   ├── components/            # 原子化、职责单一
│   ├── hooks/                 # React Query 等服务器状态
│   ├── services/              # 封装 invoke 的 API 层
│   ├── store/                 # Zustand 等 UI 状态
│   ├── types/                 # 与 Rust 模型一致的 TS 类型
│   └── App.tsx
├── package.json
└── tsconfig.json

IPC 通信

前端 → 后端:Command

// src/services/xxx.ts
import { invoke } from '@tauri-apps/api/core'

export async function getItems(): Promise<Item[]> {
  return await invoke<Item[]>('get_items')
}
// src-tauri/src/commands/xxx.rs
#[tauri::command]
pub async fn get_items(state: State<'_, AppState>) -> Result<Vec<Item>, AppError> {
    let db = state.db.lock().map_err(|_| AppError::Lock)?;
    Ok(repo::list(&db)?)
}

后端 → 前端:Event

use tauri::Manager;
app.emit_all("event-name", payload).ok();
import { listen } from '@tauri-apps/api/event';
const unlisten = await listen<T>('event-name', (e) => { ... });
// 组件卸载时 unlisten()

Read the full file on GitHub · 217 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. 3d ago First seen · 217 lines · 114 tokens per session scan A 4d05fd37187c

Subscribe to this mod's changes

tauri2-react-rust is a skill published in the GitHub repository tincopper/neeko (10 stars, last pushed 4d ago), licensed Apache-2.0. It adds 114 tokens to every session and 2,797 once invoked, about $0.0006 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-31.

Related

Other skills, from other repositories