longbridge-sector-monitor
Prompt-only analysis skill. Tracks sector rotation over 6–12 months by locating the current economic cycle phase and mapping it to historically favoured sectors. Provides ongoing allocation recommendations rather than a point-in-time snapshot.
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
When to use
- "当前经济周期在哪个阶段", "where are we in the economic cycle", "當前經濟週期在哪個階段"
- "行业配置建议", "sector allocation recommendation", "行業配置建議"
- "现在应该超配哪些行业", "which sectors to overweight now"
- "防御性板块 vs 顺周期板块", "defensive vs cyclical sectors"
- "行业轮动跟踪", "sector rotation tracking over 6 months"
For a quick point-in-time sector strength ranking use longbridge-sector-rotation. For single-stock capital flow use longbridge-capital-flow.
Economic cycle framework
| Phase |
阶段 |
Key macro signals |
Favoured sectors |
| Recovery / 复苏 |
GDP turning up, unemployment falling, rates low |
Consumer discretionary, Financials, Real estate |
|
| Overheating / 过热 |
GDP above trend, inflation rising, rates rising |
Energy, Materials, Industrials |
|
| Stagflation / 滞涨 |
Growth slowing, inflation still high |
Healthcare, Consumer staples, Utilities |
|
| Recession / 衰退 |
GDP contracting, unemployment rising |
Utilities, Consumer staples, Government bonds proxy |
|
CLI
Run longbridge <subcommand> --help to verify exact flags before use:
# Index constituents to identify sector universe
longbridge constituent <INDEX> --format json
# 120-day kline for sector ETFs / indices (trend tracking)
longbridge kline <SECTOR_ETF> --period day --count 120 --format json
# Capital flow for individual sector symbols
longbridge capital <SYMBOL> --flow --format json
# If unsure about flags:
longbridge constituent --help
longbridge kline --help
longbridge capital --help
Workflow
- Clarify scope — market (A-share / HK / US) and horizon (6-month / 12-month). Default: A-share, 6-month.
- Select sector proxies:
- A-share: 申万一级行业指数 (e.g.
801750.SH IT, 801780.SH Financials, 801730.SH Utilities)
- US: SPDR ETFs (
XLK.US, XLF.US, XLE.US, XLV.US, XLY.US, XLP.US, XLU.US, XLB.US)
- HK: HSI sector sub-indices or representative ETFs
- Fetch 120-day kline for each sector proxy:
longbridge kline <SECTOR> --period day --count 120 --format json
- Compute trend metrics in-LLM:
- 20d, 60d, 120d returns for each sector
- Trend direction: 20d MA vs 60d MA (above = uptrend)
- Fetch capital flow for top and bottom 3 sectors by 60d return:
longbridge capital <SECTOR> --flow --format json
- Locate economic cycle phase using trend patterns and macro context provided by the user (or inferred from sector behaviour):
- Broad market trend + sector leadership pattern → infer phase
- Map to allocation recommendation: overweight sectors favoured in current phase; underweight laggards.
- Output monitoring report; cite Longbridge Securities; end with disclaimer.
Output
Sector Monitor Report — Source: Longbridge Securities
Market: {market} | Horizon: {6M / 12M} | Date: {date}
[Economic cycle positioning]
Current phase estimate: {Recovery / Overheating / Stagflation / Recession}
Basis: {trend patterns, sector leadership, user-provided macro context}
[Sector trend table (120-day window)]
Sector | 20d Ret | 60d Ret | 120d Ret | Trend | Capital Flow
──────────────────|---------|---------|----------|----------|--------------
{Sector A} | +X% | +Y% | +Z% | Uptrend | Net inflow
{Sector B} | ...
...
[Allocation recommendation]
Overweight: {Sector 1}, {Sector 2} — favoured in {phase} phase
Neutral: {Sector 3}, {Sector 4}
Underweight: {Sector 5}, {Sector 6} — typically lag in {phase} phase
[Cycle transition watch]
Next likely phase: {phase} | Trigger signals to watch: {signals}
⚠️ 以上分析仅供参考,不构成投资建议。/ 以上分析僅供參考,不構成投資建議。/ For reference only. Not investment advice.
Error handling
| Situation |
简体中文回复 |
繁體中文 / English |
command not found: longbridge |
回退到 MCP;如 MCP 也不可用,请安装 longbridge-terminal。 |
回退到 MCP;如也不可用,請安裝 longbridge-terminal。/ Fall back to MCP; if also unavailable, install longbridge-terminal. |
stderr not logged in |
请运行 longbridge auth login 登录。 |
請執行 longbridge auth login。/ Run longbridge auth login. |
| kline returns < 60 bars |
趋势分析退化为可用历史,注明数据长度不足。 |
趨勢分析退化為可用歷史,注明數據長度不足。/ Degrade to available history length; note limitation. |
| Other stderr |
直接显示原始错误,不静默重试。 |
顯示原始錯誤。/ Surface verbatim — do not retry silently. |
MCP fallback
If longbridge CLI is not installed, use MCP tools:
When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime — do not rely on hardcoded tool names.
MCP setup: claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp (quote scope).
Related skills
- Point-in-time sector strength snapshot →
longbridge-sector-rotation
- Single-stock capital flow →
longbridge-capital-flow
- Index constituents →
longbridge-constituent
- Market temperature & trading session →
longbridge-market-temp
File layout
longbridge-sector-monitor/
└── SKILL.md # prompt-only, no scripts/
1---2name: longbridge-sector-monitor3description: Sector rotation continuous monitoring via Longbridge — 6–12 month trend tracking across economic cycles (recovery / overheating / stagflation / recession), identifies leading sectors per cycle phase (recovery→consumer discretionary/financials, overheating→energy/materials, stagflation→healthcare/staples, recession→utilities/bonds), and outputs sector allocation recommendations. Differs from longbridge-sector-rotation which gives a point-in-time snapshot. Triggers: "行业监控", "板块监控", "行业跟踪", "经济周期", "顺周期", "逆周期", "行业配置", "周期行业", "防御行业", "行业仓位", "行業監控", "板塊監控", "行業追蹤", "經濟週期", "順週期", "逆週期", "行業配置", "週期行業", "防禦行業", "sector monitor", "sector tracking", "economic cycle", "defensive sector", "cyclical sector", "sector allocation", "late cycle", "early cycle", "sector positioning".4license: MIT5---6
7# longbridge-sector-monitor
8
9Prompt-only analysis skill. Tracks sector rotation over 6–12 months by locating the current economic cycle phase and mapping it to historically favoured sectors. Provides ongoing allocation recommendations rather than a point-in-time snapshot.
10
11> **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English.
12
13## When to use
14
15- *"当前经济周期在哪个阶段"*, *"where are we in the economic cycle"*, *"當前經濟週期在哪個階段"*
16- *"行业配置建议"*, *"sector allocation recommendation"*, *"行業配置建議"*
17- *"现在应该超配哪些行业"*, *"which sectors to overweight now"*
18- *"防御性板块 vs 顺周期板块"*, *"defensive vs cyclical sectors"*
19- *"行业轮动跟踪"*, *"sector rotation tracking over 6 months"*
20
21For a quick point-in-time sector strength ranking use `longbridge-sector-rotation`. For single-stock capital flow use `longbridge-capital-flow`.
22
23## Economic cycle framework
24
25| Phase | 阶段 | Key macro signals | Favoured sectors |
26|---|---|---|---|
27| Recovery / 复苏 | GDP turning up, unemployment falling, rates low | Consumer discretionary, Financials, Real estate |
28| Overheating / 过热 | GDP above trend, inflation rising, rates rising | Energy, Materials, Industrials |
29| Stagflation / 滞涨 | Growth slowing, inflation still high | Healthcare, Consumer staples, Utilities |
30| Recession / 衰退 | GDP contracting, unemployment rising | Utilities, Consumer staples, Government bonds proxy |
31
32## CLI
33
34Run `longbridge <subcommand> --help` to verify exact flags before use:
35
36```bash
37# Index constituents to identify sector universe
38longbridge constituent <INDEX> --format json
39
40# 120-day kline for sector ETFs / indices (trend tracking)
41longbridge kline <SECTOR_ETF> --period day --count 120 --format json
42
43# Capital flow for individual sector symbols
44longbridge capital <SYMBOL> --flow --format json
45
46# If unsure about flags:
47longbridge constituent --help
48longbridge kline --help
49longbridge capital --help
50```
51
52## Workflow
53
541. **Clarify scope** — market (A-share / HK / US) and horizon (6-month / 12-month). Default: A-share, 6-month.
552. **Select sector proxies**:
56 - A-share: 申万一级行业指数 (e.g. `801750.SH` IT, `801780.SH` Financials, `801730.SH` Utilities)
57 - US: SPDR ETFs (`XLK.US`, `XLF.US`, `XLE.US`, `XLV.US`, `XLY.US`, `XLP.US`, `XLU.US`, `XLB.US`)
58 - HK: HSI sector sub-indices or representative ETFs
593. **Fetch 120-day kline** for each sector proxy:
60 ```bash
61 longbridge kline <SECTOR> --period day --count 120 --format json
62 ```
634. **Compute trend metrics** in-LLM:
64 - 20d, 60d, 120d returns for each sector
65 - Trend direction: 20d MA vs 60d MA (above = uptrend)
665. **Fetch capital flow** for top and bottom 3 sectors by 60d return:
67 ```bash
68 longbridge capital <SECTOR> --flow --format json
69 ```
706. **Locate economic cycle phase** using trend patterns and macro context provided by the user (or inferred from sector behaviour):
71 - Broad market trend + sector leadership pattern → infer phase
727. **Map to allocation recommendation**: overweight sectors favoured in current phase; underweight laggards.
738. **Output monitoring report**; cite **Longbridge Securities**; end with disclaimer.
74
75## Output
76
77```
78Sector Monitor Report — Source: Longbridge Securities
79Market: {market} | Horizon: {6M / 12M} | Date: {date}
80
81[Economic cycle positioning]
82Current phase estimate: {Recovery / Overheating / Stagflation / Recession}
83Basis: {trend patterns, sector leadership, user-provided macro context}
84
85[Sector trend table (120-day window)]
86Sector | 20d Ret | 60d Ret | 120d Ret | Trend | Capital Flow
87──────────────────|---------|---------|----------|----------|--------------
88{Sector A} | +X% | +Y% | +Z% | Uptrend | Net inflow
89{Sector B} | ...
90...
91
92[Allocation recommendation]
93Overweight: {Sector 1}, {Sector 2} — favoured in {phase} phase
94Neutral: {Sector 3}, {Sector 4}
95Underweight: {Sector 5}, {Sector 6} — typically lag in {phase} phase
96
97[Cycle transition watch]
98Next likely phase: {phase} | Trigger signals to watch: {signals}
99
100⚠️ 以上分析仅供参考,不构成投资建议。/ 以上分析僅供參考,不構成投資建議。/ For reference only. Not investment advice.
101```
102
103## Error handling
104
105| Situation | 简体中文回复 | 繁體中文 / English |
106|---|---|---|
107| `command not found: longbridge` | 回退到 MCP;如 MCP 也不可用,请安装 longbridge-terminal。 | 回退到 MCP;如也不可用,請安裝 longbridge-terminal。/ Fall back to MCP; if also unavailable, install longbridge-terminal. |
108| stderr `not logged in` | 请运行 `longbridge auth login` 登录。 | 請執行 `longbridge auth login`。/ Run `longbridge auth login`. |
109| kline returns < 60 bars | 趋势分析退化为可用历史,注明数据长度不足。 | 趨勢分析退化為可用歷史,注明數據長度不足。/ Degrade to available history length; note limitation. |
110| Other stderr | 直接显示原始错误,不静默重试。 | 顯示原始錯誤。/ Surface verbatim — do not retry silently. |
111
112## MCP fallback
113
114If `longbridge` CLI is not installed, use MCP tools:
115
116When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime — do not rely on hardcoded tool names.
117
118MCP setup: `claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp` (`quote` scope).
119
120## Related skills
121
122- Point-in-time sector strength snapshot → `longbridge-sector-rotation`
123- Single-stock capital flow → `longbridge-capital-flow`
124- Index constituents → `longbridge-constituent`
125- Market temperature & trading session → `longbridge-market-temp`
126
127## File layout
128
129```
130longbridge-sector-monitor/
131└── SKILL.md # prompt-only, no scripts/
132```