Agent skill

Shell Agent Delegation

by HKUDS in HKUDS/OpenSpace

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

MITAuto-check passedDocuments & Office

Install Shell Agent Delegation

skills CLI
$ npx skills add HKUDS/OpenSpace --skill shell-agent-delegation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/OpenSpace shell-agent-delegation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/OpenSpace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/benchmarks/gdpval/skills/shell-agent-delegation .claude/skills/shell-agent-delegation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
shell-agent-delegation
GitHub stars
7.7k
Token cost
~1k tokens
SKILL.md length
356 words
Files
2
Skills in repo
199
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 4 steps: Recognize the Failure Pattern → Formulate the Delegation Task → Execute the Delegation → …
  • Documents & Office work in your project
  • SKILL.md covers When to Use This Skill, Why This Works, Step-by-Step Instructions and Code Example, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Shell Agent Delegation is an agent skill from HKUDS/OpenSpace. Delegate complex tasks to shellagent when direct tool execution fails, leveraging autonomous error recovery and library selection

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file.

It sits in Documents & Office. The repository describes itself as: "OpenSpace: The Skill Management Layer for AI Agents" -- https://open-space.cloud/. The licence is MIT.

When your agent uses it

  • Documents & Office work in your project

Example prompts

  • “/shell-agent-delegation”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Recognize the Failure Pattern
  2. Formulate the Delegation Task
  3. Execute the Delegation
  4. Monitor and Verify

What it can do on your machine

Read from SKILL.md and the folder at commit 3827781. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Shell Agent Delegation loads about 1k tokens when it runs. Until then it costs about 38 tokens; SKILL.md has 356 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~38
When it runs · the whole SKILL.md, loaded when a task matches
~1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/OpenSpace at commit 3827781, republished under its MIT licence (© HKUDS). 356 words, ~1,020 tokens.

Download SKILL.mdSave it as .claude/skills/shell-agent-delegation/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
shell-agent-delegation
description
Delegate complex tasks to shell_agent when direct tool execution fails, leveraging autonomous error recovery and library selection

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:

python
# 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
Show full SKILL.md (141 more words)Show less

Code Example

python
# 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

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in benchmarks/gdpval/skills/shell-agent-delegation of HKUDS/OpenSpace.

  • SKILL.md
  • .skill_id

Open the folder on GitHubat commit 3827781

Compare with similar skills

Shell Agent Delegation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Shell Agent Delegation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Shell Agent Delegation this skillHKUDS/OpenSpace7.7k—~1kAutomated safety check: PassMIT
Markdown Article FormatterJimLiu/baoyu-skills26k7 repos~3.5kAutomated safety check: PassMIT
MarkitdownImCa0/just-laws78114 repos~3.2kAutomated safety check: NotesMIT
Obsidian MarkdownAtmosphere/atmosphere3.8k20 repos~1.3kAutomated safety check: PassApache-2.0
DOCXrvdbreemen/OTGW-firmware20733 repos~4.3kAutomated safety check: PassProprietary
Gzh Designisjiamu/gzh-design-skill3.9k1 repos~2.2kAutomated safety check: PassAGPL-3.0

Similar skills

  • Markdown Article Formatter

    JimLiu/baoyu-skills

    Reformats plain text or Markdown articles with frontmatter, a title, a summary, headings, bold, lists and code blocks, and saves a separate formatted copy.

    26k GitHub starsUsed in 7 repos~3.5k tokens
    Documents & OfficeAuto-check passed
  • Markitdown

    ImCa0/just-laws

    Convert files and office documents to Markdown. An agent skill from ImCa0/just-laws.

    781 GitHub starsUsed in 14 repos~3.2k tokens
    Documents & OfficeAuto-check: notes
  • Obsidian Markdown

    Atmosphere/atmosphere

    Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax.

    3.8k GitHub starsUsed in 20 repos~1.3k tokens
    Documents & OfficeAuto-check passed
  • DOCX

    rvdbreemen/OTGW-firmware

    A skill your agent uses whenever the user wants to create, read, edit, or manipulate Word documents (.docx files).

    207 GitHub starsUsed in 33 repos~4.3k tokens
    Documents & OfficeAuto-check passed
  • Gzh Design

    isjiamu/gzh-design-skill

    微信公众号文章排版引擎,将 Markdown 转换为可直接粘贴到公众号编辑器的 HTML。主题风格从 references/theme-index.md 注册的自定义主题库中选取,自动章节编号、关键词下划线标记、引言卡片、目录导航、代码块、图片/GIF、作者签名。支持 Markdown / Word(.docx) / PDF / 纯文本输入(非 Markdown…

    3.9k GitHub starsUsed in 1 repo~2.2k tokens
    Documents & OfficeAuto-check passed
  • Reads, creates and edits Word .docx files with python-docx, and drops to raw OOXML for tracked changes, comments and byte-exact edits.

    41k GitHub stars~2.5k tokensUpdated today
    Documents & OfficeAuto-check passed

More from HKUDS/OpenSpace

All 199 skills in this repo
  • Walks through producing a master audio track plus stems in Python, from checking a reference file and timing sections by BPM to effects, a zip archive and final verification.

    7.7k GitHub stars~2.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Handle cascading data retrieval tool failures by falling back to embedded knowledge generation

    7.7k GitHub stars~765 tokensUpdated 1 mo ago
    Auto-check passed
  • Gives an agent a workaround when its code-execution sandbox keeps failing: save the Python script to a file and run it through the shell instead.

    7.7k GitHub stars~588 tokensUpdated 1 mo ago
    Auto-check passed
  • A recovery routine for agents whose sandboxed code runner keeps failing: save the Python script to disk, then run it through the shell and read the output.

    7.7k GitHub stars~652 tokensUpdated 1 mo ago
    Auto-check passed
  • Fallback ladder for failed sandboxed code runs, plus the habit of fixing the working directory first so generated files land in the right place.

    7.7k GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Fallback workflow for executing Python code when executecodesandbox fails repeatedly

    7.7k GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Shell Agent Delegation

What does Shell Agent Delegation do?

Delegate complex tasks to shellagent when direct tool execution fails, leveraging autonomous error recovery and library selection. Shell Agent Delegation is an agent skill from HKUDS/OpenSpace.

When should I use Shell Agent Delegation?

Shell Agent Delegation fits situations like: documents & Office work in your project.

How do I install Shell Agent Delegation in Claude Code?

Run `npx skills add HKUDS/OpenSpace --skill shell-agent-delegation -a claude-code`. Or copy the skill folder (benchmarks/gdpval/skills/shell-agent-delegation in HKUDS/OpenSpace) into .claude/skills/shell-agent-delegation in your project. Claude Code loads it when a task matches its description.

How do I install Shell Agent Delegation in Codex?

Run `npx skills add HKUDS/OpenSpace --skill shell-agent-delegation -a codex`. Or copy the skill folder (benchmarks/gdpval/skills/shell-agent-delegation in HKUDS/OpenSpace) into .agents/skills/shell-agent-delegation in your project. Codex loads it when a task matches its description.

Can I use Shell Agent Delegation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/OpenSpace --skill shell-agent-delegation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/shell-agent-delegation, .gemini/skills/shell-agent-delegation, .github/skills/shell-agent-delegation and .opencode/skills/shell-agent-delegation in your project.

What does Shell Agent Delegation need to run?

SKILL.md names no scripts, command-line tools or credentials: Shell Agent Delegation is instructions for the agent only. Our summary lists: Python 3.

Does Shell Agent Delegation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Shell Agent Delegation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Shell Agent Delegation use?

Shell Agent Delegation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Shell Agent Delegation use?

About 1k tokens (SKILL.md is roughly 4.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Shell Agent Delegation?

Skills that share tags, products or a category with Shell Agent Delegation: Markdown Article Formatter (JimLiu/baoyu-skills, 26k stars), Markitdown (ImCa0/just-laws, 781 stars), Obsidian Markdown (Atmosphere/atmosphere, 3.8k stars) and DOCX (rvdbreemen/OTGW-firmware, 207 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Shell Agent Delegation?

HKUDS (a GitHub organization) maintains it in HKUDS/OpenSpace, which has 7,749 GitHub stars. The repository holds 199 skills in this directory. The repository was last updated on August 12, 2026.

Source: HKUDS/OpenSpace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.