Agent skill

Sector Rotation Analysis

by HKUDS in HKUDS/Vibe-Trading

A-share sector rotation workflow in Chinese: scores Shenwan industries on prosperity, ranks momentum and compares valuation, earnings and fund flows.

MITAuto-check passedBusiness, Finance & HR

SKILL.md written in Chinese; this summary is our English description.

Install Sector Rotation Analysis

skills CLI
$ npx skills add HKUDS/Vibe-Trading --skill sector-rotation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/Vibe-Trading sector-rotation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agent/src/skills/sector-rotation .claude/skills/sector-rotation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sector-rotation
GitHub stars
35k
Token cost
~965 tokens
SKILL.md length
182 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

A-share sector rotation workflow in Chinese: scores Shenwan industries on prosperity, ranks momentum and compares valuation, earnings and fund flows.

  • Works in 6 steps: 周期股估值陷阱:低PE可能是盈利顶点(如2021年煤炭PE仅5x但是顶部),用PB… → 政策变量权重大:A股行业轮动受政策驱动明显(集采、碳中和、AI),政策拐点>基本面… → 主题投资干扰:短期主题炒作(如AI概念)会扭曲行业动量信号,注意区分主题 vs 景气 → …
  • Deciding which A-share industries to overweight or underweight
  • SKILL.md covers 概述, 申万行业分类体系, 景气度评分框架 and 行业动量排名方法, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

A Chinese-language framework for sector rotation in the mainland A-share market, built on the Shenwan classification of 31 first-level industries, grouped as upstream cyclicals, midstream manufacturing, downstream consumer, technology and media, financials and utilities. It labels industries as strongly cyclical, weakly cyclical, growth or financial and names the drivers that matter for each type.

The agent scores each industry out of 100 on earnings growth, earnings trend, industry indicators, policy support and valuation safety, then ranks industries by price, earnings and fund-flow momentum and proposes overweights and underweights from the top and bottom of the ranking. It also traces how demand and cost shocks move along the supply chain and compares sectors on valuation, profitability and flows such as northbound capital and margin balances. The result is a Markdown report with a prosperity ranking.

When your agent uses it

  • Deciding which A-share industries to overweight or underweight
  • Ranking Shenwan industries by momentum, earnings and capital flows
  • Tracing how an upstream price move could reach midstream and downstream sectors
  • Comparing sector valuations without falling for low P/E ratios in cyclical stocks

Example prompts

  • “Rank the Shenwan first-level industries by prosperity and show me the top ten.”
  • “Which A-share sectors look best to overweight this quarter, based on momentum, valuation and fund flows?”
  • “Explain how a rise in lithium prices would pass through the battery supply chain.”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. 周期股估值陷阱:低PE可能是盈利顶点(如2021年煤炭PE仅5x但是顶部),用PB更安全
  2. 政策变量权重大:A股行业轮动受政策驱动明显(集采、碳中和、AI),政策拐点>基本面拐点
  3. 主题投资干扰:短期主题炒作(如AI概念)会扭曲行业动量信号,注意区分主题 vs 景气
  4. 数据滞后:财报数据滞后1-2个月,高频数据(PMI/开工率/价格)更及时
  5. 行业ETF替代:建议用行业ETF代码而非个股实现行业配置,降低个股风险
  6. 轮动频率:行业轮动不宜太频繁,月度/季度调仓为宜

What it can do on your machine

Read from SKILL.md and the folder at commit b1f6ce7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sector Rotation Analysis loads about 965 tokens when it runs. Until then it costs about 16 tokens; SKILL.md has 182 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~16
When it runs · the whole SKILL.md, loaded when a task matches
~965

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/Vibe-Trading at commit b1f6ce7, republished under its MIT licence (© HKUDS). 182 words, ~965 tokens.

Download SKILL.mdSave it as .claude/skills/sector-rotation/SKILL.md (or your agent's skills folder).
name
sector-rotation
description
行业轮动分析——申万行业景气度评分、行业动量排名、产业链传导、估值/盈利/资金流多维比较框架
category
asset-class

行业轮动分析

概述

基于A股申万行业分类体系,通过景气度评分、动量排名、估值比较、资金流向四个维度进行行业轮动分析,输出行业超配/低配建议。

申万行业分类体系

一级行业(31个)
大类行业代码示例
上游周期煤炭、有色、石油石化、钢铁、基础化工煤炭ETF: 515220
中游制造电力设备、机械设备、国防军工、汽车新能源ETF: 516160
下游消费食品饮料、家用电器、医药生物、美容护理消费ETF: 510150
TMT电子、计算机、通信、传媒科技ETF: 515000
金融地产银行、非银金融、房地产金融ETF: 510230
公用事业公用事业、交通运输、环保红利ETF: 510880
行业周期属性
类型行业特征驱动因子
强周期煤炭/有色/钢铁/化工盈利波动大,跟宏观紧密PPI、PMI、商品价格
弱周期食品饮料/医药/公用盈利稳定,防御属性CPI、消费数据
成长型电子/计算机/电力设备高PE高增速,政策敏感产业政策、渗透率
金融银行/非银/保险利差驱动,与利率正相关利率、社融、信贷

景气度评分框架

评分维度(满分100)
维度权重指标评分规则
盈利增速30%净利润同比增速>30%=30分, 15-30%=22分, 0-15%=15分, <0%=5分
盈利趋势20%连续N季加速加速3季+=20分, 2季=14分, 减速=-5分
景气指标20%PMI/开工率/价格高位+上行=20分, 高位回落=12分, 低位=5分
政策支持15%产业政策力度明确利好=15分, 中性=8分, 利空=2分
估值安全15%PE历史分位<30%分位=15分, 30-50%=10分, >70%=3分
景气度变化信号
景气度上行信号(超配):
1. 行业PMI连续2个月>50且环比改善
2. 龙头公司订单/收入同比加速
3. 产品价格上行(涨价周期)
4. 产能利用率>80%且在提升
5. 政策催化(补贴/准入/国产替代)

景气度下行信号(低配):
1. 行业PMI连续2个月<50
2. 存货周转天数上升(库存积压)
3. 产品价格下行
4. 产能过剩(利用率<60%)
5. 政策收紧(环保/反垄断/集采)

行业动量排名方法

价格动量
python
def sector_momentum(sector_returns: pd.DataFrame, lookback: int = 60, skip: int = 5) -> pd.Series:
    """
    Args:
        sector_returns: 行业日收益率,columns=行业名
        lookback: 回看窗口(交易日)
        skip: 跳过最近N天(避免短期反转)
    Returns:
        行业动量得分排名
    """
    cum_return = (1 + sector_returns).rolling(lookback).apply(lambda x: x[:-skip].prod() - 1)
    return cum_return.iloc[-1].rank(ascending=False)
盈利动量
盈利动量 = 当季ROE同比变化 - 上季ROE同比变化
正值 = 盈利加速(超配信号)
负值 = 盈利减速(减配信号)
综合动量排名
综合得分 = 0.4 × 价格动量排名 + 0.3 × 盈利动量排名 + 0.3 × 资金流排名
取 Top 5 行业超配,Bottom 5 行业低配

产业链上下游传导

典型传导链条
上游(原材料)→ 中游(制造加工)→ 下游(消费/应用)

示例1: 锂电产业链
  碳酸锂(上游)→ 正极材料(中游)→ 电池(中游)→ 新能源车(下游)
  传导:锂价↑ → 正极成本↑ → 电池价格↑ → 车企毛利率↓

示例2: 半导体产业链
  设备/材料(上游)→ 晶圆制造(中游)→ 封测(中游)→ 消费电子(下游)
  传导:手机需求↑ → 封测订单↑ → 晶圆产能紧 → 设备资本开支↑

示例3: 地产产业链
  土地/融资(上游)→ 开发建设(中游)→ 销售/物业(下游)
  传导:政策宽松 → 销售回暖(下游先) → 新开工↑(中游) → 拿地↑(上游)
传导规律
规律说明投资含义
需求驱动自下而上下游需求 → 中游订单 → 上游原材料需求拐点看下游先动
成本传导自上而下上游涨价 → 中游成本 → 下游提价上游涨价利好上游,利空中游
库存周期传导主动补库→被动补库→主动去库→被动去库被动去库是买入点
领先滞后上游领先中游1-2季度,中游领先下游1-2季度提前布局下一环节

行业比较框架

估值比较
指标用途注意事项
PE(TTM)盈利估值周期股PE失真(低PE可能是顶)
PB资产估值银行/地产/周期股用PB更合理
PE历史分位估值位置看5年分位数
PEG成长估值<1为低估,>2为高估
股息率收益率高股息=防御配置
盈利比较
指标含义
ROE盈利能力
ROE变化盈利趋势
毛利率竞争格局
净利润增速成长性
现金流/净利润盈利质量
资金流比较
指标数据源信号
北向资金净流入沪深港通外资偏好,领先1-3个月
融资余额变化融资融券杠杆资金方向
ETF净申购基金数据机构配置方向
大宗交易交易所机构调仓信号

输出格式

markdown
## 行业轮动分析

### 景气度排名 Top 10
| 排名 | 行业 | 景气度 | 变化 | 核心逻辑 |
|------|------|--------|------|---------|
| 1 | 电子 | 85 | ↑+8 | AI算力需求爆发 |
| 2 | 汽车 | 80 | ↑+5 | 出口+新能源双轮驱动 |
| ... | ... | ... | ... | ... |

### 行业配置建议
| 配置 | 行业 | 权重建议 | 核心逻辑 |
|------|------|---------|---------|
| 超配 | 电子、汽车、通信 | 各10-15% | 景气上行+政策催化 |
| 标配 | 食品饮料、医药 | 各5-8% | 防御属性,估值合理 |
| 低配 | 地产、建材 | 各0-3% | 景气下行,政策效果待观察 |

### 产业链机会
- **AI产业链**: 算力(上游)→模型(中游)→应用(下游),当前上游最确定
- **新能源车**: 碳酸锂价格见底,电池环节盈利修复预期

### 风险提示
- ...

注意事项

  1. 周期股估值陷阱:低PE可能是盈利顶点(如2021年煤炭PE仅5x但是顶部),用PB更安全
  2. 政策变量权重大:A股行业轮动受政策驱动明显(集采、碳中和、AI),政策拐点>基本面拐点
  3. 主题投资干扰:短期主题炒作(如AI概念)会扭曲行业动量信号,注意区分主题 vs 景气
  4. 数据滞后:财报数据滞后1-2个月,高频数据(PMI/开工率/价格)更及时
  5. 行业ETF替代:建议用行业ETF代码而非个股实现行业配置,降低个股风险
  6. 轮动频率:行业轮动不宜太频繁,月度/季度调仓为宜

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in agent/src/skills/sector-rotation of HKUDS/Vibe-Trading.

Open the folder on GitHubat commit b1f6ce7

Compare with similar skills

Sector Rotation Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sector Rotation Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sector Rotation Analysis this skillHKUDS/Vibe-Trading35k—~965Automated safety check: PassMIT
AI-Trader Market IntelHKUDS/AI-Trader23k—~1.1kAutomated safety check: PassNone
Stock Deep Analysis Workflowwbh604/UZI-Skill7.1k—~9.1kAutomated safety check: NotesMIT
Zhengxi Fund Manager Views Librarylyra81604/zhengxi-views1.8k—~1.6kAutomated safety check: PassMIT
Supply Chain Bottleneck Hunterxbtlin/ai-berkshire17k—~2.6kAutomated safety check: PassMIT
Deep Company Article Seriesxbtlin/ai-berkshire17k—~2kAutomated safety check: PassMIT

Similar skills

  • AI-Trader Market Intel

    HKUDS/AI-Trader

    Reads AI-Trader's read-only market snapshots, grouped financial news and events board through its market-intel endpoints, for context before trading or posting.

    23k GitHub stars~1.1k tokensUpdated 4 mo ago
    Business, Finance & HRAuto-check passed
  • Runs a staged deep analysis of a single stock on China A-share, Hong Kong and US markets, ending in an HTML report with valuation models and investor-panel scores.

    7.1k GitHub stars~9.1k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check: notes
  • Zhengxi Fund Manager Views Library

    lyra81604/zhengxi-views

    Answers questions with sourced quotes from one Chinese fund manager's public writings, applies his stated investment method and compares his words with real fund holdings.

    1.8k GitHub stars~1.6k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed
  • Scans a long-running industry trend for supply chain chokepoints, aiming to find second- and third-layer suppliers that the market has not yet priced in.

    17k GitHub stars~2.6k tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed
  • Deep Company Article Series

    xbtlin/ai-berkshire

    Plans and writes a three-to-eight-part long-form article series that breaks down one company, built on fact-checked financials, valuation and management analysis.

    17k GitHub stars~2k tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed
  • Longbridge Earnings

    helsome/folio

    Earnings analysis — pre- and post-earnings. An agent skill from helsome/folio.

    271 GitHub starsUsed in 1 repo~2.5k tokens
    Business, Finance & HRAuto-check passed

More from HKUDS/Vibe-Trading

All 89 skills in this repo
  • Eastmoney Market Data

    HKUDS/Vibe-Trading

    Index of Eastmoney's free, no-token market data interfaces for China A-shares and Hong Kong stocks: fund flows, dragon-tiger lists, margin trading, reports and news.

    35k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • OKX Market Data

    HKUDS/Vibe-Trading

    Retrieves public OKX cryptocurrency market data such as spot prices, candlesticks, funding rates and open interest through the OKX V5 REST API, with no authentication.

    35k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • SEC EDGAR Filings Fetcher

    HKUDS/Vibe-Trading

    Fetches U.S. SEC EDGAR data: resolves tickers to CIK numbers, lists recent 10-K, 10-Q and 8-K filings with document URLs, and pulls XBRL financial series.

    35k GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • A-Share ST Risk Screener

    HKUDS/Vibe-Trading

    Predicts whether a mainland China A-share company risks an ST or *ST warning after its next annual report, using financial thresholds and Sina penalty records.

    35k GitHub stars~4.9k tokensUpdated yesterday
    Auto-check passed
  • Breaks a structural trend such as AI infrastructure into its physical supply chain and ranks lesser-known listed companies sitting on each bottleneck.

    35k GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • Plans and drafts an eight-part, roughly 120k-word investigative series on one company, built around a strict fact-check pass rather than fast drafting.

    35k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed

Questions about Sector Rotation Analysis

What does Sector Rotation Analysis do?

A-share sector rotation workflow in Chinese: scores Shenwan industries on prosperity, ranks momentum and compares valuation, earnings and fund flows. A Chinese-language framework for sector rotation in the mainland A-share market, built on the Shenwan classification of 31 first-level industries, grouped as upstream cyclicals, midstream manufacturing, downstream consumer, technology and media, financials and utilities. It labels industries as strongly cyclical, weakly cyclical, growth or financial and names the drivers that matter for each type.

When should I use Sector Rotation Analysis?

Sector Rotation Analysis fits situations like: deciding which A-share industries to overweight or underweight; ranking Shenwan industries by momentum, earnings and capital flows; tracing how an upstream price move could reach midstream and downstream sectors; comparing sector valuations without falling for low P/E ratios in cyclical stocks.

How do I install Sector Rotation Analysis in Claude Code?

Run `npx skills add HKUDS/Vibe-Trading --skill sector-rotation -a claude-code`. Or copy the skill folder (agent/src/skills/sector-rotation in HKUDS/Vibe-Trading) into .claude/skills/sector-rotation in your project. Claude Code loads it when a task matches its description.

How do I install Sector Rotation Analysis in Codex?

Run `npx skills add HKUDS/Vibe-Trading --skill sector-rotation -a codex`. Or copy the skill folder (agent/src/skills/sector-rotation in HKUDS/Vibe-Trading) into .agents/skills/sector-rotation in your project. Codex loads it when a task matches its description.

Can I use Sector Rotation Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/Vibe-Trading --skill sector-rotation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sector-rotation, .gemini/skills/sector-rotation, .github/skills/sector-rotation and .opencode/skills/sector-rotation in your project.

What does Sector Rotation Analysis need to run?

SKILL.md names no scripts, command-line tools or credentials: Sector Rotation Analysis is instructions for the agent only.

Does Sector Rotation Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Sector Rotation Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sector Rotation Analysis use?

Sector Rotation Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sector Rotation Analysis use?

About 965 tokens (SKILL.md is roughly 3.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Sector Rotation Analysis?

Skills that share tags, products or a category with Sector Rotation Analysis: AI-Trader Market Intel (HKUDS/AI-Trader, 23k stars), Stock Deep Analysis Workflow (wbh604/UZI-Skill, 7.1k stars), Zhengxi Fund Manager Views Library (lyra81604/zhengxi-views, 1.8k stars) and Supply Chain Bottleneck Hunter (xbtlin/ai-berkshire, 17k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sector Rotation Analysis?

HKUDS (a GitHub organization) maintains it in HKUDS/Vibe-Trading, which has 35,097 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 9, 2026.

Source: HKUDS/Vibe-Trading on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.