Saltar al contenido
Skillpedia
Programación general48 mil · #6189

windows-shell-reliability

Qué hace

Esta herramienta ayuda a ejecutar comandos en Windows sin errores. Enseña a manejar rutas de archivos con espacios, usar la codificación de texto correcta y evitar errores habituales al ejecutar programas.

Cuándo usarla

  • ✓Al crear o corregir programas que se ejecutan en Windows.
  • ✓Cuando los comandos fallan por nombres de archivo con espacios.
  • ✓Si el texto de la salida de un comando aparece con caracteres extraños.

Link de la skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/windows-shell-reliability/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/windows-shell-reliability/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“¿Cómo ejecuto un programa que está en una carpeta con un espacio en su nombre?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La herramienta enseña a poner comillas alrededor de las rutas con espacios y a usar comandos específicos de Windows para evitar errores de codificación o fallos de los programas.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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.
Preguntas frecuentes

¿Por qué son importantes las comillas en las rutas?

Porque Windows puede interpretar un espacio como el final de un nombre y el inicio de otro, lo que provoca errores.

¿Qué es la codificación de texto?

Es la forma en que el equipo representa los caracteres. Usar una codificación incorrecta puede hacer que las tildes y otros símbolos se vean mal.

¿Puedo usar comandos como 'del' o 'copy'?

Sí, pero PowerShell tiene cmdlets más seguros y claros, como 'Remove-Item' y 'Copy-Item', que son preferibles en los scripts.

Detalles

Descripción original del autor

Reliable command execution on Windows: paths, encoding, and common binary pitfalls.

repo: sickn33/agentic-awesome-skills

Popularidad

Estrellas en GitHub
48 mil
Posición en el ranking
#6189
Licencia
MIT
Actualizada
15/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas