excel-report-generator▌
wwwzhouhui/skills_collection · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
自动化 Excel 报表生成工具,支持从多种数据源生成专业的 Excel 报告。
Excel Report Generator
自动化 Excel 报表生成工具,支持从多种数据源生成专业的 Excel 报告。
功能概述
这个 Skill 可以帮助你:
- 📊 从 CSV、数据库或 Python 数据结构生成 Excel 报表
- 📈 创建包含图表、格式化和公式的数据分析报告
- 📋 基于模板填充数据生成业务报告
- 💾 将系统数据批量导出为格式化的 Excel 文件
- 🎨 应用专业的样式、颜色和条件格式
核心技术栈
- pandas: 数据处理和分析
- openpyxl: Excel 文件读写和格式化
- xlsxwriter: 高级图表和格式支持(可选)
使用场景
1. 数据分析报表
从原始数据生成包含统计分析、透视表和可视化图表的综合报告。
示例请求:
- "帮我从这个 CSV 生成销售分析报表"
- "创建一个包含月度趋势图的数据分析 Excel"
- "生成带有统计汇总的财务报表"
2. 业务报告
定期生成标准化的业务报告,如销售报告、KPI 仪表板等。
示例请求:
- "生成本月的销售业绩报告"
- "创建 KPI 跟踪报表"
- "导出季度业务总结 Excel"
3. 数据导出
将数据库查询结果或系统数据导出为格式化的 Excel 文件。
示例请求:
- "把用户数据导出到 Excel"
- "将数据库查询结果保存为 Excel 文件"
- "导出多个工作表的数据集"
4. 模板填充
基于预定义的 Excel 模板填充动态数据。
示例请求:
- "使用这个模板生成报告"
- "填充 Excel 模板中的数据"
- "批量生成基于模板的发票"
使用方法
基本工作流程
- 准备数据源: CSV 文件、pandas DataFrame、数据库连接或 Python 字典
- 定义报表需求: 描述所需的格式、图表、样式
- 生成报表: 自动创建格式化的 Excel 文件
- 验证输出: 检查生成的文件是否符合要求
命令示例
从 CSV 生成报表:
请从 sales_data.csv 生成一个销售分析报表,包含:
- 按产品分类的销售汇总
- 月度销售趋势图
- Top 10 产品排名
从 DataFrame 生成报表:
我有一个 pandas DataFrame,帮我生成 Excel 报表,包括:
- 数据透视表
- 条件格式高亮异常值
- 自动筛选和冻结首行
使用模板:
基于 templates/monthly_report.xlsx 模板,填充当月数据并生成报告
实现指南
当用户请求生成 Excel 报表时,遵循以下步骤:
Step 1: 数据准备
import pandas as pd
from openpyxl import load_workbook
from openpyxl.styles import Font, PatternFill, Alignment
from openpyxl.utils.dataframe import dataframe_to_rows
# 读取数据
df = pd.read_csv('data.csv')
# 或从数据库
# df = pd.read_sql(query, connection)
Step 2: 数据处理
# 数据清洗和转换
df_clean = df.dropna()
# 统计分析
summary = df.groupby('category').agg({
'sales': ['sum', 'mean', 'count'],
'profit': 'sum'
})
Step 3: 创建 Excel 文件
# 使用 pandas ExcelWriter
with pd.ExcelWriter('output.xlsx', engine='openpyxl') as writer:
# 写入原始数据
df_clean.to_excel(writer, sheet_name='Raw Data', index=False)
# 写入汇总数据
summary.to_excel(writer, sheet_name='Summary')
# 获取 workbook 进行格式化
workbook = writer.book
worksheet = writer.sheets['Summary']
Step 4: 格式化和样式
# 标题样式
header_font = Font(bold=True, color='FFFFFF')
header_fill = PatternFill(start_color='4472C4', end_color='4472C4', fill_type='solid')
# 应用样式到标题行
for cell in worksheet[1]:
cell.font = header_font
cell.fill = header_fill
cell.alignment = Alignment(horizontal='center')
# 列宽自动调整
for column in worksheet.columns:
max_length = 0
column_letter = column[0].column_letter
for cell in column:
if len(str(cell.value)) > max_length:
max_length = len(str(cell.value))
worksheet.column_dimensions[column_letter].width = max_length + 2
Step 5: 添加图表(可选)
from openpyxl.chart import BarChart, Reference
# 创建图表
chart = BarChart()
chart.title = "Sales by Category"
chart.x_axis.title = "Category"
chart.y_axis.title = "Sales"
# 数据引用
data = Reference(worksheet, min_col=2, min_row=1, max_row=10)
categories = Reference(worksheet, min_col=1, min_row=2, max_row=10)
chart.add_data(data, titles_from_data=True)
chart.set_categories(categories)
# 添加到工作表
worksheet.add_chart(chart, "E5")
高级功能
条件格式
from openpyxl.formatting.rule import ColorScaleRule, CellIsRule
# 色阶格式
worksheet.conditional_formatting.add(
'B2:B100',
ColorScaleRule(start_type='min', start_color='FF6347',
mid_type='percentile', mid_value=50, mid_color='FFFF00',
end_type='max', end_color='90EE90')
)
# 基于规则的格式
red_fill = PatternFill(start_color='FFC7CE', end_color='FFC7CE', fill_type='solid')
worksheet.conditional_formatting.add(
'C2:C100',
CellIsRule(operator='lessThan', formula=['0'], fill=red_fill)
)
数据验证
from openpyxl.worksheet.datavalidation import DataValidation
# 下拉列表
dv = DataValidation(type="list", formula1='"优秀,良好,一般,较差"', allow_blank=True)
worksheet.add_data_validation(dv)
dv.add('D2:D100')
公式应用
# 添加求和公式
worksheet['B11'] = '=SUM(B2:B10)'
# 添加平均值公式
worksheet['C11'] = '=AVERAGE(C2:C10)'
最佳实践
1. 性能优化
- 对于大数据集(>10万行),使用
openpyxl的write_only模式 - 分批处理数据,避免内存溢出
- 使用
xlsxwriter引擎处理复杂图表和格式
2. 错误处理
try:
df = pd.read_csv('data.csv')
except FileNotFoundError:
print("数据文件不存在")
except pd.errors.EmptyDataError:
print("数据文件为空")
3. 文件命名规范
from datetime import datetime
# 使用时间戳避免文件覆盖
timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
filename = f'sales_report_{timestamp}.xlsx'
4. 数据验证
# 检查必需列
required_columns = ['date', 'product', 'sales']
if not all(col in df.columns for col in required_columns):
raise ValueError(How to use excel-report-generator on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add excel-report-generator
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches excel-report-generator from GitHub repository wwwzhouhui/skills_collection and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate excel-report-generator. Access the skill through slash commands (e.g., /excel-report-generator) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Competitive Analysis
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ Use When
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid When
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.5★★★★★35 reviews- ★★★★★Amelia Ghosh· Dec 28, 2024
Solid pick for teams standardizing on skills: excel-report-generator is focused, and the summary matches what you get after install.
- ★★★★★Dhruvi Jain· Dec 16, 2024
We added excel-report-generator from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Min Wang· Dec 16, 2024
excel-report-generator is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Min Chawla· Dec 8, 2024
Useful defaults in excel-report-generator — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Soo Rao· Nov 27, 2024
I recommend excel-report-generator for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Hana Chen· Nov 19, 2024
Registry listing for excel-report-generator matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Oshnikdeep· Nov 7, 2024
excel-report-generator fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Nikhil Huang· Nov 7, 2024
excel-report-generator reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Min Park· Nov 3, 2024
Keeps context tight: excel-report-generator is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Ganesh Mohane· Oct 26, 2024
Registry listing for excel-report-generator matched our evaluation — installs cleanly and behaves as described in the markdown.
showing 1-10 of 35