xlsx
できること
このスキルは、エージェントにMicrosoft Excelのファイルの扱い方を教えます。既存のシートの読み取り、ファイルの他の部分を壊さない慎重な編集、行の一覧から新しいブックを作ることを扱います。
使う場面
- ✓Excelファイル内のデータを見つけたり、要約したりしてほしいとき。
- ✓既存のスプレッドシートの特定のセルを、壊さずに更新する必要があるとき。
- ✓表やメモから新しいExcelのブックを作りたいとき。
スキルのリンク
https://github.com/TokenRhythm/opensquilla/blob/main/src/opensquilla/skills/bundled/xlsx/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“売上のスプレッドシートのF列の合計を、書式を失わずに直してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、ファイルのセルを直接扱い、数値、テキスト、日付、数式を別々の種類の値として扱います。Pythonのツールでブックを読み書きし、完成したファイルを返します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
xlsx
Work with .xlsx workbooks. The format is OOXML SpreadsheetML — a zip
container of XML parts. Treat each cell as a typed value: a number, a string,
a datetime, or a formula. Mixing the four causes Excel to flag the workbook
or compute incorrect totals.
Decide the path first
| You have | Goal | Path |
|---|---|---|
Existing .xlsx |
Read sheets and cells | A. Inspect |
Existing .xlsx |
Modify specific cells | B. Edit-in-place |
| Nothing or a brief | Build a new workbook | C. Create from scratch |
If the user provides a workbook to update, default to path B and treat the input as the formatting baseline. Choose path C only when the user says "start fresh".
Execution and delivery
Use execute_code with the Python examples below when it is available. Keep
all input and output files in the active workspace, then call
publish_artifact(path="out.xlsx") to deliver the finished workbook.
In a restricted channel, use openpyxl directly; the shell commands below
are optional shortcuts for sessions that expose exec_command. Do not use
Python subprocesses to bypass an unavailable shell tool or request host
execution when the sandbox fails. If execution or a required library is
unavailable, report that limitation and keep the session read-only.
Path A: Inspect
With execute_code:
from openpyxl import load_workbook
wb = load_workbook("book.xlsx", data_only=False)
for ws in wb.worksheets:
print(ws.title, list(ws.values))
wb.close()
python {baseDir}/scripts/inspect_xlsx.py /path/to/book.xlsx
Output:
{
"sheets": [
{
"name": "Q3",
"max_row": 10,
"max_col": 5,
"rows": [
[
{"value": "Metric", "type": "s"},
{"value": "Value", "type": "s"}
],
[
{"value": "Revenue", "type": "s"},
{"value": 2100000, "type": "n"}
]
]
}
]
}
type follows openpyxl conventions: n (number), s (string), d
(datetime), f (formula), b (bool), e (error), inlineStr (inline
string). The helper script reads with data_only=False so formula expressions
are returned literally; pass --data-only to get the cached computed result
instead.
Path B: Edit in place
With execute_code:
from openpyxl import load_workbook
wb = load_workbook("book.xlsx")
wb["Q3"]["B2"] = "=SUM(B3:B10)"
wb.save("edited.xlsx")
wb.close()
python {baseDir}/scripts/edit_xlsx.py book.xlsx ops.json --out edited.xlsx
ops.json:
[
{"op": "set_cell", "sheet": "Q3", "row": 2, "col": 2, "value": "=SUM(B3:B10)"},
{"op": "set_cell", "sheet": "Q3", "row": 5, "col": 1, "value": "Net margin"},
{"op": "rename_sheet", "old": "Sheet1", "new": "Summary"}
]
Rules:
- Rows and columns are 1-based (Excel convention).
- Strings starting with
=are written as formulas (cell.value = "=..."), matching openpyxl behavior. To write a literal=hellouse'=hello(Excel's leading-apostrophe escape) or pass an explicitas_text: true. - Datetimes go in as ISO 8601 strings (
"2026-05-06T09:00:00"); the helper parses them back todatetimeobjects so Excel renders the cell with date format. - Editing a cell does not recalculate dependent formulas. Excel and LibreOffice recalculate on open. If you need cached values immediately, use a calculation engine (out of scope here).
Path C: Create from scratch
python {baseDir}/scripts/create_xlsx.py spec.json --out out.xlsx
Spec:
{
"sheets": [
{
"name": "Sales",
"rows": [
["Region", "Revenue", "Growth"],
["NA", 1200000, "=B2/SUM($B$2:$B$4)"],
["EU", 850000, "=B3/SUM($B$2:$B$4)"]
],
"merged": [{"range": "A1:C1"}],
"freeze": "A2"
}
]
}
For programmatic use:
from openpyxl import Workbook
wb = Workbook()
ws = wb.active
ws.title = "Sales"
ws.append(["Region", "Revenue"])
ws.append(["NA", 1_200_000])
ws["C2"] = "=B2*1.05" # formula
ws.merge_cells("A1:B1")
ws.freeze_panes = "A2"
wb.save("out.xlsx")
See references/openpyxl.md for styles, conditional formatting, charts, and formula references.
Common pitfalls
| Symptom | Cause | Fix |
|---|---|---|
Cell shows =SUM(...) as text, not the result |
Wrote the string with as_text: true or workbook lacks cached values |
Open in Excel and save once; or use a calc engine |
| Date renders as a ser |
よくある質問
編集しても既存の書式は保たれますか?
はい。既存のブックでは、あなたのファイルを書式の基準として使い、依頼されたセルだけを変えます。
エージェントは常に新しいブックをゼロから作りますか?
いいえ。新しく作るよう言われたときだけ作り、それ以外では渡されたファイルを編集します。
Pythonのツールを実行できない場合は?
制限を報告し、代わりにセッションを読み取り専用のままにするとしています。
詳細
作者による元の説明
Read, inspect, edit, or create Microsoft Excel `.xlsx` workbooks, including structured data extraction, formula-aware cell edits, and workbook generation from rows.
repo: TokenRhythm/opensquilla
人気
- GitHubのスター
- 7.1k
- ランキング
- #13595
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
browser-use
7.1kエージェントが、OpenSquilla Desktopのサイドバーのブラウザで、ウェブページを開き、読み、操作できるよう支援します。フォームやビジュアルの確認も含みます。
deep-research
7.1kエージェントに、保存された計画、追跡される情報源、引用付きの長いレポートを使って、複数ラウンドのリサーチを行う方法を教えます。
docx
7.1kエージェントが、書式、変更の追跡、構造を保ったまま、Wordの.docxファイルを読み、編集し、作成できるよう支援します。
html-coder
7.1kエージェントが、アクセシブルなフォーム、メディア、HTML5の機能を使った、きれいで意味の明確なHTMLページを書き、ウェブのプレビューとして開けるよう支援します。
似ているスキル
feishu-doc
394kテキスト、画像、表を含むFeishuのクラウドドキュメントを、ドキュメントツールを使って読み、作成し、編集するようエージェントを支援します。
feishu-drive
394kボットと共有されたFeishuのクラウドフォルダ内のファイルを閲覧、整理、コメントできるようエージェントを支援します。
feishu-perm
394kFeishuのファイルにアクセスできる人を確認し、変更するようエージェントを支援します。依頼を満たす最小の権限を選びます。