verified-script-execution
Qué hace
Esta skill da al agente de IA un método manual para crear scripts y archivos y confirmar que se han generado. Es para personas que trabajan con archivos importantes, como PDF, documentos de Word o informes, que deben salir bien.
Cuándo usarla
- ✓Cuando el sandbox de código falla tres veces o más seguidas.
- ✓Cuando un agente de shell produce errores una y otra vez sin avanzar.
- ✓Cuando el directorio de trabajo es confuso y los archivos no se crean donde se espera.
Link de la skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/verified-script-execution/SKILL.mdCó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
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“El sandbox y el agente de shell siguen fallando con mi informe. Crea el script paso a paso en la shell y luego comprueba que el archivo existe.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente comprueba primero el directorio de trabajo y luego escribe el script con un heredoc. Lo ejecuta y comprueba el resultado, usando un marcador final entre comillas o sin ellas según deban expandirse las variables.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Verified Script Execution Workflow
When execute_code_sandbox or shell_agent fails repeatedly, use this manual fallback pattern to reliably create and verify files through explicit shell commands.
When to Activate This Pattern
- After 3+ consecutive failures with
execute_code_sandbox - When
shell_agentproduces repeated errors without progress - For critical deliverables (PDFs, Word docs, reports) that must be created reliably
- When working directory confusion causes file creation failures
Step 1: Verify Working Directory
Always confirm your current location before creating any files:
pwd
ls -la
This ensures you're writing to the correct workspace directory and reveals any existing files that might conflict.
Step 2: Create Scripts via Heredoc
Use shell heredoc syntax to create scripts with proper escaping. Choose the heredoc delimiter style based on your needs:
For literal content (no variable expansion):
cat > script_name.sh << 'EOF'
#!/bin/bash
# Your script content here
# Variables like $VAR will NOT be expanded
echo "Literal text with $symbols"
EOF
For content requiring variable expansion:
cat > script_name.sh << EOF
#!/bin/bash
OUTPUT_DIR="$PWD/output"
# Variables WILL be expanded
echo "Working in $OUTPUT_DIR"
EOF
Key escaping rules:
- Use
<< 'EOF'(quoted delimiter) to prevent variable expansion and command substitution - Use
<< EOF(unquoted delimiter) when you need shell variables expanded - Escape single quotes inside quoted heredoc as
'\'' - For nested heredocs, use different delimiters (e.g.,
EOFandINNER)
Step 3: Make Executable and Run with Explicit Path
chmod +x script_name.sh
./script_name.sh
Or use the explicit full path for certainty:
bash /full/path/to/script_name.sh
Step 4: Verify Output
Always verify file creation and inspect content:
# Check file exists and see size
ls -lh expected_output.pdf
ls -lh expected_output.docx
# For PDFs, verify structure and page count
pdfinfo expected_output.pdf
# For Word docs, inspect internal structure
unzip -l expected_output.docx | head -20
Complete Example: PDF and Word Document Generation
# Step 1: Verify directory
pwd
ls -la
# Step 2: Create document generation script
cat > generate_deliverables.sh << 'EOF'
#!/bin/bash
set -e
# Create PDF checklist
cat > checklist_content.txt << 'CONTENT'
Safety Checklist
================
Page 1: Overview
Page 2: Requirements
Page 3: Verification Steps
Page 4: Sign-off
CONTENT
# Create Word action tracker
cat > tracker_content.txt << 'CONTENT'
Action Tracker
==============
Item,Owner,Due,Status
Task 1,Team A,2024-01-15,Pending
Task 2,Team B,2024-01-20,In Progress
CONTENT
# Convert to target formats (adapt to available tools)
echo "Files created in: $(pwd)"
ls -lh *.txt
EOF
# Step 3: Execute with explicit path
chmod +x generate_deliverables.sh
./generate_deliverables.sh
# Step 4: Verify all outputs
ls -lh checklist_content.txt tracker_content.txt
# For PDFs: pdfinfo output.pdf
# For DOCX: unzip -l output.docx | head -20
Efficiency Tips
- Combine related operations in a single script to reduce iteration count
- Verify incrementally - check each file before proceeding to the next step
- Use explicit paths throughout to avoid directory confusion
- Test heredoc syntax in isolation before building complex nested scripts
- Document expected outputs (filenames, sizes, page counts) before running
- Use
set -ein scripts to fail fast on errors
Common Pitfalls to Avoid
- Unquoted heredoc delimiters when you need literal
$symbols - Missing
chmod +xbefore script execution - Not verifying output before assuming success
- Nested heredocs with same delimiter causing premature termination
- Assuming current directory without explicit
pwdverification
Migration Back to Automated Tools
Once files are created successfully with this pattern:
- Study what worked in the manual script
- Translate the working approach back to
execute_code_sandboxformat - Test incrementally with smaller code blocks
- Revert to automated tools for subsequent iterations
This pattern prioritizes reliability over iteration efficiency, ensuring deliverables are created correctly even when automated tools struggle.
Preguntas frecuentes
¿Cuándo empieza?
La skill empieza tras tres fallos con el sandbox o tras errores repetidos de un agente de shell.
¿Por qué comprobar primero el directorio?
La skill indica que así se asegura de que los archivos se escriben en la carpeta de trabajo correcta.
¿Qué diferencia hay entre los marcadores del heredoc?
Un marcador entre comillas mantiene los signos de dólar literales, mientras que uno sin comillas permite expandir las variables de la shell.
Detalles
Descripción original del autor
Fallback workflow for reliable file creation and verification when automated code execution fails
repo: HKUDS/AgentPilot
Popularidad
- Estrellas en GitHub
- 7,8 mil
- Posición en el ranking
- #13024
- Licencia
- MIT
- Actualizada
- 1/11/2026
Comentarios
- …
Más skills de este repositorio
agentpilot
7,8 milAyuda a tu agente a mejorar un proyecto paso a paso, preparando una tarea y ejecutando el bucle de AgentPilot que propone, prueba y puntúa cambios.
openspace
7,8 milAyuda a tu agente a configurar OpenSpace, una herramienta que guarda y recupera skills de agentes, y a conectarla a tu app de IA mediante MCP.
rsi-arena
7,8 milAyuda a tu agente a configurar y ejecutar pruebas de referencia de IA conocidas, como AIME y Terminal-Bench, para comparar distintos métodos de mejora.
experiment-guide
7,8 milAyuda a tu agente a planificar experimentos pequeños, leer sus resultados y anotar conclusiones mientras investiga cómo mejorar un programa.
Skills parecidas
diffs
394 milPermite que tu agente genere un diff real y compartible de los cambios, como enlace de visualización o archivo de imagen, en lugar de un resumen escrito a mano.
coding-agent
394 milAyuda a tu agente a pasar un trabajo de programación grande a Codex, Claude Code u OpenCode como trabajador en segundo plano, y después revisar su progreso.
gh-issues
394 milAyuda a tu agente a encontrar incidencias de GitHub, elegir cuáles trabajar y abrir pull requests con correcciones, incluido el seguimiento de los comentarios de revisión.