[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77VKP9M1ZD38NP4FKZEJ82Q":3,"skill-same:01M77VKP9M1ZD38NP4FKZEJ82Q":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M77VKP9M1ZD38NP4FKZEJ82Q","stock-research-system",null,"专业级股权研究自动化系统。支持首发覆盖报告（6,000-10,000字）和季报更新报告（3,000-5,000字）。触发词：股票研究、深度研究、首发覆盖、季报更新、DCF估值。","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fs\u002Fstock-research-system\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: stock-research-system\ndescription: 专业级股权研究自动化系统。支持首发覆盖报告（6,000-10,000字）和季报更新报告（3,000-5,000字）。触发词：股票研究、深度研究、首发覆盖、季报更新、DCF估值。\ntags: [投研, 财报分析, DCF估值, ROIC]\n---\n\n# 股票深度研究系统\n\n> 专业级股权研究自动化系统，集成DataHub统一数据获取层\n\n---\n\n## 核心改进（2026-05-19）\n\n**✅ 集成DataHub统一数据获取层**\n- 替代多数据源直接调用，统一入口管理\n- 智能缓存（quote: 5分钟, financial: 1小时）\n- 自动降级机制（NeoData → WeStock → AkShare）\n- 发布-订阅架构支持实时数据推送\n\n**✅ 简化数据获取流程**\n- 便捷函数：`quick_quote()`, `quick_financial()`, `quick_macro()`\n- 生产管理器：`get_production()`\n- 自然语言查询：`quick_query()`\n\n**✅ 增强代码示例**\n- 完整可执行的Python代码\n- 明确的路径和依赖\n- 统一的异常处理\n\n---\n\n## 执行流程\n\n### Step 1: 任务解析\n\n提取参数：\n- `stock_code`（必需）- 股票代码\n- `company_name`（必需）- 公司名称\n- `report_type`（默认 initiating_coverage）- 报告类型\n- `market`（自动推断）- 市场（A股\u002F港股\u002F美股）\n- `report_period`（季报必需）- 报告期\n\n❌ 缺少必需参数 → 提示用户补充\n\n### Step 2: 数据获取（data_fetch）- DataHub统一接口\n\n**数据源优先级（基于DataHub）**：\n\n```\nDataHub自动路由（优先级由Producer定义）：\n1. LocalWikiProducer（优先级1）- 本地Wiki知识库\n2. NeoDataProducer（优先级12）- 自然语言查询\n3. WeStockProducer（优先级13）- 腾讯自选股\n4. AkShareProducer（优先级15）- AkShare开源数据\n5. YFinanceProducer（优先级16）- Yahoo Finance\n```\n\n**DataHub便捷函数使用**：\n\n```python\nimport asyncio\nimport sys\n# 用户需自行配置DataHub路径\n# sys.path.insert(0, \"\u003CYOUR_DATAHUB_PATH>\")\n\nfrom datahub.production_startup import (\n    quick_quote,\n    quick_financial,\n    quick_macro,\n    quick_query,\n    get_production\n)\n\nasync def fetch_research_data(stock_code: str, market: str = 'cn') -> dict:\n    \"\"\"获取研究所需全部数据\"\"\"\n    prod = await get_production()\n\n    # 并发获取多维度数据\n    tasks = [\n        quick_quote(stock_code, market=market),\n        quick_financial(stock_code, report_type='balance'),\n        quick_financial(stock_code, report_type='income'),\n        quick_financial(stock_code, report_type='cashflow'),\n    ]\n\n    results = await asyncio.gather(*tasks, return_exceptions=True)\n\n    return {\n        'quote': results[0] if not isinstance(results[0], Exception) else None,\n        'balance': results[1] if not isinstance(results[1], Exception) else None,\n        'income': results[2] if not isinstance(results[2], Exception) else None,\n        'cashflow': results[3] if not isinstance(results[3], Exception) else None,\n    }\n\n# 执行\nasyncio.run(fetch_research_data(\"600519\", market='cn'))\n```\n\n**自然语言查询示例**：\n\n```python\nfrom datahub.production_startup import quick_query\n\nasync def query_financial_data(query: str) -> dict:\n    \"\"\"自然语言查询金融数据\"\"\"\n    result = await quick_query(query)\n\n    if result['status'] == 'success':\n        return result['data']\n    else:\n        print(f\"查询失败: {result.get('error')}\")\n        return None\n\n# 示例查询\nasyncio.run(query_financial_data(\"贵州茅台最新财报营收和净利润\"))\nasyncio.run(query_financial_data(\"新能源板块资金流向\"))\nasyncio.run(query_financial_data(\"比亚迪机构评级和目标价\"))\n```\n\n**主题订阅（高级用法）**：\n\n```python\nimport asyncio\nfrom datahub import get_datahub, register_all_producers\n\nasync def subscribe_realtime_data(stock_code: str, callback):\n    \"\"\"订阅实时数据推送\"\"\"\n    datahub = get_datahub()\n    register_all_producers(datahub)\n\n    topic = f\"westock:cn:quote:{stock_code}\"\n    datahub.subscribe(topic, callback)\n    await datahub.request_refresh(topic)\n\n# 示例回调\nasync def on_quote_update(data):\n    print(f\"行情更新: {data}\")\n\nasyncio.run(subscribe_realtime_data(\"600519\", on_quote_update))\n```\n\n**货币单位注意**：\n- 港股财报返回**港元\u002F美元**，美股返回**美元**\n- 展示时必须标注正确货币单位，禁止使用人民币符号\n\n**检查点**：`⚠️ 数据质量确认 - 是否继续？[Y\u002Fn]`\n\n### Step 3: 财务分析（financial_analysis）\n\n**使用DataHub财务数据**：\n\n```python\nfrom datahub.production_startup import quick_financial\n\nasync def analyze_financials(stock_code: str) -> dict:\n    \"\"\"财务分析\"\"\"\n    # 获取三大报表\n    balance = await quick_financial(stock_code, report_type='balance')\n    income = await quick_financial(stock_code, report_type='income')\n    cashflow = await quick_financial(stock_code, report_type='cashflow')\n\n    # 提取关键指标\n    if all(r['status'] == 'success' for r in [balance, income, cashflow]):\n        bal_data = balance['data']\n        inc_data = income['data']\n        cf_data = cashflow['data']\n\n        # 计算核心指标\n        metrics = {\n            '毛利率': (inc_data['营收'] - inc_data['营业成本']) \u002F inc_data['营收'],\n            '净利率': inc_data['净利润'] \u002F inc_data['营收'],\n            'ROE': inc_data['净利润'] \u002F bal_data['股东权益合计'],\n            'ROIC': calculate_roic(inc_data, bal_data),\n        }\n\n        return metrics\n\n    return None\n\ndef calculate_roic(income: dict, balance: dict) -> float:\n    \"\"\"计算ROIC\"\"\"\n    nopat = income['净利润'] + income['利息支出'] * (1 - 0.25)  # 假设税率25%\n    invested_capital = balance['股东权益合计'] + balance['有息负债'] - balance['现金及等价物']\n    return nopat \u002F invested_capital if invested_capital > 0 else None\n```\n\n**异常处理**：\n\n| 异常 | 处理 |\n|-----|-----|\n| 指标无法计算 | 标注\"N\u002FA\"，不估算 |\n| 负权益公司 | 用经营资产法计算 ROIC |\n| 数据不足（\u003C3年） | 标注\"分析可靠性降低\" |\n| DataHub返回错误 | 检查Producer注册，切换备用源 |\n\n### Step 4: 估值分析（valuation）\n\n**DCF估值（Python计算）**：\n\n```python\ndef dcf_valuation(\n    free_cash_flow: float,\n    growth_rate: float = 0.05,\n    discount_rate: float = 0.10,\n    terminal_growth: float = 0.03,\n    years: int = 10\n) -> dict:\n    \"\"\"DCF估值计算\"\"\"\n    # 预测未来现金流\n    fcf_projections = []\n    fcf = free_cash_flow\n    for year in range(years):\n        fcf *= (1 + growth_rate)\n        fcf_projections.append(fcf)\n\n    # 折现\n    discounted_fcf = []\n    for i, fcf in enumerate(fcf_projections, 1):\n        discounted = fcf \u002F ((1 + discount_rate) ** i)\n        discounted_fcf.append(discounted)\n\n    # 终值\n    terminal_value = fcf_projections[-1] * (1 + terminal_growth) \u002F (discount_rate - terminal_growth)\n    discounted_terminal = terminal_value \u002F ((1 + discount_rate) ** years)\n\n    # 企业价值\n    enterprise_value = sum(discounted_fcf) + discounted_terminal\n\n    return {\n        'enterprise_value': enterprise_value,\n        'pv_fcf': sum(discounted_fcf),\n        'pv_terminal': discounted_terminal,\n        'assumptions': {\n            'growth_rate': growth_rate,\n            'discount_rate': discount_rate,\n            'terminal_growth': terminal_growth,\n        }\n    }\n```\n\n**异常处理**：\n\n| 异常 | 处理 |\n|-----|-----|\n| 无可比公司 | 仅用 DCF |\n| 负自由现金流 | 改用 P\u002FB 或 EV\u002FSales |\n| DataHub无估值数据 | 从财报手动计算 |\n\n**检查点**：`⚠️ 估值假设确认 - 是否接受？[Y\u002Fedit]`\n\n### Step 5: 行业分析（仅首发覆盖）\n\n**使用DataHub + 搜索引擎**：\n\n```python\nfrom datahub.production_startup import quick_query\n# 搜索引擎（通过Skill调用）\n# multi-search-engine: 16引擎聚合\n# news-search: 财经资讯专用\n# wechat-article-search: 公众号文章\n\nasync def industry_analysis(industry: str) -> dict:\n    \"\"\"行业分析\"\"\"\n    # DataHub获取行业数据\n    industry_data = await quick_query(f\"{industry}行业规模和增长率\")\n    competitors = await quick_query(f\"{industry}主要上市公司市场份额\")\n\n    return {\n        'industry_data': industry_data,\n        'competitors': competitors,\n    }\n```\n\n**搜索引擎优先级（通过Skill调用）**：\n\n1. **multi-search-engine**（最高优先级）\n   - 16个引擎聚合（7中文 + 9国际）\n   - 无需API密钥\n   - 智能语言识别\n\n2. **news-search**（财经专用）\n   - 财经领域资讯\n   - 覆盖官媒、主流财经媒体\n\n3. **wechat-article-search**（公众号）\n   - 科技\u002FAI、财经、职场\n   - 深度分析文章\n\nPython：行业规模、市场份额、周期判断\nAI：波特五力、政策影响、技术趋势\n\n### Step 6: 竞争分析（仅首发覆盖）\n\nPython：竞争对手筛选、指标对比\nAI：护城河评估（5类评级）\n\n### Step 7: 报告生成（report_generation）\n\nPython：数据压缩（~50K → ~3K tokens）、章节编排\nAI：各章节内容生成（使用对应模板）\n\n**检查点**：`⚠️ 报告生成完成 - 是否输出？[Y\u002Fpreview\u002Fedit]`\n\n### Step 8: 对抗性检验（可选）\n\n使用 `adversarial_challenge` 模板质疑结论、识别逻辑漏洞\n\n---\n\n## 触发词\n\n股票研究、深度研究、首发覆盖、季报更新、DCF估值、可比公司分析、财务分析、ROIC分析\n\n---\n\n## 报告类型\n\n| 类型 | 字数 | 章节 | 模块 |\n|-----|-----|-----|-----|\n| 首发覆盖 | 6,000-10,000 | 投资+公司+行业+财务+估值+风险+建议 | 全部模块 |\n| 季报更新 | 3,000-5,000 | 业绩+经营+财务+预测+估值+建议 | data+financial+valuation+report |\n\n---\n\n## Python\u002FAI 分工\n\n| Python | AI |\n|-------|-----|\n| 数据获取（DataHub）、指标计算、估值建模 | 财报解读、因果推理、定性判断 |\n| 数据压缩、统计分析、图表 | 投资要点、风险提示、护城河评估 |\n\n---\n\n## AI 提示词模板（10个）\n\n| 模板 | 用途 |\n|-----|-----|\n| `investment_highlights` | 投资要点提炼 |\n| `earnings_deep_dive` | 财报深度解读（5步框架）|\n| `financial_quality` | 财务质量诊断（4维度）|\n| `industry_analysis` | 行业深度分析（波特五力）|\n| `competitive_analysis` | 竞争格局（护城河评估）|\n| `valuation_analysis` | 估值分析（多方法对比）|\n| `risk_analysis` | 风险分析（4类矩阵）|\n| `investment_recommendation` | 投资建议（评级+目标价）|\n| `adversarial_challenge` | 对抗性质疑（空头视角）|\n| `tracking_checklist` | 跟踪验证清单 |\n\n---\n\n## 完整使用示例\n\n### 示例1：首发覆盖报告\n\n```python\nimport asyncio\nimport sys\n# 用户需自行配置DataHub路径\n# sys.path.insert(0, \"\u003CYOUR_DATAHUB_PATH>\")\n\nfrom datahub.production_startup import get_production\n\nasync def initiating_coverage(stock_code: str, company_name: str, market: str = 'cn'):\n    \"\"\"首发覆盖报告完整流程\"\"\"\n    prod = await get_production()\n\n    print(f\"=== {company_name} ({stock_code}) 首发覆盖研究 ===\")\n\n    # 1. 数据获取\n    print(\"\\n[1\u002F7] 数据获取...\")\n    data = await fetch_all_data(prod, stock_code, market)\n\n    # 2. 财务分析\n    print(\"\\n[2\u002F7] 财务分析...\")\n    financials = await analyze_financials(data)\n\n    # 3. 估值分析\n    print(\"\\n[3\u002F7] 估值分析...\")\n    valuation = perform_valuation(data, financials)\n\n    # 4. 行业分析\n    print(\"\\n[4\u002F7] 行业分析...\")\n    industry = await analyze_industry(company_name)\n\n    # 5. 竞争分析\n    print(\"\\n[5\u002F7] 竞争分析...\")\n    competition = analyze_competition(data, industry)\n\n    # 6. 报告生成\n    print(\"\\n[6\u002F7] 生成报告...\")\n    report = generate_report({\n        'company': company_name,\n        'stock_code': stock_code,\n        'data': data,\n        'financials': financials,\n        'valuation': valuation,\n        'industry': industry,\n        'competition': competition,\n    })\n\n    # 7. 对抗性检验\n    print(\"\\n[7\u002F7] 对抗性检验...\")\n    challenges = adversarial_review(report)\n\n    return report\n\nasync def fetch_all_data(prod, stock_code: str, market: str) -> dict:\n    \"\"\"获取全维度数据\"\"\"\n    from datahub.production_startup import quick_quote, quick_financial\n\n    tasks = [\n        quick_quote(stock_code, market=market),\n        quick_financial(stock_code, report_type='balance'),\n        quick_financial(stock_code, report_type='income'),\n        quick_financial(stock_code, report_type='cashflow'),\n    ]\n\n    results = await asyncio.gather(*tasks, return_exceptions=True)\n\n    return {\n        'quote': results[0] if not isinstance(results[0], Exception) else None,\n        'balance': results[1] if not isinstance(results[1], Exception) else None,\n        'income': results[2] if not isinstance(results[2], Exception) else None,\n        'cashflow': results[3] if not isinstance(results[3], Exception) else None,\n    }\n\n# 执行\nasyncio.run(initiating_coverage(\"600660\", \"福耀玻璃\", market='cn'))\n```\n\n### 示例2：季报更新报告\n\n```python\nimport asyncio\nimport sys\n# 用户需自行配置DataHub路径\n# sys.path.insert(0, \"\u003CYOUR_DATAHUB_PATH>\")\n\nfrom datahub.production_startup import quick_quote, quick_financial, quick_query\n\nasync def earnings_update(stock_code: str, company_name: str, report_period: str, market: str = 'cn'):\n    \"\"\"季报更新报告\"\"\"\n    print(f\"=== {company_name} {report_period} 季报更新 ===\")\n\n    # 1. 获取最新数据\n    quote = await quick_quote(stock_code, market=market)\n    income = await quick_financial(stock_code, report_type='income')\n    news = await quick_query(f\"{company_name} {report_period} 财报分析\")\n\n    # 2. 分析业绩\n    if income['status'] == 'success':\n        data = income['data']\n        analysis = {\n            '营收同比': data.get('营收同比增长'),\n            '净利润同比': data.get('净利润同比增长'),\n            '毛利率变动': data.get('毛利率变动'),\n        }\n\n    # 3. 生成报告\n    report = {\n        'company': company_name,\n        'period': report_period,\n        'quote': quote,\n        'income': income,\n        'analysis': analysis,\n        'news': news,\n    }\n\n    return report\n\n# 执行\nasyncio.run(earnings_update(\"00700\", \"腾讯控股\", \"2024Q3\", market='hk'))\n```\n\n---\n\n## 关键约束\n\n1. **AI 不计算，只解读** — 所有数值由 Python 计算\n2. **必须引用数据** — 禁止模糊表述，每个结论引用具体数值\n3. **区分事实与推测** — 推测标注\"需验证\"\n4. **缺失数据显式标注** — 绝不估算，缺失项标注\"N\u002FA\"\n5. **分层处理** — 数据压缩后再交给 AI，避免上下文溢出\n6. **DataHub统一入口** — 所有数据获取通过DataHub，不直接调用独立数据源\n\n---\n\n## DataHub故障排查\n\n### Q: Producer未注册\n\n```python\nfrom datahub import get_datahub, register_all_producers\n\ndatahub = get_datahub()\nproducers = register_all_producers(datahub)\nprint(f\"已注册Producer: {len(producers)}\")\n```\n\n### Q: 数据获取失败\n\n```python\nfrom datahub.production_startup import quick_quote\n\nresult = await quick_quote(\"600519\", market='cn')\n\nif result['status'] == 'success':\n    print(result['data'])\nelif result['status'] == 'timeout':\n    print(\"请求超时，检查网络连接\")\nelif result['status'] == 'error':\n    print(f\"错误: {result.get('error')}\")\n```\n\n### Q: 缓存命中率低\n\n```python\nfrom datahub import get_datahub\n\ndatahub = get_datahub()\nstats = datahub.get_stats()\nprint(f\"缓存统计: {stats}\")\n```\n\n---\n\n## 相关文档\n\n- **DataHub Skill**: 需配合 datahub skill 使用\n- **DataHub生产指南**: 参考 datahub 文档\n- **Python\u002FAI分工**: 参考 docs\u002FPYTHON_AI_DIVISION.md\n- **AI提示词模板**: 参考 docs\u002FAI_PROMPT_TEMPLATES.md\n\n---\n\n**股票研究系统已集成DataHub统一数据层，数据获取更高效、更可靠！**\n","# 股票深度研究系统\n\n> 专业级股权研究自动化系统，集成DataHub统一数据获取层\n\n---\n\n## 核心改进（2026-05-19）\n\n**✅ 集成DataHub统一数据获取层**\n- 替代多数据源直接调用，统一入口管理\n- 智能缓存（quote: 5分钟, financial: 1小时）\n- 自动降级机制（NeoData → WeStock → AkShare）\n- 发布-订阅架构支持实时数据推送\n\n**✅ 简化数据获取流程**\n- 便捷函数：`quick_quote()`, `quick_financial()`, `quick_macro()`\n- 生产管理器：`get_production()`\n- 自然语言查询：`quick_query()`\n\n**✅ 增强代码示例**\n- 完整可执行的Python代码\n- 明确的路径和依赖\n- 统一的异常处理\n\n---\n\n## 执行流程\n\n### Step 1: 任务解析\n\n提取参数：\n- `stock_code`（必需）- 股票代码\n- `company_name`（必需）- 公司名称\n- `report_type`（默认 initiating_coverage）- 报告类型\n- `market`（自动推断）- 市场（A股\u002F港股\u002F美股）\n- `report_period`（季报必需）- 报告期\n\n❌ 缺少必需参数 → 提示用户补充\n\n### Step 2: 数据获取（data_fetch）- DataHub统一接口\n\n**数据源优先级（基于DataHub）**：\n\n```\nDataHub自动路由（优先级由Producer定义）：\n1. LocalWikiProducer（优先级1）- 本地Wiki知识库\n2. NeoDataProducer（优先级12）- 自然语言查询\n3. WeStockProducer（优先级13）- 腾讯自选股\n4. AkShareProducer（优先级15）- AkShare开源数据\n5. YFinanceProducer（优先级16）- Yahoo Finance\n```\n\n**DataHub便捷函数使用**：\n\n```python\nimport asyncio\nimport sys\n# 用户需自行配置DataHub路径\n# sys.path.insert(0, \"\u003CYOUR_DATAHUB_PATH>\")\n\nfrom datahub.production_startup import (\n    quick_quote,\n    quick_financial,\n    quick_macro,\n    quick_query,\n    get_production\n)\n\nasync def fetch_research_data(stock_code: str, market: str = 'cn') -> dict:\n    \"\"\"获取研究所需全部数据\"\"\"\n    prod = await get_production()\n\n    # 并发获取多维度数据\n    tasks = [\n        quick_quote(stock_code, market=market),\n        quick_financial(stock_code, report_type='balance'),\n        quick_financial(stock_code, report_type='income'),\n        quick_financial(stock_code, report_type='cashflow'),\n    ]\n\n    results = await asyncio.gather(*tasks, return_exceptions=True)\n\n    return {\n        'quote': results[0] if not isinstance(results[0], Exception) else None,\n        'balance': results[1] if not isinstance(results[1], Exception) else None,\n        'income': results[2] if not isinstance(results[2], Exception) else None,\n        'cashflow': results[3] if not isinstance(results[3], Exception) else None,\n    }\n\n# 执行\nasyncio.run(fetch_research_data(\"600519\", market='cn'))\n```\n\n**自然语言查询示例**：\n\n```python\nfrom datahub.production_startup import quick_query\n\nasync def query_financial_data(query: str) -> dict:\n    \"\"\"自然语言查询金融数据\"\"\"\n    result = await quick_query(query)\n\n    if result['status'] == 'success':\n        return result['data']\n    else:\n        print(f\"查询失败: {result.get('error')}\")\n        return None\n\n# 示例查询\nasyncio.run(query_financial_data(\"贵州茅台最新财报营收和净利润\"))\nasyncio.run(query_financial_data(\"新能源板块资金流向\"))\nasyncio.run(query_financial_data(\"比亚迪机构评级和目标价\"))\n```\n\n**主题订阅（高级用法）**：\n\n```python\nimport asyncio\nfrom datahub import get_datahub, register_all_producers\n\nasync def subscribe_realtime_data(stock_code: str, callback):\n    \"\"\"订阅实时数据推送\"\"\"\n    datahub = get_datahub()\n    register_all_producers(datahub)\n\n    topic = f\"westock:cn:quote:{stock_code}\"\n    datahub.subscribe(topic, callback)\n    await datahub.request_refresh(topic)\n\n# 示例回调\nasync def on_quote_update(data):\n    print(f\"行情更新: {data}\")\n\nasyncio.run(subscribe_realtime_data(\"600519\", on_quote_update))\n```\n\n**货币单位注意**：\n- 港股财报返回**港元\u002F美元**，美股返回**美元**\n- 展示时必须标注正确货币单位，禁止使用人民币符号\n\n**检查点**：`⚠️ 数据质量确认 - 是否继续？[Y\u002Fn]`\n\n### Step 3: 财务分析（financial_analysis）\n\n**使用DataHub财务数据**：\n\n```python\nfrom datahub.production_startup import quick_financial\n\nasync def analyze_financials(stock_code: str) -> dict:\n    \"\"\"财务分析\"\"\"\n    # 获取三大报表\n    balance = await quick_financial(stock_code, report_type='balance')\n    income = await quick_financial(stock_code, report_type='income')\n    cashflow = await quick_financial(stock_code, report_type='cashflow')\n\n    # 提取关键指标\n    if all(r['status'] == 'success' for r in [balance, income, cashflow]):\n        bal_data = balance['data']\n        inc_data = income['data']\n        cf_data = cashflow['data']\n\n        # 计算核心指标\n        metrics = {\n            '毛利率': (inc_data['营收'] - inc_data['营业成本']) \u002F inc_data['营收'],\n            '净利率': inc_data['净利润'] \u002F inc_data['营收'],\n            'ROE': inc_data['净利润'] \u002F bal_data['股东权益合计'],\n            'ROIC': calculate_roic(inc_data, bal_data),\n        }\n\n        return metrics\n\n    return None\n\ndef calculate_roic(income: dict, balance: dict) -> float:\n    \"\"\"计算ROIC\"\"\"\n    nopat = income['净利润'] + income['利息支出'] * (1 - 0.25)  # 假设税率25%\n    invested_capital = balance['股东权益合计'] + balance['有息负债'] - balance['现金及等价物']\n    return nopat \u002F invested_capital if invested_capital > 0 else None\n```\n\n**异常处理**：\n\n| 异常 | 处理 |\n|-----|-----|\n| 指标无法计算 | 标注\"N\u002FA\"，不估算 |\n| 负权益公司 | 用经营资产法计算 ROIC |\n| 数据不足（\u003C3年） | 标注\"分析可靠性降低\" |\n| DataHub返回错误 | 检查Producer注册，切换备用源 |\n\n### Step 4: 估值分析（valuation）\n\n**DCF估值（Python计算）**：\n\n```python\ndef dcf_valuation(\n    free_cash_flow: float,\n    growth_rate: float = 0.05,\n    discount_rate: float = 0.10,\n    terminal_growth: float = 0.03,\n    years: int = 10\n) -> dict:\n    \"\"\"DCF估值计算\"\"\"\n    # 预测未来现金流\n    fcf_projections = []\n    fcf = free_cash_flow\n    for year in range(years):\n        fcf *= (1 + growth_rate)\n        fcf_projections.append(fcf)\n\n    # 折现\n    discounted_fcf = []\n    for i, fcf in enumerate(fcf_projections, 1):\n        discounted = fcf \u002F ((1 + discount_rate) ** i)\n        discounted_fcf.append(discounted)\n\n    # 终值\n    terminal_value = fcf_projections[-1] * (1 + terminal_growth) \u002F (discount_rate - terminal_growth)\n    discounted_terminal = terminal_value \u002F ((1 + discount_rate) ** years)\n\n    # 企业价值\n    enterprise_value = sum(discounted_fcf) + discounted_terminal\n\n    return {\n        'enterprise_value': enterprise_value,\n        'pv_fcf': sum(discounted_fcf),\n        'pv_terminal': discounted_terminal,\n        'assumptions': {\n            'growth_rate': growth_rate,\n            'discount_rate': discount_rate,\n            'terminal_growth': terminal_growth,\n        }\n    }\n```\n\n**异常处理**：\n\n| 异常 | 处理 |\n|-----|-----|\n| 无可比公司 | 仅用 DCF |\n| 负自由现金流 | 改用 P\u002FB 或 EV\u002FSales |\n| DataHub无估值数据 | 从财报手动计算 |\n\n**检查点**：`⚠️ 估值假设确认 - 是否接受？[Y\u002Fedit]`\n\n### Step 5: 行业分析（仅首发覆盖）\n\n**使用DataHub + 搜索引擎**：\n\n```python\nfrom datahub.production_startup import quick_query\n# 搜索引擎（通过Skill调用）\n# multi-search-engine: 16引擎聚合\n# news-search: 财经资讯专用\n# wechat-article-search: 公众号文章\n\nasync def industry_analysis(industry: str) -> dict:\n    \"\"\"行业分析\"\"\"\n    # DataHub获取行业数据\n    industry_data = await quick_query(f\"{industry}行业规模和增长率\")\n    competitors = await quick_query(f\"{industry}主要上市公司市场份额\")\n\n    return {\n        'industry_data': industry_data,\n        'competitors': competitors,\n    }\n```\n\n**搜索引擎优先级（通过Skill调用）**：\n\n1. **multi-search-engine**（最高优先级）\n   - 16个引擎聚合（7中文 + 9国际）\n   - 无需API密钥\n   - 智能语言识别\n\n2. **news-search**（财经专用）\n   - 财经领域资讯\n   - 覆盖官媒、主流财经媒体\n\n3. **wechat-article-search**（公众号）\n   - 科技\u002FAI、财经、职场\n   - 深度分析文章\n\nPython：行业规模、市场份额、周期判断\nAI：波特五力、政策影响、技术趋势\n\n### Step 6: 竞争分析（仅首发覆盖）\n\nPython：竞争对手筛选、指标对比\nAI：护城河评估（5类评级）\n\n### Step 7: 报告生成（report_generation）\n\nPython：数据压缩（~50K → ~3K tokens）、章节编排\nAI：各章节内容生成（使用对应模板）\n\n**检查点**：`⚠️ 报告生成完成 - 是否输出？[Y\u002Fpreview\u002Fedit]`\n\n### Step 8: 对抗性检验（可选）\n\n使用 `adversarial_challenge` 模板质疑结论、识别逻辑漏洞\n\n---\n\n## 触发词\n\n股票研究、深度研究、首发覆盖、季报更新、DCF估值、可比公司分析、财务分析、ROIC分析\n\n---\n\n## 报告类型\n\n| 类型 | 字数 | 章节 | 模块 |\n|-----|-----|-----|-----|\n| 首发覆盖 | 6,000-10,000 | 投资+公司+行业+财务+估值+风险+建议 | 全部模块 |\n| 季报更新 | 3,000-5,000 | 业绩+经营+财务+预测+估值+建议 | data+financial+valuation+report |\n\n---\n\n## Python\u002FAI 分工\n\n| Python | AI |\n|-------|-----|\n| 数据获取（DataHub）、指标计算、估值建模 | 财报解读、因果推理、定性判断 |\n| 数据压缩、统计分析、图表 | 投资要点、风险提示、护城河评估 |\n\n---\n\n## AI 提示词模板（10个）\n\n| 模板 | 用途 |\n|-----|-----|\n| `investment_highlights` | 投资要点提炼 |\n| `earnings_deep_dive` | 财报深度解读（5步框架）|\n| `financial_quality` | 财务质量诊断（4维度）|\n| `industry_analysis` | 行业深度分析（波特五力）|\n| `competitive_analysis` | 竞争格局（护城河评估）|\n| `valuation_analysis` | 估值分析（多方法对比）|\n| `risk_analysis` | 风险分析（4类矩阵）|\n| `investment_recommendation` | 投资建议（评级+目标价）|\n| `adversarial_challenge` | 对抗性质疑（空头视角）|\n| `tracking_checklist` | 跟踪验证清单 |\n\n---\n\n## 完整使用示例\n\n### 示例1：首发覆盖报告\n\n```python\nimport asyncio\nimport sys\n# 用户需自行配置DataHub路径\n# sys.path.insert(0, \"\u003CYOUR_DATAHUB_PATH>\")\n\nfrom datahub.production_startup import get_production\n\nasync def initiating_coverage(stock_code: str, company_name: str, market: str = 'cn'):\n    \"\"\"首发覆盖报告完整流程\"\"\"\n    prod = await get_production()\n\n    print(f\"=== {company_name} ({stock_code}) 首发覆盖研究 ===\")\n\n    # 1. 数据获取\n    print(\"\\n[1\u002F7] 数据获取...\")\n    data = await fetch_all_data(prod, stock_code, market)\n\n    # 2. 财务分析\n    print(\"\\n[2\u002F7] 财务分析...\")\n    financials = await analyze_financials(data)\n\n    # 3. 估值分析\n    print(\"\\n[3\u002F7] 估值分析...\")\n    valuation = perform_valuation(data, financials)\n\n    # 4. 行业分析\n    print(\"\\n[4\u002F7] 行业分析...\")\n    industry = await analyze_industry(company_name)\n\n    # 5. 竞争分析\n    print(\"\\n[5\u002F7] 竞争分析...\")\n    competition = analyze_competition(data, industry)\n\n    # 6. 报告生成\n    print(\"\\n[6\u002F7] 生成报告...\")\n    report = generate_report({\n        'company': company_name,\n        'stock_code': stock_code,\n        'data': data,\n        'financials': financials,\n        'valuation': valuation,\n        'industry': industry,\n        'competition': competition,\n    })\n\n    # 7. 对抗性检验\n    print(\"\\n[7\u002F7] 对抗性检验...\")\n    challenges = adversarial_review(report)\n\n    return report\n\nasync def fetch_all_data(prod, stock_code: str, market: str) -> dict:\n    \"\"\"获取全维度数据\"\"\"\n    from datahub.production_startup import quick_quote, quick_financial\n\n    tasks = [\n        quick_quote(stock_code, market=market),\n        quick_financial(stock_code, report_type='balance'),\n        quick_financial(stock_code, report_type='income'),\n        quick_financial(stock_code, report_type='cashflow'),\n    ]\n\n    results = await asyncio.gather(*tasks, return_exceptions=True)\n\n    return {\n        'quote': results[0] if not isinstance(results[0], Exception) else None,\n        'balance': results[1] if not isinstance(results[1], Exception) else None,\n        'income': results[2] if not isinstance(results[2], Exception) else None,\n        'cashflow': results[3] if not isinstance(results[3], Exception) else None,\n    }\n\n# 执行\nasyncio.run(initiating_coverage(\"600660\", \"福耀玻璃\", market='cn'))\n```\n\n### 示例2：季报更新报告\n\n```python\nimport asyncio\nimport sys\n# 用户需自行配置DataHub路径\n# sys.path.insert(0, \"\u003CYOUR_DATAHUB_PATH>\")\n\nfrom datahub.production_startup import quick_quote, quick_financial, quick_query\n\nasync def earnings_update(stock_code: str, company_name: str, report_period: str, market: str = 'cn'):\n    \"\"\"季报更新报告\"\"\"\n    print(f\"=== {company_name} {report_period} 季报更新 ===\")\n\n    # 1. 获取最新数据\n    quote = await quick_quote(stock_code, market=market)\n    income = await quick_financial(stock_code, report_type='income')\n    news = await quick_query(f\"{company_name} {report_period} 财报分析\")\n\n    # 2. 分析业绩\n    if income['status'] == 'success':\n        data = income['data']\n        analysis = {\n            '营收同比': data.get('营收同比增长'),\n            '净利润同比': data.get('净利润同比增长'),\n            '毛利率变动': data.get('毛利率变动'),\n        }\n\n    # 3. 生成报告\n    report = {\n        'company': company_name,\n        'period': report_period,\n        'quote': quote,\n        'income': income,\n        'analysis': analysis,\n        'news': news,\n    }\n\n    return report\n\n# 执行\nasyncio.run(earnings_update(\"00700\", \"腾讯控股\", \"2024Q3\", market='hk'))\n```\n\n---\n\n## 关键约束\n\n1. **AI 不计算，只解读** — 所有数值由 Python 计算\n2. **必须引用数据** — 禁止模糊表述，每个结论引用具体数值\n3. **区分事实与推测** — 推测标注\"需验证\"\n4. **缺失数据显式标注** — 绝不估算，缺失项标注\"N\u002FA\"\n5. **分层处理** — 数据压缩后再交给 AI，避免上下文溢出\n6. **DataHub统一入口** — 所有数据获取通过DataHub，不直接调用独立数据源\n\n---\n\n## DataHub故障排查\n\n### Q: Producer未注册\n\n```python\nfrom datahub import get_datahub, register_all_producers\n\ndatahub = get_datahub()\nproducers = register_all_producers(datahub)\nprint(f\"已注册Producer: {len(producers)}\")\n```\n\n### Q: 数据获取失败\n\n```python\nfrom datahub.production_startup import quick_quote\n\nresult = await quick_quote(\"600519\", market='cn')\n\nif result['status'] == 'success':\n    print(result['data'])\nelif result['status'] == 'timeout':\n    print(\"请求超时，检查网络连接\")\nelif result['status'] == 'error':\n    print(f\"错误: {result.get('error')}\")\n```\n\n### Q: 缓存命中率低\n\n```python\nfrom datahub import get_datahub\n\ndatahub = get_datahub()\nstats = datahub.get_stats()\nprint(f\"缓存统计: {stats}\")\n```\n\n---\n\n## 相关文档\n\n- **DataHub Skill**: 需配合 datahub skill 使用\n- **DataHub生产指南**: 参考 datahub 文档\n- **Python\u002FAI分工**: 参考 docs\u002FPYTHON_AI_DIVISION.md\n- **AI提示词模板**: 参考 docs\u002FAI_PROMPT_TEMPLATES.md\n\n---\n\n**股票研究系统已集成DataHub统一数据层，数据获取更高效、更可靠！**\n",{"name":5,"tags":24,"description":7},[25,26,27,28],"投研","财报分析","DCF估值","ROIC","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fs\u002Fstock-research-system",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill stock-research-system",{"tool":44,"command":45},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill stock-research-system",{"tool":47,"command":48},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill stock-research-system","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fs\u002Fstock-research-system\u002FSKILL.md",true,[],[53,60,67,74,81,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]