Skip to content
cccskills
FreePublished on GitHub

shell-agent-file-ops

Describe the files you want created, updated, or organized, and let shell_agent choose how to perform the work. It selects tools such as Python or Bash, executes the operation, and handles errors with retries.

OriginalShow the original description

Leverage shell_agent for autonomous file creation and modification with automatic tool selection and error recovery

See how to install

Good for

  • Creating a document with specified content and format
  • Updating multiple configuration files
  • Creating a Python project structure

Files included (2)

  • SKILL.md3.3 KB
  • .skill_id34 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

Shell Agent File Operations

Purpose

Use shell_agent for file operations when you want the tool to autonomously decide how to accomplish the task (Python vs Bash, which commands to use, error recovery) rather than manually selecting specific tools like write_file or run_shell.

When to Use

Use this pattern when:

  • You need to create, modify, or organize files
  • The optimal approach (Python script, Bash commands, direct file write) is unclear
  • You want automatic error handling and retry logic
  • You prefer to describe what to accomplish rather than how

How to Use

Basic Pattern

Delegate to shell_agent with a clear natural-language task description.

Example: Create a Document File

Task description to shell_agent:

Create a comprehensive SOAP note file containing four sections:
Subjective, Objective, Assessment, and Plan. Include all relevant
patient visit details in a professional medical format.

The shell_agent will:

  1. Decide whether to use Python or Bash
  2. Write and execute the appropriate code
  3. Handle any errors automatically (up to several retry rounds)
  4. Return the result

Example: Modify Existing Files

Task description to shell_agent:

Update all configuration files in the config/ directory to add
a new setting "timeout: 300" under the general section.

Example: Complex File Operations

Task description to shell_agent:

Create a project structure with README.md, src/main.py, and
tests/test_main.py. Include appropriate content in each file
based on a Python data processing project template.

Best Practices

  1. Be specific about content requirements - Describe what should be in the file(s), not just that files should be created.

  2. Include format specifications - Mention desired formats (markdown, JSON, CSV, etc.) when relevant.

  3. Specify file locations - Include paths when files should be in specific directories.

  4. Let shell_agent handle complexity - Don't pre-decide the implementation approach; trust the autonomous selection.

  5. Check the output - Review what shell_agent created to ensure it meets requirements.

Comparison: When NOT to Use This Pattern

Use direct tools instead when:

  • You already know the exact command/script to run → use run_shell
  • You have the exact file content ready → use write_file directly
  • The operation is trivial (single-line file write) → use write_file
  • You need fine-grained control over the implementation

Anti-Patterns to Avoid

❌ Don't over-specify the implementation:

Use Python to write a file called notes.md with this content...

✅ Do describe the desired outcome:

Create a notes.md file with comprehensive documentation about...

❌ Don't use shell_agent for simple direct operations:

Write "hello" to hello.txt

✅ Do use write_file directly for simple cases:

write_file(path="hello.txt", content="hello")

Summary

This pattern shifts focus from implementation mechanics to task intent, leveraging shell_agent's autonomous decision-making for file operations that benefit from intelligent tool selection and automatic error recovery.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

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/OpenSpace7.8KUpdated Aug 13, 2026

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/OpenSpace7.8KUpdated Aug 13, 2026

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/OpenSpace7.8KUpdated Aug 13, 2026

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/OpenSpace7.8KUpdated Aug 13, 2026

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/OpenSpace7.8KUpdated Aug 13, 2026

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/OpenSpace7.8KUpdated Aug 13, 2026

See all skills by HKUDS

Report a problem with this skill