본문으로 건너뛰기
Skillpedia
일반 코딩48k · #6189

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/windows-shell-reliability/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#6189
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬