verified-script-execution
하는 일
이 스킬은 AI 에이전트가 스크립트와 파일을 직접 만들고 생성되었는지 확인하는 수동 방법을 제공합니다. PDF, Word 문서, 보고서처럼 정확해야 하는 중요한 파일을 다루는 사람을 위한 스킬입니다.
사용하는 경우
- ✓코드 샌드박스가 연속으로 세 번 이상 실패할 때.
- ✓셸 에이전트가 진전 없이 계속 오류를 낼 때.
- ✓작업 폴더가 헷갈려서 파일이 예상한 곳에 만들어지지 않을 때.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/verified-script-execution/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“샌드박스와 셸 에이전트가 모두 제 보고서 작업에서 계속 실패합니다. 셸에서 스크립트를 단계별로 만든 뒤 파일이 있는지 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 먼저 작업 디렉터리를 확인한 다음 heredoc으로 스크립트를 씁니다. 스크립트를 실행하고 결과를 확인하는데, 변수를 확장해야 하는지에 따라 따옴표가 있는 종료 표시나 없는 종료 표시를 사용합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Verified Script Execution Workflow
When execute_code_sandbox or shell_agent fails repeatedly, use this manual fallback pattern to reliably create and verify files through explicit shell commands.
When to Activate This Pattern
- After 3+ consecutive failures with
execute_code_sandbox - When
shell_agentproduces repeated errors without progress - For critical deliverables (PDFs, Word docs, reports) that must be created reliably
- When working directory confusion causes file creation failures
Step 1: Verify Working Directory
Always confirm your current location before creating any files:
pwd
ls -la
This ensures you're writing to the correct workspace directory and reveals any existing files that might conflict.
Step 2: Create Scripts via Heredoc
Use shell heredoc syntax to create scripts with proper escaping. Choose the heredoc delimiter style based on your needs:
For literal content (no variable expansion):
cat > script_name.sh << 'EOF'
#!/bin/bash
# Your script content here
# Variables like $VAR will NOT be expanded
echo "Literal text with $symbols"
EOF
For content requiring variable expansion:
cat > script_name.sh << EOF
#!/bin/bash
OUTPUT_DIR="$PWD/output"
# Variables WILL be expanded
echo "Working in $OUTPUT_DIR"
EOF
Key escaping rules:
- Use
<< 'EOF'(quoted delimiter) to prevent variable expansion and command substitution - Use
<< EOF(unquoted delimiter) when you need shell variables expanded - Escape single quotes inside quoted heredoc as
'\'' - For nested heredocs, use different delimiters (e.g.,
EOFandINNER)
Step 3: Make Executable and Run with Explicit Path
chmod +x script_name.sh
./script_name.sh
Or use the explicit full path for certainty:
bash /full/path/to/script_name.sh
Step 4: Verify Output
Always verify file creation and inspect content:
# Check file exists and see size
ls -lh expected_output.pdf
ls -lh expected_output.docx
# For PDFs, verify structure and page count
pdfinfo expected_output.pdf
# For Word docs, inspect internal structure
unzip -l expected_output.docx | head -20
Complete Example: PDF and Word Document Generation
# Step 1: Verify directory
pwd
ls -la
# Step 2: Create document generation script
cat > generate_deliverables.sh << 'EOF'
#!/bin/bash
set -e
# Create PDF checklist
cat > checklist_content.txt << 'CONTENT'
Safety Checklist
================
Page 1: Overview
Page 2: Requirements
Page 3: Verification Steps
Page 4: Sign-off
CONTENT
# Create Word action tracker
cat > tracker_content.txt << 'CONTENT'
Action Tracker
==============
Item,Owner,Due,Status
Task 1,Team A,2024-01-15,Pending
Task 2,Team B,2024-01-20,In Progress
CONTENT
# Convert to target formats (adapt to available tools)
echo "Files created in: $(pwd)"
ls -lh *.txt
EOF
# Step 3: Execute with explicit path
chmod +x generate_deliverables.sh
./generate_deliverables.sh
# Step 4: Verify all outputs
ls -lh checklist_content.txt tracker_content.txt
# For PDFs: pdfinfo output.pdf
# For DOCX: unzip -l output.docx | head -20
Efficiency Tips
- Combine related operations in a single script to reduce iteration count
- Verify incrementally - check each file before proceeding to the next step
- Use explicit paths throughout to avoid directory confusion
- Test heredoc syntax in isolation before building complex nested scripts
- Document expected outputs (filenames, sizes, page counts) before running
- Use
set -ein scripts to fail fast on errors
Common Pitfalls to Avoid
- Unquoted heredoc delimiters when you need literal
$symbols - Missing
chmod +xbefore script execution - Not verifying output before assuming success
- Nested heredocs with same delimiter causing premature termination
- Assuming current directory without explicit
pwdverification
Migration Back to Automated Tools
Once files are created successfully with this pattern:
- Study what worked in the manual script
- Translate the working approach back to
execute_code_sandboxformat - Test incrementally with smaller code blocks
- Revert to automated tools for subsequent iterations
This pattern prioritizes reliability over iteration efficiency, ensuring deliverables are created correctly even when automated tools struggle.
자주 묻는 질문
이 방법은 언제 시작하나요?
샌드박스가 세 번 실패했거나 셸 에이전트에서 반복 오류가 나온 뒤 시작합니다.
왜 디렉터리를 먼저 확인하나요?
파일이 올바른 작업 공간 폴더에 쓰이도록 하기 위해서라고 스킬은 설명합니다.
종료 표시의 차이는 무엇인가요?
따옴표가 있는 표시는 달러 기호를 그대로 두고, 따옴표가 없는 표시는 셸 변수를 확장합니다.
상세 정보
작성자의 원본 설명
Fallback workflow for reliable file creation and verification when automated code execution fails
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #13024
- 라이선스
- 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프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.