Fallback workflow for reliable file creation and verification when automated code execution fails
58
66%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./benchmarks/gdpval/skills/verified-script-execution/SKILL.mdWhen execute_code_sandbox or shell_agent fails repeatedly, use this manual fallback pattern to reliably create and verify files through explicit shell commands.
execute_code_sandboxshell_agent produces repeated errors without progressAlways confirm your current location before creating any files:
pwd
ls -laThis ensures you're writing to the correct workspace directory and reveals any existing files that might conflict.
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"
EOFFor content requiring variable expansion:
cat > script_name.sh << EOF
#!/bin/bash
OUTPUT_DIR="$PWD/output"
# Variables WILL be expanded
echo "Working in $OUTPUT_DIR"
EOFKey escaping rules:
<< 'EOF' (quoted delimiter) to prevent variable expansion and command substitution<< EOF (unquoted delimiter) when you need shell variables expanded'\''EOF and INNER)chmod +x script_name.sh
./script_name.shOr use the explicit full path for certainty:
bash /full/path/to/script_name.shAlways 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# 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 -20set -e in scripts to fail fast on errors$ symbolschmod +x before script executionpwd verificationOnce files are created successfully with this pattern:
execute_code_sandbox formatThis pattern prioritizes reliability over iteration efficiency, ensuring deliverables are created correctly even when automated tools struggle.
c5a9c4b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.