跳到正文
cccskills
免费在 GitHub 公开

shell-agent-delegation

Hand complex document generation or data processing to shell_agent when direct tools repeatedly fail. Define the required output, let the tool choose libraries and recover from errors, then verify the resulting files and content.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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

查看安装方法

适用场景

  • Resuming work after repeated tool failures
  • Delegating PDF or DOCX document generation
  • Handing off multi-step data processing
  • Delegating web scraping with fallback handling

包含的文件(2)

  • SKILL.md4.0 KB
  • .skill_id36 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Prepare audio stems, the separate parts of a track, for mixing by matching their durations with silence, loops, or crossfades. Verify each generated and processed file before moving to the next production step.

中文简介正在准备中。当前显示英语简介。

  • Match audio parts with different durations
  • Extend drums and melodic parts using suitable methods
  • Check audio specifications before mixing
HKUDS/OpenSpace77602026年8月13日 更新

Produce audio in separate stems, meaning individual instrument tracks, and verify each output as you go. Align track lengths with silence, loops, or crossfades, then apply effects, mix a master, and package the files.

中文简介正在准备中。当前显示英语简介。

  • Align instrument tracks to a reference audio file
  • Choose how to extend tracks that are too short
  • Verify audio properties after generation and effects
HKUDS/OpenSpace77602026年8月13日 更新

Build serverless endpoints that relay external API requests for a dashboard while keeping API keys on the server. Includes Vercel examples for input checks, caching, cross-origin access, and consistent JSON responses.

中文简介正在准备中。当前显示英语简介。

  • Connect a dashboard to external APIs without exposing API keys
  • Create endpoints for stock quotes and news
  • Standardize API responses and error handling
HKUDS/OpenSpace77602026年8月13日 更新

Produce a master track and separate audio parts through a structured Python workflow. Apply filters and reverb, export WAV files with consistent settings, package them in a ZIP archive, and check that the deliverables meet the requested specifications.

中文简介正在准备中。当前显示英语简介。

  • Export a master track with separate audio parts
  • Apply filters and reverb to audio
  • Check duration and format across deliverables
HKUDS/OpenSpace77602026年8月13日 更新

Keep document creation moving when web searches and page retrieval repeatedly fail. The skill preserves the original task, uses the model’s existing knowledge, and clearly identifies information that could not be checked against external sources.

中文简介正在准备中。当前显示英语简介。

  • Continue drafting after repeated web retrieval failures
  • Preserve task requirements during network errors
  • Mark information that could not be externally verified
HKUDS/OpenSpace77602026年8月13日 更新

When Python execution repeatedly fails in execute_code_sandbox, use a file-based alternative: save the script, run it through the shell, and capture results or errors. The guidance covers paths, imports, timeouts, structured output, and optional cleanup.

中文简介正在准备中。当前显示英语简介。

  • Retry Python work through the shell after repeated sandbox failures
  • Run longer tasks with an adjusted timeout
  • Execute Python work that needs multiple files or system utilities
HKUDS/OpenSpace77602026年8月13日 更新

查看 HKUDS 的全部技能

报告此技能的问题