Agent skill
webview-bridge-handshake
Contract-first browser preview pattern for WebView2-hosted React apps
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/webview-bridge-handshake
SKILL.md
Context
Use this when a React UI and a WebView2 desktop host need to move in parallel without hard-blocking each other.
Pattern
- Define one shared
BridgeMessageenvelope and keep request payloads serializable. - Expose
window.hostBridge.receive(message)early so the host can inject messages later without changing React code. - On the desktop side, post JSON with WebView2 and inject a document-created shim that forwards
messageevents intowindow.hostBridge.receive(...)when that hook exists. - Resolve the real Web UI build first, but ship a bundled placeholder page so the WPF shell stays bootable and the bridge can be exercised before the real bundle exists.
- Let preview and placeholder modes resolve to an explicit "host pending" handshake snapshot instead of throwing or inventing fake success states.
- Keep page components read-only until real host capabilities are available; render bridge status and activity so integration work is observable.
Why it helps
- Frontend and host work can proceed in parallel.
- The desktop host can boot honestly even when the real Web UI build is not ready yet.
- Placeholder UI still compiles and stays honest about missing capabilities.
- The host team gets one narrow seam to target instead of scattered component callbacks.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?