windows-agent-shell

Diagnose and fix shell environment issues when commands work locally but break on Windows.

579|76|Updated Oct 29, 2026
Ready to run
npx skills add https://github.com/phuryn/product-engineering --skill windows-agent-shell-phuryn
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: windows-agent-shell
Source: https://github.com/phuryn/product-engineering/tree/main/agent-harness/skills/windows-agent-shell
Command: npx skills add https://github.com/phuryn/product-engineering --skill windows-agent-shell-phuryn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? When a command works on your machine but fails on Windows—or works in Git Bash but breaks in PowerShell—the root cause is often invisible: path separators, argument quoting, line endings, or text encoding handled differently by each shell. This Skill teaches you how to measure what actually happens instead of reasoning about it, then apply the specific fix for your shell and Claude Code version. ## Core Features & Use Cases - Path handling: Forward vs. backslash conversion, Git Bash MSYS2 path rewriting, drive letter casing for npm and Vitest. - Argument passing: PowerShell token splitting, backtick command substitution in git commit, MSYS_NO_PATHCONV environment variable. - Text encoding: UTF-8 corruption through PowerShell 5.1's Get-Content, CRLF vs. LF line endings, Python pipe encoding on Windows. - Use Case: Your release script passes locally but fails on CI. Run probe_argv.py with the same arguments in the actual shell to see exactly what the program receives, then apply the documented fix for your shell version. ## Quick Start Run the probe_argv.py script with your command arguments to see exactly what shell transformations occurred and which encodings are active.

Frequently Asked Questions about windows-agent-shell

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix Git Bash path conversion when arguments start with a slash?▼

Git Bash rewrites `/x` arguments into Windows paths before native programs see them. Remove the leading slash (`gh api repos/owner/name` instead of `gh api /repos/owner/name`), or set `MSYS_NO_PATHCONV=1` for that specific command to disable the conversion.

Why does PowerShell split my command-line flag into two arguments?▼

Windows PowerShell 5.1 and PowerShell 7 both split bare tokens like `-c.a.b=c` into `['-c', '.a.b=c']` instead of keeping them as one argument. Quote the entire flag: `-c.a.b=c` becomes `'-c.a.b=c'` to preserve it as a single token.

What causes UTF-8 text corruption when editing files in PowerShell?▼

PowerShell 5.1's Get-Content decodes UTF-8 as ANSI (cp1252), corrupting characters like § and —. Use the agent's own file edit tool instead, or write text to a file first and pass it by path with `--body-file` to avoid PowerShell's text handling.

How do I detect and fix CRLF line endings that a tool rewrites silently?▼

Run `check_text.py --changed` to find files with CRLF that differ from the repository index. Use `git ls-files --eol | grep w/crlf` to find tracked files with working-tree CRLF. Fix with `check_text.py --fix-crlf <file>`, which converts only line endings.

Why does Claude Code auto mode stop on commands that work in manual mode?▼

Claude Code 2.1.232–2.1.233 had a Windows-only analyser that stopped `cd && cmd`, heredocs, and variable expansions. This was fixed in 2.1.233 for most cases. Run `cd <dir> && sed -n '1,5p' <file>` on your version—if it runs without prompting, drop the workaround.

How do I prevent PowerShell from deleting environment variables when I set them to empty?▼

PowerShell deletes env vars set to empty string: `$env:X = ""` removes it. Set a single space instead (`$env:X = " "`) or use an explicit flag. Bash's `VAR= cmd` passes an empty value without deletion.