SkillHub

nerve-bridge-skill

vv1.0.0

Bi-directional control of Trae via macOS AppleScript with built-in feedback mechanism. Use when needing to execute code/commands in Trae IDE and wait for completion confirmation.

Sourced from ClawHub, Authored by 88901111hz-lang

Installation

Please help me install the skill `nerve-bridge-skill` from SkillHub official store. npx skills add 88901111hz-lang/nerve-bridge-skill

Nerve Bridge (v2)

Direct neural link to Trae with closed-loop feedback via macOS AppleScript.

Quick Start

Send instruction and wait for confirmation:

python3 nerve_bridge.py "<instruction>"

Example:

python3 nerve_bridge.py "Create a new Python file and add a simple 'Hello World' function. After creating, add a print statement to test it."

How It Works

  1. Signal Injection:
  2. Payload is copied to system clipboard via pbcopy
  3. AppleScript activates Trae and simulates: Space (wake) → Delete → Cmd+V → Enter

  4. Feedback Loop:

  5. Instruction must include a Python hook that writes to ~/.openclaw/workspace/trae_feedback.json when done
  6. Script waits up to 5 minutes (300 seconds) for the signal file
  7. Returns JSON feedback when received

Required Hook Pattern

When crafting instructions, include this pattern at the end:

import json, time
with open("~/.openclaw/workspace/trae_feedback.json", "w") as f:
    json.dump({"status": "success", "timestamp": time.time()}, f)

Environment

  • Platform: macOS only
  • Dependencies: System Python (python3), AppleScript (osascript)
  • Permissions: System Events and Terminal must have "Accessibility" permissions
  • Output File: ~/.openclaw/workspace/trae_feedback.json (created by the script)

Troubleshooting

  • No output from Trae: Check if Trae window is active and input is focused
  • Timeout: Trae didn't complete within 5 minutes
  • Permission denied: macOS may need to grant Terminal System Events permission