{"id":"de3f1a99-abe4-4b1c-83a3-b60536060655","shortId":"FWnY6U","kind":"skill","title":"windows-shell-reliability","tagline":"Reliable command execution on Windows: paths, encoding, and common binary pitfalls.","description":"# Windows Shell Reliability Patterns\n\n> Best practices for running commands on Windows via PowerShell and CMD.\n\n## When to Use\nUse this skill when developing or debugging scripts and automation that run on Windows systems, especially when involving file paths, character encoding, or standard CLI tools.\n\n---\n\n## 1. Encoding & Redirection\n\n### CRITICAL: Redirection Differences Across PowerShell Versions\nOlder Windows PowerShell releases can rewrite native-command output in ways that break\nlater processing. PowerShell 7.4+ preserves the byte stream when redirecting stdout,\nso only apply the UTF-8 conversion workaround when you are dealing with older shell\nbehavior or a log file that is already unreadable.\n\n| Problem | Symptom | Solution |\n|---------|---------|----------|\n| `dotnet > log.txt` | `view_file` fails in older Windows PowerShell | `Get-Content log.txt | Set-Content -Encoding utf8 log_utf8.txt` |\n| `npm run > log.txt` | Need a UTF-8 text log with errors included | `npm run ... 2>&1 | Out-File -Encoding UTF8 log.txt` |\n\n**Rule:** Prefer native redirection as-is on PowerShell 7.4+, and use explicit UTF-8\nconversion only when older Windows PowerShell redirection produces an unreadable log.\n\n---\n\n## 2. Handling Paths & Spaces\n\n### CRITICAL: Quoting\nWindows paths often contain spaces.\n\n| ❌ Wrong | ✅ Correct |\n|----------|-----------|\n| `dotnet build src/my project/file.fsproj` | `dotnet build \"src/my project/file.fsproj\"` |\n| `& C:\\Path With Spaces\\bin.exe` | `& \"C:\\Path With Spaces\\bin.exe\"` |\n\n**Rule:** Always quote absolute and relative paths that may contain spaces.\n\n### The Call Operator (&)\nIn PowerShell, if an executable path starts with a quote, you MUST use the `&` operator.\n\n**Pattern:**\n```powershell\n& \"C:\\Program Files\\dotnet\\dotnet.exe\" build ...\n```\n\n---\n\n## 3. Common Binary & Cmdlet Pitfalls\n\n| Action | ❌ CMD Style | ✅ PowerShell Choice |\n|--------|-------------|---------------------|\n| Delete | `del /f /q file` | `Remove-Item -Force file` |\n| Copy | `copy a b` | `Copy-Item a b` |\n| Move | `move a b` | `Move-Item a b` |\n| Make Dir | `mkdir folder` | `New-Item -ItemType Directory -Path folder` |\n\n**Tip:** Using CLI aliases like `ls`, `cat`, and `cp` in PowerShell is usually fine, but using full cmdlets in scripts is more robust.\n\n---\n\n## 4. Dotnet CLI Reliability\n\n### Build Speed & Consistency\n| Context | Command | Why |\n|---------|---------|-----|\n| Fast Iteration | `dotnet build --no-restore` | Skips redundant nuget restore. |\n| Clean Build | `dotnet build --no-incremental` | Ensures no stale artifacts. |\n| Background | `Start-Process dotnet -ArgumentList 'run' -RedirectStandardOutput output.txt -RedirectStandardError error.txt` | Launches the app without blocking the shell and keeps logs. |\n\n---\n\n## 5. Environment Variables\n\n| Shell | Syntax |\n|-------|--------|\n| PowerShell | `$env:VARIABLE_NAME` |\n| CMD | `%VARIABLE_NAME%` |\n\n---\n\n## 6. Long Paths\nWindows has a 260-character path limit by default.\n\n**Fix:** If you hit long path errors, use the extended path prefix:\n`\\\\?\\C:\\Very\\Long\\Path\\...`\n\n---\n\n## 7. Troubleshooting Shell Errors\n\n| Error | Likely Cause | Fix |\n|-------|-------------|-----|\n| `The term 'xxx' is not recognized` | Path not in $env:PATH | Use absolute path or fix PATH. |\n| `Access to the path is denied` | File in use or permissions | Stop process or run as Admin. |\n| `Encoding mismatch` | Older shell redirection rewrote the output | Re-export the file as UTF-8 or capture with `2>&1 | Out-File -Encoding UTF8`. |\n\n---\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["windows","shell","reliability","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding"],"capabilities":["skill","source-sickn33","skill-windows-shell-reliability","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/windows-shell-reliability","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34404 github stars · SKILL.md body (3,835 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T00:51:59.352Z","embedding":null,"createdAt":"2026-04-18T21:47:38.280Z","updatedAt":"2026-04-22T00:51:59.352Z","lastSeenAt":"2026-04-22T00:51:59.352Z","tsv":"'-8':99,146,176,478 '/f':268 '/q':269 '1':60,155,483 '2':154,188,482 '260':399 '3':256 '4':328 '5':381 '6':393 '7':421 '7.4':86,171 'absolut':222,441 'access':446 'across':66 'action':261 'admin':462 'alias':308 'alreadi':116 'alway':220 'app':373 'appli':96 'argumentlist':365 'artifact':359 'as-i':166 'ask':522 'autom':43 'b':279,284,288,293 'background':360 'behavior':109 'best':20 'bin.exe':213,218 'binari':14,258 'block':375 'boundari':530 'break':82 'build':202,206,255,332,341,350,352 'byte':89 'c':209,214,250,417 'call':231 'captur':480 'cat':311 'caus':427 'charact':54,400 'choic':265 'clarif':524 'clean':349 'clear':497 'cli':58,307,330 'cmd':30,262,390 'cmdlet':259,322 'command':6,24,77,336 'common':13,257 'consist':334 'contain':197,228 'content':132,136 'context':335 'convers':100,177 'copi':276,277,281 'copy-item':280 'correct':200 'cp':313 'criteria':533 'critic':63,192 'deal':105 'debug':40 'default':404 'del':267 'delet':266 'deni':451 'describ':501 'develop':38 'differ':65 'dir':295 'directori':302 'dotnet':121,201,205,253,329,340,351,364 'dotnet.exe':254 'encod':11,55,61,137,159,463,487 'ensur':356 'env':387,438 'environ':382,513 'environment-specif':512 'error':150,411,424,425 'error.txt':370 'especi':49 'execut':7,237 'expert':518 'explicit':174 'export':473 'extend':414 'fail':125 'fast':338 'file':52,113,124,158,252,270,275,452,475,486 'fine':318 'fix':405,428,444 'folder':297,304 'forc':274 'full':321 'get':131 'get-cont':130 'handl':189 'hit':408 'includ':151 'increment':355 'input':527 'involv':51 'item':273,282,291,300 'itemtyp':301 'iter':339 'keep':379 'later':83 'launch':371 'like':309,426 'limit':402,489 'log':112,148,187,380 'log.txt':122,133,142,161 'log_utf8.txt':139 'long':394,409,419 'ls':310 'make':294 'match':498 'may':227 'mismatch':464 'miss':535 'mkdir':296 'move':285,286,290 'move-item':289 'must':244 'name':389,392 'nativ':76,164 'native-command':75 'need':143 'new':299 'new-item':298 'no-increment':353 'no-restor':342 'npm':140,152 'nuget':347 'often':196 'older':69,107,127,180,465 'oper':232,247 'out-fil':156,484 'output':78,470,507 'output.txt':368 'path':10,53,190,195,210,215,225,238,303,395,401,410,415,420,435,439,442,445,449 'pattern':19,248 'permiss':456,528 'pitfal':15,260 'powershel':28,67,71,85,129,170,182,234,249,264,315,386 'practic':21 'prefer':163 'prefix':416 'preserv':87 'problem':118 'process':84,363,458 'produc':184 'program':251 'project/file.fsproj':204,208 'quot':193,221,242 're':472 're-export':471 'recogn':434 'redirect':62,64,92,165,183,467 'redirectstandarderror':369 'redirectstandardoutput':367 'redund':346 'relat':224 'releas':72 'reliabl':4,5,18,331 'remov':272 'remove-item':271 'requir':526 'restor':344,348 'review':519 'rewrit':74 'rewrot':468 'robust':327 'rule':162,219 'run':23,45,141,153,366,460 'safeti':529 'scope':500 'script':41,324 'set':135 'set-cont':134 'shell':3,17,108,377,384,423,466 'skill':36,492 'skill-windows-shell-reliability' 'skip':345 'solut':120 'source-sickn33' 'space':191,198,212,217,229 'specif':514 'speed':333 'src/my':203,207 'stale':358 'standard':57 'start':239,362 'start-process':361 'stdout':93 'stop':457,520 'stream':90 'style':263 'substitut':510 'success':532 'symptom':119 'syntax':385 'system':48 'task':496 'term':430 'test':516 'text':147 'tip':305 'tool':59 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'treat':505 'troubleshoot':422 'unread':117,186 'use':33,34,173,245,306,320,412,440,454,490 'usual':317 'utf':98,145,175,477 'utf8':138,160,488 'valid':515 'variabl':383,388,391 'version':68 'via':27 'view':123 'way':80 'window':2,9,16,26,47,70,128,181,194,396 'windows-shell-reli':1 'without':374 'workaround':101 'wrong':199 'xxx':431","prices":[{"id":"0932f379-65f5-46a1-8974-d639d2d63cd7","listingId":"de3f1a99-abe4-4b1c-83a3-b60536060655","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:47:38.280Z"}],"sources":[{"listingId":"de3f1a99-abe4-4b1c-83a3-b60536060655","source":"github","sourceId":"sickn33/antigravity-awesome-skills/windows-shell-reliability","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/windows-shell-reliability","isPrimary":false,"firstSeenAt":"2026-04-18T21:47:38.280Z","lastSeenAt":"2026-04-22T00:51:59.352Z"}],"details":{"listingId":"de3f1a99-abe4-4b1c-83a3-b60536060655","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"windows-shell-reliability","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34404,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-21T16:43:40Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"400e94f4c6e7a94f3807a8dcf410953fa9867c65","skill_md_path":"skills/windows-shell-reliability/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/windows-shell-reliability"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"windows-shell-reliability","description":"Reliable command execution on Windows: paths, encoding, and common binary pitfalls."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/windows-shell-reliability"},"updatedAt":"2026-04-22T00:51:59.352Z"}}