fallback-doc-with-delegation
यह क्या करती है
यह स्किल AI एजेंट को डेटा टूल फेल होने के बाद भी दस्तावेज़ बनाने का तरीका बताती है। यह उन लोगों के लिए है जिन्हें फ़ॉर्मेटेड PDF या सादा टेक्स्ट या markdown फ़ाइल, जो भी हो, तैयार दस्तावेज़ चाहिए।
कब इस्तेमाल करें
- ✓जब PDF पढ़ना या वेब खोज फेल हो, फिर भी दस्तावेज़ बनाना ज़रूरी हो।
- ✓जब दस्तावेज़ जटिल प्रारूप में हो, जैसे फ़ॉर्मेटेड PDF।
- ✓जब दस्तावेज़ सादा टेक्स्ट या markdown हो और सीधे लिखा जा सकता हो।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/write-file-fallback-report-enhanced/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरा PDF रीडर और वेब खोज दोनों फेल हो गए। फिर भी सारांश दस्तावेज़ बनाइए, अगर संभव हो तो फ़ॉर्मेटेड PDF के रूप में।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट जटिलता के हिसाब से तरीका चुनता है। फ़ॉर्मेटेड दस्तावेज़ के लिए वह शेल एजेंट को साफ़ काम सौंपता है, और सादे टेक्स्ट या markdown के लिए फ़ाइल लिखने वाले टूल से सीधे फ़ाइल लिखता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Fallback Document Generation with Delegation
When to Use This Skill
Use this workflow when attempting to generate a document or report, but multiple primary data source tools fail simultaneously:
read_filereturns binary/image data instead of text (common with PDFs)search_webreturns errors or no resultsexecute_code_sandboxfails unexpectedly- Other data retrieval tools are unavailable
Key insight: Rather than getting stuck on failed data retrieval, pivot immediately to generating the document using the most appropriate available method—either shell_agent for complex formats or write_file for simple text.
Step-by-Step Instructions
Step 1: Detect Tool Failure Pattern
Recognize when you're in a fallback scenario:
TOOL_FAILURE_INDICATORS = [
"read_file returns binary or image data",
"search_web returns unknown error or empty results",
"execute_code_sandbox fails repeatedly",
"Multiple consecutive tool failures on data retrieval"
]
Decision point: If 2+ indicators are present, proceed to Step 2.
Step 2: Choose the Appropriate Fallback Method
Critical Decision: Select between shell_agent and write_file based on document complexity:
Use shell_agent when... |
Use write_file when... |
|---|---|
| Generating PDFs or formatted documents | Creating simple markdown/text files |
| Complex layout or styling needed | Plain structured content is sufficient |
| External libraries required (reportlab, pandoc) | No special formatting libraries needed |
| Multi-step generation process | Single-pass content generation |
| Verification/validation needed | Direct file creation is adequate |
Decision Tree:
Is the output a PDF or complex formatted document?
├── YES → Use shell_agent (delegates to skilled agent)
└── NO → Is it markdown or plain text?
├── YES → Use write_file (direct content generation)
└── NO → Use shell_agent (handles uncertainty)
Step 3A: Execute with shell_agent (Complex Documents)
For PDFs and complex formatting:
# Delegate to shell_agent with clear task description
shell_agent(
task="Generate a professional [document type] about [topic]. "
"Use appropriate libraries (e.g., reportlab for PDFs). "
"Include: [list key sections/requirements]. "
"Save to working directory as [filename]."
)
Advantages of shell_agent:
- Agent autonomously handles library selection and usage
- Automatically retries and fixes errors
- Can use multiple tools internally (run_shell, execute_code_sandbox)
- Validates output before completion
Example:
shell_agent(
task="Create a 1-page SBAR (Situation-Background-Assessment-Recommendation) "
"template PDF with 4 sections. Each section should have guiding points "
"and blank lined spaces for user input. Use reportlab library. "
"Save as SBAR_template.pdf in current directory."
)
Step 3B: Execute with write_file (Simple Documents)
For markdown and plain text:
# Generate content with embedded domain knowledge
report_content = f"""# [Document Title]
## Executive Summary
[Brief overview of key findings/content]
## Background
[Context and scope - use embedded knowledge]
## Main Content
[Organized sections with headers, lists, tables as appropriate]
## Limitations & Notes
[Transparent about data source limitations if relevant]
## Recommendations/Next Steps
[Actionable guidance based on available information]
"""
write_file(path="output/report.md", content=report_content)
Step 4: Structure Content Professionally
Regardless of method, ensure professional organization:
# [Document Title]
## Executive Summary
[Brief overview of key findings/content]
## Background
[Context and scope - use embedded knowledge]
## Main Content
[Organized sections with headers, lists, tables as appropriate]
## Limitations & Notes
[Transparent about data source limitations if relevant]
## Recommendations/Next Steps
[Actionable guidance based on available information]
Step 5: Leverage Embedded Domain Knowledge
When external data is unavailable:
- Use general domain knowledge appropriately
- Clearly distinguish between verified facts and general guidance
- Include actionable frameworks rather than specific unverified data
- Add placeholder notes where specific data would enhance the document
Examp
अक्सर पूछे जाने वाले सवाल
एजेंट शेल एजेंट कब इस्तेमाल करता है?
स्किल कहती है कि PDF और दूसरे फ़ॉर्मेटेड दस्तावेज़ों के लिए इसका उपयोग करें।
सादी फ़ाइल कब काफ़ी है?
स्किल कहती है कि सादा टेक्स्ट या markdown फ़ाइल लिखने वाले टूल से सीधे लिखी जा सकती है।
क्या अब भी असफल डेटा की ज़रूरत है?
स्किल कहती है कि असफल पुनर्प्राप्ति पर अटके रहने के बजाय दस्तावेज़ बनाने की ओर मुड़ें।
जानकारी
लेखक का मूल विवरण
Generate professional documents after tool failures using shell_agent for complex formats or write_file for simple text/markdown
repo: HKUDS/AgentPilot
लोकप्रियता
- GitHub स्टार
- 7.8k
- रैंकिंग में स्थान
- #13032
- लाइसेंस
- 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
obsidian-vault-maintainer
394kयह आपके एजेंट को Obsidian के अनुकूल मेमोरी vault व्यवस्थित रखने देती है, जिसमें काम करने वाले wiki लिंक, एक जैसी properties और सुरक्षित जेनरेटेड सेक्शन हों।
wiki-maintainer
394kयह आपके एजेंट को OpenClaw मेमोरी wiki दोहराए जा सकने वाले पेजों, सुरक्षित मैनेज्ड ब्लॉक्स और विरोधाभास या कमियों की जांच के साथ संभालने देती है।
obsidian
394kयह आपके एजेंट को आधिकारिक Obsidian कमांड-लाइन से Obsidian नोट्स, टास्क, लिंक और properties पढ़ने, खोजने, बनाने और बदलने देती है।