/prometheus-tauri-skills:tauri-react-vitefrom prometheus-tauri-skills
Tauri 2 + React 19 + Vite 8 desktop application pattern for Prometheus AGS. Covers the Tauri command API, IPC invoke() pattern, Rust sidecar or plugin integration, Flutter WebView embedding within Tauri, secure window configuration, and the gen_ui_core Rust crate sharing between Tauri backend and flutter_rust_bridge. Use when building any Prometheus desktop application.
Ships in prometheus-tauri-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
my-desktop-app/
├── src-tauri/ ← Rust backend (Tauri 2)
│ ├── Cargo.toml
│ ├── tauri.conf.json
│ └── src/
│ ├── main.rs ← Tauri app entry
│ ├── commands/ ← #[tauri::command] handlers
│ │ ├── mod.rs
│ │ ├── inference.rs
│ │ └── storage.rs
│ └── lib.rs
├── src/ ← React 19 + Vite 8 frontend
│ ├── main.tsx
│ ├── routes/ ← TanStack Router
│ ├── features/
│ └── lib/
│ └── tauri.ts ← typed invoke() wrappers
└── vite.config.ts
Define commands in src-tauri/src/commands/. All commands are async, return Result,
and use tauri::State for dependency injection.
// src-tauri/src/commands/inference.rs
use tauri::State;
use crate::InferenceState;
#[tauri::command]
pub async fn run_inference(
state: State<'_, InferenceState>,
prompt: String,
model: String,
) -> Result<String, String> {
state
.client
.complete(&prompt, &model)
.await
.map_err(|e| e.to_string())
}
#[tauri::command]
pub async fn list_models(
state: State<'_, InferenceState>,
) -> Result<Vec<String>, String> {
state.client.list_models().await.map_err(|e| e.to_string())
}
Register in main.rs:
tauri::Builder::default()
.manage(InferenceState::new())
.invoke_handler(tauri::generate_handler![
commands::inference::run_inference,
commands::inference::list_models,
commands::storage::read_file,
])
.run(tauri::generate_context!())
.expect("error running tauri app");
Never use raw invoke() in component code. Wrap all commands in typed functions
in src/lib/tauri.ts and import from there.
// src/lib/tauri.ts
import { invoke } from '@tauri-apps/api/core'
export async function runInference(prompt: string, model: string): Promise<string> {
return invoke<string>('run_inference', { prompt, model })
}
export async function listModels(): Promise<string[]> {
return invoke<string[]>('list_models')
}
In React components:
import { runInference, listModels } from '@/lib/tauri'
import { useQuery, useMutation } from '@tanstack/react-query'
export function useModelList() {
return useQuery({ queryKey: ['models'], queryFn: listModels })
}
export function useInferenceMutation() {
return useMutation({
mutationFn: ({ prompt, model }: { prompt: string; model: string }) =>
runInference(prompt, model),
})
}
When the same app needs both a Tauri desktop shell and a Flutter mobile target,
gen_ui_core is a shared Rust workspace crate used by both:
# src-tauri/Cargo.toml
[dependencies]
gen-ui-core = { path = "../../gen_ui_core" } # shared with flutter_rust_bridge
In Tauri commands, call gen_ui_core directly (no FFI needed — same process):
use gen_ui_core::inference::InferenceClient;
#[tauri::command]
pub async fn run_inference(prompt: String, model: String) -> Result<String, String> {
InferenceClient::global()
.map_err(|e| e.to_string())?
.complete(&prompt, &model)
.await
.map_err(|e| e.to_string())
}
For apps that combine a Tauri shell with Flutter UI panels:
// src-tauri/src/commands/flutter.rs
use tauri::{Manager, WebviewUrl, WebviewWindowBuilder};
#[tauri::command]
pub async fn open_flutter_panel(app: tauri::AppHandle, url: String) {
WebviewWindowBuilder::new(&app, "flutter-panel", WebviewUrl::External(url.parse().unwrap()))
.title("Flutter Panel")
.inner_size(800.0, 600.0)
.build()
.expect("failed to build flutter webview");
}
tauri.conf.json){
"app": {
"security": {
"csp": "default-src 'self'; script-src 'self'; connect-src 'self' http://localhost:*"
}
},
"build": {
"frontendDist": "../dist",
"devUrl": "http://localhost:5173"
}
}
Never use dangerousDisableAssetCspModification in production. Never enable
allowlist.all — allowlist only the capabilities actually needed.
// vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
// Tauri expects a fixed port; mobile can't use ephemeral ports
server: { port: 5173, strictPort: true },
// Optimize asset handling for Tauri
envPrefix: ['VITE_', 'TAURI_'],
build: { target: 'esnext', minify: !process.env.TAURI_DEBUG ? 'esbuild' : false },
})
eval() in any JS/TS code running inside Tauri — use invoke()window.location.href for navigation — use TanStack Routerinvoke('command_name') without type parameter — always invoke<ReturnType>(...)window.__TAURI__ directly — use @tauri-apps/api importsallowlist.all: true in tauri.conf.json — allowlist preciselyWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub prometheus-ags/prometheus-skill-system --plugin prometheus-tauri-skills2 plugins in one repository ship this exact skill · first indexed Nov 27, 2026