windows-shell-reliability
하는 일
이 도구는 Windows에서 오류 없이 명령을 실행하는 데 도움을 줍니다. 공백이 있는 파일 경로를 다루는 법, 올바른 텍스트 인코딩을 쓰는 법, 프로그램을 실행할 때의 흔한 함정을 피하는 법을 가르칩니다.
사용하는 경우
- ✓Windows에서 실행되는 프로그램을 만들거나 고칠 때.
- ✓파일 이름에 공백이 있어 명령이 실패하는 경우.
- ✓명령 출력 텍스트에 이상한 문자가 보일 때.
스킬 링크
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/windows-shell-reliability/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“공백이 들어 있는 이름의 폴더에 있는 프로그램은 어떻게 실행하나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
도구는 공백이 있는 파일 경로를 따옴표로 감싸는 방법과, 인코딩 오류나 프로그램 문제를 피하기 위한 특정 Windows 명령을 사용하는 방법을 알려 줍니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Windows Shell Reliability Patterns
Best practices for running commands on Windows via PowerShell and CMD.
When to Use
Use 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.
1. Encoding & Redirection
CRITICAL: Redirection Differences Across PowerShell Versions
Older Windows PowerShell releases can rewrite native-command output in ways that break later processing. PowerShell 7.4+ preserves the byte stream when redirecting stdout, so only apply the UTF-8 conversion workaround when you are dealing with older shell behavior or a log file that is already unreadable.
| Problem | Symptom | Solution |
|---|---|---|
dotnet > log.txt |
view_file fails in older Windows PowerShell |
`Get-Content log.txt |
npm run > log.txt |
Need a UTF-8 text log with errors included | `npm run ... 2>&1 |
Rule: Prefer native redirection as-is on PowerShell 7.4+, and use explicit UTF-8 conversion only when older Windows PowerShell redirection produces an unreadable log.
2. Handling Paths & Spaces
CRITICAL: Quoting
Windows paths often contain spaces.
| ❌ Wrong | ✅ Correct |
|---|---|
dotnet build src/my project/file.fsproj |
dotnet build "src/my project/file.fsproj" |
& C:\Path With Spaces\bin.exe |
& "C:\Path With Spaces\bin.exe" |
Rule: Always quote absolute and relative paths that may contain spaces.
The Call Operator (&)
In PowerShell, if an executable path starts with a quote, you MUST use the & operator.
Pattern:
& "C:\Program Files\dotnet\dotnet.exe" build ...
3. Common Binary & Cmdlet Pitfalls
| Action | ❌ CMD Style | ✅ PowerShell Choice |
|---|---|---|
| Delete | del /f /q file |
Remove-Item -Force file |
| Copy | copy a b |
Copy-Item a b |
| Move | move a b |
Move-Item a b |
| Make Dir | mkdir folder |
New-Item -ItemType Directory -Path folder |
Tip: Using CLI aliases like ls, cat, and cp in PowerShell is usually fine, but using full cmdlets in scripts is more robust.
4. Dotnet CLI Reliability
Build Speed & Consistency
| Context | Command | Why |
|---|---|---|
| Fast Iteration | dotnet build --no-restore |
Skips redundant nuget restore. |
| Clean Build | dotnet build --no-incremental |
Ensures no stale artifacts. |
| Background | Start-Process dotnet -ArgumentList 'run' -RedirectStandardOutput output.txt -RedirectStandardError error.txt |
Launches the app without blocking the shell and keeps logs. |
5. Environment Variables
| Shell | Syntax |
|---|---|
| PowerShell | $env:VARIABLE_NAME |
| CMD | %VARIABLE_NAME% |
6. Long Paths
Windows has a 260-character path limit by default.
Fix: If you hit long path errors, use the extended path prefix:
\\?\C:\Very\Long\Path\...
7. Troubleshooting Shell Errors
| Error | Likely Cause | Fix |
|---|---|---|
The term 'xxx' is not recognized |
Path not in $env:PATH | Use absolute path or fix PATH. |
Access to the path is denied |
File in use or permissions | Stop process or run as Admin. |
Encoding mismatch |
Older shell redirection rewrote the output | Re-export the file as UTF-8 or capture with `2>&1 |
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
자주 묻는 질문
경로에 따옴표가 왜 중요한가요?
Windows가 공백을 한 이름의 끝과 다른 이름의 시작으로 잘못 해석해 오류가 생길 수 있기 때문입니다.
텍스트 인코딩이란 무엇인가요?
컴퓨터가 문자를 표현하는 방식입니다. 잘못된 인코딩을 쓰면 악센트 기호나 다른 기호가 잘못 보일 수 있습니다.
‘del’이나 ‘copy’ 같은 명령을 쓸 수 있나요?
네, 하지만 PowerShell에는 스크립트에서 더 안전하고 명확한 ‘Remove-Item’, ‘Copy-Item’ 같은 cmdlet이 있어 이것이 더 좋습니다.
상세 정보
작성자의 원본 설명
Reliable command execution on Windows: paths, encoding, and common binary pitfalls.
인기도
- GitHub 스타
- 48k
- 순위
- #6189
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
00-andruia-consultant
48k에이전트가 AI 프로젝트를 시작하거나 개선할 수 있도록 코드를 분석하고 스페인어로 실행 계획을 세워 줍니다.
007
48k에이전트가 보안 감사와 위협 모델링을 수행해 공격과 취약점으로부터 프로젝트를 보호하도록 돕습니다.
10-andruia-skill-smith
48k에이전트가 AI 도구의 작동 방식을 정의하고 문서를 쓰며 구조를 검증하도록 돕습니다.
20-andruia-niche-intelligence
48k에이전트가 신뢰할 수 있는 자료를 바탕으로 특정 산업의 맥락, 규칙, 사용 패턴, 위험을 정리한 요약을 만들도록 돕습니다.