shell-agent-delegation
できること
このスキルは、直接のツールが失敗した後に、AIエージェントが難しいタスクをシェルエージェントに渡す方法を示します。段階ごとの管理なしに、書類やデータの作業を終えたい人向けです。
使う場面
- ✓コードサンドボックス、ページ読み取り、検索のツールが原因不明のエラーを返したとき。
- ✓同じタスクで直接のツールを何度か続けて試して失敗したとき。
- ✓書類やデータの作業が複雑で、複数の手順やライブラリの選択が必要なとき。
スキルのリンク
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/shell-agent-delegation/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“1ページのSBARテンプレートをPDFで作ってください。直接のツールが失敗し続けているので、作業全体をシェルエージェントに任せてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、目標、セクション、内容を分かりやすく詳しく書いた、独立して読める作業説明を作ります。それをシェルエージェントに渡します。シェルエージェントは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
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
agentpilot
7.8kエージェントが、作業を準備し、変更案を提案してテストし、評価するAgentPilotのループを実行することで、プロジェクトを段階的に改善できるよう支援します。
openspace
7.8kエージェントが、スキルを保存し取り出すツールであるOpenSpaceをセットアップし、MCPを通じてAIアプリに接続できるよう支援します。
rsi-arena
7.8kエージェントが、AIMEやTerminal-Benchなどの標準的なAIベンチマークテストをセットアップして実行し、異なる改善方法を比較できるよう支援します。
experiment-guide
7.8kエージェントが、プログラムを改善する方法を調べる間に、小さな実験を計画し、その結果を読み、発見を記録できるよう支援します。
似ているスキル
add-model-provider
394k安全なセットアップコマンドで新しいAIモデルプロバイダーをOpenClawに接続し、APIキーを平文で残さず、ライブテストを行うようエージェントを支援します。
acp-router
394kClaude CodeやCursorなどのコーディングアシスタントに、OpenClaw経由でタスクを渡し、その作業がそのツール内で行われるようエージェントを支援します。
browser-automation
394kログイン、タブ、応答しなくなったページからの復旧を含め、Webページを段階的に操作するようエージェントに教えます。