SuperAPI AI Directory

stock-sector-monitoring

Data & analytics

View repository

Updated 10-15 02:23

About this skill

Stock Sector Monitoring Skill

For A-share market monitoring based on Tushare, with key support for:

  • Concept sector monitoring (sector)
  • Dragon Tiger List daily details (lhb,top_list / doc_id=106)
  • Output and save results as Markdown files

When to Use

Use this skill when users express the following intents:

  • "Monitor concept sectors/industry heat/gainers ranking"
  • "Query Dragon Tiger List data"
  • "Filter out ST stocks and output results"
  • "Save monitoring results as markdown/md files"

Prerequisites

Execute in the skill root directory:

cd /Users/yujian/Code/py/aj-skills/skills/stock-sector-monitoring

Dependency preparation:

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -U pip
python3 -m pip install tushare pandas

The Tushare token is by convention read from ~/.aj-skills/.env :

# ~/.aj-skills/.env
TUSHARE_TOKEN=your_token

Core Workflow

1) Collect Dragon Tiger List data (recommended by default)

source .venv/bin/activate
python3 scripts/sector-monitoring.py \
  --once \
  --data-source lhb \
  --trade-date 20260213 \
  --top 20 \
  --format json

Notes:

  • --data-source lhb Use the Dragon Tiger List interface (top_list)
  • --trade-date YYYYMMDD specify the trading day, defaults to the current day
  • The current script already has built-in filtering of ST / ST / SST / SST stocks

2) Sector movement + news linkage analysis (required)

This analysis must be completed on every execution, without requiring an additional user prompt; the corresponding report may only be generated after the analysis is completed.

Step 1: Identify moving sectors
Extract the top N sectors by gain from the sector monitoring data.

Step 2: Search related news
For the moving sectors, search recent news:

  • Industry policy changes
  • Price/supply-demand changes
  • Leading company developments
  • International market impact

Step 3: Form conclusions on the reasons for the movement
Integrate sector data + news to produce conclusions on the reasons for the movement that can be written into the report.

3) Generate Markdown report

After completing the analysis in Step 2, organize the JSON output and the conclusions on the reasons for the movement into Markdown, and save it to the reports/ directory.

Report title requirements (required):

  • First generate an attractive title suitable for social media sharing.
  • The title must reflect "moving sectors + key drivers/news clues", and avoid flat naming such as "Daily Report/Monitoring".
  • The title should be controlled to 18-32 characters, with high information density and strong readability.

Leading sector output requirements (required):

  • Must output the 今日领涨板块原因分析 section.
  • Cover at least the top 1-3 sectors by gain (3 by default, adjustable based on data completeness).
  • Each sector must include: sector name + gain, core logic, driver factor table, trend conclusion.
  • 涨幅榜 In 上榜理由 must be short mobile-friendly sentences, with each item recommended not to exceed 16 Chinese characters (or 24 characters), retaining only key information.

File naming conventions:

  • Dragon Tiger List daily report:reports/lhb-YYYYMMDD.md
  • Specified stock:reports/lhb-YYYYMMDD-TS_CODE.md
  • Concept sector:reports/sector-YYYYMMDD.md

Minimum Markdown structure:

# 【板块异动】算力板块领涨:政策催化+龙头放量(YYYY-MM-DD)

## 今日领涨板块原因分析

### 1. 有色金属(铅锌 +5.76%、小金属 +4.65%、铜 +2.96%)

核心逻辑:需求爆发 + 供给收缩

| 驱动因素 | 具体内容 |
|---|---|
| 国际金属价格普涨 | LME 铜涨超 1.7%,锡涨超 4.6%,海外定价中枢上移 |
| AI 产业需求 | 算力与数据中心建设拉动铜等导电金属需求 |
| 新能源需求 | 锑、钨、稀土、锡等小金属受新能源产业链拉动 |
| 供给管控 | 国内供给管控政策持续,供需缺口支撑价格 |
| 货币环境 | 国际货币环境宽松,风险偏好提升带动商品走强 |

趋势结论:有色金属正从周期品向战略资源属性演进,阶段性主线仍看供需错配与产业升级共振。

## 涨幅榜 Top N
| 排名 | 代码 | 名称 | 涨跌幅 | 龙虎榜净买入额(亿) | 净买额占比(%) | 上榜理由(短句) |
|---|---|---|---:|---:|---:|---|

## 综合评分 Top N
| 排名 | 代码 | 名称 | 综合评分 | 涨跌幅 | 龙虎榜净买入额(亿) |
|---|---|---|---:|---:|---:|

## 预警
- 列出超过阈值的标的(若无则写“无”)

## 免责声明
本文为市场复盘与信息整理,不构成任何投资建议。市场有风险,决策需结合自身风险承受能力并独立判断。

4) Saving requirements (required)

Every response should:

  • Clearly output the file path
  • Write the final result to disk as .md
  • In the reply, provide "Saved to:<path>”

5) Publishing inquiry and official account publishing (required)

After the report is generated and saved, you must additionally ask the user whether it needs to be published to the official account.

Standard inquiry:

  • "The report has been generated. Would you like me to publish it directly to the official account?"

Execution rules:

  • If the user confirms "yes", call post-to-wechat skill(baoyu-post-to-wechat) to publish.
  • If the user does not confirm or refuses, do not perform the publish operation and only keep the local report file.

Output Rules

  • Output Markdown by default, not only displaying it in the conversation.
  • Output only the main body of the analysis report, and do not output data source explanations, interface information, or filtering rule explanations.
  • The report's main title must be an "attractive social-media-style title" and must not use a generic placeholder title.
  • The report must include 今日领涨板块原因分析, and each leading sector must provide "core logic + driver factor table + trend conclusion".
  • 涨幅榜 of 上榜理由 must be condensed into short mobile-friendly sentences, and must not contain overly long verbatim copying.
  • At the end of the report, 免责声明 section must be appended, and it must be the last section.
  • If the user does not specify a file name, automatically generate one according to the naming convention.
  • If the user specifies a date or TS code, the file name must reflect that condition.
  • If there is no data for the day, still generate Markdown, and state in the main body: "No available data (non-trading day/not on the list)".
  • After the report is saved, you must ask the user whether to publish it to the official account; only call post-to-wechat skill。

Quality Checklist

  • Completed sector movement + news linkage analysis and wrote it into the report
  • The report title has been optimized for social media sharing scenarios
  • The leading sector output already includes, according to the template: sector gain, core logic, driver factor table, trend conclusion
  • Gainers list 上榜理由 has been condensed into short mobile-friendly sentences
  • A disclaimer has been appended at the end of the report
  • The main body of the report does not include data source explanations or filtering rule explanations
  • Table column names are complete and units are clear (amounts uniformly in "100 million yuan")
  • The report has been saved as .md
  • The reply includes the save path
  • Asked the user whether to publish to the official account; if the user confirmed, called post-to-wechat skill to publish

Notes

  • The Dragon-Tiger List interface has relatively high permission requirements (top_list usually requires points-based permissions).
  • If the interface returns empty, first prompt about trading day and permission issues, then output an empty report template.