tauri-connector
Skill428 starsChanged 10 days agoMITView on GitHub
Use only when the user explicitly requests tauri-connector screenshot recognition of the TeyvatGuide Tauri v2 desktop UI. Otherwise do not proactively start or call the connector bridge.
- Installs packages
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use the repository's debug-only connector plugin with the globally installed tauri-connector CLI only when the user explicitly requests …
- Distinctive: line 15
Use the bridge only when the user explicitly requests screenshot recognition.
- Distinctive: line 16
Before starting anything, check whether a debug instance is already running and reuse it.
- Distinctive: line 52
Check for an already-running debug instance:
- Very specific: line 59
If status reports a live candidate, reuse it and skip starting a new process.
- Distinctive: line 63
Verify the setup and connection before interacting:
- Very specific: line 95
Stop only the exact dev process started by the agent unless the user asks to keep it running.
- Very specific: line 125
If status reports a stale candidate or the bridge reports no connected webview, restart the debug app and run tauri-connector bridge again.
- Very specific: line 127
If commands fail with a missing window, add the global --window-id TeyvatGuide.
- Very specific: line 128
If the captured screen does not match the inspected DOM, check for another installed TeyvatGuide window and confirm the .connector.json PID …
- Very specific: line 130
If a snapshot is truncated by the token budget, follow the printed subtree paths or use tauri-connector snapshots list and tauri-connector …
- Very specific: line 144
Keep that wiring in the client's own MCP configuration instead of committing a shared .mcp.json to this repository: the CLI workflow above …
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TeyvatGuide Tauri Connector Preview
Use the repository's debug-only connector plugin with the globally installed tauri-connector CLI only when the
user explicitly requests connector screenshot recognition; otherwise do not proactively start or call it.
This replaces the former tauri-mcp (tauri-plugin-mcp-bridge + @hypothesi/tauri-mcp-cli) workflow.
Usage principles
- Use the bridge only when the user explicitly requests screenshot recognition; do not proactively start or call it.
- Before starting anything, check whether a debug instance is already running and reuse it; start a new dev process only when none is running.
tauri-connectorresolves the connection as--host/--port>TAURI_CONNECTOR_*env > nearby.connector.jsonport scan, so a running debug app is usually discovered without extra flags.
Project constants
- CLI:
tauri-connector(install once withcargo install connector-cli --version 0.16.0 --locked) - Main window label:
TeyvatGuide— pass--window-id TeyvatGuideglobally, because the CLI defaultmaindoes not exist in this repository - Dev URL:
http://localhost:4000 - Debug command:
pnpm tauri dev --exit-on-panic - Ports: WS
9555(falls back through9555-9655), embedded MCP9556, in-webview bridge9300-9400 - Discovery file:
src-tauri/target/.connector.json(pid,ws_port,mcp_port,bridge_port,app_name,app_id)
The plugin is registered only for debug builds (src-tauri/src/lib.rs, #[cfg(debug_assertions)]) and requires the
connector:default capability plus app.withGlobalTauri: true; both are already configured. An installed release
application cannot be driven through this session even when it has the same executable name.
Screenshot source limits
tauri-plugin-connector is used with default-features = false, features = ["xcap"]. The upstream
native-screenshot feature is disabled on purpose: it calls WebView2 CapturePreview through
webview2-com 0.38/windows 0.61, which conflicts with Tauri 2.12's webview2-com 0.39/windows-core 0.62 at the
ICoreWebView2 call site.
Consequences:
- Window-level capture via
xcapis the default and supported path (equivalent to the previous viewport capture). --screenshot-source webview_nativeand other rich-inspection sources are unavailable; do not pass them.- The frontend
@zumer/snapdomfallback remains available for DOM rendering capture.
Preview workflow
- Inspect
src-tauri/tauri.conf.json,src-tauri/src/lib.rs, and the target UI before starting. Check for an already-running debug instance:
tauri-connector status --json Get-Content src-tauri/target/.connector.json -ErrorAction SilentlyContinue- If
statusreports a live candidate, reuse it and skip starting a new process. Only when nothing is running, startpnpm tauri dev --exit-on-panicas a hidden background process. Redirect stdout and stderr to explicit files under$env:TEMP, retain the returned process ID, and report build progress when it takes longer than one turn. Verify the setup and connection before interacting:
tauri-connector doctor --json tauri-connector bridgeAddress elements through references from a fresh snapshot, scoped to this repository's main window:
tauri-connector --window-id TeyvatGuide snapshot -i -c tauri-connector --window-id TeyvatGuide click "@e12" tauri-connector --window-id TeyvatGuide wait ".uc-box" --state visible --timeout 15000Validate both appearance and behavior. Check the active state, relevant DOM counts/text, and console errors; toggle changed controls at least once and restore the intended default.
tauri-connector --window-id TeyvatGuide get text "@e12" tauri-connector --window-id TeyvatGuide get count ".list-item" tauri-connector --window-id TeyvatGuide logs -n 20 -l error tauri-connector --window-id TeyvatGuide runtime -l errorSave screenshots to an explicit temporary path and inspect the image visually. The command prints the resolved path and
sha256as JSON; a requested path is not overwritten unless--overwriteis passed:tauri-connector --window-id TeyvatGuide screenshot $shotPath -f png -m 1600 --name-hint preview- Stop only the exact dev process started by the agent unless the user asks to keep it running. Never terminate
processes by a broad
TeyvatGuideor command-line wildcard.
Interaction examples
Navigate through visible UI controls instead of reloading the WebView, because app startup may restore the last route asynchronously:
tauri-connector --window-id TeyvatGuide snapshot -i -c
tauri-connector --window-id TeyvatGuide click "@e7"
tauri-connector --window-id TeyvatGuide wait "a[href='/user/combat']" --state visible --timeout 10000Execute serializable inspection scripts and act-then-verify in one call:
tauri-connector --window-id TeyvatGuide eval "JSON.stringify({ href: location.href, title: document.title })"
tauri-connector --window-id TeyvatGuide act click "@e7" --wait-selector ".uc-box" --screenshot --logsLocators are the fallback when refs are stale or unavailable:
tauri-connector --window-id TeyvatGuide locator --role button --name "高难挑战" --action click
tauri-connector --window-id TeyvatGuide find "高难挑战" -s textRecovery
- If
statusreports a stale candidate or the bridge reports no connected webview, restart the debug app and runtauri-connector bridgeagain. - If commands fail with a missing window, add the global
--window-id TeyvatGuide. - If the captured screen does not match the inspected DOM, check for another installed TeyvatGuide window and
confirm the
.connector.jsonPID belongs to the debug process; release builds never register the connector. - If a snapshot is truncated by the token budget, follow the printed subtree paths or use
tauri-connector snapshots listandtauri-connector snapshots read <uuid> subtree-0.txt. - Workflow, picker and IPC-capture commands additionally require
TAURI_CONNECTOR_WORKFLOW_TOKEN(at least 32 bytes) shared with the app process; screenshots, snapshots and basic interaction need no token.
MCP clients (optional)
While the debug app runs, the plugin embeds an MCP server at http://127.0.0.1:9556/mcp. An MCP client can either
connect to that URL directly or spawn the stdio proxy, which re-discovers the port on every connect:
tauri-connector bridgeKeep that wiring in the client's own MCP configuration instead of committing a shared .mcp.json to this
repository: the CLI workflow above needs no MCP configuration at all.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- fluent2-designSkill
- frontend-designSkill
- git-workflowSkill
- sentry-mcpSkill
- testingSkill
- teyvat-guideSkill
- typescript-standardsSkill
- vue3-standardsSkill
- web-design-guidelinesSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

