Chuyển đến nội dung
Skillpedia
Agent7.8k · #12996

shell-agent-delegation

Skill này làm gì

Skill này bảo AI agent chuyển một nhiệm vụ khó cho shell agent sau khi các công cụ trực tiếp thất bại. Nó dành cho những người cần hoàn thành một công việc tài liệu hoặc dữ liệu mà không phải điều khiển từng bước.

Khi nào nên dùng

  • ✓Khi sandbox mã, trình đọc trang hoặc công cụ tìm kiếm lỗi không rõ nguyên nhân.
  • ✓Khi nhiều lần thử trực tiếp liên tiếp đã thất bại với cùng một nhiệm vụ.
  • ✓Khi một công việc tài liệu hoặc dữ liệu phức tạp cần nhiều bước và lựa chọn thư viện.

Liên kết skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/shell-agent-delegation/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/shell-agent-delegation/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một mẫu SBAR một trang dưới dạng PDF. Các công cụ trực tiếp liên tục lỗi, nên hãy giao toàn bộ công việc cho một shell agent.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent viết mô tả nhiệm vụ rõ ràng, tự đủ ý, rồi đưa cho shell agent. Shell agent quyết định dùng Python hay Bash, viết mã, chạy, kiểm tra đầu ra và sửa lỗi.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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:

  1. Check that the output file was created in the working directory
  2. Verify the content meets requirements
  3. 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

  1. Be specific about the output: Clearly describe what the final product should look like
  2. Trust the autonomy: Let shell_agent decide on libraries and implementation details
  3. Allow sufficient timeout: Set timeout to 300+ seconds for complex tasks requiring iteration
  4. One task at a time: Give shell_agent a complete, self-contained objective
  5. 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

Câu hỏi thường gặp

Một mô tả nhiệm vụ tốt cần có gì?

Skill yêu cầu mô tả mục tiêu, các phần và nội dung một cách chi tiết, rõ ràng để shell agent có thể tự làm việc.

Shell agent có tự chọn công cụ không?

Có, nó quyết định dùng Python hay Bash và dùng thư viện nào.

Nó thử sửa lỗi bao nhiêu lần?

Skill nói nó tự động thử lại trong nhiều vòng.

Chi tiết

Mô tả gốc của tác giả

Delegate complex tasks to shell_agent when direct tool execution fails, leveraging autonomous error recovery and library selection

repo: HKUDS/AgentPilot

Độ phổ biến

Sao GitHub
7.8k
Vị trí xếp hạng
#12996
Giấy phép
MIT
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự