rps-analyst
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "rps-analyst" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-ba185f6ee2f2282e258be5f30ff1407e4bd5dd35896043a41a5b4d904414cecd. Verify the upstream source and version against https://skillhub.cn/skills/user_09cf1a59/rps-analyst before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
RPS report generator: reads rps_full_YYYYMMDD.json and the previous day's JSON file, and produces a complete ranking report in both Markdown and HTML formats.
Introduction source: third_party · user_09cf1a59 · 1.0.1 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: rps-report-generator
description: RPS 报告生成器 — 读取 rps_full_YYYYMMDD.json + 前一日 JSON,生成 Markdown + HTML 双版本完整排名报告
agent_created: true功能说明
本 Skill 根据 RPS 引擎计算出的 JSON 数据,自动生成双版本排名报告(Markdown + HTML),包含:全量排名、市场宽度、跨期对比分析。
适用市场:美股(A股不支持)
适用品种:美国科技股/ETF(数字货币、期货、其他市场不在范围内)
前置要求:必须先运行过 rps_engine.py,确保 JSON 文件已生成
触发方式
以下任一说法均可激活本 Skill:
| 类型 | 示例 |
|---|---|
| 完整任务 | "运行 RPS 每日计算,生成完整报告" |
| 报告生成 | "生成今天的 RPS 排名报告" |
| 对比分析 | "RPS 对比昨日分析" / "生成 RPS 周报" |
| 特定标的 | "查看英维克(002837.SZ)的 RPS 排名"(A股另走 AKShare 流程,不适用) |
工作流程
Step 1 — 确定日期
取最新日期 JSON(如 20260528),格式为 rps_full_{DATE}.json
Step 2 — 确认路径
JSON 文件必须位于:
{WORKSPACE}/rps-engine/scripts/rps_results/
常见错误:若提示"文件不存在",请检查:
- 是否已运行
rps_engine.py生成数据 - 路径是否误写为
rps_results/(少了scripts/)
Step 3 — 读取模板
模板文件:{WORKSPACE}/rps_engine_tpl.html
Step 4 — 生成报告脚本
创建 generate_rps_report_{DATE}.py,必须包含:
SECTOR_MAP(板块 CSS class 映射)- 辅助函数:
rank_class / score_class / yield_class / tag_class / html_escape / fmt / price_fmt - 全量排名 Markdown 表格(含板块列,不去持仓)
- 市场宽度区块
- 对比分析:Top50 升序/降序/升幅最大/跌幅最大/新晋前50/跌出前50/大幅变动
Step 5 — 执行
python generate_rps_report_{DATE}.py
Step 6 — 交付
调用 deliver_attachments 交付 .md 和 .html 文件
关键数据结构
JSON 内各数据结构 tuple 格式:
score_changes (top50_up/down, max_rise/fall, big_movers):
(diff: float, ticker_str: str, ct_dict: dict, old_r: int)
new_top50 / exited:
(ticker_str: str, ct_dict: dict, old_r: int)
ct_dict 字段:ticker / composite_rank / rps_composite / category /
rps_20 / rps_50 / rps_90 / rps_120 / rps_250 /
yield_250d / price
常见 Bug 预警
| 错误现象 | 原因 | 正确写法 |
|---|---|---|
fmt() TypeError |
fmt(v, '+.2f', '%') decimals 传了字符串 |
f"{v:+.2f}%" |
'NoneType' object has no attribute 'ticker' |
t[1]["ticker"] — t[1] 是 ticker 字符串不是 dict |
t[2]["ticker"] |
KeyError: breadth__20d |
.replace("breadth","breadth_") 产生了双下划线 |
key + "_above" |
变量名报错 top rise_t |
变量名里有空格 | toprise_t |
| JSON FileNotFoundError | 路径写了 rps_results/ |
rps-engine/scripts/rps_results/ |
错误处理对照表
| 报错关键词 | 含义 | 解决步骤 |
|---|---|---|
FileNotFoundError: rps_full_...json |
JSON 不存在 | ① 确认已运行 rps_engine.py ② 检查路径是否含 scripts/ |
KeyError: 'composite_rank' |
JSON 结构不匹配 | 确认 JSON 是本 Skill 输出的格式,非其他来源 |
IndexError: tuple index out of range |
数据解析格式错误 | 检查是否正确解包了 tuple(参考上方数据结构) |
pct_change() got NaT |
数据库缺少历史数据 | 目标股票上市不足250天,数据不足无法计算 |
| 报告缺少某板块颜色 | SECTOR_MAP 未覆盖该板块关键词 | 对照模板文档添加新映射 |
| HTML 占位符未替换 | 6 个 placeholder 有遗漏 | 确认模板6个占位符全部替换 |
能力边界
✅ 本 Skill 可以
- 生成美股科技股(ETF/个股)5 周期 RPS 排名报告
- 对比前后两个交易日排名变化
- 输出 Markdown(纯文本)+ HTML(可视化)双版本
- 计算市场宽度指标
- 识别新晋/跌出 Top50 的标的
❌ 本 Skill 不能
- 直接爬取实时价格(依赖 rps_engine.py 预先计算的 JSON)
- 分析 A 股(数据格式和板块分类不同)
- 分析数字货币、期货(不在覆盖范围内)
- 自动运行 RPS 计算(需用户单独触发 rps_engine.py)
- 上传腾讯文档(如需上传,请手动告知)
输出示例
Markdown 报告片段
| 排名 | 股票代码 | 板块 | RPS综合 | 20日 | 50日 | 90日 | 120日 | 250日 | 250日收益 |
|------|---------|------|--------|------|------|------|-------|-------|---------|
| 🥇 1 | MU | 半导体 | 99 | 99 | 98 | 97 | 99 | 99 | +38.5% |
| 🥈 2 | AVGO | 半导体 | 97 | 96 | 97 | 95 | 96 | 98 | +31.2% |
HTML 报告截图描述
- 顶部:数据日期 + 4个统计数字(标的总数/大幅变动/新晋前50/跌出前50)
- 中部:完整排名表格,带板块颜色标签(前3名金色/4-10银色/11-50铜色)
- 底部:5个对比分析模块(Top50升序/降序/升幅最大/跌幅最大/新晋跌出)
FAQ
Q: 提示 JSON 文件不存在怎么办?
A: 请按顺序执行:① 确认 tiger_market.db 已放在 rps-engine/scripts/ ② 运行 python rps_engine.py 生成数据 ③ 再要求生成报告
Q: 某个股票排名显示 NaN 或 None? A: 该股票历史数据不足250天,RPS 无法计算,属于正常现象
Q: 报告里板块颜色不对/没颜色? A: 该股票板块关键词未被 SECTOR_MAP 覆盖,可对照模板文档添加
Q: 可以分析 A 股吗? A: 目前不支持,A 股数据结构和板块分类与美股不同,需另走 AKShare 流程
Q: 数据哪天更新的? A: 取决于最近一次运行 rps_engine.py 的日期,报告内会显示数据截止日期
输出规范
- Markdown:全量排名表(含板块列),不去持仓
- HTML:用 rps_engine_tpl.html 模板,6 个 placeholder 全替换
- 对比分析:Top50 升序/降序/升幅最大/跌幅最大/新晋前50/跌出前50/大幅变动(≥5)
- 不上传腾讯文档
Current listing version
1.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 面向美股量化投资场景,解决 RPS 排名报告生成的实际痛点
- 功能闭环完整,支持 Markdown 和 HTML 双版本输出,具备实质性专业价值
Areas to improve
-
周报触发场景未细化 Reported severity: Minor
触发方式中提到“生成 RPS 周报”,但未说明周报的具体逻辑(如是否对比近7日数据)
Recommendation: 建议在 FAQ 或工作流程中补充周报生成的具体规则
Highlights
- 触发词覆盖全面,包含完整任务、报告生成、对比分析、特定标的等多种场景
- 明确标注 A 股不适用,边界清晰,减少误触风险
Highlights
- 文档结构完整,涵盖功能说明、触发方式、六步工作流程、数据结构、常见 Bug 预警、错误处理、能力边界、输出示例、FAQ、输出规范
- 提供端到端示例和门控条件(如前置要求运行 rps_engine.py),frontmatter 完整
Areas to improve
-
模板文件存在性未校验 Reported severity: Minor
工作流程中要求读取 rps_engine_tpl.html,但未在脚本中说明如何校验该文件是否存在
Recommendation: 建议在生成脚本中加入模板文件存在性检查,若不存在则提示用户放置模板文件
Highlights
- 工具来源明确,依赖 rps_engine.py 生成的 JSON 数据,参数说明清晰
- 覆盖主要异常场景(FileNotFoundError、KeyError、IndexError、NaN 等),并提供具体解决步骤
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.