pwragent-dev-restart
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 ki
SKILL.md.agents/skills/pwragent-dev-restart/SKILL.md
GitHubPwrAgent 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.
Run the commands below from the checkout you want to restart. The script derives its default root from its own location, so it targets the checkout it ships in, including a git worktree.
Workflow
Confirm the target checkout is updated and clean enough to run:
git status --short --branchgit 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 --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 --delay 30After the delay, verify the app came back:
tail -120 .local/pwragent-dev-restart.logpgrep -fl "$PWD|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 helper and coding-agent CLI processes whose serialized command payloads mention the checkout path but are not part of the PwrAgent dev process tree.
- It also never signals its own ancestors. The shell or agent session that
starts the restart is usually a grandparent or higher, and its command line
can contain the checkout path.
schedulepasses that protected pid set to the detachedrestart-nowchild, which is reparented and cannot discover it. - 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 derived from the script location: the checkout that contains
.agents/skills/pwragent-dev-restart/scripts/restart-pwragent-dev.zsh. Pass--root PATHto target a different checkout. - The root must be a pnpm workspace root (
package.jsonandpnpm-workspace.yaml). The script stops processes whose command line matches the root path, so it refuses a broad root that would match unrelated processes. - Default log is
<root>/.local/pwragent-dev-restart.log. - Use
--dry-runbefore scheduling unless the user explicitly asks to restart immediately.