shell-agent-delegation
ما الذي تفعله
توجّه هذه المهارة وكيل الذكاء الاصطناعي إلى تسليم مهمة صعبة إلى وكيل طرفية بعد فشل الأدوات المباشرة. وهي مناسبة لمن يحتاج إلى إنهاء مستند أو مهمة بيانات دون التحكم بكل خطوة.
متى تستخدمها
- ✓عندما تفشل بيئة التنفيذ المعزولة أو أداة قراءة الصفحات أو أداة البحث بأخطاء غير معروفة.
- ✓عندما تفشل عدة محاولات مباشرة متتالية في المهمة نفسها.
- ✓عندما تكون مهمة المستند أو البيانات معقدة وتحتاج إلى عدة خطوات واختيار مكتبات.
رابط المهارة
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/shell-agent-delegation/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أنشئ قالب SBAR من صفحة واحدة بصيغة PDF. الأدوات المباشرة تفشل باستمرار، فسلّم المهمة كاملة إلى وكيل طرفية.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يكتب الوكيل وصفًا واضحًا ومكتملًا للمهمة ويسلّمه إلى وكيل الطرفية. يقرر وكيل الطرفية إن كان سيستخدم Python أو Bash، ويكتب الكود ويشغّله، ثم يفحص المخرجات ويصحح الأخطاء.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Shell Agent Delegation for Resilient Workflow Execution
When to Use This Skill
Apply this pattern when:
- Direct tool execution (execute_code_sandbox, read_webpage, search_web) fails with 'unknown error'
- Multiple tool attempts have failed in sequence
- The task requires complex document generation or data processing
- You need a tool that can autonomously select libraries and handle multi-step workflows
Why This Works
The shell_agent tool differs from direct execution tools in key ways:
- Autonomous tool selection: Decides whether to use Python or Bash based on the task
- Built-in error recovery: Automatically retries and fixes errors (up to several rounds)
- Iterative execution: Writes code, executes, inspects output, and adapts
- Full workflow ownership: Handles the entire task end-to-end without manual intervention
Step-by-Step Instructions
Step 1: Recognize the Failure Pattern
Identify when to pivot to shell_agent:
- execute_code_sandbox returned 'unknown error'
- read_webpage/search_web failed multiple times
- Direct approaches are struggling with the task complexity
Step 2: Formulate the Delegation Task
Create a clear, self-contained task description for shell_agent:
Good task description:
Create a 1-page SBAR Template PDF document. Include sections for:
- Situation: Brief description of the current situation
- Background: Relevant context and history
- Assessment: Current assessment and analysis
- Recommendation: Proposed actions and next steps
Use a professional layout with clear headings and adequate whitespace.
Key elements to include:
- The end goal (what should be produced)
- Required sections/components
- Format requirements (PDF, DOCX, etc.)
- Any style or layout preferences
Step 3: Execute the Delegation
Call shell_agent with your task description:
# Conceptual example
shell_agent(task="Create a professional SBAR Template PDF with Situation, Background, Assessment, and Recommendation sections. Include clear headings and professional formatting.")
Step 4: Monitor and Verify
After shell_agent completes:
- Check that the output file was created in the working directory
- Verify the content meets requirements
- If issues remain, provide refined instructions to shell_agent
Code Example
# When direct approaches fail:
# execute_code_sandbox(code="...") # Returns 'unknown error'
# search_web(query="...") # Returns 'unknown error'
# Pivot to shell_agent:
shell_agent(
task="Generate a professional one-page template document in PDF format. "
"Include clearly labeled sections with appropriate spacing and formatting. "
"Select the most appropriate Python library for PDF generation.",
timeout=300 # Allow time for iteration and error recovery
)
Best Practices
- Be specific about the output: Clearly describe what the final product should look like
- Trust the autonomy: Let shell_agent decide on libraries and implementation details
- Allow sufficient timeout: Set timeout to 300+ seconds for complex tasks requiring iteration
- One task at a time: Give shell_agent a complete, self-contained objective
- Don't micromanage: Avoid prescribing specific libraries or code unless necessary
Common Use Cases
- Document generation (PDF, DOCX, reports, templates)
- Data processing pipelines with multiple steps
- Web scraping with fallback handling
- Complex file manipulation tasks
- Tasks requiring library discovery and selection
Anti-Patterns to Avoid
❌ Don't use shell_agent for simple, single-command tasks (use run_shell instead) ❌ Don't provide overly prescriptive code instructions (defeats the autonomous benefit) ❌ Don't set timeout too low (<60 seconds for complex tasks) ❌ Don't split a coherent task into multiple shell_agent calls unnecessarily
الأسئلة الشائعة
ما الذي يجعل وصف المهمة جيدًا؟
تقول المهارة إن على الوصف أن يذكر الهدف والأقسام والمحتوى بتفصيل واضح، حتى يعمل وكيل الطرفية باستقلالية.
هل يختار وكيل الطرفية الأدوات؟
نعم، يقرر إن كان سيستخدم Python أو Bash وأي مكتبات يستخدم.
كم مرة يحاول الإصلاح؟
تقول المهارة إنه يعيد المحاولة تلقائيًا لعدة جولات.
التفاصيل
الوصف الأصلي من المؤلف
Delegate complex tasks to shell_agent when direct tool execution fails, leveraging autonomous error recovery and library selection
repo: HKUDS/AgentPilot
الشعبية
- نجوم GitHub
- 7.8k
- الترتيب
- #12996
- الترخيص
- MIT
- آخر تحديث
- 1/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
agentpilot
7.8kيساعد وكيلك على تحسين مشروع خطوة بخطوة، بتجهيز مهمة وتشغيل حلقة AgentPilot التي تقترح التغييرات وتختبرها وتقيّمها.
openspace
7.8kيساعد وكيلك على إعداد OpenSpace، وهو أداة تخزن مهارات الوكلاء وتسترجعها، وربطه بتطبيق الذكاء الاصطناعي عبر MCP.
rsi-arena
7.8kيساعد وكيلك على إعداد اختبارات معيارية مثل AIME وTerminal-Bench وتشغيلها، لمقارنة طرق التحسين المختلفة.
experiment-guide
7.8kيساعد وكيلك على تخطيط تجارب صغيرة وقراءة نتائجها وتسجيل ما يتعلمه أثناء التحقيق في طرق تحسين برنامج.
مهارات مشابهة
add-model-provider
394kتتيح لوكيلك ربط مزوّد نموذج ذكاء اصطناعي جديد بـ OpenClaw باستخدام أوامر إعداد آمنة، وإبقاء مفاتيح API خارج النص العادي، وإجراء اختبار حي.
acp-router
394kيساعد وكيلك على إرسال مهمة إلى مساعد برمجة مثل Claude Code أو Cursor عبر OpenClaw، فيعمل العمل داخل تلك الأداة.
browser-automation
394kتعلّم وكيلك التحكم في صفحات الويب خطوة بخطوة، بما في ذلك تسجيل الدخول والتبويبات والتعافي عندما تتوقف الصفحة عن الاستجابة.