← 返回 Skills 市场
jiayinian

jy-asset-allocation-report

作者 jiayinian · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
149
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install jy-asset-allocation-report
功能描述
专业大类资产配置报告生成器,基于恒生聚源 (gildata) MCP 金融数据库生成券商风格月度/季度配置报告。 覆盖宏观经济分析、大类资产配置建议、行业配置主线、风险管理措施等核心模块,所有数据可溯源、带时间戳。 **Triggers when user mentions:** - "生成资产配置报告" - "...
使用说明 (SKILL.md)

【大类资产配置报告】

专业大类资产配置报告生成技能,基于恒生聚源 (gildata) MCP 金融数据库,生成券商风格的月度/季度资产配置报告。

功能范围

本技能支持以下功能:

功能 说明
月度资产配置报告 生成指定月份的完整资产配置报告
季度资产配置报告 生成指定季度的配置报告
行业专项配置报告 针对特定行业的资产配置建议
宏观数据查询 获取最新 GDP、CPI、PMI 等宏观经济指标
研报观点汇总 获取近 3 个月券商研报核心观点
资产权重建议 股票、债券、商品、现金等大类资产配置权重
情景推演分析 乐观/悲观/基准三种情景下的配置调整建议

查询建议

查询需要具备的要素:

  • 报告类型:月度/季度/行业专项
  • 时间范围:如"2026 年 3 月"、"2025 年第四季度"
  • (可选)行业主题:如"科技行业"、"消费行业"

查询写法:

生成 {时间} 资产配置报告
生成{YYYY 年 MM 月}大类资产配置报告
生成{行业}资产配置报告

查询示例

# 生成当月报告
"生成 2026 年 3 月资产配置报告"

# 生成指定月份报告
"生成 2025 年 12 月大类资产配置报告"

# 生成季度报告
"生成 2025 年第四季度资产配置报告"

# 生成行业专项报告
"生成科技行业资产配置报告"
"生成消费行业月度配置建议"

# 英文触发
"generate asset allocation report for March 2026"
"monthly portfolio allocation advice"

环境检查与配置

⚠️ 每次使用本技能前,必须先检查 mcporter 安装和 MCP 服务配置状态!

步骤 1:检查 mcporter 是否安装

mcporter --version

如未安装,按以下流程安装:

# 1. 通过 npm 全局安装
npm install -g mcporter

# 2. 验证安装
mcporter --version

步骤 2:检查 MCP 服务配置

# 列出所有已配置的 MCP 服务
mcporter list

预期输出(必须包含以下两个服务):

  • jy-financedata-tool
  • jy-financedata-api

如服务未配置,需要获取 JY_API_KEY 并配置:

2.1 获取 JY_API_KEY

向恒生聚源官方邮箱发送邮件申请签发数据地图 JY_API_KEY,用于接口鉴权。

申请邮箱: [email protected]

邮件标题: 数据地图 KEY 申请 -XX 公司 - 申请人姓名

正文模板:

• 姓名:
• 手机号:
• 公司/单位全称:
• 所属部门:
• 岗位:
• MCP_KEY 申请用途:
• Skill 申请列表:
• 是否需要 Skill 安装包:(是,邮件提供/否,自行下载)
• 其他补充说明(可选):

申请通过后,恒生聚源将默认发送【工具版和接口版】KEY。

2.2 配置 MCP 服务

# 配置 jy-financedata-tool 服务
mcporter config add jy-financedata-tool --url "https://api.gildata.com/mcp-servers/aidata-assistant-srv-tool?token=你的 JY_API_KEY"

# 配置 jy-financedata-api 服务
mcporter config add jy-financedata-api --url "https://api.gildata.com/mcp-servers/aidata-assistant-srv-api?token=你的 JY_API_KEY"

2.3 验证配置

mcporter list

确认两个服务均显示为 connected 状态。

步骤 3:测试数据获取

# 测试研报查询
mcporter call jy-financedata-tool.FinancialResearchReport --query "资产配置研报"

# 测试宏观数据查询
mcporter call jy-financedata-tool.MacroIndustryData --query "GDP CPI PMI 最新数据"

如返回数据正常,则配置完成。

工作流程

1. 确认需求

确认报告时间范围和类型(月度/季度/行业专项)。

2. 环境检查

执行环境检查流程,确保 mcporter 和 MCP 服务配置正常。

3. 数据收集

使用 mcporter call 调用以下工具获取数据:

工具 MCP 服务 用途
FinancialResearchReport jy-financedata-tool 获取近 3 个月券商研报观点
MacroIndustryData jy-financedata-tool 获取最新宏观经济数据
FinQuery jy-financedata-api 获取资产类别价格/估值数据
FinGeneralQuery jy-financedata-api 综合金融数据查询

4. 分析研判

按模板结构分析数据,研报时效性权重按发布时间倒序。

5. 生成报告

输出 Markdown 格式报告,包含:

  • 报告摘要(核心观点表格化)
  • 宏观经济分析(全球 + 国内 + 预期推演)
  • 大类资产配置分析(含配置原因)
  • 行业配置分析(顺周期/科技成长/高股息防御主线)
  • 风险管理措施
  • 结论与展望

6. 导出与保存

推荐方式:使用 Chrome 浏览器生成 PDF(中文支持最佳)

# 1. 先保存为 HTML 格式
# 2. 使用 Chrome 无头模式转换为 PDF
google-chrome --headless --disable-gpu --print-to-pdf="报告.pdf" "file://路径/报告.html"

备用方式:使用 reportlab(需配置中文字体)

# 需要安装中文字体(如 fonts-wqy-microhei)
# 使用 DroidSansFallback 或 AR PL UMing 字体
python3 generate_pdf.py

保存位置: ~/桌面/资产配置报告输出/

命名规范: {YYYY 年 MM 月} 大类资产配置报告.pdf

可用工具

所有工具调用统一使用 mcporter call 命令,入参均为 query

# 研报查询
mcporter call jy-financedata-tool.FinancialResearchReport --query "\x3C查询内容>"

# 宏观数据查询
mcporter call jy-financedata-tool.MacroIndustryData --query "\x3C查询内容>"

# 金融数据查询
mcporter call jy-financedata-api.FinQuery --query "\x3C查询内容>"

# 综合查询
mcporter call jy-financedata-api.FinGeneralQuery --query "\x3C查询内容>"

工具说明

工具 功能 典型查询
FinancialResearchReport 获取券商研报观点 "资产配置 最新观点"、"宏观经济 研报"
MacroIndustryData 获取宏观经济数据 "GDP CPI PMI 最新"、"货币供应 M2"
FinQuery 获取金融市场价格数据 "股票估值"、"债券收益率"、"商品价格"
FinGeneralQuery 综合金融查询 "行业景气度"、"资金流向"

报告模板

完整报告模板结构详见 references/template.md

核心模块

  1. 报告摘要

    • 核心观点表格化呈现
    • 配置建议一目了然
  2. 宏观经济分析

    • 全球宏观经济形势
    • 国内宏观经济形势
    • 预期推演(新增):乐观/悲观/基准三种情景
  3. 大类资产配置分析

    • 股票、债券、商品、现金、另类资产
    • 配置权重建议
    • 配置原因(新增):说明配置逻辑
  4. 行业配置分析

    • 顺周期主线
    • 科技成长主线
    • 高股息防御主线
  5. 风险管理措施

    • 风险识别
    • 对冲策略
    • 仓位控制
  6. 结论与展望

    • 下阶段配置建议
    • 关注事项

输出格式

项目 说明
默认格式 Markdown
推荐格式 HTML → Chrome 打印为 PDF(中文支持最佳)
备用格式 reportlab 生成 PDF(需配置中文字体)
存储位置 ~/桌面/资产配置报告输出/
命名规范 {YYYY 年 MM 月} 大类资产配置报告.pdf
数据时效 研报近 3 个月,宏观数据最新可用

PDF 生成方式对比

方式 优点 缺点 推荐度
Chrome 无头模式 中文支持完美,格式美观,字体嵌入完整 需要 Chrome 浏览器 ⭐⭐⭐⭐⭐
reportlab 纯 Python,无需浏览器 中文字体配置复杂,易乱码 ⭐⭐
WeasyPrint 支持 CSS 样式 中文字体嵌入有问题 ⭐⭐
pandoc+xelatex 格式专业 需要安装 xelatex ⭐⭐⭐

Chrome 生成 PDF 示例

# 1. 准备 HTML 文件(包含完整 CSS 样式)
# 2. 使用 Chrome 无头模式转换
google-chrome --headless --disable-gpu --print-to-pdf="2026 年 3 月大类资产配置报告.pdf" "file:///path/to/report.html"

# 输出:3-4MB PDF 文件,中文显示正常,格式美观

示例报告

示例报告参考 examples/sample_report.md

注意事项

  • ⚠️ 报告仅供研究参考,NOT investment advice
  • ⚠️ 数据来源于 gildata 聚源数据库及官方统计机构,部分数据可能存在延迟
  • ⚠️ 所有数据必须标注截止日期
  • ⚠️ 首次使用需完成 JY_API_KEY 配置(配置一次即可)
  • ⚠️ 如未配置 JY_API_KEY,技能将提示并要求用户提供

Troubleshooting

"mcporter: command not found"

# 安装 mcporter
npm install -g mcporter

"MCP server not connected"

# 检查配置
mcporter list
# 如服务缺失,重新配置
mcporter config add jy-financedata-tool --url "https://api.gildata.com/mcp-servers/aidata-assistant-srv-tool?token=你的 JY_API_KEY"

"JY_API_KEY not found"

# 检查环境变量或配置文件
# 如未配置,按"步骤 2.1 获取 JY_API_KEY"流程申请

"Data query timeout"

  • gildata API 可能需要较长时间(30-60 秒)
  • 重试或简化查询条件

"PDF 中文乱码"

# 解决方案 1(推荐):使用 Chrome 浏览器生成 PDF
google-chrome --headless --disable-gpu --print-to-pdf="报告.pdf" "file://路径/报告.html"

# 解决方案 2:安装中文字体
apt-get install fonts-wqy-microhei fonts-noto-cjk

# 解决方案 3:使用 HTML 格式直接查看
# HTML 文件可在任意浏览器中正常显示中文

"Chrome 无头模式失败"

# 检查 Chrome 是否安装
google-chrome --version

# 如未安装,使用 Chromium
chromium-browser --headless --disable-gpu --print-to-pdf="报告.pdf" "file://路径/报告.html"

# 或使用系统默认浏览器打印功能手动保存为 PDF

References

文件 说明
references/template.md 完整报告模板结构(Markdown 格式)
references/report_template.html HTML 报告模板(支持 Chrome 生成 PDF)
references/data_sources.md MCP 工具使用说明
examples/sample_report.md 示例报告参考

HTML 模板使用说明

references/report_template.html 是一个包含完整 CSS 样式的 HTML 模板,支持:

  1. 直接使用:填充模板变量后在浏览器中查看
  2. 生成 PDF:使用 Chrome 无头模式转换为 PDF
    google-chrome --headless --disable-gpu --print-to-pdf="报告.pdf" "file://路径/report.html"
    
  3. 中文支持:内置多种中文字体回退方案,确保正常显示

模板变量列表

变量 说明 示例
{{TITLE}} 页面标题 2026 年 3 月大类资产配置报告
{{REPORT_TITLE}} 报告主标题 【2026 年 3 月】大类资产配置报告
{{ORGANIZATION}} 编制机构 Test Agent
{{REPORT_DATE}} 报告日期 2026-03-31
{{DATA_CUTOFF}} 数据截止 2026-03-31
{{KEYWORD1-4}} 本月关键词 地缘风险、滞胀担忧...
{{CN_PMI}} 中国 PMI 50.4
{{CN_CPI_YOY}} 中国 CPI 同比 1.3%
{{HS300_PE}} 沪深 300 PE 13.97 倍
{{BOND_10Y}} 10 年期国债收益率 1.804%
... ... ...
安全使用建议
This skill appears to be what it claims (generating reports from gildata via an MCP client), but there are mismatches and omissions you should address before installing: 1) The SKILL.md requires a JY_API_KEY, but the registry metadata does not declare any required credential — verify where and how you will provide the key and whether the platform will protect it. 2) The instructions embed the token into mcporter service URLs which may be saved in local mcporter config — confirm mcporter's storage location and permissions so your key isn't leaked. 3) SKILL.md references additional tools (google-chrome headless, python3/reportlab, fonts, pandoc/xelatex) and suggests saving to ~/Desktop — ensure you have these binaries or are comfortable installing them; they are not declared as required in the registry. 4) Validate the npm package 'mcporter' publisher and version before global install (npm packages can be abused); prefer installing in a controlled environment or container. 5) Consider least-privilege: use a gildata key with minimal scope (if possible) and avoid putting production or high-privilege credentials into unvetted skills. If you can, ask the skill author to: (a) declare JY_API_KEY in requires.env, (b) declare all required system binaries (chrome, python3) or make them optional, and (c) document where mcporter stores credentials and how to remove them. If you cannot verify the mcporter package or the skill author, run this in an isolated environment (VM/container) and do not share high-value credentials.
功能分析
Type: OpenClaw Skill Name: jy-asset-allocation-report Version: 1.0.0 The 'jy-asset-allocation-report' skill is a professional tool designed to generate financial asset allocation reports using the gildata (恒生聚源) MCP financial database. It utilizes the 'mcporter' CLI tool to interface with legitimate financial APIs (api.gildata.com) and provides clear instructions for environment setup, including obtaining an API key via official channels. The use of headless Chrome for PDF generation is a standard approach for handling complex document rendering, and no evidence of data exfiltration, malicious execution, or harmful prompt injection was found across the SKILL.md or supporting files.
能力评估
Purpose & Capability
The skill claims to build asset-allocation reports from 恒生聚源 (gildata) MCP. Requesting an MCP client (mcporter) and a gildata API key (JY_API_KEY) is coherent with that purpose. Installing mcporter via npm is reasonable for a Node-based CLI wrapper.
Instruction Scope
The SKILL.md instructs the agent to run mcporter calls to external gildata MCP services (expected), configure services by embedding token in service URLs, and to save files under ~/桌面/资产配置报告输出/. However the instructions also reference additional tools (google-chrome headless, python3/reportlab, fonts, pandoc/xelatex) and system paths that are not declared in registry metadata. The skill will perform network calls to gildata endpoints — expected for its function — but the open-ended use of mcporter queries and the embedding of keys in URLs raise configuration/storage concerns.
Install Mechanism
Install spec is a single npm package (mcporter) installed globally via npm install -g mcporter. This is a standard registry-based install (moderate risk vs. direct download). The package source (npm) and global installation should be validated by the user (verify package name, publisher, and versions) before allowing installation.
Credentials
SKILL.md explicitly requires a JY_API_KEY for MCP authentication and shows commands embedding the token in service URLs, but the skill's registry metadata lists no required environment variables or primary credential. This mismatch (declared none vs. documented-required JY_API_KEY) is an inconsistency that should be resolved. Embedding the token into a URL and mcporter config may persist the key in local config files — users should understand where their key will be stored and how it's protected.
Persistence & Privilege
The skill does not request always:true and is user-invocable only. It does not attempt to modify other skills or system-wide configurations beyond adding mcporter service entries (which is within its documented operation).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install jy-asset-allocation-report
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /jy-asset-allocation-report 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
jy-asset-allocation-report v1.0.0 – Initial release - Generates professional monthly/quarterly asset allocation reports based on Gildata MCP financial database. - Covers macroeconomic analysis, asset class recommendations, industry allocation, and risk management, with traceable, timestamped data. - Output in Markdown or PDF format, saved to desktop; includes Chinese and English trigger phrases. - Requires mcporter tool and MCP service configuration with JY_API_KEY authentication. - Clear troubleshooting, environment setup, and export (PDF) instructions provided. - NOT investment advice.
元数据
Slug jy-asset-allocation-report
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

jy-asset-allocation-report 是什么?

专业大类资产配置报告生成器,基于恒生聚源 (gildata) MCP 金融数据库生成券商风格月度/季度配置报告。 覆盖宏观经济分析、大类资产配置建议、行业配置主线、风险管理措施等核心模块,所有数据可溯源、带时间戳。 **Triggers when user mentions:** - "生成资产配置报告" - "... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 149 次。

如何安装 jy-asset-allocation-report?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install jy-asset-allocation-report」即可一键安装,无需额外配置。

jy-asset-allocation-report 是免费的吗?

是的,jy-asset-allocation-report 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

jy-asset-allocation-report 支持哪些平台?

jy-asset-allocation-report 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 jy-asset-allocation-report?

由 jiayinian(@jiayinian)开发并维护,当前版本 v1.0.0。

💬 留言讨论