resilient-spreadsheet-workflow
できること
このスキルは、サンドボックスがエラーを返すときのスプレッドシート作業の、慎重な流れをAIエージェントに与えます。CSVやExcelのファイルを整理したり、要約したりする必要がある人向けです。
使う場面
- ✓CSVやExcelのファイルを扱っている途中で、コードのサンドボックスが不明なエラーを返すとき。
- ✓フォルダにあるスプレッドシートのファイルと、その大きさを知る必要があるとき。
- ✓次の処理に進む前に、スプレッドシートの作業の各ステップを確認したいとき。
スキルのリンク
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/resilient-spreadsheet-workflow/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“フォルダにあるスプレッドシートを探して、売上のCSVを整理し、要約を保存してください。進めながら各ステップを確認してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントはまず、ヘルパーを使ってスプレッドシートのファイルとその大きさを一覧にします。次に、処理のスクリプトをファイルに書いて実行し、次に進む前に各段階で出力を確認します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Resilient Spreadsheet Workflow
This skill provides a robust workflow for processing spreadsheet files (CSV, XLSX) when execute_code_sandbox encounters failures. It uses a combination of tools to ensure reliable execution and clear error diagnosis.
When to Use
- Processing spreadsheet files when
execute_code_sandboxreturns unknown errors - Need to debug why spreadsheet operations fail
- Require reliable file I/O with verification at each step
Step-by-Step Workflow
Step 1: Initial Exploration with shell_agent
Start by using shell_agent to explore the file structure and understand what files exist:
Use shell_agent to:
- List files in the working directory
- Identify spreadsheet files (CSV, XLSX)
- Examine file sizes and basic structure
Example task for shell_agent:
Explore the current directory to find all spreadsheet files (CSV, XLSX).
List their sizes and identify which files need processing.
Step 2: Write Processing Script with write_file
Create a standalone script file rather than executing inline code:
# Use write_file to create a script like "process_sheet.py"
content = """
import pandas as pd
import sys
try:
df = pd.read_csv('input.csv') # or pd.read_excel for XLSX
# Perform your processing
result = df.describe()
result.to_csv('output.csv', index=False)
print("Processing complete")
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
"""
write_file(path="process_sheet.py", content=content)
Step 3: Execute with run_shell and Error Redirection
Execute the script with stderr redirected to stdout for complete error capture:
run_shell command="python process_sheet.py 2>&1"
The 2>&1 redirection ensures both stdout and stderr are captured together, making error messages visible.
Step 4: Isolate Errors with Verification Commands
If Step 3 fails, add targeted verification commands to diagnose the actual problem:
# Check if Python is available
run_shell command="which python 2>&1"
# Check if pandas is installed
run_shell command="python -c 'import pandas' 2>&1"
# Verify input file exists and is readable
run_shell command="ls -la input.csv 2>&1"
# Check file encoding/content
run_shell command="file input.csv 2>&1"
run_shell command="head -5 input.csv 2>&1"
Step 5: Verify Output Before Reading
Before reading results with read_file, verify the output file exists:
list_dir(path=".")
# Confirm output file appears in the listing
# Then proceed to read_file
Complete Example
1. shell_agent(task="Find and describe all CSV/XLSX files in current directory")
2. write_file(path="analyze_data.py", content="<processing script>")
3. run_shell(command="python analyze_data.py 2>&1")
4. If error: run_shell(command="python -c 'import pandas; print(pandas.__version__)' 2>&1")
5. list_dir(path=".") # Verify output exists
6. read_file(filetype="csv", file_path="output.csv")
Common Error Patterns
| Symptom | Diagnostic Command | Likely Cause |
|---|---|---|
| Module not found | python -c 'import pandas' |
Missing dependency |
| File not found | ls -la <filename> |
Wrong path or name |
| Permission denied | ls -la <filename> |
File permissions |
| Encoding error | file <filename> |
Wrong file format |
Best Practices
- Always use 2>&1 with run_shell for shell commands to capture full error output
- Verify before reading - use list_dir to confirm file existence before read_file
- Break into small steps - separate exploration, script writing, execution, and verification
- Use shell_agent for unknowns - when directory structure or file types are unclear
- Write scripts to files - more reliable than inline code execution for complex operations
よくある質問
最初のステップは何をしますか?
作業フォルダのスプレッドシートのファイルを一覧にし、その大きさと構造を記録します。
インラインのコードではなく、スクリプトのファイルを書くのはなぜですか?
保存されたスクリプトは再実行や修正がしやすく、サンドボックスの失敗も避けられるからです。
CSVとExcelの両方に対応しますか?
はい。スキルは、CSVとXLSXのファイルを扱い、それぞれの読み取り方法を示しています。
詳細
作者による元の説明
Resilient multi-step workflow for spreadsheet processing when execute_code_sandbox fails, using shell_agent exploration, file-based scripts, and verification steps
repo: HKUDS/AgentPilot
人気
- GitHubのスター
- 7.8k
- ランキング
- #12974
- ライセンス
- 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エージェントが、プログラムを改善する方法を調べる間に、小さな実験を計画し、その結果を読み、発見を記録できるよう支援します。
似ているスキル
gitcrawl
394k保存されたGitHubのイシューとプルリクエストのアーカイブを検索し、重複をまとめ、GitHub上の現在の状態を確認するようエージェントを支援します。
slacrawl
394kローカルのSlackアーカイブ内のメッセージを検索して件数を数え、アーカイブの新しさを確認し、必要に応じて更新するようエージェントを支援します。
goplaces
394kGoogle Placesを使って、場所を検索し、詳細や口コミを取得し、場所の名前を解決するようエージェントを支援します。スクリプト用にJSON出力もできます。