shell-agent-file-ops
できること
このスキルは、AIエージェントがファイルの作成や設定ファイルの更新などを、シェルエージェントに任せる方法を示します。どうやるかではなく、何が必要かを伝えたい人向けです。
使う場面
- ✓ファイルを作成または変更する必要があるが、最適な方法が明確でないとき。
- ✓ファイルの作業で、自動的なエラー処理と再試行を求めるとき。
- ✓コマンドを指定するより、求める結果を説明したいとき。
スキルのリンク
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/shell-agent-file-ops/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“設定フォルダーにあるすべての設定ファイルに、タイムアウト300を追加してください。シェルエージェントに方法を考えてもらってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、平易な言葉でタスクをシェルエージェントに渡します。シェルエージェントはPythonかBashを選び、コードを書いて実行し、複数回の再試行でエラーを処理して、結果を返します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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:
- Decide whether to use Python or Bash
- Write and execute the appropriate code
- Handle any errors automatically (up to several retry rounds)
- 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
Be specific about content requirements - Describe what should be in the file(s), not just that files should be created.
Include format specifications - Mention desired formats (markdown, JSON, CSV, etc.) when relevant.
Specify file locations - Include paths when files should be in specific directories.
Let shell_agent handle complexity - Don't pre-decide the implementation approach; trust the autonomous selection.
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_filedirectly - 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.
よくある質問
複数のファイルを一度に編集できますか?
はい。スキルの例では、1つのフォルダーにあるすべての設定ファイルを一度に更新しています。
どの種類のファイルを扱いますか?
スキルは、書類、メモ、設定ファイルなどの例を挙げています。
コマンドを知っておく必要がありますか?
いいえ。タスクを説明すれば、シェルエージェントがコマンドを処理します。
詳細
作者による元の説明
Leverage shell_agent for autonomous file creation and modification with automatic tool selection and error recovery
repo: HKUDS/AgentPilot
人気
- GitHubのスター
- 7.8k
- ランキング
- #12997
- ライセンス
- 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ページを段階的に操作するようエージェントに教えます。