name: pwragent-dev-restart
description: Safely restart the local PwrAgent Electron development app after pulling, rebasing, or merging changes. Use when Codex is running inside or alongside the PwrAgent dev app and a normal restart could kill the current session before pnpm dev is relaunched.
PwrAgent Dev Restart
Use this skill when the running Electron app must be stopped and restarted from a freshly updated checkout, especially after merging a PR into ~/github/PwrAgnt.
Workflow
Confirm the target checkout is updated and clean enough to run:
git -C /Users/huntharo/github/PwrAgnt status --short --branch git -C /Users/huntharo/github/PwrAgnt log -1 --oneline --decorateDry-run the restart to see which processes would be stopped:
.agents/skills/pwragent-dev-restart/scripts/restart-pwragent-dev.zsh \ schedule --root /Users/huntharo/github/PwrAgnt --delay 30 --dry-runSchedule the restart and answer the user before the delay expires:
.agents/skills/pwragent-dev-restart/scripts/restart-pwragent-dev.zsh \ schedule --root /Users/huntharo/github/PwrAgnt --delay 30After the delay, verify the app came back:
tail -120 /Users/huntharo/github/PwrAgnt/.local/pwragent-dev-restart.log pgrep -fl '/Users/huntharo/github/PwrAgnt|PwrAgent|pnpm.*dev|electron-vite'
Script Notes
- The script stops processes matching the target checkout path and their bounded parent dev-server chain, then starts
pnpm dev:devfrom the checkout. - The script discovers running processes by checkout path. It does not require a pidfile or a previous skill-started instance.
- It excludes Codex helper processes whose serialized command payloads mention the checkout path but are not part of the PwrAgent dev process tree.
- With
--detach-start, the script starts the dev command in a detachedtmuxsession whentmuxis available. This survives parent command cleanup while keeping the dev logs in the configured restart log. - It uses a
nohupsleep wrapper for the delayed timer. Do not uselaunchctl submithere: launchd can keep descendantpnpm devprocesses in the submitted job context and relaunch them after they exit. - Default root is
/Users/huntharo/github/PwrAgnt. - Default log is
<root>/.local/pwragent-dev-restart.log. - Use
--dry-runbefore scheduling unless the user explicitly asks to restart immediately.