fallback-file-ops
Fungsinya
Skill ini adalah cadangan untuk membuat folder dan file ketika alat tingkat tinggi mengembalikan galat yang samar atau gagal tanpa pemberitahuan. Skill ini cocok untuk orang yang pengaturan proyek AI-nya terus gagal.
Kapan dipakai
- βSaat sandbox mengembalikan galat yang tidak diketahui ketika membuat file atau folder.
- βSaat helper menyatakan telah membuat file, tetapi file tersebut sebenarnya tidak ada.
- βSaat saya membutuhkan struktur folder proyek bersarang yang dibangun dengan benar.
Link skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/fallback-file-ops/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBuat struktur folder proyek dengan beberapa folder dan file bersarang. Helper terus gagal, jadi tolong pakai shell.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
AI beralih ke perintah shell seperti mkdir dan penulisan dengan pengalihan, lalu memeriksa setiap item dengan ls atau perintah test untuk memastikan item itu ada.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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_sandboxreturns 'unknown error' on file/directory creationshell_agentfails 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_shellfor all filesystem operations (mkdir, write, copy, move) - Continue using
execute_code_sandboxorshell_agentfor 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
- Be explicit: Always use full paths or confirm working directory
- Create parent directories: Use
mkdir -pfor nested structures - Verify before proceeding: Check files exist before dependent operations
- Log tool switches: Note when you fall back to run_shell for debugging
- 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
Pertanyaan umum
Bagaimana AI tahu bahwa suatu langkah gagal?
AI memperhatikan pesan galat yang tidak diketahui, atau file yang tidak muncul setelah diklaim berhasil.
Perintah apa yang dipakai?
Perintah seperti mkdir -p, echo, atau cat dengan heredoc, serta ls atau test untuk memeriksa hasilnya.
Apakah verifikasi wajib?
Ya, panduan ini meminta agar setiap file atau folder diverifikasi setelah dibuat.
Detail
Deskripsi asli dari pembuat
Use run_shell as fallback when execute_code_sandbox or shell_agent fail on filesystem operations
repo: HKUDS/AgentPilot
Popularitas
- Bintang GitHub
- 7.8k
- Peringkat
- #12881
- Lisensi
- MIT
- Diperbarui
- 1/11/2026
Komentar
- β¦
Skill lain dari repositori ini
agentpilot
7.8kMembantu agent Anda meningkatkan proyek langkah demi langkah dengan menyiapkan tugas dan menjalankan loop AgentPilot yang mengusulkan, menguji, dan memberi skor pada perubahan.
openspace
7.8kMembantu agent Anda menyiapkan OpenSpace, alat yang menyimpan dan mengambil skill agent, lalu menghubungkannya ke aplikasi AI Anda melalui MCP.
rsi-arena
7.8kMembantu agent Anda menyiapkan dan menjalankan tes benchmark AI standar, seperti AIME dan Terminal-Bench, untuk membandingkan berbagai metode perbaikan.
experiment-guide
7.8kMembantu agent Anda merencanakan eksperimen kecil, membaca hasilnya, dan mencatat temuan saat menyelidiki cara memperbaiki sebuah program.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.