Officialコーディング&開発github.com

xlsx

スプレッドシート(.xlsx, .xlsm, .xltx, .csv, .tsv)の作成、読み取り、編集、修正、フォーマット変換、またはデータ整形を必要とするタスクに使用します。

xlsx とは?

このスキルは、スプレッドシートファイル(.xlsx, .xlsm, .xltx, .csv, .tsv)を主な入力または出力とするあらゆるタスクに対応します。ユーザーが「ファイルを開く」「読み取り」「編集」「修正」「列追加」「数式計算」「書式設定」「グラフ作成」「データクリーニング」「新規作成」「フォーマット変換」などを行う際にトリガーされます。特に、ユーザーがファイル名やパスを指定した場合に自動的に起動します。このスキルはClaude CodeのようなAIエージェント向けに設計されており、openpyxl(数式・書式付き編集)、pandas(大規模データの一括入出力)、markitdown(簡易プレビュー)などのツールを駆使して、プロフェッショナルなスプレッドシートを生成します。すべての出力ファイルに対して、フォント指定、数式の使用(ハードコードされた値は禁止)、ゼロエラー保証、再利用性を重視した設計が求められます。また、openpyxlの注意点(2回読み込み、data_only=Trueの破壊性、結合セル、外部参照リンクの喪失)や、LibreOfficeで動作する互換性のある関数(SUMIFS、INDEX/MATCHなど)の選択、recalc.pyによる強制再計算検証ルールも含まれており、完成度の高いワークブックを生成するための厳格なガイドラインが定義されています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/anthropics/skills/tree/main/skills/xlsx

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

XLSX の作成、編集、分析

タスクアプローチ
数式/書式を含む 作成 または 編集openpyxl — 以下の注意点を参照
大量データ の入出力pandas (read_excel, to_excel)
シートの クイック確認markitdown file.xlsx — シートごとに ## シート名 を出力。.xlsm も読み取り可能。セル座標は出力されないため、編集の計画には使用不可
モデル(数式 と 値)の 読み取り2回の load_workbook パス — 以下の注意点を参照

openpyxl、pandas、markitdown はプリインストール済みです — pip install を実行せず、スクリプトを作成して直接インポートしてください。インポートが失敗した場合(または markitdown コマンドが見つからない場合)にのみ、不足しているパッケージを pip install してください。

以下のスクリプトパスは、このスキルのディレクトリからの相対パスです。

すべての出力に対する要件

  • プロフェッショナルなフォント (Arial、Times New Roman) を全体に使用する。ただし、ユーザーが別途指定した場合はその限りではない。
  • 数式エラーゼロ。recalc.py が errors_found を報告している状態では絶対に成果物を提供しないでください。エラーが元から存在したと思われる場合、それを証明してください:data_only=True で元のファイルをロードし、該当セルを確認してください。あなたが導入したエラーは、受け継いだエラーと見た目がまったく同じです。
  • 数式を使用し、ハードコードされた結果は絶対に使用しない。 sheet['B10'] = '=SUM(B2:B9)' のように記述し、Python で計算した合計値は記述しないでください。シートは入力が変更されたときに再計算される必要があります。
  • ユーザーの仕様に文字通り従う。 タブ名、列見出し、ユーザーが指定した数式をそのまま使用します。異なる計算を行う再設計は、どんなに洗練されていても失敗とみなされます。
  • すべての仮定とハードコードされた数値について、 読者が確認できる場所(セルコメント、表の末尾の隣接セルなど)に文書化します。実在する情報源がある場合はそれを引用してください(出典:Company 10-K, FY2024, Page 45, Revenue Note, [SEC EDGAR URL])。数値がユーザーからのものである場合は、その旨を明確に記述します。
  • ユーザーが記入するためにあなたが作成するワークブック には、どのセルを編集するかを示す短い凡例と、期待する書式を示す現実的な値が入力された1行のサンプルを含める必要があります。編集を依頼されたファイルに、そのような行を追加しないでください。
  • 既存ファイルを編集する場合:そのファイルの規則に正確に従うこと。 これらの規則は、ここにあるすべてのガイドラインに優先します。まず、専用の入力セル(異なるフォント色、塗りつぶし、または網掛けでマークされている)を見つけ、そこにのみ書き込み、既存の数式はすべてそのまま変更しないでください。

再計算(ファイルに数式が含まれている場合は必須)

openpyxl は数式をキャッシュされた値なしの文字列として書き込みます。再計算を行うまで、すべての数式セルは、キャッシュされた値を読み取るもの(pandas、load_workbook(data_only=True)、ほとんどのプレビューア)に対して None として読み戻されます。

python scripts/recalc.py output.xlsx [timeout_seconds]   # デフォルトは30

LibreOffice がすべての数式を計算し、ファイルはその場で上書きされ、JSON が出力されます。status (success | errors_found)、total_formulas、total_errors、およびエラータイプごとに最大100個のセルを名前付きで示す error_summary が含まれます(locations_truncated は、どれだけ省略したかを示します — total_errors を信頼し、リストの長さを信頼しないでください)。名前付きエラーを修正し、再度実行してください。status の代わりに error キーを持つ JSON は、何も再計算されなかったことを意味し、その場合のみ終了コードが非ゼロになります — errors_found は終了コード0で終了するため、クリーンな終了をクリーンなワークブックとみなさないでください。

緑色の再計算は、数式が 評価される ことを証明しますが、正しい ことを証明するわけではありません。 1つずれた範囲や間違った行への参照は、数値が間違っているがエラーのないクリーンなファイルを生成します。グリッド全体を作成する前に、最初に2~3個の数式を作成し、期待する値が取得されることを確認してください。

別のファイルにリンクするワークブックは、 openpyxl で再保存して再計算すると、それらのリンクが失われます。そのような数式は ='[1]Returns Analysis'!$B$2 のように読み取られます — [1] はワークブックの外部参照リストへのインデックスであり、シートではなくディスク上の別のファイルを指定しています。そのファイルがここに存在することは稀であるため、そのセルのキャッシュされた値だけがデータを保持しています。openpyxl は保存時にその値を削除します。その後、LibreOffice は実際に参照を解決する必要があり、失敗して #NAME? を書き込み、すべてのリンクを削除します。recalc.py はその状態では実行を拒否します — 上書き保存する前に、元のファイルからそれらのセルの値をコピーしてください(--force で上書きし、損失を受け入れます)。

検証に耐える数式の選択

LibreOffice は Excel よりも少ない関数しか実装しておらず、評価できない関数は文字通りの #NAME? となり、提供するファイルに組み込まれます。

  • Excel 2007 時代の関数 — SUMIFS、INDEX、MATCH、IFERROR、SUMPRODUCT — を優先してください。これらはプレフィックスを必要としません。
  • 2007年以降の6つの関数は動作しますが、_xlfn. プレフィックスが必要です。 openpyxl は数式をそのまま XML に書き込み、Excel はプレフィックス付きで2007年以降の名前を保存するためです(UI ではプレフィックスは非表示):_xlfn.TEXTJOIN、_xlfn.CONCAT、_xlfn.IFS、_xlfn.SWITCH、_xlfn.MAXIFS、_xlfn.MINIFS。これらの関数をプレフィックスなしで記述すると、それぞれ #NAME? になります。
  • XLOOKUP、XMATCH、SORT、FILTER、UNIQUE、SEQUENCE は絶対に使用しないでください。 ランタイムの LibreOffice は、どのプレフィックスでもこれらを評価できません。新しいビルドでは評価できるものもありますが、これらはスピルする配列関数であり、openpyxl で作成されたファイルにはスピルメタデータがないため、範囲の左上のセルだけが値を取得します — そして recalc.py は切り詰められた結果に対して total_errors: 0 を報告します。ルックアップには INDEX/MATCH を使用し、並べ替え、フィルター、重複除去は Python で行ってからセルに書き込んでください。
  • LibreOffice が解析できなかった数式は小文字で書き戻されます — これは #NAME? の隣にある素早い兆候です。

openpyxl の注意点

  • モデルの読み取りには2回のロードが必要です。 data_only=True は数式がなくなったキャッシュされた値を生成します。デフォルトは値のない数式文字列を生成します。1回のパスで両方を取得することはできません。
  • data_only=True は保存すると破壊的です。 そのワークブックには数式が残っていないため、保存するとすべての数式がリテラルに置き換えられます — 永久に。
  • openpyxl が書き込んだばかりのファイルに対して data_only=True を使用すると、全体が None を返します — 最初に recalc.py を実行してください。(結果が "" の数式も None として読み戻されます。)
  • 結合セル:左上のアンカーのみに書き込みます。 範囲内の他のすべてのセルは MergedCell であり、その .value は読み取り専用です。
  • .xlsm は、load_workbook に keep_vba=True を渡さないとマクロが失われます。
  • スペースを含むシート名は、 シート間参照で引用符で囲む必要があります:='Assumptions Inputs'!$B$5。引用符で囲まないと、#VALUE! と評価されます。

財務モデル

ユーザーが別途指定した場合、または既存ファイルがすでに別のことを行っている場合を除きます。

色: ハードコードされた入力とシナリオレバーには青いテキスト (0,0,255) · 数式には黒 · 別のシートへのリンクには緑 (0,128,0) · 別のファイルへのリンクには赤 (255,0,0) · 主要な仮定とユーザーが入力するセルには黄色の塗りつぶし (255,255,0)。

数値: 通貨 $#,##0、ヘッダーで単位を指定(収益 ($mm)) · ゼロは - として表示(パーセンテージも同様、$#,##0;($#,##0);-) · 負の数は括弧内 · パーセンテージ 0.0%、分数として格納(0.15 は 15.0% と表示されます。15 を格納すると 1500.0% と表示されます) · バリュエーションマルチプル 0.0x · 年はテキストとして("2024"、決して 2,024 ではありません)。

構造: すべての仮定は、それを使用する数式から参照される、ラベル付きの独自セルに配置します(=B5*(1+$B$6)、決して =B5*1.05 ではありません) · 数式はすべての予測期間で一貫していること。行の途中で単独で編集されたセルは、最も一般的な静かなエラーだからです · ゼロになる可能性のある分母をガードします。

依存関係

openpyxl、pandas、markitdown (pip、プリインストール済み — インポートが失敗した場合またはコマンドが見つからない場合のみインストール) · LibreOffice (soffice、サンドボックス環境用に scripts/office/soffice.py を介して自動設定)

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

academy-guide

Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

algorithmic-art

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists

anthropics/template-skill

Replace with description of the skill and when Claude should use it.

brand-guidelines

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

canvas-design

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists

claude-api

|-

discernment-nudge

After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.

doc-coauthoring

Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.

docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of

frontend-design

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

internal-comms

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

pdf

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.

pptx

Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions \

skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill

slack-gif-creator

Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like

theme-factory

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

web-artifacts-builder

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

関連スキル