User wants to analyze data (statistics, trends, comparisons, pivots, aggregation) and receive results as an Excel file — possibly with charts, summary tables, or dashboards.
This scene bridges pandas analysis with openpyxl output. The deliverable is always an .xlsx file.
1. LOAD → Read input data (CSV/XLSX/JSON/DB)
2. EXPLORE → Understand structure, quality, distributions
3. ANALYZE → Compute metrics, aggregations, statistical tests
4. DESIGN → Plan Excel output (sheets, charts, KPIs)
5. BUILD → Write analysis results to .xlsx with formatting
6. CHART → Add charts (Excel-native or embedded matplotlib)
7. QA → recalc → audit → scan → chart-verify
8. PIVOT → If needed, run xlsx.py pivot as final step
9. VALIDATE → validate → deliver
Industry-specific frameworks:
Sheet 1: "Dashboard" — KPI cards + summary chart
Sheet 2: "Detail" — Full analysis table with formatting
Sheet 3: "Charts" — Additional visualizations
Sheet 4: "Raw Data" — Original data for reference (tab color: gray)
Place 4-6 KPI metrics at the top of Dashboard sheet (row 3-4), each spaced 3 columns apart. Include label (small, gray) and value (large, bold, themed) with appropriate number format.
| Situation | Use |
|---|---|
| Need interactive PivotTable in Excel | "$(command -v zcode-python \|\| command -v python3)" "$XLSX_SKILL_DIR/xlsx.py" pivot |
| Just need a summary table (static) | pandas pivot_table → openpyxl |
| Simple aggregation (1 dimension) | pandas groupby → openpyxl |
Trigger phrases: summarize, aggregate, group by, categorize, breakdown, distribution, tally, totals per, cross-tab, 汇总, 透视, 分类统计, 交叉分析
When analysis uses external data, create a "Sources" sheet (tab color: PRIMARY) with columns: Data Description | Source Name | Source URL | Access Date.
Skip when user provides all data directly.
When the analysis involves aggregation, time series, comparison, cleaning, or bridge patterns, you MUST read scenes/analyze-recipes.md before writing code. It contains tested code patterns — do not reinvent them from memory.