LiveHotspot
Operating Model
Treat hotspot instability as two related problems:
- The laptop sleeps, idles disks, or drops Wi-Fi during long-running work.
- The phone hotspot or OS Wi-Fi stack decides the client is inactive and disconnects.
Use the smallest transparent fix that handles the live machine. Prefer native commands, user-level schedulers, readable scripts, logs, and simple rollback commands. Avoid compiled binaries, obfuscation, credential scraping, browser/session access, stealth persistence, hidden-window tricks, global power changes, or admin escalation unless the user explicitly approves.
This skill must work in two modes:
- Direct execution mode: the current agent diagnoses and installs the fix on the live machine.
- Delegation mode: the current agent gives the user a single copy-paste prompt from
assets/agent-prompt.zh.mdso a weaker local agent can execute the workflow.
Workflow
-
Confirm OS and hotspot role.
- Client mode: laptop connects to a phone hotspot. This is the default for this skill.
- Host mode: laptop creates a hotspot for other devices. Use the OS-specific notes in
references/windows.mdorreferences/linux.md; do not apply client assumptions blindly.
-
Inspect current state before changing anything.
- macOS:
route -n get default,ipconfig getifaddr en0,networksetup -getairportnetwork en0,pmset -g assertions. - Windows:
netsh wlan show interfaces,ipconfig,powercfg /requests. - Linux:
nmcli -t -f DEVICE,TYPE,STATE,CONNECTION dev,ip route,systemd-inhibit --list.
- macOS:
-
Choose the OS path.
- macOS: use
scripts/macos-livehotspot.shplus a user LaunchAgent. Readreferences/macos.md. - Windows: use a user Task Scheduler action that runs a transparent PowerShell script. Read
references/windows.md. - Linux: use NetworkManager plus a user systemd service/timer when available. Read
references/linux.md.
- macOS: use
-
Keep AV and security posture boring.
- Store scripts in a normal user directory with ASCII paths.
- Log to a normal user log path.
- Do not use
curl | sh, base64 payloads, encoded PowerShell commands, registry Run keys, LaunchDaemons, root services, browser automation, or credential APIs. - Prefer user-visible command lines and documented OS APIs.
- Include uninstall commands in the final answer.
-
Verify with evidence.
- Show the user the service state, process/assertion evidence, latest log lines, and a short time-window stability check.
- If testing cannot run on the current OS, say so and provide a dry-run/syntax check instead.
Copy-paste Agent Prompt
When the user wants another agent to use this capability, return the text in assets/agent-prompt.zh.md. Do not summarize away its safety rules; the point is to give a weaker agent a complete, explicit runbook.
Decision Points
- If the hotspot is an iPhone on macOS, detect it by route/gateway and the
172.20.10.xaddress pattern instead of SSID alone; Instant Hotspot often reports no AirPort association while routing still works. - If the connection still drops after keepalive, add reconnect attempts to known SSIDs, then consider USB tethering as the next more reliable transport.
- If the user is on battery and wants long runtime, ask before forcing aggressive no-sleep behavior.
- If a corporate antivirus/EDR is present, keep scripts especially plain: no encoded commands, no downloaded dependencies, no hidden scheduled task, no privilege escalation.
Bundled Resources
scripts/macos-livehotspot.sh: generic macOS client-side keepalive/reconnect loop adapted from a live iPhone hotspot fix.references/macos.md: LaunchAgent install/verify/uninstall pattern.references/windows.md: PowerShell and Task Scheduler pattern for Windows laptops.references/linux.md: NetworkManager and user systemd pattern for Linux laptops.references/research.md: notes from public GitHub/web research and what not to reuse blindly.assets/agent-prompt.zh.md: Chinese copy-paste prompt for generic local agents, including safety rules, OS routing, verification, and rollback requirements.