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

データ分析

ユーザーがアップロードしたExcel(.xlsx/.xls)またはCSVファイルに対して、データ分析、統計生成、要約、ピボットテーブル、SQLクエリ、構造化データ探索を実行します。複数シートのExcelブック、集計、フィルタリング、結合、結果のCSV/JSON/Markdownへのエクスポートに対応しています。

データ分析 とは?

このスキルは、DuckDB(インプロセス分析SQLエンジン)を使用して、アップロードされたExcel/CSVファイルを解析・分析するための強力なツールです。ファイルのスキーマ検査、任意のSQLクエリの実行、統計サマリーの生成、結果のCSV/JSON/Markdown形式へのエクスポートを、単一のPythonスクリプトを通じて実現します。複数シートのExcelブックをサポートし、各シートを個別のテーブルとして扱うため、シート間やファイル間でのJOINクエリも可能です。大規模ファイル(100MB以上)でもDuckDBのカラムナエンジンにより効率的に処理され、ファイルの変更検出による自動キャッシュ機能で複数クエリ実行時のパフォーマンスが最適化されます。このスキールは主にCline(旧Claude Code)やCodexなどのAIエージェントがデータ分析タスクを遂行するために設計されており、ユーザーの質問に基づいてファイル構造を調査し、SQL分析を実行し、結果をわかりやすく説明します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/bytedance/deer-flow/tree/main/skills/public/data-analysis

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

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

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

ドキュメント

データ分析スキル

概要

このスキルは、ユーザーがアップロードしたExcel/CSVファイルを、インプロセス分析SQLエンジンであるDuckDBを使用して分析します。スキーマ検査、SQLベースのクエリ、統計サマリーの生成、結果のエクスポートを、単一のPythonスクリプトで実現します。

コア機能

  • Excel/CSVファイルの構造を検査(シート、列、型、行数)
  • アップロードされたデータに対して任意のSQLクエリを実行
  • 統計サマリーを生成(平均、中央値、標準偏差、パーセンタイル、null数)
  • 複数シートのExcelブックをサポート(各シートがテーブルになる)
  • クエリ結果をCSV、JSON、Markdownにエクスポート
  • DuckDBのカラムナエンジンにより大規模ファイルを効率的に処理

ワークフロー

ステップ1:要件の理解

ユーザーがデータファイルをアップロードして分析を依頼した場合、以下を特定します:

  • ファイルの場所:/mnt/user-data/uploads/ 以下にあるアップロードされたExcel/CSVファイルへのパス
  • 分析の目的:ユーザーが求めている洞察(要約、フィルタリング、集計、比較など)
  • 出力形式:結果の表示方法(表、CSVエクスポート、JSONなど)
  • /mnt/user-data 以下のフォルダを確認する必要はありません

ステップ2:ファイル構造の検査

まず、アップロードされたファイルのスキーマを理解するために検査します:

python /mnt/skills/public/data-analysis/scripts/analyze.py \
  --files /mnt/user-data/uploads/data.xlsx \
  --action inspect

これにより以下が返されます:

  • シート名(Excelの場合)またはファイル名(CSVの場合)
  • 列名、データ型、非nullカウント
  • シート/ファイルごとの行数
  • サンプルデータ(最初の5行)

ステップ3:分析の実行

スキーマに基づいて、ユーザーの質問に答えるSQLクエリを構築します。

SQLクエリの実行

python /mnt/skills/public/data-analysis/scripts/analyze.py \
  --files /mnt/user-data/uploads/data.xlsx \
  --action query \
  --sql "SELECT category, COUNT(*) as count, AVG(amount) as avg_amount FROM Sheet1 GROUP BY category ORDER BY count DESC"

統計サマリーの生成

python /mnt/skills/public/data-analysis/scripts/analyze.py \
  --files /mnt/user-data/uploads/data.xlsx \
  --action summary \
  --table Sheet1

数値列の場合:count、mean、std、min、25%、50%、75%、max、null_countを返します。 文字列列の場合:count、unique、top value、frequency、null_countを返します。

結果のエクスポート

python /mnt/skills/public/data-analysis/scripts/analyze.py \
  --files /mnt/user-data/uploads/data.xlsx \
  --action query \
  --sql "SELECT * FROM Sheet1 WHERE amount > 1000" \
  --output-file /mnt/user-data/outputs/filtered-results.csv

サポートされる出力形式(拡張子から自動検出):

  • .csv — カンマ区切り値
  • .json — レコードのJSON配列
  • .md — Markdownテーブル

パラメータ

パラメータ必須説明
--filesはいExcel/CSVファイルへのパス(スペース区切り)
--actionはいinspect、query、summary のいずれか
--sqlqueryの場合実行するSQLクエリ
--tablesummaryの場合サマリーを生成するテーブル/シート名
--output-fileいいえ結果をエクスポートするパス(CSV/JSON/MD)

[!NOTE] Pythonファイルを直接読まず、パラメータを指定して呼び出してください。

テーブル命名規則

  • Excelファイル:各シートがシート名のテーブルになります(例:Sheet1、Sales、Revenue)
  • CSVファイル:テーブル名は拡張子を除いたファイル名です(例:data.csv → data)
  • 複数ファイル:すべてのファイルのすべてのテーブルが同じクエリコンテキストで利用可能になり、ファイル間のJOINが可能です
  • 特殊文字:スペースや特殊文字を含むシート/ファイル名は自動的にサニタイズされます(スペース → アンダースコア)。数値で始まる名前や特殊文字を含む名前は二重引用符で囲んでください(例:"2024_Sales")

分析パターン

基本的な探索

-- 行数
SELECT COUNT(*) FROM Sheet1

-- 列のユニーク値
SELECT DISTINCT category FROM Sheet1

-- 値の分布
SELECT category, COUNT(*) as cnt FROM Sheet1 GROUP BY category ORDER BY cnt DESC

-- 日付範囲
SELECT MIN(date_col), MAX(date_col) FROM Sheet1

集計とグループ化

-- カテゴリと月ごとの売上
SELECT category, DATE_TRUNC('month', order_date) as month,
       SUM(revenue) as total_revenue
FROM Sales
GROUP BY category, month
ORDER BY month, total_revenue DESC

-- 支出額トップ10の顧客
SELECT customer_name, SUM(amount) as total_spend
FROM Orders GROUP BY customer_name
ORDER BY total_spend DESC LIMIT 10

ファイル間のJOIN

-- 異なるファイルの売上と顧客情報を結合
SELECT s.order_id, s.amount, c.customer_name, c.region
FROM sales s
JOIN customers c ON s.customer_id = c.id
WHERE s.amount > 500

ウィンドウ関数

-- 累計と順位
SELECT order_date, amount,
       SUM(amount) OVER (ORDER BY order_date) as running_total,
       RANK() OVER (ORDER BY amount DESC) as amount_rank
FROM Sales

ピボット型分析

-- ピボット:カテゴリ別月次売上
SELECT category,
       SUM(CASE WHEN MONTH(date) = 1 THEN revenue END) as Jan,
       SUM(CASE WHEN MONTH(date) = 2 THEN revenue END) as Feb,
       SUM(CASE WHEN MONTH(date) = 3 THEN revenue END) as Mar
FROM Sales
GROUP BY category

完全な例

ユーザーが sales_2024.xlsx(シート:Orders、Products、Customers)をアップロードし、「売上データを分析して、売上高トップの製品と月次の傾向を見せて」と依頼した場合。

ステップ1:ファイルの検査

python /mnt/skills/public/data-analysis/scripts/analyze.py \
  --files /mnt/user-data/uploads/sales_2024.xlsx \
  --action inspect

ステップ2:売上高トップの製品

python /mnt/skills/public/data-analysis/scripts/analyze.py \
  --files /mnt/user-data/uploads/sales_2024.xlsx \
  --action query \
  --sql "SELECT p.product_name, SUM(o.quantity * o.unit_price) as total_revenue, SUM(o.quantity) as total_units FROM Orders o JOIN Products p ON o.product_id = p.id GROUP BY p.product_name ORDER BY total_revenue DESC LIMIT 10"

ステップ3:月次の売上傾向

python /mnt/skills/public/data-analysis/scripts/analyze.py \
  --files /mnt/user-data/uploads/sales_2024.xlsx \
  --action query \
  --sql "SELECT DATE_TRUNC('month', order_date) as month, SUM(quantity * unit_price) as revenue FROM Orders GROUP BY month ORDER BY month" \
  --output-file /mnt/user-data/outputs/monthly-trends.csv

ステップ4:統計サマリー

python /mnt/skills/public/data-analysis/scripts/analyze.py \
  --files /mnt/user-data/uploads/sales_2024.xlsx \
  --action summary \
  --table Orders

結果を、発見事項、傾向、実用的な洞察の明確な説明とともにユーザーに提示します。

複数ファイルの例

ユーザーが orders.csv と customers.xlsx をアップロードし、「平均注文金額が最も高い地域はどこ?」と質問した場合:

python /mnt/skills/public/data-analysis/scripts/analyze.py \
  --files /mnt/user-data/uploads/orders.csv /mnt/user-data/uploads/customers.xlsx \
  --action query \
  --sql "SELECT c.region, AVG(o.amount) as avg_order_value, COUNT(*) as order_count FROM orders o JOIN Customers c ON o.customer_id = c.id GROUP BY c.region ORDER BY avg_order_value DESC"

出力の処理

分析後:

  • クエリ結果は、整形されたテーブルとして会話内に直接表示
  • 大規模な結果の場合は、ファイルにエクスポートして present_files ツールで共有
  • 常に平易な言葉で発見事項を説明し、重要なポイントを示す
  • 興味深いパターンが見られた場合は、フォローアップ分析を提案
  • ユーザーが結果を保持したい場合、エクスポートを提案

キャッシュ

スクリプトは読み込んだデータを自動的にキャッシュし、呼び出しごとにファイルの再解析を回避します:

  • 初回ロード時、ファイルは解析され、/mnt/user-data/workspace/.data-analysis-cache/ の下にある永続的なDuckDBデータベースに保存されます
  • キャッシュキーはすべての入力ファイルの内容のSHA256ハッシュです — ファイルが変更されると、新しいキャッシュが作成されます
  • 同じファイルでの以降の呼び出しでは、キャッシュされたデータベースが直接使用されます(ほぼ瞬時に起動)
  • キャッシュは透過的で、追加のパラメータは不要です

これは特に、同じデータファイルに対して複数のクエリ(inspect → query → summary)を実行する場合に便利です。

注記

  • DuckDBはウィンドウ関数、CTE、サブクエリ、高度な集計を含む完全なSQLをサポートしています
  • Excelの日付列は自動的に解析されます。DuckDBの日付関数(DATE_TRUNC、EXTRACT など)を使用してください
  • 非常に大きなファイル(100MB以上)の場合、DuckDBはすべてをメモリに読み込まず効率的に処理します
  • スペースを含む列名は二重引用符でアクセスします:"Column Name"

Individual skills in this repo

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

academic-paper-review

Use this skill when the user requests to review, analyze, critique, or summarize academic papers, research articles, preprints, or scientific publications. Supports comprehensive structured reviews covering methodology assessment, contribution evaluation, literature positioning, and constructive feedback generation. Trigger on queries involving paper URLs, uploaded PDFs, arXiv links, or requests like "review this paper", "analyze this research", "summarize this study", or "write a peer review".

bootstrap

Generate a personalized SOUL.md through a warm, adaptive onboarding conversation. Trigger when the user wants to create, set up, or initialize their AI partner's identity — e.g., "create my SOUL.md", "bootstrap my agent", "set up my AI partner", "define who you are", "let's do onboarding", "personalize this AI", "make you mine", or when a SOUL.md is missing. Also trigger for updates: "update my SOUL.md", "change my AI's personality", "tweak the soul".

bytedance/academic-paper-review

Use this skill when the user requests to review, analyze, critique, or summarize academic papers, research articles, preprints, or scientific publications. Supports comprehensive structured reviews covering methodology assessment, contribution evaluation, literature positioning, and constructive feedback generation. Trigger on queries involving paper URLs, uploaded PDFs, arXiv links, or requests like "review this paper", "analyze this research", "summarize this study", or "write a peer review".

bytedance/chart-visualization

This skill should be used when the user wants to visualize data. It intelligently selects the most suitable chart type from 26 available options, extracts parameters based on detailed specifications, and generates a chart image using a JavaScript script.

bytedance/claude-to-deerflow

Interact with DeerFlow AI agent platform via its HTTP API. Use this skill when the user wants to send messages or questions to DeerFlow for research/analysis, start a DeerFlow conversation thread, check DeerFlow status or health, list available models/skills/agents in DeerFlow, manage DeerFlow memory, upload files to DeerFlow threads, or delegate complex research tasks to DeerFlow. Also use when the user mentions deerflow, deer flow, or wants to run a deep research task that DeerFlow can handle.

bytedance/consulting-analysis

Use this skill when the user requests to generate, create, or write professional research reports including but not limited to market analysis, consumer insights, brand analysis, financial analysis, industry research, competitive intelligence, investment due diligence, or any consulting-grade analytical report. This skill operates in two phases — (1) generating a structured analysis framework with chapter skeleton, data query requirements, and analysis logic, and (2) after data collection by other skills, producing the final consulting-grade report with structured narratives, embedded charts, and strategic insights.

bytedance/data-analysis

Use this skill when the user uploads Excel (.xlsx/.xls) or CSV files and wants to perform data analysis, generate statistics, create summaries, pivot tables, SQL queries, or any form of structured data exploration. Supports multi-sheet Excel workbooks, aggregation, filtering, joins, and exporting results to CSV/JSON/Markdown.

bytedance/deep-research

Use this skill instead of WebSearch for ANY question requiring web research. Trigger on queries like "what is X", "explain X", "compare X and Y", "research X", or before content generation tasks. Provides systematic multi-angle research methodology instead of single superficial searches. Use this proactively when the user's question needs online information.

bytedance/find-skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

bytedance/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

bytedance/github-deep-research

Conduct multi-round deep research on any GitHub Repo. Use when users request comprehensive analysis, timeline reconstruction, competitive analysis, or in-depth investigation of GitHub. Produces structured markdown reports with executive summaries, chronological timelines, metrics analysis, and Mermaid diagrams. Triggers on Github repository URL or open source projects.

bytedance/image-generation

Use this skill when the user requests to generate, create, imagine, or visualize images including characters, scenes, products, or any visual content. Supports structured prompts and reference images for guided generation.

bytedance/podcast-generation

Use this skill when the user requests to generate, create, or produce podcasts from text content. Converts written content into a two-host conversational podcast audio format with natural dialogue.

bytedance/ppt-generation

Use this skill when the user requests to generate, create, or make presentations (PPT/PPTX). Creates visually rich slides by generating images for each slide and composing them into a PowerPoint file.

bytedance/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's description for better triggering accuracy.

bytedance/surprise-me

Create a delightful, unexpected "wow" experience for the user by dynamically discovering and creatively combining other enabled skills. Triggers when the user says "surprise me" or any request expressing a desire for an unexpected creative showcase. Also triggers when the user is bored, wants inspiration, or asks for "something interesting".

bytedance/vercel-deploy

Deploy applications and websites to Vercel. Use this skill when the user requests deployment actions such as "Deploy my app", "Deploy this to production", "Create a preview deployment", "Deploy and give me the link", or "Push this live". No authentication required - returns preview URL and claimable deployment link.

bytedance/video-generation

Use this skill when the user requests to generate, create, or imagine videos. Supports structured prompts and reference image for guided generation.

bytedance/web-design-guidelines

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

chart-visualization

This skill should be used when the user wants to visualize data. It intelligently selects the most suitable chart type from 26 available options, extracts parameters based on detailed specifications, and generates a chart image using a JavaScript script.

関連スキル