Skip to content
Skills Library
Programming · Planning

web-to-tauri-migration-loop

/web-to-tauri-migration-loop

Drive Web-first to Tauri v2 migration with contract-first architecture, dual transport adapters, fail-fast runtime checks, and loop-based quality gates. Use when user mentions Tauri migration, dev:tauri crash, ECONNREFUSED, invoke/HTTP fallback, TDD strategy, e2e setup, or ralph loop workflows.

Licence
MIT
Last repository change
19.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 19.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/scaffold-loop.mjs

What it does and when to use it

Drive Web-first to Tauri v2 migration with contract-first architecture, dual transport adapters, fail-fast runtime checks, and loop-based quality gates. Use when user mentions Tauri migration, dev:tauri crash, ECONNREFUSED, invoke/HTTP fallback, TDD strategy, e2e setup, or ralph loop workflows.

Original author description

Drive Web-first to Tauri v2 migration with contract-first architecture, dual transport adapters, fail-fast runtime checks, and loop-based quality gates. Use when user mentions Tauri migration, dev:tauri crash, ECONNREFUSED, invoke/HTTP fallback, TDD strategy, e2e setup, or ralph loop workflows.

How it works

  1. What This Skill Solves
  2. Core Principle
  3. Target Architecture (Final Code Shape)
  4. Development Loop (Ralph-Ready)
  5. Step-by-Step Execution
  6. Tauri Migration Anti-Patterns
  7. Prompt Template for Each Loop
  8. Scaffold Templates (Executable)
  9. Definition of Done
  10. Quick Troubleshooting Map
Original SKILL.md headings · 236 lines, 1,001 words
SKILL.md preview
---
name: web-to-tauri-migration-loop
description: "Drive Web-first to Tauri v2 migration with contract-first architecture, dual transport adapters, fail-fast runtime checks, and loop-based quality gates. Use when user mentions Tauri migration, dev:tauri crash, ECONNREFUSED, invoke/HTTP fallback, TDD strategy, e2e setup, or ralph loop workflows."
---

<role>
You are a Web-to-Tauri migration loop architect who enforces contract-first delivery, strict runtime guards, and gated incremental rollout.
</role>

<purpose>
Prevent late-stage migration failures by delivering each feature through a repeatable loop that keeps Web and Tauri paths aligned, testable, and releasable.
</purpose>

<trigger>
```text
Tauri migration
pnpm dev:tauri crash
ECONNREFUSED /api in Tauri
invoke/HTTP fallback issues
need TDD + e2e migration loop
```
</trigger>

<gsd:workflow>
  <gsd:meta>
    <owner>web-to-tauri-migration-loop</owner>
    <mode>incremental-loop</mode>
  </gsd:meta>
  <gsd:goal>Ship migrated features with no silent HTTP fallback in Tauri runtime and with passing build/test gates.</gsd:goal>
  <gsd:phase id="1" name="contract-and-command">Define API contract first, scaffold Rust command, and register handler before UI wiring.</gsd:phase>
  <gsd:phase id="2" name="adapter-and-guard">Integrate domain client with dual transport and enforce fail-fast runtime guard in Tauri mode.</gsd:phase>
  <gsd:phase id="3" name="tests-and-gates">Run layered tests and mandatory gates (`cargo check` + web build) before marking loop complete.</gsd:phase>
</gsd:workflow>

# Web to Tauri Migration Loop

Use this skill to migrate a Web-first app to Tauri v2 without "last-mile explosion".

## What This Skill Solves

- `pnpm dev:tauri` starts but app crashes or hangs
- Vite proxy `/api` works in web mode but fails in Tauri (`ECONNREFUSED`)
- Frontend pages are complete but Tauri commands are missing
- Type drift between TypeScript models and Rust structs
- Team wants TDD + e2e, but does not know where to place each test

## Core Principle

Do **not** migrate at the end in one shot.
Ship each feature in a **dual-path incremental loop**:

1. Contract first
2. Rust command scaffold
3. Frontend adapter integration
4. Runtime fail-fast guard
5. Layered tests
6. Gate checks before done

## Target Architecture (Final Code Shape)

Frontend pages must never call transport directly.

- `UI layer`: React pages/components
- `Domain API layer`: stable methods like `listSkills()`, `linkSkill()`
- `Transport layer`:
  - `tauriTransport` -> `invoke(...)`
  - `webTransport` -> HTTP client
- `Runtime selection`: one adapter entrypoint decides transport once
- `Rust command layer`: `#[tauri::command]` functions registered in `generate_handler!`

Mandatory rule:
- In Tauri runtime, do not silently fallback to HTTP.
- If Tauri transport unavailable, fail fast with clear error.

## Development Loop (Ralph-Ready)

Copy this checklist each loop iteration:

```txt
Loop Progress
- [ ] L1 Contract defined (request/response/error)
- [ ] L2 Rust command exists and registered
- [ ] L3 Frontend domain API wired to adapter
- [ ] L4 Tauri runtime uses invoke path only (no silent HTTP fallback)
- [ ] L5 Unit tests added (TS + Rust as needed)
- [ ] L6 Smoke e2e for critical path passed
- [ ] L7 Build gates passed (cargo check + web build)
- [ ] L8 Docs/changelog updated for real behavior
```

If any gate fails, do not mark loop complete.

## Step-by-Step Execution

### Step 1: Contract First

For each feature, write:
- method name
- input payload
- output payload
- error cases

Keep TypeScript and Rust names aligned (recommend camelCase on JSON boundary).

### Step 2: Rust First Skeleton

Before UI usage:
- add command in Rust
- register in `tauri::generate_handler![...]`
- return structured result (`Result<T, String>` or serializable app error)

### Step 3: Adapter Integration

Implement in domain API client:
- `if tauri => invoke`
- `else => HTTP`

Never call `invoke` or `fetch` directly in pages.

### Step 4: Fail-Fast Guard

In Tauri runtime:
- if invoke path is unavailable, throw explicit error
- do not fallback to `/api`

This prevents hidden regressions and random `ECONNREFUSED`.

### Step 5: Layered TDD Strategy

Use this test pyramid:

1. **Contract tests (TS, fast)**
   - validate adapter request/response shape
   - validate runtime selection logic
2. **Rust command tests (unit/integration)**
   - command behavior with temp dirs / mock data
3. **UI tests (component)**
   - mock domain API only, not transport
4. **Minimal e2e smoke (few high-value paths)**
   - app boots
   - one read path works (e.g. list)
   - one write path works (e.g. link/install)

Do not start with full e2e matrix. Start with 2-3 smoke cases.

### Step 6: Pre-Complete Gates

Always run:

```bash
cargo check --manifest-path src-tauri/Cargo.toml
pnpm --filter <web-package-name> build
```

And verify:
- no `/api/*` requests when running inside Tauri for migrated features
- no unregistered command invocation errors

## Tauri Migration Anti-Patterns

- "Web feature complete, migrate all later"
- Pages directly using HTTP/invoke
- Runtime auto fallback from Tauri to HTTP
- Rust command implemented but not registered
- TS/Rust schema mismatch discovered only at runtime
- e2e-only strategy without lower-level tests

## Prompt Template for Each Loop

Use this prompt in automation loops:

```txt
Apply web-to-tauri-migration-loop for feature: <feature-name>.
Follow L1-L8 gates strictly.
Constraints:
1) Contract first, then Rust command, then adapter, then UI.
2) In Tauri runtime, forbid silent HTTP fallback.
3) Add tests at contract layer and command layer before e2e.
4) Run cargo check and web build; report exact failures if any.
Output:
- Changed files
- Gate checklist status
- Remaining risks
```

## Scaffold Templates (Executable)

Use the scaffold script to generate feature skeletons for Web + Tauri + tests:

```bash
npx web-to-tauri-migration-loop-scaffold --feature <feature-name>
```

Optional:

```bash
npx web-to-tauri-migration-loop-scaffold \
  --feature <feature-name> \
  --web-root packages/web/src \
  --tauri-root src-tauri/src \
  --dry-run
```

The script creates:
- `packages/web/src/features/<feature>/api/contract.ts`
- `packages/web/src/features/<feature>/api/transport.tauri.ts`
- `packages/web/src/features/<feature>/api/transport.http.ts`
- `packages/web/src/features/<feature>/api/client.ts`
- `packages/web/src/features/<feature>/api/__tests__/runtime-selection.test.ts`
- `src-tauri/src/commands/<feature>.rs`
- `src-tauri/tests/<feature>_smoke.rs`
- `e2e/<feature>.tauri-smoke.spec.ts`

After scaffolding, manually:
- implement command body
- register command in `generate_handler![]`
- wire UI/store to domain client
- pass L1-L8 gates

## Definition of Done

A feature is done only when:

- Same domain API works in both Web and Tauri modes
- Tauri path does not depend on HTTP proxy for migrated behavior
- Commands are registered and callable
- Contract, command, and smoke tests pass
- Build gates pass without manual patching

## Quick Troubleshooting Map

- `ECONNREFUSED /api/...` in Tauri:
  - Tauri runtime fell into HTTP path, fix adapter/runtime guard
- `Command not found`:
  - command missing in `generate_handler!`
- UI works in web, fails in tauri:
  - transport coupling in page or schema drift between TS/Rust
- Frequent loop regressions:
  - missing L1 contract gate or L4 fail-fast gate
Files in this package (3)
  • SKILL.md 7 KB
  • reference.md 2 KB
  • scripts/scaffold-loop.mjs 7 KB

Versions

The database has no other skills named web-to-tauri-migration-loop.

Database snapshot: 13.11.2026 · package version be29e9029633 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 96tauri-troubleshooting
    Tauri v2 开发中常见问题的故障排查指南。当遇到 Tauri 插件权限、命令调用、配置错误等问题时触发此 skill。
  • 96tauri
    Tauri开发专家助手。当用户需要进行Tauri桌面应用开发、Rust后端+Web前端桌面应用、轻量级跨平台应用或系统级API调用时调用。
  • 100tauri-expert
    Expert in Tauri framework, Rust backend, web frontend integration, and lightweight desktop applications. Use when the user mentions desktop, Rust, web, cross platform, or performance, or when the task involves Tauri Architecture, Tauri vs Electron, Core Components, or Security Features.
  • 100tauri-mcp-test-runner
    Run Tauri MCP-driven E2E checks for VMark. Use when asked to execute or update automated UI flows that must use Tauri MCP tools (not browser DevTools), or when validating behavior in a running desktop session.
  • 100tauri
    Tauri builds desktop and mobile apps from a web frontend and a Rust backend, rendering the UI in the operating system's webview instead of a bundled Chromium. Use when creating or extending a Tauri v2 app: scaffolding with create-tauri-app, writing Rust commands and calling them…
  • 100tauri-mcp-testing
    E2E testing expert for Tauri applications using Tauri MCP server. Use when testing running Tauri apps - session management, webview interaction, IPC verification, screenshot capture, and debugging. ALWAYS use tauri_* tools, NEVER Chrome DevTools MCP for Tauri apps.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.