본문으로 건너뛰기
Skillpedia
일반 코딩7.8k · #12975

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/robust-file-creation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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_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

자주 묻는 질문

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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬