Stock Sector Monitoring Skill
It is used for A-share market monitoring based on Tushare, and mainly supports:
- Concept sector monitoring ()
- Daily details of Dragon Tiger List (, / doc_id=106)
- Output and save results as Markdown files
When to Use
Use this skill when users have the following intentions:
- "Monitor concept sector/industry popularity/ranking list of gainers"
- "Query Dragon Tiger List data"
- "Filter ST stocks and output results"
- "Save monitoring results as markdown/md files"
Prerequisites
Execute in the skill root directory:
bash
cd /Users/yujian/Code/py/aj-skills/skills/stock-sector-monitoring
Dependency preparation:
bash
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -U pip
python3 -m pip install tushare pandas
Tushare token is agreed to be read from
:
bash
# ~/.aj-skills/.env
TUSHARE_TOKEN=your_token
Core Workflow
1) Collect Dragon Tiger List data (recommended by default)
bash
source .venv/bin/activate
python3 scripts/sector-monitoring.py \
--once \
--data-source lhb \
--trade-date 20260213 \
--top 20 \
--format json
Description:
- uses Dragon Tiger List interface ()
- specifies the trading date, default is the current day
- The current script has built-in filtering of ST / ST / SST / SST stocks
2) Sector fluctuation and news linkage analysis (mandatory)
This analysis must be completed for each execution without additional user inquiries; the corresponding report can be generated only after the analysis is completed.
Step 1: Identify fluctuating sectors
Extract the top N sectors by gain from sector monitoring data.
Step 2: Search related news
Search recent news for fluctuating sectors:
- Industry policy changes
- Price/supply and demand changes
- Leading company trends
- International market impact
Step 3: Form conclusions on fluctuation reasons
Integrate sector data and news to produce analysis conclusions on fluctuation reasons that can be written into the report.
3) Generate Markdown report
After completing the analysis in Step 2, organize the JSON output and fluctuation reason conclusions into Markdown, and save it to the
directory.
Report title requirements (mandatory):
- First generate an attractive title suitable for social media sharing.
- The title should reflect "fluctuating sector + key driver/news clue", avoid using plain names such as "daily report/monitoring".
- The title should be controlled within 18-32 characters, with high information density and strong readability.
Leading sector output requirements (mandatory):
- The chapter
Analysis of Reasons for Today's Leading Sectors
must be output.
- Cover at least the top 1-3 sectors by gain (3 by default, adjustable according to data integrity).
- Each sector must include: sector name + gain, core logic, driver table, trend conclusion.
- The in the must be short sentences suitable for mobile terminals, each suggested to be no more than 16 Chinese characters (or 24 characters), only key information is retained.
File naming convention:
- Dragon Tiger List daily report:
- Specified stocks:
reports/lhb-YYYYMMDD-TS_CODE.md
- Concept sector:
reports/sector-YYYYMMDD.md
Minimum Markdown structure:
markdown
# 【板块异动】算力板块领涨:政策催化+龙头放量(YYYY-MM-DD)
## 今日领涨板块原因分析
### 1. 有色金属(铅锌 +5.76%、小金属 +4.65%、铜 +2.96%)
核心逻辑:需求爆发 + 供给收缩
|---|---|
| 国际金属价格普涨 | LME 铜涨超 1.7%,锡涨超 4.6%,海外定价中枢上移 |
| AI 产业需求 | 算力与数据中心建设拉动铜等导电金属需求 |
| 新能源需求 | 锑、钨、稀土、锡等小金属受新能源产业链拉动 |
| 供给管控 | 国内供给管控政策持续,供需缺口支撑价格 |
| 货币环境 | 国际货币环境宽松,风险偏好提升带动商品走强 |
趋势结论:有色金属正从周期品向战略资源属性演进,阶段性主线仍看供需错配与产业升级共振。
## 涨幅榜 Top N
|---|---|---|---:|---:|---:|---|
## 综合评分 Top N
|---|---|---|---:|---:|---:|
## 预警
- 列出超过阈值的标的(若无则写“无”)
## 免责声明
本文为市场复盘与信息整理,不构成任何投资建议。市场有风险,决策需结合自身风险承受能力并独立判断。
4) Saving requirements (mandatory)
Each response should:
- Clearly output the file path
- Save the final result as file on disk
- Give "Saved to: " in the reply
5) Release inquiry and Official WeChat Account release (mandatory)
After the report is generated and saved, you must additionally ask the user whether it needs to be released to the Official WeChat Account.
Standard inquiry:
- "The report has been generated, do you need me to publish it directly to the Official WeChat Account?"
Execution rules:
- If the user confirms "yes", call the skill () to publish.
- If the user does not confirm or refuses, no release operation is performed, only the local report file is retained.
Output Rules
- Output Markdown by default, not only displayed in the conversation.
- Only output the body of the analysis report, do not output data source description, interface information or filtering rule description.
- The main title of the report must be an "attractive social media-style title", and generic placeholder titles cannot be used.
- The report must include
Analysis of Reasons for Today's Leading Sectors
, and each leading sector must be given "core logic + driver table + trend conclusion".
- The of the must be compressed into short sentences suitable for mobile terminals, and excessive original text copying is not allowed.
- The chapter must be added at the end of the report and be the last section.
- If the user does not specify a file name, it will be automatically generated according to the naming convention.
- If the user specifies a date or TS code, the file name must reflect this condition.
- If there is no data on the day, Markdown is still generated, and "No available data (non-trading day/no listing)" is written in the body.
- After the report is saved, you must ask the user whether to publish it to the Official WeChat Account; call the skill only after the user explicitly agrees.
Quality Checklist
- Sector fluctuation and news linkage analysis has been completed and written into the report
- The report title has been optimized for social media sharing scenarios
- The leading sector output has included according to the template: sector gain, core logic, driver table, trend conclusion
- The of the gainer list has been compressed into short sentences suitable for mobile terminals
- A disclaimer has been added at the end of the report
- The body of the report does not include data source description and filtering rule description
- Table column names are complete and units are clear (amount is uniformly in "100 million yuan")
- The report has been saved as
- The reply includes the save path
- Have asked the user whether to publish to the Official WeChat Account; if the user confirms, the skill has been called to publish
Notes
- The Dragon Tiger List interface has high permission requirements ( usually requires point permission).
- If the interface returns empty, first prompt the trading day and permission issues, then output the empty report template.