bytedance/deer-flow/data-analysis
Claude Code and agent skill by bytedance/deer-flow
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install bytedance/deer-flow/data-analysisSKILL.md
The same SKILL.md was published earlier as bytedance/deer-flow/data-analysis.
Data Analysis Skill
Overview
This skill analyzes user-uploaded Excel/CSV files using DuckDB — an in-process analytical SQL engine. It supports schema inspection, SQL-based querying, statistical summaries, and result export, all through a single Python script.
Environment setup
Prepare the Python environment before running analyses. Install the required packages explicitly using the same interpreter that will run the script:
If either package is missing, the script exits with a setup instruction; it does not invoke an installer or modify the environment. DuckDB's spatial extension is initialized only for .xlsx input. CSV and legacy .xls analysis do not install or load it, so they can run offline with an empty extension cache.
Legacy Excel 97–2003 (.xls) workbooks additionally require:
These optional packages are loaded only for .xls input. A missing package produces an explicit setup instruction. Legacy workbooks are read sheet by sheet with pandas' xlrd engine, preserving cell values (including literal NA strings and leading zeros in text identifiers) and treating empty cells as nulls. Columns with incompatible cell types, such as a date and a number, are stored as text with nulls preserved. Compatible numeric types still produce numeric columns. Completely empty sheets are skipped. The .xlsx reader continues to use openpyxl and DuckDB's spatial extension. A legacy workbook that cannot be opened is reported and skipped so remaining inputs can still be analyzed. The command fails if no input produces a table.
Core Capabilities
- Inspect Excel/CSV file structure (sheets, columns, types, row counts)
- Execute arbitrary SQL queries against uploaded data
- Generate statistical summaries (mean, median, stddev, percentiles, nulls)
- Support multi-sheet Excel workbooks (each sheet becomes a table)
- Export query results to CSV, JSON, or Markdown
- Handle large files efficiently with DuckDB's columnar engine
Workflow
Step 1: Understand Requirements
When a user uploads data files and requests analysis, identify:
- File location: Path(s) to uploaded Excel/CSV files under
/mnt/user-data/uploads/ - Analysis goal: What insights the user wants (summary, filtering, aggregation, comparison, etc.)
- Output format: How results should be presented (table, CSV export, JSON, etc.)
- You don't need to check the folder under
/mnt/user-data
Step 2: Inspect File Structure
First, inspect the uploaded file to understand its schema:
This returns:
- Sheet names (for Excel) or filename (for CSV)
- Column names, data types, and non-null counts
- Row count per sheet/file
- Sample data (first 5 rows)
Step 3: Perform Analysis
Based on the schema, construct SQL queries to answer the user's questions.
Run SQL Query
Generate Statistical Summary
This returns for each numeric column: count, mean, std, min, 25%, 50%, 75%, max, null_count. For string columns: count, unique, top value, frequency, null_count.
Export Results
Supported output formats (auto-detected from extension):
.csv— Comma-separated values.json— JSON array of records.md— Markdown table
Relative output paths are resolved from the current working directory. A bare filename such as report.csv writes there directly; missing parent directories in paths such as reports/report.csv are created automatically. An existing file at the target path is overwritten without warning.
JSON result column names must be unique. Use explicit SQL aliases for repeated names, for example SELECT a.id AS left_id, b.id AS right_id FROM .... Duplicate names cause an error and leave any existing output file untouched. The error lists the repeated names so you can alias them directly. The CLI prints a short Error: ... message to stderr and exits nonzero for this rejection.
JSON exports also reject non-finite numbers (NaN, Infinity, and -Infinity), including values inside lists or structs, before opening the output file. Filter or replace them in SQL, for example CASE WHEN isfinite(ratio) THEN ratio ELSE NULL END AS ratio. Finite numbers, nulls, and text such as 'NaN' remain valid.
Parameters
| Parameter | Required | Description | |
|---|---|---|---|
--files | Yes | Space-separated paths to Excel/CSV files | |
--action | Yes | One of: inspect, query, summary | |
--sql | For query | SQL query to execute | |
--table | For summary | Table/sheet name to summarize | |
--output-file | No | Path to export results (CSV/JSON/MD) |
[!NOTE]Do NOT read the Python file, just call it with the parameters.
Table Naming Rules
- Excel files: Each sheet becomes a table named after the sheet (e.g.,
Sheet1,Sales,Revenue) - CSV files: Table name is the filename without extension (e.g.,
data.csv→data) - Multiple files: All tables from all files are available in the same query context, enabling cross-file joins
- Collisions: Repeated names (including case-only differences) receive unique SQL names in input order, such as
report,report_1,report_2. This also applies to repeated Excel sheet names. Use the SQL names shown byinspectfor queries and summaries. An original-name alias never overrides an earlier SQL name. - Special characters: Sheet/file names are sanitized into SQL names (for example,
sales-2026→sales_2026). Use the SQL names printed byinspect, or double-quote a unique original name, e.g.,SELECT * FROM "sales-2026". Queries execute unchanged: string literals, column aliases, comments, and CTEs retain normal DuckDB semantics. Names containing a double quote escape it by doubling it, e.g.,"net""amount"
Analysis Patterns
Basic Exploration
Aggregation & Grouping
Cross-file Joins
Window Functions
Pivot-style Analysis
Complete Example
User uploads sales_2024.xlsx (with sheets: Orders, Products, Customers) and asks: "Analyze my sales data — show top products by revenue and monthly trends."
Step 1: Inspect the file
Step 2: Top products by revenue
Step 3: Monthly revenue trends
Step 4: Statistical summary
Present results to the user with clear explanations of findings, trends, and actionable insights.
Multi-file Example
User uploads orders.csv and customers.xlsx and asks: "Which region has the highest average order value?"
Output Handling
After analysis:
- Present query results directly in conversation as formatted tables
- For large results, export to file and share via
present_filestool - Always explain findings in plain language with key takeaways
- Suggest follow-up analyses when patterns are interesting
- Offer to export results if the user wants to keep them
Caching
The script automatically caches loaded data to avoid re-parsing files on every call:
- On first load, files are parsed into a private DuckDB generation under the system temporary directory (.data-analysis-cache/generations-v1/). Its writer closes before a complete generation and table map become visible together through an atomic manifest replacement
- The cache key hashes the ordered input basenames and a separate SHA256 digest of each file. Renaming, reordering, or changing inputs creates a new cache; moving unchanged, identically named inputs to another directory preserves reuse. Older flat caches are ignored and rebuilt from source without deleting the old files
- Subsequent calls open a complete generation read-only. Overlapping readers can reuse it while another analysis is still running; invalid manifests or damaged databases rebuild from source
- Cache is transparent — no extra parameters needed
Concurrent cold calls may build separate complete generations. Failed private builds are removed, while complete generations are retained so active readers remain valid. Stop analyses before manually clearing .data-analysis-cache/; automatic cache garbage collection is not implemented. These are rebuildable local caches, not snapshots of changing input files or a power-loss guarantee. Analysis connections are read-only; export query results with --output-file.
This is especially useful when running multiple queries against the same data files (inspect → query → summary).
Notes
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/public/data-analysis/SKILL.md
Popularity
- Repository stars
- 84,640
- Repository forks
- 11,868
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bytedance/deer-flow/data-analysis)