| name | tauri-worker |
| description | Implements Tauri features end-to-end (Rust commands + React components) |
Tauri Worker
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
When to Use This Skill
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.
Required Skills
agent-browser — For verifying UI interactions in the Tauri WebView when the feature includes user-facing components.
Work Procedure
-
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:
- Create unit tests in the same file or a tests/ module
- Tests should cover: happy path, error cases, edge cases
- Run
cd src-tauri && cargo test — confirm tests FAIL (red)
-
Implement Rust backend (green). Write the command logic:
- Add to
commands/account.rs (or appropriate module)
- Register in
commands/mod.rs and lib.rs
- Use
#[tauri::command(rename_all = "camelCase")]
- Return
Result<T, String> where T is a serializable struct
- Run
cd src-tauri && cargo test — confirm tests PASS (green)
-
Write frontend tests first (red). For any new React component:
- Create test file in
src/__tests__/ or co-located
- Test rendering, user interactions, i18n keys
- Run
pnpm test:unit — confirm tests FAIL (red)
-
Implement React frontend (green). Build the component:
- All text via
t("key") from react-i18next — add keys to both en.json and zh.json
- Use shadcn/ui primitives (Button, Card, Dialog, Badge, etc.)
- Use
invoke() from @tauri-apps/api/core to call Rust commands
- Use react-query hooks for data fetching
- Run
pnpm test:unit — confirm tests PASS (green)
-
Run validators. Execute all of:
cd src-tauri && cargo test
pnpm test:unit
pnpm typecheck
-
Manual verification via agent-browser. If the feature has UI:
- Start the dev server:
pnpm tauri dev
- Use agent-browser to navigate, click, type, and verify the feature works
- Each interaction flow = one
interactiveChecks entry
- Stop the dev server after verification
-
Commit with a descriptive message.
Example Handoff
{
"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": []
}
When to Return to Orchestrator
- Feature depends on a Rust module or React component that doesn't exist yet
- Factory API endpoint returns unexpected response format
- Cannot start
pnpm tauri dev (build errors from prior features)
- Requirements are ambiguous (e.g., unclear what fields to show in account card)