robust-file-creation
하는 일
이 스킬은 자동 도구가 고장 났을 때 프로젝트 폴더와 파일을 수동으로 만드는 방법을 AI 에이전트에게 줍니다. 파일 설정을 안정적으로 만들어야 하는 사람에게 맞습니다.
사용하는 경우
- ✓코드 샌드박스나 도우미 에이전트가 폴더나 파일을 만드는 데 실패할 때.
- ✓여러 파일이 들어 있는 중첩 폴더 구조가 필요할 때.
- ✓파일 도구 오류 때문에 프로젝트 진행이 막힌 경우.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/robust-file-creation/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 웹사이트용 프로젝트 폴더와 시작 파일을 만들어 주세요. 자동 도구가 계속 실패하니 이 작업은 셸로 해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 mkdir -p로 각 폴더를 만들고, 부모 폴더까지 한 번에 생성합니다. 그다음 파일을 하나씩 쓰고, 목록을 출력해 구조가 맞는지 확인할 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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_sandboxfails with unknown error on file/directory creationshell_agentfails 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
- Create all directories first before writing any files to avoid path errors
- Write files one at a time rather than attempting batch operations
- Use absolute or clearly relative paths to avoid ambiguity
- Verify after creation when working on critical deliverables
- Document the structure in comments or SKILL.md if it's complex
Why This Works
run_shellexecutes commands directly without the abstraction layer that can failwrite_fileis 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
자주 묻는 질문
mkdir에 -p 옵션을 쓰는 이유는 무엇인가요?
-p 옵션은 상위 폴더도 함께 만들어 전체 경로를 한 명령으로 만듭니다.
파일을 하나씩 쓰는 이유는 무엇인가요?
스킬은 파일 생성을 한꺼번에 묶지 말라고 말합니다. 그래야 각 단계를 확인하기 쉽기 때문입니다.
결과를 나중에 확인할 수 있나요?
네, 스킬은 폴더와 파일이 있는지 확인하는 목록 명령을 제안합니다.
상세 정보
작성자의 원본 설명
Fallback to run_shell and write_file when execute_code_sandbox or shell_agent fail on filesystem operations
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #12975
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
agentpilot
7.8k작업을 준비하고 AgentPilot 루프를 실행해 변경을 제안, 테스트, 점수화하면서 프로젝트를 단계적으로 개선하도록 돕습니다.
openspace
7.8k에이전트 스킬을 저장하고 가져오는 도구인 OpenSpace를 설정하고, MCP를 통해 AI 앱에 연결하도록 돕습니다.
rsi-arena
7.8kAIME나 Terminal-Bench 같은 표준 AI 벤치마크 테스트를 설정하고 실행해 서로 다른 개선 방법을 비교하도록 돕습니다.
experiment-guide
7.8k프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.