packages/desktop/.agents/skills/desktop-develop/SKILL.md
Use this skill to turn desktop work into a tight harness loop: gather runtime context, reproduce with the UI and logs visible to the agent, make the smallest fix, verify through the same path, and encode any missing affordance back into the repo.
Read references/harness-principles.md when the task changes the development
workflow, observability, docs, tests, or agent-facing harness itself.
For bug reports, UI failures, hangs, startup problems, messaging issues, or anything involving the running desktop app, inspect the runtime logs directly. Important paths:
~/Library/Logs/@craft-agent/electron/main.log~/Library/Logs/@craft-agent/electron/main.old.log~/.craft-agent/logs/messaging-gateway.logSearch logs before guessing:
rg -n "error|warn|failed|exception|crash|Unhandled|rejection|browser-cdp|messaging-gateway" \
"$HOME/Library/Logs/@craft-agent/electron/main.log" \
"$HOME/.craft-agent/logs/messaging-gateway.log"
list_pages, select_page, take_snapshot, then console/network
inspection. Prefer accessibility snapshots over screenshots for reasoning.Use desktop-specific commands from packages/desktop:
cd packages/desktop
bun run electron:dev
bun run electron:dev:terminal
bun run electron:dev:logs
Use electron:dev:terminal when the bug involves process output, startup, or
shutdown. Use electron:dev:logs when the app is already running and you need a
live log tail.
If DevTools tools are not loaded, search for chrome-devtools tools first.
Then:
mcp__chrome_devtools.list_pages.mcp__chrome_devtools.select_page.mcp__chrome_devtools.take_snapshot.mcp__chrome_devtools.list_console_messages, then
mcp__chrome_devtools.get_console_message for important entries.mcp__chrome_devtools.get_network_request when network state is involved.mcp__chrome_devtools.take_heapsnapshot and keep it under .qwen/ or
/tmp, not in source directories.Always take a fresh snapshot after each UI-changing action. Do not rely on stale element ids or old console state.
Choose the narrowest checks that cover the touched surface:
cd packages/desktop && bun run typecheck:electron
cd packages/desktop && bun run typecheck:all
cd packages/desktop && bun run validate:dev
cd packages/desktop/apps/electron && bun run lint
cd packages/desktop/packages/shared && bun test path/to/file.test.ts
For root CLI/core changes, use the root repository commands from AGENTS.md
instead. For desktop-only changes, prefer desktop package commands first.
Favor changes that future agents can inspect and verify:
.qwen/investigations/.Stop and ask the user only when the missing input cannot be discovered locally and a reasonable assumption would risk changing the wrong behavior.