financial-report-analyzer
eosphoros-ai/DB-GPT · Agent Skill
分析公司財務報告,提取關鍵指標,計算比率,生成圖表,並生成專業的分析報告。
前往安裝 ↓總覽
| 發布者 | |
|---|---|
| 儲存庫 | eosphoros-ai/DB-GPT ↗ |
| 技能資料夾 | financial-report-analyzer |
| 星 | 19,880 |
| 附帶檔案 | 1 |
| 授權 | MIT |
| 最近更新 | 2026年3月15日 |
| 連結 | 技能原始碼 ↗ · 儲存庫 ↗ |
Mozgi 檢查
我們在技能檔案中發現的內容。詳細資訊需訂閱。
安裝
技能就是一個含 SKILL.md 的資料夾。選擇你的代理,在專案根目錄的終端機(macOS、Linux 或 Windows 的 Git Bash)執行指令。
把提示貼到 Claude、Codex 或其他助理:它會自行檢查並安裝技能。
Install the “financial-report-analyzer” skill from mozgi.io (https://mozgi.io/skills/financial-report-analyzer/) for me. 1. Download the archive: https://mozgi.io/skills/financial-report-analyzer/download If it fails, take the skill folder from the source: https://github.com/eosphoros-ai/DB-GPT/tree/main/skills/financial-report-analyzer 2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me. 3. Put the “financial-report-analyzer” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.). 4. Make sure <skills folder>/financial-report-analyzer/SKILL.md exists. 5. Briefly tell me what this skill does and offer to try it on my task. If you cannot do a step yourself, tell me what to click or type.
git clone --depth 1 --branch main https://github.com/eosphoros-ai/DB-GPT.git /tmp/DB-GPT mkdir -p .claude/skills cp -r /tmp/DB-GPT/skills/financial-report-analyzer .claude/skills/financial-report-analyzer
重新啟動 Claude Code — 技能就會出現在清單中,手動呼叫:/financial-report-analyzer。要套用到所有專案,請放在 ~/.claude/skills。
git clone --depth 1 --branch main https://github.com/eosphoros-ai/DB-GPT.git /tmp/DB-GPT mkdir -p .agents/skills cp -r /tmp/DB-GPT/skills/financial-report-analyzer .agents/skills/financial-report-analyzer
Codex 會從目前資料夾往上到儲存庫根目錄,在 .agents/skills 中尋找技能;用 /skills 或 $financial-report-analyzer 呼叫。所有專案:~/.agents/skills。
git clone --depth 1 --branch main https://github.com/eosphoros-ai/DB-GPT.git /tmp/DB-GPT mkdir -p .cursor/skills cp -r /tmp/DB-GPT/skills/financial-report-analyzer .cursor/skills/financial-report-analyzer
Cursor 啟動時會載入技能;在 Agent 聊天輸入「/」呼叫。Cursor 也會讀取 .claude/skills 與 .agents/skills。所有專案:~/.cursor/skills。
git clone --depth 1 --branch main https://github.com/eosphoros-ai/DB-GPT.git /tmp/DB-GPT mkdir -p .gemini/skills cp -r /tmp/DB-GPT/skills/financial-report-analyzer .gemini/skills/financial-report-analyzer
任務符合時,Gemini CLI 會提議啟用技能,由你確認。所有專案:~/.gemini/skills。
安裝前請先檢視 SKILL.md 與相關檔案。點擊檔案即可預覽。
SKILL.md 內容
作者原文 · 唯讀财报分析技能 (Financial Report Analyzer)
本技能旨在帮助 DB-GPT 系统化地分析上市公司财报,通过提取核心数据、计算财务比率、生成可视化图表并结合业务背景,产出高质量的财务分析报告。
核心工作流程
1. 数据提取与结构化:
- 使用
execute_skill_script_file工具执行scripts/extract_financials.py脚本,传入财报文件路径(file_path参数),自动提取营收、净利润、资产、负债等核心数值。 - 脚本支持 PDF 文件(通过 pdfplumber 解析)和纯文本文件,返回 JSON 格式的结构化数据。
2. 财务比率计算:
- 使用
execute_skill_script_file执行scripts/calculate_ratios.py,传入 Step 1 的 JSON 数据。 - 自动计算毛利率、净利率、ROE、资产负债率等关键指标,输出 30 个模板占位符键值。
- 参考
references/financial_metrics.md确保指标定义的准确性。 - 系统会自动保存返回的 JSON 结果(
react_state["ratio_data"]),后续 html_interpreter 会自动合并。
3. 图表生成:
- 使用
execute_skill_script_file执行scripts/generate_charts.py,传入 Step 1 的 JSON 数据。 - 自动生成 3 张可视化图表:
financial_overview.png:核心财务指标对比柱状图profitability.png:盈利能力指标横向条形图asset_structure.png:资产结构环形饼图- 系统会自动将图片复制到静态目录并记录 URL 映射(
react_state["image_url_map"]),后续 html_interpreter 会自动合并。
4. 深度分析:
- 遵循
references/analysis_framework.md提供的框架,从盈利质量、偿债风险、营运效率和现金流四个维度进行深度剖析。 - 结合"经营情况讨论与分析"章节,解释业绩变动的核心驱动因素。
- 撰写以下 7 段分析文本:
PROFITABILITY_ANALYSIS:盈利能力分析SOLVENCY_ANALYSIS:偿债与风险分析EFFICIENCY_ANALYSIS:营运效率分析CASHFLOW_ANALYSIS:现金流与利润质量分析ADVANTAGES_LIST:核心优势列表(HTML<li>格式)RISKS_LIST:主要风险列表(HTML<li>格式)OVERALL_ASSESSMENT:综合评价
5. 渲染报告:
- 调用
html_interpreter,使用template_path模式:
```json
{
"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 段分析文本!后端会自动合并: - Step 2 的 30 个数据指标(COMPANY_NAME、REVENUE、NET_PROFIT 等)
- Step 3 的图表 URL(CHART_FINANCIAL_OVERVIEW、CHART_PROFITABILITY、CHART_ASSET_STRUCTURE)
- 绝对不要在
data中包含数据指标或图表路径,否则 JSON 过大会导致截断。
6. 完成:
- 调用
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,请确保环境中已安装该库。
常見問題
financial-report-analyzer 技能有什麼用途?
分析公司財務報告,提取關鍵指標,計算比率,生成圖表,並生成專業的分析報告。
如何安裝 financial-report-analyzer?
打開本頁的「安裝」區塊並選擇你的代理 — Claude Code、Codex、Cursor 或 Gemini CLI:那裡有把技能資料夾複製到正確位置的現成指令。也可以複製「透過助理」分頁中的提示,讓助理自行檢查並安裝技能。
financial-report-analyzer 適用哪些 AI 模型?
技能是純 Markdown 指示(Agent Skills 格式),因此 financial-report-analyzer 適用任何讀取 SKILL.md 的代理:Claude Code、Codex、Cursor、Gemini CLI、GitHub Copilot、OpenCode 等。只有在任務符合技能描述時,模型才會載入指示。
financial-report-analyzer 是免費的嗎?
此技能由 eosphoros-ai 公開發布,採用 MIT 授權。技能本身免費 — 你只需向 AI 供應商支付實際使用的 token 費用。
安裝技能安全嗎?
技能是代理會遵循的指示,安裝前請閱讀 SKILL.md 及相關檔案。技能資料夾中的腳本只有在代理執行時才會運行 — 留意它的動作,不要授予多餘權限。
技能和 MCP 伺服器或外掛有何不同?
MCP 伺服器或外掛為模型提供新工具 — 會執行並回傳結果的程式碼。技能提供的是知識與流程:如何處理任務、要遵循哪些步驟、好的成果長什麼樣子。它不需要伺服器或 API 金鑰。