analyzing-data-html-report
数据分析报告开发技能 / Data Analysis Report Development Skill
Provides data analysis report development capabilities, including creating analysis report projects, generating static HTML analysis reports, integrating visualization charts, and complete development workflows.
如何使用本文档 / How to Use This Document
This document provides quick guidance and core tool descriptions. For details, refer to the following reference documents:
- Complete code examples → references/report-workflow.md
- ECharts 5.6.0 specification → references/report-echarts-v5.md
代码执行方式 / Code Execution Method
Python analysis scripts are executed via Shell tool (e.g., python analyze.py).
快速开始 / Quick Start
Important: Before executing the following steps, it's recommended to read the corresponding reference documents to understand detailed specifications:
- Before starting report development → Read
reference/report-workflow.mdfor complete workflow and code examples - When configuring charts → Read
reference/report-echarts-v5.mdfor ECharts 5.6.0 usage specification
Develop report project: Create report working directory and execute analysis:
# Step 1: 创建报告目录(目录名体现分析内容)/ Create report directory (name reflects analysis content)
import os
os.makedirs('销售数据分析', exist_ok=True) # or 'Sales Data Analysis' for English
# Step 2: 编写分析脚本 / Write analysis script
# 脚本读取数据源,执行分析,输出 data.json
Develop HTML report:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.6.0/echarts.min.js"></script>
</head>
<body>
<div id="chart" style="width:800px;height:400px;"></div>
<script data-type="report">
var reportData = {"total": 12345, "chart": [...]};
</script>
<script>
var chart = echarts.init(document.getElementById('chart'));
chart.setOption({...});
</script>
</body>
</html>
主要流程 / Main Workflow
- Create report working directory: Must create dedicated directory at task start. Directory name must reflect analysis content (e.g., "Sales Data Analysis"). Place all report files (analyze.py, data.json, index.html, README.md) in this directory
- Execute data analysis: Use Python script to get accurate analysis results and output data.json file
- Develop HTML report: Create index.html file with ECharts visualization, data embedded via inline script tag
- Documentation: Write README.md documentation
- Complete delivery: Provide report summary
文件命名规范 / File Naming Rules
Directory Naming: Must reflect analysis content and business domain, intelligently determined by user preferred language, e.g.:
- User preferred language is Chinese: "销售数据分析", "2024年财务报告", "用户行为分析"
- User preferred language is English: "Sales Data Analysis", "2024 Financial Report", "User Behavior Analysis"
File Naming: Use standard names within directory, e.g.:
- HTML report:
index.html(main report file) - Data file:
data.json(analysis result data) - Analysis script:
analyze.py(data analysis script) - Documentation:
README.md(project documentation)
Complete Examples:
- Chinese project:
销售数据分析/index.html,销售数据分析/data.json - English project:
Sales Data Analysis/index.html,Sales Data Analysis/data.json
关键规则 / Key Rules
Staticization Principle
- Single HTML file, all data inline, zero async loading
- Data embedded via
<script data-type="report">tag:var reportData = {...};
Technical Constraints
- Use ECharts 5.6.0 specification only
- Python scripts for data analysis to get accurate results only, not for generating images
- Charts must use ECharts, strictly prohibited to generate images via Python
决策树 / Decision Tree
Need analysis report? ├─ Yes → Report type? │ ├─ Static HTML single-page report → This skill │ └─ Interactive Dashboard → analyzing-data-dashboard skill └─ No → Only instant numeric answer → data-qa skill
Chart type? ├─ Line/Bar/Pie etc → ECharts 5.6.0 ├─ Table only → HTML table └─ Mixed → ECharts + table
技术栈 / Tech Stack
CDN Resources:
- TailwindCSS: https://cdn.tailwindcss.com/3.4.17
- ECharts: https://cdnjs.cloudflare.com/ajax/libs/echarts/5.6.0/echarts.min.js
- FontAwesome: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css
- Tabler Icons: https://cdnjs.cloudflare.com/ajax/libs/tabler-icons/3.34.1/tabler-icons.min.css
- Google Fonts: https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap
参考文档 / Reference
For detailed usage, refer to the reference directory:
report-workflow.md- Complete workflow and code examplesreport-echarts-v5.md- ECharts 5.6.0 usage specification
More from dtyq/magic
find-skill
Search and install skills from the platform skill library, skill market, or skillhub. Use when the agent needs to find or install a skill to expand its capabilities. Always search the platform first; fall back to skillhub only if nothing is found.
18ui-data-testid
Add stable `data-testid` attributes by default for new or refactored UI components. Use when implementing React/TSX views, shadcn/antd-style components, dropdown/menu configs, or interactive UI flows that need reliable selectors for unit/E2E tests.
17skill-vetter
Security-first skill vetting protocol for AI agents. Use before installing any skill from the platform skill market, skillhub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns to determine whether a skill is safe to install.
16wiki-generator
通过分析代码结构与依赖,自动提取系统总体架构、核心特有功能模块的实现细节,并生成互相关联的多页面 Wiki 结构文档集。作为项目的架构知识库守护者,还负责在日常开发中解答疑问,并在架构变更时自动维护文档。
15env-manager
Manage persistent environment variables. Use when the user provides API keys or other configuration values that need to be saved and reused across sessions.
14using-cron
Manage scheduled tasks — create, query, update, and delete. CRITICAL - When user message contains any future time intent (e.g. "in 2 days", "tomorrow at 8am", "every morning"), you MUST load this skill first. NEVER write custom scheduler scripts.
14