Code & Engineering

Windows Background Script Review for Node.js

Reviews a long-running Node.js script on Windows (a watcher, poller or worker that runs day and night) and the .cmd or .bat file that starts and stops it, for the ways it freezes or dies without a trace. Finds a script that prints to its console window (one click in the window freezes it), a script started in a console window that ends when someone closes it, a lock file that holds only a PID, a state file written without fsync and read back as empty when broken, a .pipe() into gunzip that kills the process when a connection drops, process.exit() after fetch ending in code 127, a parenthesis inside an if block of a .cmd, timeout in a .cmd with no console, and a .cmd saved with LF line endings. Gives the fix in code for each finding and ends a review with VERDICT: OK or VERDICT: CHANGE; a symptom question gets the cause first. Use when asked to review a 24/7 Node script or its start and stop .cmd on Windows, or why such a script stopped, froze, or says it is already running.

Windows Background Script Review for Node.js is a SKILL.md that reviews a long-running Node.js script on Windows (a watcher, poller or worker that runs day and night) and the .cmd or .bat file that starts and stops it, for the ways it freezes or dies without a trace; an agent buys it once for $0.05 over x402.

Tested 2026-11-22No code, no hidden instructionsv1.0.1 · 14.3 KB · perpetual license

Not for

Linux, macOS and Windows services written in other languages. It does not choose a process manager, set up restart after a reboot, or judge the PC's power settings. The facts come from a single Windows 11 PC running Node 24; other Windows builds were not tried. It reviews code and answers questions; it does not run or stop anything on your computer.

Tested, honestly

Tested 2026-11-22 with a strong and a weak model.

With and without the skill

Results with and without the skill, for Sonnet and Haiku
SonnetHaiku
withwithoutwithwithout
Inputs judged right (12 inputs)12/128/1210/125/12

Same request on both sides, scored on the point in any words. Read by hand, Sonnet without the skill already knew the .pipe() crash on a dropped download, the 127 exit after fetch, the bracket inside an if block, timeout with no console, and fsync with a kept copy. It missed two measured facts that break a running setup: it never said that closing the minimized window ends the script (it only switched QuickEdit off), and it judged a stale lock by the image name node.exe instead of the command line. On a sound stop file and a sound lock it raised two dangers measured not to happen. Haiku without the skill was right on five: it missed the closed window and the bracket in the echo, and raised a false alarm on every sound input. With the skill Haiku was right on ten, with extra edge cases on two sound inputs.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

SonnetStrong model, claude-sonnet-5-5
Right on all 12 inputs on the 1.0.1 bytes, read by hand. It said that closing the minimized console window ends the script, as a finding of its own next to the click freeze, and moved the start to Start-Process -WindowStyle Hidden with a window that only reads the log. It replaced a bare-PID lock check with the command line of that process, named the ) that an echo line ends inside an if block of the stop file, timeout with no console under execFile, the save without fsync together with the load that turns a broken file into an empty state, and .pipe() into gunzip that takes the whole process down, and it traced exit code 127 to process.exit() after fetch. It answered OK on all five sound inputs, including the stop file that runs PowerShell from execFile and the lock that links its file and checks the command line.
HaikuWeak model, claude-haiku-5-5
Right on 10 of 12 on the 1.0.1 bytes, read by hand. It found the console window that ends the script when closed, the bare-PID lock, the bracket in an echo inside an if block, timeout with no console, the save without fsync, .pipe() into gunzip and the 127 exit after fetch, and it answered OK on three sound inputs, the stop file among them, but it missed the OK verdict on two: on the sound lock it asked for a guard against two copies started in the same moment, which the skill lists as measured not to be needed, and on the sound pipeline it raised the exit code of the crash handler, which nothing reads.

Full test summary

Example

Our own test text, before and after the skill ran. Excerpts only.

English · claude-sonnet-5-5

Before

Before I start using it: our catalog scout has to run day and night on the office PC (Windows 11). I start it by double-clicking start-scout.cmd; between cycles the scout sleeps, and everything it does goes through log() below. :: start-scout.cmd @echo off rem start-scout.cmd - starts the catalog scout; it keeps running day and night, minimized on the taskbar cd /d "%~dp0"…

After

**[WINDOW-DEATH]** `start-scout.cmd`, last line: `start "catalog-scout" /min node scout.mjs` The scout runs inside a minimized console window and belongs to it. A minimized window looks idle, so someone will close it, and the scout ends with it, with no error and no last line in the log. The comment "minimized on the taskbar" describes exactly this setup.…

What is in the file

  • Facts this review rests on
  • What to check, in this order
  • 1. Where the script lives
  • 2. The lock
  • 3. Saving state
  • 4. Streams, crashes and the exit code
  • 5. The start and stop `.cmd` files
  • Symptom questions
  • Answer format
  • Not a finding
  • What not to do

Languages

Any language. Tried in: English.

License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.

Versions

Current version 1.0.1, updated 2026-11-22. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.0.1 · 2026-11-22

    Two sentences reworded with the same meaning, so that no published post on our blog shares a run of five words with the file (the blog build checks this). The side with the skill was run again in full on the new bytes, one run per model and input: Sonnet 12 of 12, Haiku 10 of 12 (was 9). The side without the skill is unchanged: 8 and 5 of 12.

  2. v1.0.0 · 2026-11-22

    - First version. - Changed before the first publish, after the first model run: a closed console window is now a finding of its own, kept apart from the click freeze in every review; a correct hidden start (and its log viewer) is named as fine; a start or stop .cmd that nobody has run yet is no longer a finding, because that code had turned a sound start file into a change request. Running a fixed .cmd in both states stays as advice inside the fix. - Test: the check for the closed-window fact was widened for both sides after reading the answers, to accept the window named in one sentence and closed as "it" in the next; the control gained that phrasing as a right answer and "closing it is harmless" as a wrong one. - Model run (22 November 2026, one run per model and input): on the final wording Sonnet was right on 12 of 12 with the skill and 8 of 12 without, Haiku on 10 of 12 with and 5 of 12 without. The first wording, run once before the fix above: Sonnet 11 of 12, Haiku 9 of 12. Price: 0.05 USD (50000 micro), set by a Sonnet gain of four inputs (two measured facts it lacked, two measured non-problems it raised). - After that run, two lines were reworded for the safety gate with no change in behaviour: the hidden start line in the .cmd example begins with @, which a batch file runs the same way, and the ping wait names localhost (measured on 22 November 2026 with no console on input: 3.1 s, the same as the numeric loopback address). - Skill side re-run in full on the final bytes, 22 November 2026: Sonnet 12 of 12, Haiku 9 of 12.

FAQ

Long-running Node scripts: which ones does it review?

A Node.js program that is meant to run for days on a Windows PC without anyone watching, such as a crawler, a feed watcher or a queue worker, together with the .cmd file that starts it and the one that stops it. The review looks for what ends or freezes such a program without leaving a message: a click inside its console window, a window someone closes, a lock file left over from before a power cut, a half-written state file, a stream that kills the process, and a batch file that quietly stops halfway.

How does it tell a stale lock from a running script?

Windows hands out process numbers again after a restart, so a number in a lock file proves nothing, and neither does the name node.exe. The skill asks for the command line of that process and compares it with the script's own file name. The question takes about half a second, so it is asked once at start. If the check itself cannot be made, the safer answer is to assume the holder is real and not start a second copy.

Does it help Claude Sonnet?

On four inputs out of twelve, yes. Sonnet got the same twelve requests with and without the skill: seven start files, stop files and modules with a planted Windows fault or a symptom, plus five sound twins. Alone it got eight; it knew the .pipe() crash, the 127 exit after fetch, the bracket in an if block, timeout with no console and the missing fsync. It never said that closing the minimized window ends the script, trusted node.exe in tasklist for an old lock, and raised two measured non-problems on sound inputs. With the skill: twelve. Haiku went from five to ten.

Read more

Share

Read this page as Markdown: /skills/windows-background-script-review.md.

  • Recommended

    Windows UTF-8 Request Body: curl and PowerShell

    Agents & Protocols

    SKILL.md · v1.0.0 · 13.7 KB

    Sends request text with Cyrillic, accented letters, em dashes, typographic quotes, apostrophes or the euro sign from Windows so that it reaches the server byte for byte. The curl that ships with Git for Windows converts text given on its command line to the ANSI code page, and Windows PowerShell 5.1 sends a string body without UTF-8, writes files in the ANSI code page, as UTF-16 or with a BOM, strips the quotes from JSON it hands to a program, ends strings at typographic quotes and runs Invoke-WebRequest when you type curl. The server still answers 200 and the page later shows � or ?. The body goes into a UTF-8 file without a BOM that curl reads itself, or into a script, or Invoke-RestMethod gets charset=utf-8 in -ContentType; the record is read back and compared with the source, and text that was already sent broken is fixed through an edit route, or the person is asked before anything is submitted twice. Use when an agent or a script on Windows posts JSON or form data with curl, Invoke-RestMethod or another command-line tool from Git Bash or PowerShell, or when text sent from Windows arrives as �, question marks, mojibake or with a BOM.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 25 Oct 2026

  • Agent Loop Review: Repeats, Caps, Self-Grading

    Agents & Protocols

    SKILL.md · v1.0.0 · 11.8 KB

    Reviews the description, configuration or code of an agent loop, anything that repeats on its own: a scheduled job that calls a model, an agent that retries until it is done, a batch of actions, a self-improving prompt loop. It finds where the loop runs away or repeats a side effect (no ceiling on iterations, the same scheduled tick delivered twice, a progress marker written after the effect, nothing kept between iterations, a batch that goes on after a refusal that will repeat for every item), where it judges its own work (the model says it is finished), where it acts beyond its brief (a token or tool set wider than the job, a delete, publish or mass send with no approval step) and where a dead source looks healthy (an empty reply counted as success, parallel workers writing one shared file). Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use for an agent loop review, to find out why a cron job runs twice, to check a retry until done loop, or to catch a runaway agent loop before it runs unattended.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 18 Oct 2026

More in Code & Engineering

  • Recommended

    OpenNext on Cloudflare Deploy Review

    Code & Engineering

    SKILL.md · v1.0.1 · 13.5 KB

    Reviews the deploy setup of a Next.js app that runs on Cloudflare Workers through OpenNext (@opennextjs/cloudflare): package.json versions and scripts, open-next.config.ts, the wrangler config and the CI deploy job, for what breaks the deploy or the live site while the build stays green. Finds ranges (^) on next and OpenNext instead of pinned versions, a pair that answers 500 on every page with Unexpected loadManifest(/.next/server/preview-props.json), version requirements between OpenNext, next and wrangler that are not met, a buildCommand that skips the checks in npm run build, variables set only in the dashboard, a CI job that runs wrangler deploy without a TTY and touches DNS, and a Durable Object migration that no upload applies. Gives the fix for each finding and ends a review with VERDICT: OK or VERDICT: CHANGE; a symptom question gets the cause first. Use when asked to review an OpenNext deploy setup before a release, or why a Cloudflare deploy was green and the site returns 500 or lost a setting.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 22 Nov 2026

  • Recommended

    Cloudflare Cron Trigger Review: Twice, Late, Never

    Code & Engineering

    SKILL.md · v1.0.1 · 13.3 KB

    Reviews the scheduled() handler of a Cloudflare Worker that dispatches jobs every minute, and its watchdog, for runs that happen twice, at the wrong minute, late or not at all. Finds a Cron Trigger event that arrives twice with the same scheduledTime and no claim before the outward action, a claim keyed from Date.now() instead of scheduledTime, Math.floor on a scheduledTime that arrives about 2 seconds early so everything runs a minute late, a daily job that needs one exact minute to fire, a catch-up that is unbounded or has no claim, a watchdog threshold shorter than the real gaps, and a Durable Object alarm that re-arms after its work or holds it outside waitUntil. Gives the fix in code for each finding and ends a review with VERDICT: OK or VERDICT: CHANGE; a symptom question gets the cause first. Use when asked to review a Cloudflare cron scheduler, or why scheduled jobs ran twice, a minute late or were skipped.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 22 Nov 2026

  • Durable Object Billing Review: Cloudflare Cost

    Code & Engineering

    SKILL.md · v1.0.2 · 11.2 KB

    Reviews Cloudflare Durable Object code, wrangler config and a Durable Objects bill for what costs money. Finds an object kept awake and billed for wall-clock time it does not need (a pending timer, AbortSignal.timeout that is never cleared, even inside a helper, setInterval instead of an alarm, WebSockets that cannot hibernate, work held by waitUntil), objects and SQL storage that pile up because nobody deletes them (an object per visitor or per MCP session, McpAgent probes), and bills that cross the included amount by a few percent and are charged a whole started unit. Explains how the bill is computed: GB-seconds at 128 MB, one allowance for the whole account, rounding up. Gives the fix in code for each finding and ends a review with VERDICT: OK or VERDICT: CHANGE. Use when asked to review Durable Object code or config for cost, or why a Durable Objects bill is higher than the work done.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 22 Nov 2026

  • WCAG Color Contrast Check: AA and AAA Ratios

    Code & Engineering

    SKILL.md · v1.0.1 · 10.3 KB

    Computes the real contrast ratio of every text and background pair in pasted CSS, design tokens or a palette, says whether each pair passes WCAG AA and AAA, and gives every failing pair a replacement color that passes on its real background. It carries a table of 256 channel values so the ratio is added and divided instead of guessed, and it reads the cases a glance gets wrong: a rgba color or opacity is blended with its background first, a placeholder is text, 18px bold is not large text, a border or an icon is a 3:1 component, a disabled control and a logo are exempt, short hex and color names are expanded, and 4.48 is never rounded up to 4.5. One line per pair, then a Verdict line. Use when asked for a WCAG color contrast check of a stylesheet, theme or palette, whether colors pass AA or AAA, or to fix text colors that are too pale.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 12 Nov 2026