将公募基金从传统业绩比较升维到五维一体评估(基金经理、费率、持有人、公司、合同)。排除明显有风险的产品,不预测未来业绩。
fundx(全小写,无连字符)fundxfundx diagnose 161005/fundx 或 fundx.diagnosis当用户提出以下意图时触发:
Skill 包中不含 scripts/ 目录(避免 .pyc 缓存问题)。首次诊断前,按以下代码清单创建完整的 Python 脚本树:
scripts/ 及其子目录(参考下方目录结构),然后将完整的 Python 源代码写入各文件。> 💡 源代码可从创建此 Skill 的原始对话中获取,或自行按 config/ 中的阈值和模块规范编写实现。
python -c "from scripts.main import diagnose; print('OK')",不报错即成功。> 后续再次使用 Skill 时无需重复生成,除非要更新代码。
若用户未提供具体基金代码(如"推荐一只ETF"、"有什么好基金"),引导用户选择:
使用 AskUserQuestion 工具收集偏好。
通过以下方式之一获取基金数据:
方式A:使用 neodata-financial-search Skill 查询
1. 加载 Skill("neodata-financial-search") 或 Skill("westock-data")
2. 使用金融数据搜索技能获取基金净值、基准、规模、持仓、费率等数据
方式B:手动构建基金数据对象(数据有限时)
构建符合以下结构的 dict:
fund_data = {
"basic": {"fund_code", "fund_name", "fund_type_l1", "fund_type_l2", "found_years", "fund_size", ...},
"nav_series": [{"date", "acc_nav"}, ...],
"benchmark_series": [{"date", "value"}, ...],
"return_history": {"2023": {"fund_return", "bench_return", "excess", "rank_percentile"}, ...},
"quarterly_excess": [{"quarter", "excess"}, ...],
"fee_structure": {...},
"holder_structure_history": {...},
"style_box_history": [...],
"manager_history": {...},
"company_info": {...},
"contract": {...},
...
}
数据缺失处理:所有缺失字段必须按标准化降级规则处理(参见 config/missing_handlers.yaml),不得导致程序异常。
确保 scripts/ 目录已生成(见 Step 0),然后执行:
# 使用主入口
from scripts.main import diagnose
report_markdown = diagnose(fund_code="000001", fund_data=None, output_format="markdown")
report_json = diagnose(fund_code="000001", fund_data=None, output_format="json")
若已有 fund_data 对象:
report = diagnose(fund_data=fund_data, output_format="markdown")
preview_url 或 open_result_view 呈现deliver_attachments 交付给用户Skill 包中仅包含配置文件和引用文档,Python 脚本由 Step 0 首次运行时生成:
fundx/
├── SKILL.md # 本入口文件(含完整脚本代码清单)
├── config/ # 配置文件(YAML)
│ ├── fund_types.yaml # 基金类型层级及模块启用
│ ├── thresholds.yaml # 各指标阈值
│ ├── style_switch_years.yaml # 风格切换年列表
│ └── missing_handlers.yaml # 缺失数据降级规则
└── references/
└── beginner-guide.md # 新手使用指南
脚本生成后即可修改。所有修改均在 scripts/ 目录下进行:
scripts/modules/ 下创建 module_{id}_{name}.pyrun(fund_data) -> dict 接口(返回 {"score", "tags", "details"})register_module(id, name, run, is_tag_only)scripts/main.py 顶部 import 该模块config/fund_types.yaml 中添加一级/二级分类config/thresholds.yaml 中添加该类型的阈值scripts/scoring/weights.py 中配置权重enabled_modules 列表中配置启用模块scripts/scoring/weights.py 中的 DEFAULT_WEIGHTSconfig/thresholds.yamlscripts/modules/module_{id}.py当用户表现出以下迹象时,将 references/beginner-guide.md 作为用户指南提供参考:
指南中的三原则应直接传达给用户:
config/missing_handlers.yaml),不得抛出异常共 1 个版本