verified-script-execution
यह क्या करती है
यह स्किल AI एजेंट को स्क्रिप्ट और फ़ाइलें बनाने और उनके बनने की पुष्टि करने का मैन्युअल तरीका देती है। यह उन लोगों के लिए है जिनकी PDF, Word या रिपोर्ट जैसी ज़रूरी फ़ाइलें सही बननी चाहिए।
कब इस्तेमाल करें
- ✓जब कोड सैंडबॉक्स लगातार तीन या अधिक बार फेल हो।
- ✓जब शेल एजेंट बिना प्रगति के बार-बार त्रुटियां दे।
- ✓जब कार्यकारी डायरेक्टरी उलझन में हो और फ़ाइलें अपेक्षित जगह पर न बन रही हों।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/verified-script-execution/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“सैंडबॉक्स और शेल एजेंट दोनों मेरी रिपोर्ट पर फेल हो रहे हैं। शेल में चरण-दर-चरण स्क्रिप्ट बनाइए, फिर पुष्टि कीजिए कि फ़ाइल मौजूद है।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट पहले वर्किंग डायरेक्टरी जाँचता है, फिर हेरडॉक से स्क्रिप्ट लिखता है। वह स्क्रिप्ट चलाकर नतीजा जाँचता है, और एंड मार्कर को इस आधार पर चुनता है कि शेल वेरिएबल का विस्तार होना चाहिए या नहीं।
तकनीकी सामग्री (मूल 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
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
agentpilot
7.8kआपके एजेंट को AgentPilot से प्रोजेक्ट को चरण-दर-चरण सुधारने में मदद करती है, जिसमें बदलाव सुझाए, परखे और स्कोर किए जाते हैं।
openspace
7.8kआपके एजेंट को OpenSpace सेट करने में मदद करती है, जो एजेंट स्किल्स सहेजता और वापस लाता है, और MCP के ज़रिए आपके AI ऐप से जुड़ता है।
rsi-arena
7.8kआपके एजेंट को AIME और Terminal-Bench जैसे मानक AI बेंचमार्क टेस्ट सेट करने और चलाने में मदद करती है, ताकि सुधार के तरीकों की तुलना हो सके।
experiment-guide
7.8kआपके एजेंट को छोटे प्रयोग बनाने, उनके नतीजे पढ़ने और जाँच के दौरान उपयोगी निष्कर्ष लिखने में मदद करती है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।