Pular para o conteúdo
Skillpedia
Código em geral7,8 mil · #12881

fallback-file-ops

O que ela faz

Esta skill é uma alternativa para criar pastas e arquivos quando ferramentas de nível superior retornam erros vagos ou falham em silêncio. Ela é para quem tem uma configuração de projeto de IA que continua falhando.

Quando usar

  • ✓Quando o sandbox retorna um erro desconhecido ao criar um arquivo ou pasta.
  • ✓Quando um auxiliar diz que criou um arquivo, mas o arquivo não está lá de fato.
  • ✓Quando preciso montar corretamente uma estrutura de pastas de projeto aninhada.

Link da skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/fallback-file-ops/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/fallback-file-ops/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Crie a estrutura de pastas do projeto com várias pastas e arquivos aninhados. O auxiliar continua falhando, então use o shell, por favor.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

A IA muda para comandos de shell como mkdir e gravações redirecionadas, depois verifica cada item com ls ou um comando de teste para confirmar que ele existe.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

Fallback File Operations

Purpose

When execute_code_sandbox or shell_agent fail with 'unknown error' on filesystem operations, fall back to run_shell with explicit mkdir and file write commands. This hybrid approach is more reliable for creating complex project structures.

When to Apply

  • execute_code_sandbox returns 'unknown error' on file/directory creation
  • shell_agent fails to write files or create nested directories
  • You need to create complex project structures with multiple levels

Procedure

Step 1: Detect Tool Failure

Monitor for these failure patterns:

  • Error message contains "unknown error"
  • File operations silently fail (file not created)
  • Directory creation returns success but directory doesn't exist

Step 2: Switch to run_shell

When failures occur, immediately switch to run_shell for filesystem operations:

# Create directory structure explicitly
run_shell: mkdir -p /path/to/nested/directory

# Write files using shell redirection or echo
run_shell: echo "content" > /path/to/file.txt

# Or use cat with heredoc for multi-line files
run_shell: cat > /path/to/file.txt << 'EOF'
line 1
line 2
EOF

Step 3: Verify Creation

After each operation, verify the file/directory was created:

run_shell: ls -la /path/to/created/item
run_shell: test -f /path/to/file && echo "File exists"
run_shell: test -d /path/to/dir && echo "Directory exists"

Step 4: Continue with Hybrid Approach

  • Use run_shell for all filesystem operations (mkdir, write, copy, move)
  • Continue using execute_code_sandbox or shell_agent for code execution, compilation, or other non-filesystem tasks
  • Document which tool handles which operation for clarity

Example: Creating Project Structure

# Failed attempt with execute_code_sandbox
execute_code_sandbox: create directory src/components

# Fallback with run_shell
run_shell: mkdir -p src/components
run_shell: mkdir -p src/utils
run_shell: mkdir -p tests/unit
run_shell: echo "// Component file" > src/components/Button.tsx
run_shell: echo "// Utility file" > src/utils/helpers.ts

Best Practices

  1. Be explicit: Always use full paths or confirm working directory
  2. Create parent directories: Use mkdir -p for nested structures
  3. Verify before proceeding: Check files exist before dependent operations
  4. Log tool switches: Note when you fall back to run_shell for debugging
  5. Batch operations: Group related file operations in consecutive run_shell calls

Common Pitfalls

  • Don't assume filesystem state after tool failure
  • Don't mix tools for the same file operation (pick one and stick with it)
  • Don't skip verification steps when using fallback
Perguntas frequentes

Como a IA sabe que uma etapa falhou?

Ela observa mensagens de erro desconhecidas ou arquivos que não aparecem apesar de um sucesso informado.

Quais comandos são usados?

Comandos como mkdir -p, echo ou cat com um heredoc, além de ls ou test para conferir os resultados.

A verificação é obrigatória?

Sim. O guia manda verificar cada arquivo ou pasta depois de criado.

Detalhes

Descrição original do autor

Use run_shell as fallback when execute_code_sandbox or shell_agent fail on filesystem operations

repo: HKUDS/AgentPilot

Popularidade

Estrelas no GitHub
7,8 mil
Posição no ranking
#12881
Licença
MIT
Atualizada em
01/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas