| 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 --decorate
-
Dry-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-run
-
Schedule 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 30
-
After 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 from the checkout.
- It uses a
nohup sleep wrapper for the delayed timer. Do not use launchctl submit here: launchd can keep descendant pnpm dev processes 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-run before scheduling unless the user explicitly asks to restart immediately.