with one click
tauri-worker
// Implements Tauri features end-to-end (Rust commands + React components)
// Implements Tauri features end-to-end (Rust commands + React components)
| name | tauri-worker |
| description | Implements Tauri features end-to-end (Rust commands + React components) |
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
For features that involve both Rust backend logic and React frontend UI. This covers account management commands, quota queries, settings, auto-switch, and all UI components.
agent-browser — For verifying UI interactions in the Tauri WebView when the feature includes user-facing components.Read the feature description, AGENTS.md, and architecture.md. Understand what to build and what conventions to follow. Check preconditions.
Read existing code. Before writing anything, read the files you'll modify or extend. Understand the current command registration in lib.rs, the component structure in App.tsx, and any existing patterns.
Write Rust tests first (red). For any new Tauri command:
cd src-tauri && cargo test — confirm tests FAIL (red)Implement Rust backend (green). Write the command logic:
commands/account.rs (or appropriate module)commands/mod.rs and lib.rs#[tauri::command(rename_all = "camelCase")]Result<T, String> where T is a serializable structcd src-tauri && cargo test — confirm tests PASS (green)Write frontend tests first (red). For any new React component:
src/__tests__/ or co-locatedpnpm test:unit — confirm tests FAIL (red)Implement React frontend (green). Build the component:
t("key") from react-i18next — add keys to both en.json and zh.jsoninvoke() from @tauri-apps/api/core to call Rust commandspnpm test:unit — confirm tests PASS (green)Run validators. Execute all of:
cd src-tauri && cargo testpnpm test:unitpnpm typecheckManual verification via agent-browser. If the feature has UI:
pnpm tauri devinteractiveChecks entryCommit with a descriptive message.
{
"salientSummary": "Implemented add_account Tauri command (JWT decode + storage write) and AddAccountDialog React component. Paste JSON → instant preview of decoded user info → save to ~/.factory-accounts/. Verified via `cargo test` (5 passing), `pnpm test:unit` (3 passing), and agent-browser (paste JSON → see preview → click Add → appears in list).",
"whatWasImplemented": "Rust: add_account command in commands/account.rs that accepts JSON string, decodes JWT payload, writes to storage. React: AddAccountDialog component with textarea, live JWT preview, label input, and submit. Added i18n keys for en/zh. Integrated with react-query invalidation on success.",
"whatWasLeftUndone": "",
"verification": {
"commandsRun": [
{ "command": "cd src-tauri && cargo test", "exitCode": 0, "observation": "5 tests passed including JWT decode, storage write, duplicate detection" },
{ "command": "pnpm test:unit", "exitCode": 0, "observation": "3 tests passed: dialog renders, preview shows on paste, error on invalid JSON" },
{ "command": "pnpm typecheck", "exitCode": 0, "observation": "No TypeScript errors" }
],
"interactiveChecks": [
{ "action": "Opened Add Account dialog, pasted valid token JSON", "observed": "Preview section appeared showing 'Sam Pi, sam@gmail.com, owner, expires 2026-02-04'" },
{ "action": "Clicked Add button", "observed": "Dialog closed, toast 'Account added' appeared, account visible in list" },
{ "action": "Pasted invalid JSON '{bad'", "observed": "Error message 'Invalid JSON format' displayed, Add button disabled" }
]
},
"tests": {
"added": [
{ "file": "src-tauri/src/commands/account.rs", "cases": [
{ "name": "test_add_account_valid", "verifies": "valid JSON creates account" },
{ "name": "test_add_account_invalid_json", "verifies": "malformed JSON returns error" },
{ "name": "test_add_account_missing_token", "verifies": "JSON without access_token returns error" }
]},
{ "file": "src/__tests__/AddAccountDialog.test.tsx", "cases": [
{ "name": "renders dialog with paste area", "verifies": "dialog opens with textarea" },
{ "name": "shows preview on valid paste", "verifies": "JWT decoded info displayed" },
{ "name": "shows error on invalid paste", "verifies": "error message for bad JSON" }
]}
]
},
"discoveredIssues": []
}
pnpm tauri dev (build errors from prior features)