con un clic
financial-report-analyzer
// 专门用于上市公司财报(如年度报告、季度报告)的深度分析。该技能能够自动提取关键财务指标,计算核心财务比率,生成可视化图表,并结合行业背景生成专业的财务分析报告。
// 专门用于上市公司财报(如年度报告、季度报告)的深度分析。该技能能够自动提取关键财务指标,计算核心财务比率,生成可视化图表,并结合行业背景生成专业的财务分析报告。
This skill should be used when users need to analyze CSV or Excel files, understand data patterns, generate statistical summaries, or create data visualizations. Trigger keywords include "analyze CSV", "analyze Excel", "data analysis", "CSV analysis", "Excel analysis", "data statistics", "generate charts", "data visualization", "分析CSV", "分析Excel", "数据分析", "CSV分析", "Excel分析", "数据统计", "生成图表", "数据可视化".
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Analyze Walmart sales data to explore trends between store sales and unemployment rates. Generate insightful visualizations and a beautiful HTML report with deep analysis. Suitable for quick insights into the relationship between sales data and macroeconomic factors.
| name | financial-report-analyzer |
| description | 专门用于上市公司财报(如年度报告、季度报告)的深度分析。该技能能够自动提取关键财务指标,计算核心财务比率,生成可视化图表,并结合行业背景生成专业的财务分析报告。 |
本技能旨在帮助 DB-GPT 系统化地分析上市公司财报,通过提取核心数据、计算财务比率、生成可视化图表并结合业务背景,产出高质量的财务分析报告。
数据提取与结构化:
execute_skill_script_file 工具执行 scripts/extract_financials.py 脚本,传入财报文件路径(file_path 参数),自动提取营收、净利润、资产、负债等核心数值。财务比率计算:
execute_skill_script_file 执行 scripts/calculate_ratios.py,传入 Step 1 的 JSON 数据。references/financial_metrics.md 确保指标定义的准确性。react_state["ratio_data"]),后续 html_interpreter 会自动合并。图表生成:
execute_skill_script_file 执行 scripts/generate_charts.py,传入 Step 1 的 JSON 数据。financial_overview.png:核心财务指标对比柱状图profitability.png:盈利能力指标横向条形图asset_structure.png:资产结构环形饼图react_state["image_url_map"]),后续 html_interpreter 会自动合并。深度分析:
references/analysis_framework.md 提供的框架,从盈利质量、偿债风险、营运效率和现金流四个维度进行深度剖析。PROFITABILITY_ANALYSIS:盈利能力分析SOLVENCY_ANALYSIS:偿债与风险分析EFFICIENCY_ANALYSIS:营运效率分析CASHFLOW_ANALYSIS:现金流与利润质量分析ADVANTAGES_LIST:核心优势列表(HTML <li> 格式)RISKS_LIST:主要风险列表(HTML <li> 格式)OVERALL_ASSESSMENT:综合评价渲染报告:
html_interpreter,使用 template_path 模式:
{
"template_path": "financial-report-analyzer/templates/report_template.html",
"data": {
"PROFITABILITY_ANALYSIS": "LLM撰写的盈利能力分析...",
"SOLVENCY_ANALYSIS": "LLM撰写的偿债分析...",
"EFFICIENCY_ANALYSIS": "LLM撰写的营运效率分析...",
"CASHFLOW_ANALYSIS": "LLM撰写的现金流分析...",
"ADVANTAGES_LIST": "<li>优势1</li><li>优势2</li>",
"RISKS_LIST": "<li>风险1</li><li>风险2</li>",
"OVERALL_ASSESSMENT": "LLM撰写的综合评价..."
},
"title": "XX公司 2023年度财报分析报告"
}
data 字典中只需传入你撰写的 7 段分析文本!后端会自动合并:
data 中包含数据指标或图表路径,否则 JSON 过大会导致截断。完成:
terminate 返回 1-2 句话的简短摘要。Step 1: execute_skill_script_file(skill_name="financial-report-analyzer", script_file_name="extract_financials.py", args={"file_path": "/path/to/report.pdf"})
→ 返回 JSON: {"revenue": 10500000000, "net_profit": 1200000000, ...} (记为 raw_data)
Step 2: execute_skill_script_file(skill_name="financial-report-analyzer", script_file_name="calculate_ratios.py", args=<raw_data>)
→ 返回 30 个模板键值,系统自动记录到 react_state["ratio_data"]
Step 3: execute_skill_script_file(skill_name="financial-report-analyzer", script_file_name="generate_charts.py", args=<raw_data>)
→ 生成图表,系统自动复制到 /images/ 并记录 URL 映射
Step 4: (LLM 自行撰写 7 段深度分析文本)
Step 5: html_interpreter(template_path="financial-report-analyzer/templates/report_template.html", data={仅包含 7 段分析文本}, title="报告标题")
→ 后端自动合并数据指标 + 图表 URL + 分析文本,渲染完整报告
Step 6: terminate(result="简短摘要")
execute_skill_script_file 执行):
scripts/extract_financials.py:接收 file_path 参数,读取财报文件(支持 PDF 和文本格式),提取核心财务数据。scripts/calculate_ratios.py:计算财务比率,输出 30 个模板占位符键值。系统自动记录结果。scripts/generate_charts.py:生成 3 张可视化图表(matplotlib),系统自动处理图片复制。scripts/fill_template.py:(备用)接收 ratio_data、chart_paths、analysis 三个参数,读取 HTML 模板并替换所有占位符。正常情况下不需要使用此脚本,因为 html_interpreter 的 template_path 模式会自动完成模板填充。references/financial_metrics.md:包含公式定义。references/analysis_framework.md:包含分析逻辑。templates/report_template.html:最终交付报告的 HTML 模板(必须严格遵循,不得删减章节或修改表格结构)。由 html_interpreter 的 template_path 参数自动读取并填充。templates/report_template.md:Markdown 版本,仅供参考结构说明。execute_skill_script_file 执行脚本(不要用 shell_interpreter),因为 execute_skill_script_file 会自动处理图片复制和数据记录。generate_charts.py 依赖 matplotlib,请确保环境中已安装该库。