agentleFS
SamuelNDCESamuelNDCE/claude-super-skill-library/skills/devops-infra/windows-process-restart/SKILL.md

Windows Process Restart (Safe)

Skill1 starsChanged 3 months agoMITView on GitHub

Safely stop and restart Windows background Node/supervised processes with real verification. Use when restarting a supervised bot process, any run.js-supervised watcher, or any long-running background process on this machine, especially after a code change that needs a live reload.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Wait a few seconds and re-check: same PID still alive (no crash loop), sane memory footprint.

    line 29
  2. Distinctive:

    Never trust "stopped successfully" from any tool: verify by process listing.

    line 36
  3. Very specific:

    Never Stop-Process by name (node) on this machine: multiple unrelated Node processes run (MCP servers, other bots).

    line 37
  4. Distinctive:

    If a Tauri/WebView2 app window stops rendering with the process alive, check for a stale lock after a previous taskkill before restarting …

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Windows Process Restart (Safe)

TaskStop's success message is NOT trustworthy on this Windows setup (logged 2026-07-02, recurred 2026-07-04 and 2026-07-06). Never report a restart done without PID-level verification.

The procedure

  1. Find the real processes first:
Get-CimInstance Win32_Process -Filter "Name='node.exe'" | Select-Object ProcessId, ParentProcessId, CommandLine

Identify which PID is the supervisor (e.g. run.js) and which is the child (e.g. index.js). Match on CommandLine, not guesswork.

  1. For supervised processes (child/supervisor pattern): kill ONLY the child. The self-healing supervisor respawns it with the new code. Killing the supervisor takes everything down.
Stop-Process -Id <childPid> -Force

Confirm with the user before killing anything if the process serves live traffic.

  1. Verify the respawn actually happened:
Get-CimInstance Win32_Process -Filter "Name='node.exe'" | Select-Object ProcessId, CommandLine
  • A NEW PID must exist for the child script.
  • Wait a few seconds and re-check: same PID still alive (no crash loop), sane memory footprint.
  • For watchers, also confirm the state file timestamp refreshes (e.g. launch-watch-state.json).
  1. Before wiring new code into a supervised process: node --check <file> every changed file first. A syntax error puts the supervisor into a crash loop.

Rules

  • Never trust "stopped successfully" from any tool: verify by process listing.
  • Never Stop-Process by name (node) on this machine: multiple unrelated Node processes run (MCP servers, other bots).
  • If a Tauri/WebView2 app window stops rendering with the process alive, check for a stale lock after a previous taskkill before restarting blindly (see NV lesson 2026-07-05).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.