regen-windows-env
Environment recipes for building, testing, and shipping regen-civics from Rye's Windows machine and the Cowork sandbox. Use when tests fail with React.act errors, when the sandbox mount shows phantom
SKILL.md.claude/skills/regen-windows-env/SKILL.md
GitHubReGen Windows Environment
Mined 2026-07-17 from session memory that only Cowork could see. These quirks break builds and tests for any agent that does not know them. Deterministic recipes, no judgment calls.
Test and typecheck
- A global
NODE_ENV=productionenv var breaks vitest React component tests (React.act is not a function). Always runnpx cross-env NODE_ENV=test vitest run .... - The typecheck script is
pnpm check. (pnpm typecheckexists now only as an alias; older docs referencing it were wrong for months.)
Cowork sandbox limits
- The sandbox cannot run the node toolchain: pnpm's Windows junction symlinks in node_modules give I/O errors through the mount. Pure-python repo scripts against the mount are fine (audit-truncation.py works).
- The FUSE mount can serve STALE state: phantom truncated files, phantom deletions in
git diff, phantom index.lock (observed 2026-07-12). Never trustgit status/diffor sandbox file reads for this repo; verify on the real filesystem. Host-path Read/Write/Edit tools are fine. - Background processes do not survive between sandbox bash calls, so anything needing a live server or browser install cannot run there.
Desktop Commander (cmd.exe) recipes
- Syntax:
cd /d "path" && .... - Long jobs: output capture times out around 2 to 3 minutes and can falsely return "0 lines". Redirect to a file and poll it:
... 2>&1 | Add-Content .verify.logthen read the file. Launch withstart /b cmd /c "... > log 2>&1"for anything long. - PowerShell
-Commandstrings get$stripped ($_arrives as_). Avoid variables; pipe toSelect-Object/Format-List. - Commit and push as separate process calls: multi-part
git commit -m -minside a cmd /c chain can swallow the following&&into the commit body. - Stale 0-byte
.git/index.lockwith no git.exe running is safe to delete. Usegit pull --rebase --autostashsince the tree usually carries unrelated local edits.
Worktree gate recipe (isolated verification)
git worktree add .claude\worktrees\<name> origin/main --detachINSIDE the connected folder.pnpm install --prefer-offlinein the worktree (~70s). A node_modules JUNCTION breaks tsc resolution (hundreds of phantom TS2307s); a real install avoids it.- Run
pnpm gateDETACHED viaStart-Process powershellwriting to a file; MCP timeouts kill child processes otherwise. - Targeted
git addonly (parallel sessions sweep loose edits into their commits), thengit push origin HEAD:main.