/knowledge-base:web-to-tauri-migration-loopfrom knowledge-base
Migrates Web-first apps to Tauri v2 using contract-first architecture, dual transport adapters, fail-fast runtime checks, and loop-based quality gates.
Ships in knowledge-base. 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.
Read when SKILL.md points to them; scripts run unread.
gsd:workflow
gsd:meta
web-to-tauri-migration-loop
incremental-loop
</gsd:meta>
gsd:goalShip 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>
Use this skill to migrate a Web-first app to Tauri v2 without "last-mile explosion".
pnpm dev:tauri starts but app crashes or hangs/api works in web mode but fails in Tauri (ECONNREFUSED)Do not migrate at the end in one shot. Ship each feature in a dual-path incremental loop:
Frontend pages must never call transport directly.
UI layer: React pages/componentsDomain API layer: stable methods like listSkills(), linkSkill()Transport layer:
tauriTransport -> invoke(...)webTransport -> HTTP clientRuntime selection: one adapter entrypoint decides transport onceRust command layer: #[tauri::command] functions registered in generate_handler!Mandatory rule:
Copy this checklist each loop iteration:
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.
For each feature, write:
Keep TypeScript and Rust names aligned (recommend camelCase on JSON boundary).
Before UI usage:
tauri::generate_handler![...]Result<T, String> or serializable app error)Implement in domain API client:
if tauri => invokeelse => HTTPNever call invoke or fetch directly in pages.
In Tauri runtime:
/apiThis prevents hidden regressions and random ECONNREFUSED.
Use this test pyramid:
Do not start with full e2e matrix. Start with 2-3 smoke cases.
Always run:
cargo check --manifest-path src-tauri/Cargo.toml
pnpm --filter <web-package-name> build
And verify:
/api/* requests when running inside Tauri for migrated featuresUse this prompt in automation loops:
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
Use the scaffold script to generate feature skeletons for Web + Tauri + tests:
npx web-to-tauri-migration-loop-scaffold --feature <feature-name>
Optional:
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.tspackages/web/src/features/<feature>/api/transport.tauri.tspackages/web/src/features/<feature>/api/transport.http.tspackages/web/src/features/<feature>/api/client.tspackages/web/src/features/<feature>/api/__tests__/runtime-selection.test.tssrc-tauri/src/commands/<feature>.rssrc-tauri/tests/<feature>_smoke.rse2e/<feature>.tauri-smoke.spec.tsAfter scaffolding, manually:
generate_handler![]A feature is done only when:
ECONNREFUSED /api/... in Tauri:
Command not found:
generate_handler!What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wangjs-jacky/jacky-skills --plugin knowledge-base9 skills in this plugin
/chrome-ext-ai-script📖 参考方案 | AI 驱动的 Chrome Extension 架构方案:Plasmo + Vercel AI SDK,侧边栏对话生成并执行页面脚本。此为蒸馏产物,供开发时参考查阅。触发词:Chrome 扩展参考、AI 脚本方案、Plasmo 参考、侧边栏脚本方案/codex-env-configCodex 环境配置兼容入口:安装升级、环境迁移、运行配置、认证、代理、Responses WebSocket 与技能同步统一读取 codex-ops 对应能力及 operation。/gh-workflow-generator快速生成带 GitHub Actions Workflow 的自动化采集项目。当用户想要创建定时采集、数据处理、自动化发布的 GitHub 仓库时触发。Other plugins' skills for the same job