Saltar al contenido
Skillpedia
Programación general7,8 mil · #12975

robust-file-creation

Qué hace

Esta skill da al agente de IA una forma manual de crear carpetas y archivos de proyecto cuando sus herramientas automáticas se rompen. Está pensada para quienes necesitan que se construya de forma fiable un conjunto de carpetas y archivos.

Cuándo usarla

  • ✓Cuando el entorno aislado de código o el agente auxiliar fallan al crear carpetas o archivos.
  • ✓Cuando necesitas una estructura de carpetas anidadas con varios archivos dentro.
  • ✓Cuando el avance de un proyecto está bloqueado por errores de las herramientas de archivos.

Link de la skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/robust-file-creation/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/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/robust-file-creation/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

“Crea las carpetas del proyecto y los archivos iniciales de mi sitio web. Las herramientas automáticas siguen fallando con esto.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

El agente crea cada carpeta con mkdir -p, que también crea las carpetas padre. Después escribe cada archivo por separado y puede listar el resultado para confirmar que la estructura es correcta.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Robust File Creation Strategy

When creating complex project structures, automated tools like execute_code_sandbox and shell_agent may fail with 'unknown error' on filesystem operations. This skill provides a reliable fallback strategy using explicit shell commands.

When to Use

Apply this pattern when:

  • execute_code_sandbox fails with unknown error on file/directory creation
  • shell_agent fails to complete filesystem operations after retries
  • You need to create nested directory structures with multiple files
  • Task progress is blocked by filesystem tool failures

Fallback Procedure

Step 1: Detect the Failure

When either execute_code_sandbox or shell_agent fails on filesystem operations (especially after automatic retries), immediately switch to the manual hybrid approach.

Step 2: Create Directories Explicitly

Use run_shell with mkdir -p for each required directory:

run_shell command="mkdir -p /path/to/nested/directory"

The -p flag ensures parent directories are created automatically.

Step 3: Write Files Individually

Use write_file tool for each file with explicit path and content:

write_file path="/path/to/file.py" content="..."

Do not attempt to batch multiple file creations in a single operation.

Step 4: Verify Creation (Optional)

Confirm the structure was created correctly:

run_shell command="ls -la /path/to/directory"
# or
run_shell command="tree /path/to/directory"

Complete Example Flow

[execute_code_sandbox fails on project setup]
        ↓
[run_shell mkdir -p src/components]
[run_shell mkdir -p src/utils]
[run_shell mkdir -p tests]
        ↓
[write_file path="src/main.py" content="..."]
[write_file path="src/components/widget.py" content="..."]
[write_file path="tests/test_main.py" content="..."]
        ↓
[run_shell ls -la src/  # verify]

Best Practices

  1. Create all directories first before writing any files to avoid path errors
  2. Write files one at a time rather than attempting batch operations
  3. Use absolute or clearly relative paths to avoid ambiguity
  4. Verify after creation when working on critical deliverables
  5. Document the structure in comments or SKILL.md if it's complex

Why This Works

  • run_shell executes commands directly without the abstraction layer that can fail
  • write_file is a primitive operation with fewer failure modes
  • Separating directory creation from file writing isolates potential failure points
  • Explicit commands are easier to debug when issues occur

Anti-Patterns to Avoid

❌ Don't keep retrying the same failing execute_code_sandbox command ❌ Don't attempt to create complex nested structures in a single Python script via sandbox ❌ Don't assume directories exist before writing files to them ❌ Don't skip verification on critical project scaffolding

Preguntas frecuentes

¿Por qué usar mkdir con la opción -p?

La opción -p crea también las carpetas padre, así que toda la ruta se crea en un solo comando.

¿Por qué escribir los archivos uno a uno?

La skill indica no agrupar la creación de archivos, lo que mantiene cada paso sencillo de comprobar.

¿Puedo comprobar el resultado después?

Sí. La skill sugiere un comando de listado para confirmar que existen las carpetas y los archivos.

Detalles

Descripción original del autor

Fallback to run_shell and write_file when execute_code_sandbox or shell_agent fail on filesystem operations

repo: HKUDS/AgentPilot

Popularidad

Estrellas en GitHub
7,8 mil
Posición en el ranking
#12975
Licencia
MIT
Actualizada
1/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas