longbridge skills logo

longbridge skills

0

skills plugin for Cursor

100 skills

longbridge-adr-premium

|

# longbridge-adr-premium Cross-market premium / discount analysis for companies dual- or triple-listed as ADR (US), H-share (HK), and/or A-share (CN). > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking about: - ADR vs H-share premium / discount — *"BABA ADR 溢价"*, *"百度 ADR 和港股哪个便宜"* - Three-market comparison — *"BABA.US / 9988.HK / 阿里A股 比价"* - Theoretical arbitrage spread and constraints — *"ADR 套利空间"*, *"ADR arbitrage"* - Dual-listing pricing discrepancy — *"dual-listed premium"*, *"跨市场套利"* For pure A/H premium time series defer to `longbridge-ah-premium`. ## Workflow 1. Identify all available listing venues for the company (ADR ticker, HK code, A-share code). 2. Fetch real-time quotes for each venue. 3. Fetch USD/HKD and USD/CNY exchange rates. 4. Convert all prices to a common currency (USD) using the ADR ratio where applicable. 5. Calculate premium / discount between each pair: `(Price_A − Price_B) / Price_B × 100%`. 6. Assess arbitrage constraints: FX repatriation rules, stamp duty, liquidity depth, settlement lag. 7. Output a comparison table and narrative. > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## CLI ```bash # Quotes for each listing venue longbridge quote <ADR_SYMBOL> --format json longbridge quote <HK_SYMBOL> --format json longbridge quote <A_SYMBOL> --format json # omit if no A-share listing # Exchange rates for currency conversion longbridge exchange-rate --format json ``` Common examples: | Company | ADR | H-share | A-share | |---------|-----|---------|---------| | Alibaba | BABA.US | 9988.HK | — | | Baidu | BIDU.US | 9888.HK | — | | JD.com | JD.US | 9618.HK | — | | NIO | NIO.US | 9866.HK | — | ## Output Present a summary table then a narrative: ``` Symbol Price (local) Price (USD) vs ADR ────────────────────────────────────────────────── BABA.US $82.50 $82.50 baseline 9988.HK HK$638.00 $81.79 −0.9% ``` Then explain: - Which venue is cheapest / most expensive and why. - Arbitrage constraints (FX controls, transaction costs, liquidity). - Whether the spread is actionable or structural. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | Symbol not found | 未找到该代码,请确认上市交易所和代码格式。 | 找不到該代碼,請確認上市交易所和代碼格式。 | Symbol not found — please verify the exchange and ticker format. | | No ADR listing | 该公司没有美股 ADR,只能比较 H 股和 A 股。 | 該公司沒有美股 ADR,只能比較 H 股和 A 股。 | No US ADR found — comparing H-share vs A-share only. | | Exchange rate unavailable | 汇率数据暂时不可用,无法换算成同一货币。 | 匯率數據暫時不可用,無法換算成同一貨幣。 | Exchange rate unavailable — cannot convert to a common currency. | | `command not found: longbridge` | 请先安装 longbridge-terminal,或通过 MCP 连接。 | 請先安裝 longbridge-terminal,或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | | `not logged in` | 请运行 `longbridge auth login` 完成登录。 | 請執行 `longbridge auth login` 完成登入。 | Run `longbridge auth login` to authenticate. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-ah-premium` — A/H premium time series and intraday curve - `longbridge-peer-comparison` — side-by-side valuation across 2–5 symbols - `longbridge-fx` — FX spot rates ## File layout ``` skills/longbridge-adr-premium/ └── SKILL.md ```

longbridge-ah-premium

|

# longbridge-ah-premium A/H premium ratio for dual-listed Mainland-Chinese companies — historical kline or today's intraday curve. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user asks about the **price gap** between an HK listing and its A-share twin: - *"工行 A/H 溢价"*, *"工行 AH 比价"* → `1398.HK` - *"建行 AH 折价"* → `939.HK` - *"中国平安港股比 A 股贵多少"* → `2318.HK` - *"AH premium for ICBC over the last year"* → `1398.HK --kline-type day --count 250` - *"今天 939 的 AH 溢价走势"* → `intraday 939.HK` For single-symbol quote, use `longbridge-quote`. For comparison of unrelated tickers, use `longbridge-peer-comparison`. ## Symbol format Always pass the **HK side** (`<CODE>.HK`) of the dual-listed pair. The Longbridge API maps internally to the A-share counterpart. Common pairs: | Company | HK | A-share | |---|---|---| | 工商银行 / ICBC | `1398.HK` | `601398.SH` | | 建设银行 / CCB | `939.HK` | `601939.SH` | | 中国平安 / Ping An | `2318.HK` | `601318.SH` | | 招商银行 / CMB | `3968.HK` | `600036.SH` | | 中国人寿 / China Life | `2628.HK` | `601628.SH` | If the user gives an A-share symbol, translate to the HK side. If the stock is not dual-listed (e.g. `700.HK`), the API returns no data — report that, don't retry. ## Subcommands > Run `longbridge ah-premium --help` (and `longbridge ah-premium intraday --help`) if unsure of current flags. | CLI command | Returns | |---|---| | `longbridge ah-premium <SYMBOL> [--kline-type T] [--count N] --format json` | Historical premium ratio kline | | `longbridge ah-premium intraday <SYMBOL> --format json` | Today's intraday premium time series | `--kline-type`: `1m` / `5m` / `15m` / `30m` / `60m` / `day` (default) / `week` / `month` / `year`. `--count` defaults to 100. ## Workflow 1. Identify the dual-listed pair; pass the **HK** symbol. 2. Decide mode: - "近一年 / last year走势" → kline `--kline-type day --count 250` - "近一月 / past month" → kline `--kline-type day --count 22` - "今天 / 当日 / intraday" → `intraday` subcommand 3. Run the command, render the time series (table or summary: latest premium %, range, trend). 4. Cite source as **Longbridge Securities** / **数据来源:长桥证券** / **數據來源:長橋證券**. ## CLI examples ```bash # Default daily kline (100 days) longbridge ah-premium 939.HK --format json # Last year of daily premium longbridge ah-premium 1398.HK --kline-type day --count 250 --format json # Last 12 weeks longbridge ah-premium 2318.HK --kline-type week --count 12 --format json # Today's intraday premium curve longbridge ah-premium intraday 939.HK --format json ``` ## Output Each row carries a timestamp and a premium ratio (typically expressed as `(H_price * fx) / A_price - 1`, in %). Negative = HK trades at a discount to A-share. Surface latest value + recent range. ## Error handling | Situation | LLM response | |---|---| | Shell `command not found: longbridge` | Fall back to MCP if configured; otherwise tell the user to install longbridge-terminal. | | Empty array | "No A/H premium data — `<SYMBOL>` is likely not dual-listed in A-shares." | | stderr `param_error` | Verify the symbol is an HK ticker of a dual-listed pair. | | Other stderr | Surface verbatim. | ## MCP fallback 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. ## Related skills | User asks | Route to | |---|---| | Single-symbol price / change | `longbridge-quote` | | HK or A-share candlestick history | `longbridge-kline` | | Cross-symbol comparison (>2 tickers) | `longbridge-peer-comparison` | | Why the premium changed (news / catalysts) | `longbridge-news` | ## File layout ``` longbridge-ah-premium/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-alert

|

# longbridge-alert ⚠️ **Mutating skill**: changes the user's price-alert state on Longbridge. No money is involved, but the change is persistent and will affect future push notifications. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger only on **clear imperatives** to manage price alerts: - *"提醒我 NVDA.US 涨到 200"* / *"在 200 美元提醒我"* - *"删除提醒 486469"* / *"關掉那個提醒"* - *"set an alert when TSLA hits 250"* Vague prompts (*"整理一下我的提醒"*, *"看看我的提醒怎么样"*) must be **refused with a clarifying question** — ask which symbol, which direction, which price, which alert id — never guess. For **read-only** listing of existing alerts, you may run `longbridge alert --format json` directly without the preview/confirm gate (listing changes nothing). Mutations always need the gate. ## Two-step protocol (mandatory) Every mutation must run as **two distinct turns**: 1. **Preview** — describe exactly what you are about to do (symbol, target price, direction `rise`/`fall`, alert id for delete/enable/disable), in the user's language. **Do not run the CLI yet.** 2. **Wait for explicit confirmation** containing "确认 / yes / 是的 / confirm". If the user replies anything ambiguous, ask again — do **not** assume consent. 3. **Execute** — only after step 2, run the actual `longbridge alert <subcommand> ...` command. > The Longbridge CLI's `delete` subcommand prints its own confirmation prompt — let it run; do not pipe `yes` or pass any flag that bypasses it. For `add` / `enable` / `disable`, this skill's preview-then-confirm protocol is the SKILL-layer gate. ## CLI subcommands `longbridge alert` carries one read mode (no subcommand) and four write subcommands. **Always run `longbridge alert <subcommand> --help` first if you are not 100% sure of the current flag spelling, defaults, or argument order** — this protects against version drift. | Action | CLI invocation (typical shape — verify with `--help` before use) | |---|---| | List all alerts | `longbridge alert --format json` | | List alerts for one symbol | `longbridge alert <SYMBOL> --format json` | | Add a price alert | `longbridge alert add <SYMBOL> --price <PRICE> --direction <rise\|fall> --format json` | | Delete an alert by id | `longbridge alert delete <ALERT_ID> --format json` | | Enable an alert | `longbridge alert enable <ALERT_ID> --format json` | | Disable an alert | `longbridge alert disable <ALERT_ID> --format json` | > The `delete` subcommand has a built-in confirmation prompt. Let it run interactively in your environment. If the user gives a **symbol** but no alert id for delete/enable/disable, first run `longbridge alert <SYMBOL> --format json` to look up the id, then quote the id back in your preview before asking for confirmation. ## Preview templates (LLM) > 即将{动作}:{plan 摘要}。是否确认执行? > > About to {action}: {plan summary}. Confirm? > > 即將{動作}:{plan 摘要}。是否確認執行? Examples: - *"即将设置 NVDA.US 在 200 美元时提醒,价格上穿触发。是否确认执行?"* - *"About to add a price alert on TSLA.US at 250 USD, triggered when price falls below. Confirm?"* - *"即將刪除提醒 486469(NVDA.US @ 200,上穿)。是否確認執行?"* - *"即将停用提醒 486469。是否确认?"* If the user did not specify a direction (rise vs fall), **ask** — do not default. If the user did not specify a price, ask. Never invent values. ## OAuth scope Price alerts are tied to the user's Longbridge account but do not place trades, so the **basic login scope** is sufficient — `longbridge auth login` without trade scope works. If the call returns `unauthorized`, tell the user to re-run `longbridge auth login` and complete the OAuth flow. ## Error handling | Situation | LLM response | |---|---| | Shell `command not found: longbridge` | Tell the user to install [longbridge-terminal](https://github.com/longportapp/longbridge-terminal); MCP fallback can apply (see below) but **only after user confirmation** — never use MCP to bypass the preview / confirm protocol. | | stderr contains `not logged in` / `unauthorized` | Tell the user to run `longbridge auth login`. | | Bad `<ALERT_ID>` (not found) | Re-run the list command (`longbridge alert --format json`) and re-check the id. | | `direction` flag rejected | Run `longbridge alert add --help` to confirm the current accepted values (typically `rise` / `fall`); surface the help excerpt to the user. | | Other stderr | Surface verbatim. **Do not silently retry** — if a mutating call failed, ask the user before any second attempt. | ## MCP fallback (only after confirmation) When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. > **Important**: the preview / confirm cycle still applies when going through MCP. MCP write tools have no built-in confirmation prompt; this SKILL is responsible for the gate. ## Related skills - `longbridge-quote` — look up the current price of a symbol before suggesting an alert level. - `longbridge-watchlist` / `longbridge-watchlist-admin` — manage the favourites list (alerts and watchlists are independent). - `longbridge-subscriptions` — diagnose real-time stream health (separate from alert push notifications). ## File layout ``` longbridge-alert/ └── SKILL.md # prompt-only, no scripts/ ``` Prompt-only — no `scripts/`. Discover the latest CLI flags via `longbridge alert <subcommand> --help`.

longbridge-analyst-estimates

|

# longbridge-analyst-estimates Prompt-only skill. Fetches the **historical EPS estimate time series** for a stock — each data point shows what analysts collectively expected at that moment in time (high / low / mean / median / count) plus the reported actual when available. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"TSLA 分析师预期一年来怎么变化的"*, *"TSLA analyst estimates over the past year"*, *"TSLA 分析師預期一年來怎麼變化"* - *"NVDA EPS 预期有没有被上调"*, *"has NVDA EPS estimate been revised up?"*, *"NVDA EPS 預期有沒有被上調"* - *"苹果最近分析师是在下调还是上调预期"*, *"are analysts cutting or raising AAPL estimates"* - *"700.HK 历史一致预期"*, *"700.HK consensus estimate history"* For the **current** consensus snapshot (not the history) → `longbridge-consensus`. For beat/miss analysis and PEAD signals → `longbridge-consensus` (which also calls `analyst-estimates`). For full fundamentals → `longbridge-fundamental`. ## CLI Run `longbridge analyst-estimates --help` to verify exact flags. Primary call: ```bash # Full estimate time series for a symbol longbridge analyst-estimates TSLA.US --format json longbridge analyst-estimates 700.HK --format json # Help — always verify flags before use longbridge analyst-estimates --help ``` If the user asks for a specific period type (annual / quarterly) or fiscal year, check `--help` for the relevant flag and pass it. If unsure, omit and use the default. ## Workflow 1. **Resolve symbol** to `<CODE>.<MARKET>` format. 2. **Run** `longbridge analyst-estimates <SYMBOL> --format json`. 3. **Parse** the returned array. Each element typically contains: | Field | Description | |---|---| | `day` | Data point date | | `high` | Highest analyst estimate | | `low` | Lowest analyst estimate | | `mean` | Consensus mean estimate | | `median` | Consensus median estimate | | `num` | Number of analysts contributing | | `currency` | Estimate currency | | `value` | Actual reported value (null if not yet reported) | 4. **Identify trend**: - Direction of `mean` over time: rising (upgrades) / flat / falling (downgrades). - Spread (`high − low`): narrowing = greater consensus; widening = diverging views. - `num` changes: cover expansion or contraction. - Where `value` is present: compute surprise `(value − mean) / |mean| × 100%`. 5. **Present** as a table + trend narrative; note the reporting currency. ## Output **TSLA.US — Analyst EPS estimate history** Source: Longbridge Securities ``` Date | High | Mean | Median | Low | Analysts | Actual | Surprise 2024-10-31 | 0.95 | 0.75 | 0.76 | 0.52 | 34 | 0.72 | −4.0% 2025-01-31 | 1.12 | 0.88 | 0.89 | 0.61 | 36 | — | — 2025-04-30 | 1.25 | 0.97 | 0.98 | 0.70 | 37 | — | — … ``` *Trend*: Mean EPS estimates have risen +29% over 6 months (0.75 → 0.97); analyst count expanded from 34 to 37 — consistent upgrade cycle. ⚠️ 分析师预测仅供参考,不构成投资建议。 ⚠️ 分析師預測僅供參考,不構成投資建議。 ⚠️ Analyst estimates are for reference only. Not investment advice. ## Error handling | Situation | 简体中文回复 | 繁體中文 / English | |---|---|---| | `command not found: longbridge` | 回退到 MCP;如也不可用,请安装 longbridge-terminal。 | 回退到 MCP;如也不可用,請安裝 longbridge-terminal。/ Fall back to MCP; if unavailable, install longbridge-terminal. | | Returns empty array | "{symbol} 暂无分析师预期历史数据。" | "{symbol} 暫無分析師預期歷史數據。" / "{symbol} has no analyst estimate history." | | `num` < 3 across all points | 覆盖分析师不足 3 位,预测可靠性较低,请谨慎参考。 | 覆蓋分析師不足 3 位,可靠性較低。/ Fewer than 3 analysts — estimates are indicative only. | | Other stderr | 直接显示原始错误,不静默重试。 | 顯示原始錯誤。/ Surface verbatim — do not retry silently. | ## MCP fallback If `longbridge` CLI is unavailable (`command not found`), 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 - Current consensus snapshot (not history) → `longbridge-consensus` - Beat/miss analysis and PEAD signals → `longbridge-consensus` - Full fundamentals (revenue / margins / ROE) → `longbridge-fundamental` - Valuation (PE / PB / industry rank) → `longbridge-valuation` ## File layout ``` longbridge-analyst-estimates/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-anomaly

|

# longbridge-anomaly Two complementary intraday lenses: market-wide unusual movements (`anomaly`) and a single stock's price-by-volume distribution (`trade-stats`). > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"今天港股有什么异动"*, *"US anomaly today"*, *"市场异动榜"* → `anomaly --market <MKT>` - *"TSLA 今天有没有异动"*, *"700.HK 异动"* → `anomaly --market <MKT> --symbol <SYMBOL>` - *"AAPL 今日筹码分布"*, *"成交密集区"*, *"price by volume"*, *"volume profile"* → `trade-stats <SYMBOL>` - *"X 拉升的位置在哪"*, *"成交都堆在哪个价位"* → `trade-stats` For tick-by-tick trade ribbon → `longbridge-depth` (`trades`). For intraday capital flow (large/medium/small orders) → `longbridge-capital-flow`. For market-level mood → `longbridge-market-temp`. ## Subcommands > Run `longbridge anomaly --help` and `longbridge trade-stats --help` if unsure of current flags. The CLI's built-in help is the canonical source. | CLI command | Returns | |---|---| | `longbridge anomaly --market <HK\|US\|CN\|SG> --format json` | List of unusual movements in that market (default `HK`, `--count` up to 100, default 50). | | `longbridge anomaly --market <MKT> --symbol <SYMBOL> --format json` | Anomalies filtered to a specific symbol. | | `longbridge trade-stats <SYMBOL> --format json` | Intraday price-by-volume distribution for the symbol — bucketed price levels with the volume traded at each. | ## Workflow 1. Decide the lens: - **Market scan** → `anomaly --market`. Default to `HK` if the user does not specify. - **Single-symbol scan** → `anomaly --market <MKT> --symbol`. - **Volume profile** → `trade-stats <SYMBOL>`. 2. Resolve symbol → `<CODE>.<MARKET>` and infer market for `--market`. 3. Call the CLI; render a structured summary (see Output). 4. Cite **Longbridge Securities** and the data timestamp. ## CLI ```bash # Market-wide anomaly board longbridge anomaly --market HK --format json longbridge anomaly --market US --count 100 --format json # Single-symbol anomaly longbridge anomaly --market US --symbol TSLA.US --format json # Price-by-volume distribution longbridge trade-stats 700.HK --format json longbridge trade-stats AAPL.US --format json ``` If `--help` shows newer flags, follow the help output rather than hard-coding here. ## Output Render in the user's language. **`anomaly`** — table grouped by anomaly type (e.g. *spike up / spike down / volume surge / 60-day high / 60-day low*): time / symbol / name / type / price / change %. For a market scan, sort within each group by time (most recent first) or by magnitude. **`trade-stats`** — price-bucket distribution. Suggested layout: ``` {Symbol} ({code}) intraday price-by-volume — Source: Longbridge Securities Total volume: V | Total turnover: T | VWAP: P Top 5 volume buckets (where the volume sat): - price [a–b]: vol X (Y% of day) ▇▇▇▇▇ - ... Day high / low: H / L Most-traded zone: [a–b] (this is the heaviest range, not "support / resistance") ``` Do **not** call any range "support" or "resistance" — that is interpretive. Stick to *"heaviest-traded zone"*. State the timestamp. When a result is empty (no anomalies, or no volume data yet), state so explicitly. ## Error handling | Situation | Reply | |---|---| | Shell `command not found: longbridge` | Fall back to MCP if configured; otherwise tell the user to install longbridge-terminal. | | stderr `not logged in` / `unauthorized` | Hint `longbridge auth login`. | | Empty `anomaly` list | *"No anomalies detected for this market/symbol right now."* | | `trade-stats` empty (pre-market / new listing) | *"No intraday volume data yet — try after the session opens."* | | Symbol mapping fails | Ask for `<CODE>.<MARKET>`. | | Other stderr | Relay verbatim — never silently retry. | ## MCP fallback When the CLI binary is missing, fall back via the equivalent MCP tool. Tool names typically mirror CLI subcommand names (snake_case). 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. If a name above does not resolve, fall back via the equivalent MCP tool when CLI is missing. ## Related skills | Skill | Why | |---|---| | `longbridge-quote` | Live price + change behind the anomaly. | | `longbridge-capital-flow` | Whose money drove the move (large / medium / small orders). | | `longbridge-depth` | Tick-by-tick trades and orderbook microstructure. | | `longbridge-news` | News / filings that could explain the spike. | | `longbridge-catalyst-radar` | Watchlist-scoped briefings that aggregate anomalies. | ## File layout ``` longbridge-anomaly/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-ark-analysis

|

# longbridge-ark-analysis Prompt-only ARK-inspired diagnostic for a single ticker. Runs a suitability gate (must be a disruptive-innovation name), then builds TAM, a Wright's-Law cost-curve note, and a three-scenario 5-year target price. Closes with a mandatory data-source appendix whose final row is a one-line reconciliation summary. > **Response language**: detect the user's input language (Simplified Chinese / Traditional Chinese / English) and render the **entire report — every section heading, label, scenario write-up, narrative, education block, appendix row, reconciliation summary, and disclaimer — in that one language**. Do not mix languages within a single output. The output template in `references/output.md` is shown in English for reference; translate it as a whole into the user's language using the label-translation lookup in that file. The error / source tables inside *this* SKILL.md remain 3-column because they document what the skill says under each language — that 3-column form is for the skill's reference docs, not for the user-facing report. > **Independence statement (mandatory)**: this skill is an independent implementation inspired by ARK Invest's publicly described methodology. It is **not affiliated with, endorsed by, or representative of ARK Invest or Cathie Wood's actual views or positions**. The independence statement must appear in the disclaimer of every output. ## When to use - *"用木头姐的方法分析 TSLA"* / *"用木頭姐的方法分析 TSLA"* / *"analyze TSLA with the ARK framework"* - *"ARK 怎么看 NVDA"* / *"ARK 怎麼看 NVDA"* / *"how does ARK see NVDA"* - *"PLTR 的颠覆式创新逻辑成立吗"* / *"PLTR 的顛覆式創新邏輯成立嗎"* / *"is PLTR a real disruptive-innovation story"* - *"帮我算一下 TSLA 5 年的 bull base bear 目标价"* / *"算一下 TSLA 5 年的 bull base bear 目標價"* / *"build a 5-year bull/base/bear target on TSLA"* - *"AMZN 属于 ARK 的哪个平台"* / *"AMZN 屬於 ARK 的哪個平台"* / *"which ARK platform is AMZN in"* - *"建行用 ARK 怎么看"* / *"建行用 ARK 怎麼看"* / *"would the ARK framework work on CCB"* (→ reject + recommend alternative) For Buffett-style moat analysis → `longbridge-buffett-moat-analyzer`. For Graham cigar-butt → `longbridge-graham-stock-analysis`. For pure DCF → `longbridge-dcf`. For peer benchmarking → `longbridge-peer-comparison`. ## Cognitive frame (do not skip) ARK's reference is **5-year ownership of disruptive-innovation companies**, with three-scenario thinking around a TAM × market-share × margin × multiple terminal value, discounted back. Two things every output must surface: 1. **Suitability is a gate, not a soft preference.** If the company is not in one of ARK's five innovation platforms (**Artificial Intelligence · Robotics & Autonomous Mobility · Energy Storage & EV Adoption · Multiomic Sequencing & AI Drug Discovery · Public Blockchains & Digital Assets** — see `references/scoring.md` §Suitability for the value-chain decomposition into upstream / core / downstream / adjacent tiers, and the convergence themes), **reject** and recommend an alternative method — do not produce a "for reference" ARK report on a bank, oil major, or consumer staple. A company qualifies if its revenue depends materially on **any tier** of a platform (upstream / core / downstream / adjacent) — not only on being the platform's headline name. 2. **5-year predictions are wide ranges, not point estimates.** TAM and market share are deeply uncertain. The output always shows three scenarios (Bull / Base / Bear) with explicit assumptions; never collapse them to a single confident number, and never present the weighted target price as a forecast — call it a model-derived expectation. Two failure modes the user must be able to distinguish: - **"Right platform, wrong company"** → platform fit strong but innovation revenue < 20% or no quantified management vision → ❌ reject; recommend a method that fits the actual revenue mix. - **"Right company, framework limit"** → fits the platform but pre-revenue / no comparable history → ❌ reject (data-basis insufficient); recommend an early-stage framework. ## Workflow 1. **Resolve symbol** to `<CODE>.<MARKET>` (e.g. `TSLA.US`, `00700.HK`, `300750.SZ`). 2. **Sector triage**: - Traditional industry (bank / insurance / oil / real estate / staples / utilities not in energy-transition) → halt with reject reason **A — Traditional industry** (see `references/scoring.md` §Reject reasons). - Being-disrupted incumbent (e.g. ICE auto, fossil-fuel major, legacy media against streaming) → halt with reason **B — Being disrupted**. - Pre-revenue / listed < 2 fiscal years / no meaningful revenue history → halt with reason **C — Data basis insufficient**. - Mature tech with disruption already priced in (e.g. mature consumer electronics supply chain) → halt with reason **D — Disruption premium already realised**. 3. **Fetch raw data via Longbridge CLI first** (parallel where possible). See [§CLI](#cli). If `longbridge` is missing, fall back to MCP (see [§MCP fallback](#mcp-fallback)). Use WebSearch **only** for items genuinely outside Longbridge — TAM figures, Wright's-Law learning rates, qualitative management innovation signals, industry-runway evidence. 4. **Reconciliation gate** (勾稽校验) — runs **before** suitability scoring or any analysis. See [§Reconciliation](#reconciliation-勾稽校验). Two-state outcome: - **Pass (every check within tolerance)** → proceed. A one-line summary of the result still appears at the end of the data-source appendix. - **Fail (any check exceeds tolerance)** → halt all downstream analysis, emit a halt message naming the failing check and gap, still print the data-source appendix and the reconciliation summary describing the failure. 5. **Suitability scoring** — score 4 dimensions on 强/中/弱; apply the pass/reject matrix in `references/scoring.md` §Suitability. If reject, emit the reject layout (see `references/output.md` §Reject case) with an alternative-method recommendation matched from `references/scoring.md` §Alternative-method matching. **Do not** produce a "for reference" ARK analysis on a rejected name. 6. **TAM** — three tiers (low / base / high), each tagged with a source priority (权威机构 > 公司自披露 > 学术/智库 > ARK 公开报告 > 估算). Estimation-only TAM must be explicitly labelled `估算`. See `references/scoring.md` §TAM rules. 7. **Wright's-Law note** — pick the technology learning rate from the table in `references/scoring.md` §Wright's Law and refresh it via WebSearch against the cited authority (BloombergNEF / IRENA / NHGRI / Epoch AI / ARK). Never use the embedded historical figure as the current value without verification. 8. **Three-scenario 5-year target** — Bull / Base / Bear with explicit (TAM, market share, net margin, terminal multiple) for each; weights 25 / 50 / 25 by default; discount rate 15% over 5 years; report each scenario price plus weighted expectation and upside/downside vs current price. See `references/scoring.md` §Scenario. 9. **Risks, action-frame, key observation node** — three concrete risks, condition-based action sentences (no buy/sell command), one explicit next observation event/date. 10. **Output** the report from `references/output.md` — summary line → suitability → TAM → cost curve → 3 scenarios → risks → action frame → **Data Source Appendix (mandatory)** ending with the reconciliation summary line. Close with the ARK disclaimer variant matching the user's input language (single-language only — see `references/output.md` §Disclaimer variants). ## CLI Run `longbridge <subcommand> --help` to verify exact flags before each call — do not hard-code flag names without verification. Primary calls (run in parallel): ```bash # Balance sheet — equity, debt, working capital (for reconciliation only; ARK analysis is forward-looking) longbridge financial-report <SYMBOL> --kind BS --report af --format json # last 3–5 annual longbridge financial-report <SYMBOL> --kind BS --report qf --format json # last 4 quarterly # Income statement — revenue, segment mix, gross/operating margin, R&D longbridge financial-report <SYMBOL> --kind IS --report af --format json longbridge financial-report <SYMBOL> --kind IS --report qf --format json # Cash flow — CFO, capex, FCF; for reconciliation and capital-intensity context longbridge financial-report <SYMBOL> --kind CF --report af --format json longbridge financial-report <SYMBOL> --kind CF --report qf --format json # Snapshot: current price, PE, PB, shares outstanding, market cap longbridge quote <SYMBOL> --format json longbridge calc-index <SYMBOL> --format json # Long-window history (used for sanity-checking current vs historical valuation, not as the primary anchor) longbridge kline <SYMBOL> --period day --count 2500 --format json # Company profile + classification (for platform-fit decision) longbridge basicinfo <SYMBOL> --format json longbridge company-profile <SYMBOL> --format json # Recent news + filings — for verifying management innovation vision claims longbridge news <SYMBOL> --format json longbridge sec-filings <SYMBOL> --format json # US; for HK use the appropriate filings endpoint per --help ``` ### WebSearch fallback — only for items not available from Longbridge ARK methodology depends heavily on third-party market-size and learning-rate data. WebSearch is **required** for TAM and Wright's-Law inputs; it must not be skipped to "save a step". | Missing data | WebSearch query pattern | Acceptable source authorities | |---|---|---| | Sector TAM (general tech) | `"<market name> market size 2030 Gartner"` `"<market name> TAM IDC"` | Gartner, IDC, Forrester, McKinsey Global Institute | | Clean-energy TAM | `"<segment> market size BloombergNEF"` `"<segment> 2030 IRENA"` | BloombergNEF, IRENA | | Battery learning rate | `"battery learning rate" BloombergNEF` | BloombergNEF EV Outlook (latest annual) | | Solar PV learning rate | `"solar PV learning rate" IRENA` | IRENA Renewable Power Generation Costs | | DNA sequencing cost trend | `"DNA sequencing cost" NHGRI` | NHGRI cost database (latest update) | | AI compute / inference cost | `"AI compute cost" learning rate "Epoch AI"` | Epoch AI, MLCommons, Stanford AI Index | | Autonomous-driving runway | `site:ark-invest.com "autonomous" "Big Ideas"` | ARK Big Ideas (yearly, free) | | Management innovation vision | `"<CEO>" innovation roadmap shareholder letter` | Annual report, earnings call, IR deck | | Regulatory / policy overhangs | `"<sector> regulation <region> 2025"` | Government agency, FT, Reuters, WSJ | Every WebSearch-sourced figure must be tagged `[Source: WebSearch — <publisher>, <report name>, <year>, <url>]` in the appendix; never silently mix it with Longbridge data, never invent a publisher to dress up an internal estimate. ## Reconciliation (勾稽校验) Before any suitability scoring, TAM construction, or target-price calculation, verify the fetched figures are internally consistent. Reconciliation is **user-visible in this skill** — a one-line summary always appears as the final row of the Data Source Appendix. If a check fails, all downstream analysis halts. | Check | Formula | Tolerance | |---|---|---| | IS↔BS link | Net income(t) ≈ Δ Retained earnings(BS, t) − dividends paid(CF, t) | ±3% | | IS↔CF link | Net income + D&A + impairments + ΔWC ≈ Operating CF | ±5% | | CF↔BS link | ΔCash from CF statement = Cash(t) − Cash(t−1) on BS | ±1% | | Revenue segment sum | Σ segment revenue ≈ total revenue | ±2% | | Innovation-revenue share | Innovation-related revenue / total revenue used in suitability matches the segment-mix breakdown | exact (must match what you display) | | R&D ratio | R&D expense / total revenue used in suitability matches the IS statement | exact | | BS — current assets sum | Cash + AR + Inventory + Other CA ≈ Total current assets | ±2% | | BS — liabilities sum | ST debt + LT debt + Other liabilities ≈ Total liabilities | ±2% | | Market cap | `calc-index` shares × current price ≈ market cap from `quote` | ±2% | | Period alignment | All statements from the same fiscal period (or the lag is named) | exact | | TAM source-tagging | Each TAM number has a source row in the appendix (机构 + 报告 + 年份, or `估算`) | exact | | Learning-rate source-tagging | Wright's-Law learning rate has a source row (BloombergNEF / IRENA / NHGRI / Epoch AI / ARK) | exact | Output rules for reconciliation: - **All pass within tolerance** → final appendix row uses the clean-pass variant from `references/output.md` §Reconciliation summary, rendered in the user's input language only. - **Some residuals within tolerance but material to displayed figures** → final appendix row lists each material residual on its own sub-line (which figure it affects). - **Any check fails > tolerance** → halt all analysis; emit the halt message defined in `references/output.md` §Reject case-reconciliation and still print the appendix with the reconciliation summary describing the failure. ## Output ARK-style diagnostic with 7 fixed sections (full template in `references/output.md`): 1. **Header + one-line conclusion** — platform attribution, weighted 5-year target, upside/downside vs current price, the one-line "core bet" sentence. 2. **Suitability check** — 4 dimensions (platform fit / innovation revenue / R&D intensity / management vision) each tagged 强 / 中 / 弱, with one-line evidence. 3. **TAM** — three tiers with source tags and a plain-language analogy. 4. **Wright's-Law cost curve** — technology domain, learning rate with cited authority, current cost position, plain-language interpretation. 5. **5-year target — three scenarios** — Bull / Base / Bear table with explicit (market share, net margin, terminal multiple), weighted expectation, current price, upside/downside. 6. **Main risks** — 3 concrete, named risks (not generic boilerplate). 7. **Action frame + key observation node** — condition-based sentences only ("if you believe X, then current price implies Y"); never a buy/sell directive. Plus one explicit next observation event/date. Followed by the **Data Source Appendix (mandatory)** — every figure in sections [1]–[7] traceable to a row with source, fetch time, period, and (for WebSearch rows) URL; **final row is the reconciliation summary line** (pass / within-tolerance residual list / or failure description). > ⚠️ 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。/ 以上內容僅供參考,不構成投資建議。投資決策請結合自身風險承受能力獨立判斷。/ For reference only. Not investment advice. Please make investment decisions independently based on your own risk tolerance. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;若不可用,请安装 longbridge-terminal。 | 回退到 MCP;若不可用,請安裝 longbridge-terminal。 | Fall back to MCP; if unavailable install longbridge-terminal. | | stderr `not logged in` / `unauthorized` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | | Sector = traditional / being-disrupted / pre-revenue / mature | 直接拒绝并按 `references/output.md` 给出原因 A/B/C/D 与替代方法推荐。 | 直接拒絕並按 `references/output.md` 給出原因 A/B/C/D 與替代方法推薦。 | Reject and emit reason A/B/C/D plus alternative-method recommendation per `references/output.md`. | | Reconciliation fails > tolerance | 明确披露失败项与差距,不输出任何评分或目标价;附录仍输出且勾稽汇总行注明失败。 | 明確披露失敗項與差距,不輸出任何評分或目標價;附錄仍輸出且勾稽匯總行註明失敗。 | Disclose failing check and gap; do not emit any scoring or target price; appendix still printed and reconciliation summary marks the failure. | | TAM authority WebSearch returns nothing | 标注「TAM 暂无可引用的权威数据,以下为基于行业逻辑的估算区间」,附录该行写 `估算` 而非伪造机构。 | 標註「TAM 暫無可引用的權威數據,以下為基於行業邏輯的估算區間」,附錄該行寫 `估算` 而非偽造機構。 | Tag "TAM has no citable authoritative figure; the band shown is a logic-based estimate"; appendix row uses `估算` (estimated), never a fabricated publisher. | | Learning-rate authority WebSearch returns nothing | 标注「学习率暂无公开权威数据」;不得直接使用本 Skill 中嵌入的历史数字。 | 標註「學習率暫無公開權威數據」;不得直接使用本 Skill 中嵌入的歷史數字。 | Tag "no publicly available authoritative learning rate"; do not silently use the embedded historical figure as current. | | Suitability < pass threshold | 拒绝并匹配替代方法,不得给出「仅供参考」的 ARK 分析。 | 拒絕並匹配替代方法,不得給出「僅供參考」的 ARK 分析。 | Reject and match an alternative method; do not produce a "for reference" ARK analysis. | | User horizon < 3 years stated | 提示 ARK 框架是 5 年视角,与短期需求不匹配。 | 提示 ARK 框架是 5 年視角,與短期需求不匹配。 | Warn that the ARK framework is a 5-year lens and does not fit a < 3-year horizon. | | Other stderr | 原样透传错误,不静默重试。 | 原樣透傳錯誤,不靜默重試。 | Surface stderr verbatim; never silently retry. | ## MCP fallback If `longbridge` CLI is not installed, use MCP tools (`claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp`, `quote` scope): | MCP tool | CLI equivalent | |---|---| | `mcp__longbridge__financial_report` | `longbridge financial-report` | | `mcp__longbridge__calc_indexes` | `longbridge calc-index` | | `mcp__longbridge__quote` | `longbridge quote` | | `mcp__longbridge__kline` | `longbridge kline` | | `mcp__longbridge__basicinfo` | `longbridge basicinfo` | | `mcp__longbridge__news` | `longbridge news` | | `mcp__longbridge__sec_filings` | `longbridge sec-filings` | ## Related skills - Buffett moat single-stock view → `longbridge-buffett-moat-analyzer` - Graham cigar-butt single-stock view → `longbridge-graham-stock-analysis` - DCF intrinsic value → `longbridge-dcf` - Three-statement reading → `longbridge-financial-report` - Peer benchmarking → `longbridge-peer-comparison` - Industry runway / sector view → `longbridge-industry-overview` - Method selection guide → `longbridge-valuation-methodology` - Small-cap growth → `longbridge-smallcap-growth` ## File layout ``` longbridge-ark-analysis/ ├── SKILL.md └── references/ ├── scoring.md # suitability rubric + reject reasons + alt-method matching + TAM rules + Wright's-Law table + scenario formula └── output.md # full report template + label-translation lookup + reconciliation summary variants + ARK disclaimer ```

longbridge-asset-allocation

|

# longbridge-asset-allocation Prompt-only analysis skill. Explains major asset-allocation frameworks (MPT efficient frontier, Black-Litterman, risk parity, all-weather) and, when the user is logged in, applies them to their actual Longbridge portfolio data. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我做资产配置分析"* / *"資產配置分析"* / *"help me with asset allocation"* - *"什么是有效前沿"* / *"有效前沿"* / *"explain the efficient frontier"* - *"Black-Litterman 模型怎么用"* / *"Black-Litterman model"* - *"风险平价策略"* / *"風險平價策略"* / *"risk parity strategy"* - *"全天候策略怎么配置"* / *"全天候策略"* / *"all-weather portfolio allocation"* - *"帮我优化组合配置"* / *"optimize my portfolio allocation"* ## Workflow 1. **Framework selection**: identify which allocation approach the user wants (MPT / Black-Litterman / risk parity / all-weather / practical advice). 2. **Account data** (if logged in): fetch current positions and 252-day price history for each holding. 3. **Explain the framework** with the user's actual holdings as context. 4. **Generate suggested target weights** based on the chosen framework. 5. Present the allocation with rationale. ## CLI Run `longbridge <subcommand> --help` to verify exact flags before calling. ```bash # Current holdings (if user is logged in) longbridge portfolio --format json longbridge positions --format json # 252-day daily price history for each holding (run concurrently; ~1 year for covariance) longbridge kline <SYMBOL> --period day --count 252 --format json # Optional: valuation context longbridge calc-index <SYMBOL> --format json ``` ## Framework Reference ### MPT (Modern Portfolio Theory) - Compute expected return (historical mean daily return × 252) and covariance matrix from 252-day returns. - Find minimum-variance portfolio and tangency portfolio (max Sharpe). - Caution: MPT is sensitive to input estimation error; treat outputs as directional, not prescriptive. ### Black-Litterman - Start from market-cap equilibrium weights (CAPM implied returns). - Blend user's views (e.g. "I expect TSLA to outperform by 5%") via Bayesian update. - Output: posterior expected returns + revised weights. - Explain conceptually; provide numeric illustration when user supplies explicit views. ### Risk Parity - Allocate so each asset contributes equally to total portfolio volatility. - Approximate weight ∝ 1 / volatility (simplified). For full risk parity use covariance. - Result: typically overweights low-volatility assets (bonds, gold) vs equities. ### All-Weather (Bridgewater style) - 4 economic quadrants: growth up/down × inflation up/down. - Suggested weight guidance: 30% equities, 40% long bonds, 15% intermediate bonds, 7.5% gold, 7.5% commodities. - Map user's holdings to quadrant exposure; identify gaps. ## Output template ``` Asset Allocation Analysis — Source: Longbridge Securities Framework: <MPT / Black-Litterman / Risk Parity / All-Weather / Practical> Date: <today> [Current Portfolio] Asset Weight Expected Return Volatility (ann.) <symbol> <N>% <N>% <N>% ... [Suggested Allocation — <Framework>] Asset Target Weight Rationale <symbol> <N>% <reason> ... [Key Metrics] - Portfolio expected return (ann.): N% - Portfolio volatility (ann.): N% - Sharpe ratio (rf=4%): N [Caveats] - Historical returns do not guarantee future results. - Covariance estimates are noisy over short windows. - <framework-specific caveats> ⚠️ 仅供参考,不构成投资建议。/ 僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;若也不可用,请安装 longbridge-terminal | 回退到 MCP;若也不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal. | | stderr `not logged in` | 未登录时将使用用户指定的标的做示例分析 | 未登入時將使用用戶指定的標的做示例分析 | Not logged in — will analyse user-specified symbols instead. | | Price history < 60 days | 数据不足,降级为简单波动率估算 | 數據不足,降級為簡單波動率估算 | Insufficient history; degrade to simple volatility estimate. | | No positions and no symbols given | 请提供要分析的标的或登录账户 | 請提供要分析的標的或登入賬戶 | Please provide symbols to analyse or log in to your account. | ## 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; `trade_read` for account data). ## Related skills - Rebalance to a new target → `longbridge-portfolio-rebalance` - Portfolio health-check → `longbridge-portfolio-diagnosis` - Risk metrics (VaR, drawdown) → `longbridge-risk-analysis` ## File layout ``` longbridge-asset-allocation/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-basicinfo

|

# longbridge-basicinfo Static basic information for Longbridge-tradable securities across all categories — stocks, ETFs, options, warrants. Returns name, listing date, exchange, industry, share structure, market cap, IPO price, website, and address. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user asks about: - Company name / exchange / listing date — *"茅台是什么时候上市的"*, *"AAPL 在哪个交易所"* - Share structure (total shares, circulating shares, free float) — *"NVDA 总股本多少"* - IPO price / founding info — *"700.HK 上市价格是多少"* - Official website or company address — *"Apple 官网"*, *"腾讯公司地址"* - Industry classification — *"特斯拉属于什么行业"* For live price / volume, defer to `longbridge-quote`. For executives / board / major shareholders, defer to `longbridge-corporate`. ## Workflow 1. Normalise the symbol to `<CODE>.<MARKET>` format (see symbol table below). 2. Run `longbridge static` to get share structure and listing metadata. 3. Run `longbridge company` to get company profile (name, website, address, founding date, employees). 4. Optionally run `longbridge calc-index` for market-cap derived from real-time data. 5. Merge results by `symbol` and present as a structured summary. ## Symbol format | Pattern | Market | Example | |---|---|---| | Uppercase ticker | `.US` | `AAPL.US`, `NVDA.US` | | 4-digit numeric | `.HK` | `700.HK`, `9988.HK` | | 6-digit starts `60` | `.SH` | `600519.SH` | | 6-digit starts `00`/`30` | `.SZ` | `300750.SZ` | | Singapore | `.SG` | `D05.SG` | ## CLI ```bash # Static share structure and listing info longbridge static <SYMBOL> --format json # Company profile (name, address, website, employees) longbridge company <SYMBOL> --format json # Market cap and valuation indices longbridge calc-index <SYMBOL> --index total_market_value --format json ``` > If unsure of exact flag names, run `longbridge static --help`, `longbridge company --help`, or `longbridge calc-index --help` first — the CLI self-documents all arguments. ## Output Merge the three JSON responses by `symbol` and present key fields: | Field | 简体 | 繁體 | English | |---|---|---|---| | Company name | 公司名称 | 公司名稱 | Company name | | Exchange | 交易所 | 交易所 | Exchange | | Listing date | 上市日期 | 上市日期 | Listing date | | Industry | 行业 | 行業 | Industry | | Total shares | 总股本 | 總股本 | Total shares | | Circulating shares | 流通股 | 流通股 | Circulating shares | | IPO price | IPO价格 | IPO價格 | IPO price | | Market cap | 总市值 | 總市值 | Market cap | | Website | 官网 | 官網 | Website | | Address | 地址 | 地址 | Address | ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请先安装 longbridge-terminal | 請先安裝 longbridge-terminal | Please install longbridge-terminal first | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Please run `longbridge auth login` | | `invalid symbol` / `param_error` | 请确认标的代码格式 `CODE.MARKET` | 請確認標的代碼格式 | Please verify symbol format `CODE.MARKET` | | Other stderr | 原样展示错误信息,不重试 | 原樣展示錯誤,不重試 | Surface verbatim, do not retry | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills | User asks | Route to | |---|---| | Live price / volume | `longbridge-quote` | | Executives / board / major shareholders | `longbridge-corporate` | | Share structure + top-10 shareholders | `longbridge-ownership` | | Fundamentals / financials | `longbridge-fundamental` | | Candlestick / price history | `longbridge-kline` | ## File layout ``` longbridge-basicinfo/ └── SKILL.md ``` Prompt-only — no `scripts/`. Discover current CLI flags via `longbridge <subcommand> --help`.

longbridge-behavioral-finance

|

# longbridge-behavioral-finance Apply behavioral finance theory to identify exploitable market inefficiencies — map common cognitive biases to measurable price/volume patterns using Longbridge data. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"这只股票是不是过度反应了"*, *"did the market overreact to this news"*, *"這隻股票是否過度反應"* - *"动量效应还是反转效应"*, *"momentum or reversal for this sector"* - *"处置效应怎么影响散户行为"*, *"how does disposition effect affect retail traders"* - *"现在市场有没有羊群效应"*, *"is there herding in the market right now"* - *"锚定效应怎么影响股价"*, *"how does anchoring bias affect stock prices"* For quantitative factor testing (IC/IR), use `longbridge-factor-research`. For market temperature index, use `longbridge-market-temp`. ## Bias catalogue and tradeable signals ### 1. Overreaction (过度反应) **Theory**: Investors overweight recent bad/good news, pushing prices beyond fundamental value. De Bondt & Thaler (1985). **Signal**: Long-term reversal. Stocks down 30–50% over 12M outperform over the next 12M; top performers underperform. **Detect**: ```bash longbridge kline <SYMBOL> --period day --count 252 --format json ``` Compare 12M return vs peer group. If a stock is in the bottom 10% of sector returns, screen for reversal setup. ### 2. Underreaction (反应不足) **Theory**: Investors are slow to update beliefs; price drifts gradually toward fair value after earnings surprises. **Signal**: Post-earnings announcement drift (PEAD). Buy after positive earnings surprise; price continues rising for 1–3 months. **Detect**: Use `longbridge-earnings` to identify beats. Track price drift with `longbridge kline --period day --count 60`. ### 3. Disposition Effect (处置效应) **Theory**: Investors sell winners too early and hold losers too long (Shefrin & Statman, 1985). **Market impact**: Selling pressure on recent winners creates resistance near recent highs; support near cost basis concentrations. **Detect**: High capital inflows after a price surge = retail profit-taking. ```bash longbridge capital <SYMBOL> --format json ``` ### 4. Anchoring Bias (锚定效应) **Theory**: Investors anchor to arbitrary reference prices (52-week high, IPO price, round numbers). **Signal**: 52-week high breakout tends to persist (stocks resist breaking prior highs but accelerate once broken). **Detect**: Fetch 52-week high from `longbridge calc-index <SYMBOL> --format json` or static data. ### 5. Herding (羊群效应) **Theory**: Investors follow the crowd, amplifying trends beyond fundamentals. **Signal**: Abnormal volume + price acceleration without fundamental catalyst = herding. Also: analyst consensus clustering. **Detect**: ```bash longbridge market-temp --format json # Market sentiment index 0-100 longbridge capital <SYMBOL> --format json # Capital flow concentration ``` If market temperature > 80 and a single sector dominates capital inflow → herding warning. ### 6. Overconfidence (过度自信) **Theory**: Investors overestimate precision of their forecasts, leading to under-diversification and excess trading. **Market impact**: High turnover in bull markets; individual stocks show higher volatility than fundamentals justify. **Detect**: Turnover rate spike from `longbridge quote <SYMBOL> --format json` (turnover_rate field). ## Workflow 1. Identify which bias the user is asking about (or scan all six). 2. Fetch relevant data (kline / market-temp / capital flow). 3. Map observed price/volume pattern to the bias. 4. Quantify signal strength: magnitude, duration, persistence. 5. Suggest a trading implication (entry / exit / avoid) with explicit caveats. ## CLI ```bash longbridge kline --help longbridge market-temp --help longbridge capital --help longbridge market-temp --format json longbridge kline <SYMBOL> --period day --count 60 --format json longbridge capital <SYMBOL> --format json ``` ## Output Present: 1. Identified bias and academic basis. 2. Observable evidence from Longbridge data (specific numbers). 3. Tradeable implication (signal direction, horizon, conviction). 4. Risks: when the bias does not persist (e.g. mean-reversion fails in trending markets). 5. Disclaimer: behavioral signals are probabilistic, not deterministic. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请安装 longbridge-terminal 或检查 MCP 配置。 | 請安裝 longbridge-terminal 或檢查 MCP 配置。 | Install longbridge-terminal or check MCP config. | | stderr: `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | | Insufficient price history | 历史数据不足,无法可靠识别偏差信号,请延长观察期。 | 歷史數據不足,請延長觀察期。 | Insufficient history to identify bias reliably; extend the lookback. | ## Related skills - `longbridge-market-temp` — market sentiment temperature index - `longbridge-capital-flow` — intraday capital flow and large/small order split - `longbridge-factor-research` — quantitative factor IC/IR analysis - `longbridge-anomaly` — unusual price/volume movements ## File layout ``` skills/longbridge-behavioral-finance/ └── SKILL.md ```

longbridge-buffett-moat-analyzer

|

# longbridge-buffett-moat-analyzer Prompt-only Buffett-style moat diagnostic. Given a single ticker, produces a five-dimension verdict — moat / financial health / management / valuation / long-term visibility — closed with a Buffett-voice narrative, an explicit holding-period expectation, and a mandatory data-source appendix whose final row is a one-line reconciliation summary. > **Response language**: detect the user's input language (Simplified Chinese / Traditional Chinese / English) and render the **entire report — every section heading, label, dimension write-up, Buffett-voice narrative, user-education block, appendix row, reconciliation summary, and disclaimer — in that one language**. Do not mix languages within a single output. The output template in `references/output.md` is shown in English for reference; translate it as a whole into the user's language using the label-translation lookup in that file. The error / data-source tables inside *this* SKILL.md remain 3-column because they document what the skill says under each language — that 3-column form is for the skill's reference docs, not for the user-facing report. ## When to use - *"巴菲特会买茅台吗"* / *"巴菲特會買茅台嗎"* / *"would Buffett buy Moutai"* - *"帮我用巴菲特的方法诊断 700.HK"* / *"幫我用巴菲特的方法診斷 700.HK"* / *"diagnose 700.HK Buffett-style"* - *"AAPL 有护城河吗"* / *"AAPL 有護城河嗎"* / *"does AAPL have a moat"* - *"这只股票是不是好生意"* / *"這隻股票是不是好生意"* / *"is this a good business"* - *"NVDA 的护城河宽不宽"* / *"NVDA 的護城河寬不寬"* / *"how wide is NVDA's moat"* - *"我持有比亚迪 6 个月了,长期值得拿吗"* / *"我持有比亞迪 6 個月了,長期值得拿嗎"* / *"I've held BYD 6 months, worth holding long-term"* For Graham-style net-net cigar-butt analysis, use `longbridge-graham-stock-analysis`. For pure DCF intrinsic value, use `longbridge-dcf`. For three-statement reading, use `longbridge-financial-report`. For comparable peers, use `longbridge-peer-comparison`. ## Cognitive frame (do not skip) Buffett strategy is **long-term ownership of high-quality businesses**, not market timing. Two things every output must surface alongside the score: 1. **Holding-period expectation** — Buffett's reference is "ideally forever, at minimum 3 years." If the user has a < 3-year capital horizon, warn explicitly that this framework is not the right lens. 2. **Price vs business quality** — *"A great business at a fair price is far better than a fair business at a great price."* The valuation dimension is a margin-of-safety check on a separately-scored quality verdict; never collapse quality and price into one number. Two failure modes the user must be able to distinguish: - **"Great business, wait for price"** → moat wide, financials clean, but valuation rich → 🟡 watchlist with a target-price band, not a buy. - **"Cheap but no moat"** → low PE/PB but moat narrow or absent → ❌ not a Buffett candidate; redirect to Graham (`longbridge-graham-stock-analysis`). ## Workflow 1. **Resolve symbol** to `<CODE>.<MARKET>` (e.g. `00700.HK`, `AAPL.US`, `600519.SH`). 2. **Sector triage**: - Bank / insurance / brokerage → moat framework still applies but tweak financial-health dimension (use ROA, NIM, NPL, capital adequacy in place of FCF/leverage). Note this in the report. - Pre-revenue / heavy-loss / lifecycle-stage-zero biotech → halt: Buffett framework needs a track record; suggest the user use `longbridge-fundamental` for an early-stage view instead. - ST / 退市风险 / listed < 3 years → emit report but tag earnings-stability and capital-allocation dimensions as "insufficient history" and pro-rate scores. 3. **Fetch raw data via Longbridge CLI first** (parallel where possible). See [§CLI](#cli). If `longbridge` is missing, fall back to MCP (see [§MCP fallback](#mcp-fallback)). Use WebSearch **only** for items genuinely outside Longbridge (industry outlook, qualitative management signals, brand surveys, regulatory news). 4. **Reconciliation gate** (勾稽校验) — runs **before** any scoring. See [§Reconciliation](#reconciliation-勾稽校验). Two-state outcome: - **Pass (every check within tolerance)** → proceed to scoring. A one-line summary of the result still appears at the end of the data-source appendix. - **Fail (any check exceeds tolerance)** → halt scoring, emit a halt message naming the failing check and gap, still print the data-source appendix and reconciliation summary. 5. **Five-dimension scoring** — each dimension gets a 1–5 star rating with concrete evidence. See `references/scoring.md` for the rubric per dimension. 6. **Holding-period mapping** — derive expected minimum hold from moat width (★★★★★ → 5y+, ★★★★ → 3–5y, ★★★ → 1–3y, ★★ or below → not a Buffett candidate). See `references/scoring.md` §Holding-period. 7. **Output** the report defined in `references/output.md` — diagnostic card → 5-dimension detail → Buffett-voice narrative → user education block → **Data Source Appendix (mandatory)** ending with the reconciliation summary line. Close with the disclaimer variant matching the user's input language (single-language only — see `references/output.md` §Disclaimer variants). ## CLI Run `longbridge <subcommand> --help` to verify exact flags before each call — do not hard-code flag names without verification. Primary calls (run in parallel): ```bash # Balance sheet — leverage, equity (PB / ROE denominator), debt longbridge financial-report <SYMBOL> --kind BS --report af --format json # last 5 annual (10y ideal — fetch as many as available) longbridge financial-report <SYMBOL> --kind BS --report qf --format json # last 4 quarterly # Income statement — ROE, gross margin, earnings stability, EPS trend longbridge financial-report <SYMBOL> --kind IS --report af --format json longbridge financial-report <SYMBOL> --kind IS --report qf --format json # Cash flow — FCF = OCF − Capex, capex intensity, buyback / dividend cash outflow longbridge financial-report <SYMBOL> --kind CF --report af --format json longbridge financial-report <SYMBOL> --kind CF --report qf --format json # Snapshot: PE, PB, market cap, dividend yield, shares outstanding longbridge calc-index <SYMBOL> --format json longbridge quote <SYMBOL> --format json # Long-window history for valuation-vs-history band longbridge kline <SYMBOL> --period day --count 2500 --format json # ~10 years for PE/PB percentile # Dividend & buyback history (capital allocation track record) longbridge dividend <SYMBOL> --format json longbridge corporate <SYMBOL> --format json # buyback / split / spin-off # Ownership & insider activity (management alignment, capital allocation signals) longbridge ownership <SYMBOL> --format json longbridge insresearch <SYMBOL> --format json # Company profile + industry classification (for moat-type hypothesis) longbridge basicinfo <SYMBOL> --format json longbridge company-profile <SYMBOL> --format json # Peer set for moat / margin / ROE benchmarking longbridge peer-comparison <SYMBOL> --format json ``` ### WebSearch fallback — only for items not available from Longbridge | Missing data | WebSearch query pattern | |---|---| | Industry runway / disruption risk | `"<industry> 2025 outlook"`, `"<industry> disruption risk"` | | Brand / pricing-power signals | `"<company> price increase 2024 2025"`, `"<brand> brand value ranking"` | | Management qualitative track record | `"<CEO name> capital allocation"`, `"<CEO name> shareholder letter"` | | Regulatory / policy overhangs | `"<sector> regulation <region> 2025"` | | Latest insider transactions if `ownership` is stale | `"<ticker> insider selling 2025"` | Every WebSearch-sourced figure must be tagged `[Source: WebSearch — <publisher>, <date>, <url>]` in the appendix; never silently mix it with Longbridge data. ## Reconciliation (勾稽校验) Before any scoring, verify the fetched figures are internally consistent. Reconciliation is **user-visible in this skill** — a one-line summary always appears as the final row of the Data Source Appendix (per the design doc's transparency requirement). If a check fails, scoring halts entirely. | Check | Formula | Tolerance | |---|---|---| | IS↔BS link | Net income(t) ≈ Δ Retained earnings(BS, t) − dividends paid(CF, t) | ±3% | | IS↔CF link | Net income + D&A + impairments + ΔWC ≈ Operating CF | ±5% | | CF↔BS link | ΔCash from CF statement = Cash(t) − Cash(t−1) on BS | ±1% | | FCF sanity | Operating CF − Capex(CF) ≈ FCF used in valuation dimension | exact (must match what you display) | | BS — current assets sum | Cash + AR + Inventory + Other CA ≈ Total current assets | ±2% | | BS — liabilities sum | ST debt + LT debt + Other liabilities ≈ Total liabilities | ±2% | | ROE inputs | Net income / Avg shareholders' equity ≈ reported ROE (if disclosed) | ±1pp | | Market cap | `calc-index` shares × current price ≈ market cap from `quote` | ±2% | | Period alignment | All statements from the same fiscal period (or the lag is named) | exact | Output rules for reconciliation: - **All pass within tolerance** → final appendix row uses the clean-pass variant from `references/output.md` §Reconciliation summary, rendered in the user's input language only (English / 简体 / 繁體 — pick one). - **Some residuals within tolerance but material to displayed figures** → final appendix row lists each material residual on its own sub-line, e.g. `IS↔CF residual −2.1% (within ±5%) — affects FCF row of the valuation dimension`. - **Any check fails > tolerance** → halt scoring; emit the halt message defined in `references/output.md` and still print the appendix with the reconciliation summary describing the failure. ## Output Single-stock diagnostic with 7 fixed sections (full template in `references/output.md`): 1. **Diagnostic summary card** — star ratings on 5 dimensions, 综合评级 / Overall Rating: ★★★★★ — [强护城河/宽护城河/待观察/不符合标准 / Strong moat / Wide moat / Watch / Does not meet criteria], badge color (🟢🟡🟠🔴), suggested minimum holding period. 2. **Dimension 1 — Business model & moat** — moat type (brand / network / cost / switching / resource), width (wide / narrow / none), pricing-power evidence, 3–5 supporting points. 3. **Dimension 2 — Financial health** — ROE 10y track, FCF persistence, leverage, gross-margin trajectory, capex intensity. Each metric vs Buffett threshold with current value. 4. **Dimension 3 — Management & capital allocation** — insider holding & changes, buyback/dividend history, M&A track record, alignment signals. 5. **Dimension 4 — Valuation & margin of safety** — PE/PB vs 10y history percentile, PEG, simplified DCF concept value, safety-margin tier (充足 / 一般 / 偏贵 / 高估). 6. **Dimension 5 — Long-term visibility** — industry ceiling, disruption risk, regulatory exposure, global runway. 7. **Buffett-voice narrative + user education block** — first-person narrative in Buffett's register (concrete, plain-spoken, dryly humorous), then the **mandatory user education block** covering holding-period expectation, position-building rhythm, and the disclaimer variant matching the user's input language (one language only). Followed by the **Data Source Appendix (mandatory)** — every figure in sections [1]–[7] traceable to a row with source, fetch time, and period; **final row is the reconciliation summary line** (pass / within-tolerance residual list / or failure description). > ⚠️ 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。/ 以上內容僅供參考,不構成投資建議。投資決策請結合自身風險承受能力獨立判斷。/ For reference only. Not investment advice. Please make investment decisions independently based on your own risk tolerance. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;若不可用,请安装 longbridge-terminal。 | 回退到 MCP;若不可用,請安裝 longbridge-terminal。 | Fall back to MCP; if unavailable install longbridge-terminal. | | stderr `not logged in` / `unauthorized` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | | Sector = pre-revenue / loss-making early biotech | 巴菲特框架需要业绩纪录;建议改用 `longbridge-fundamental` 早期视角。 | 巴菲特框架需要業績紀錄;建議改用 `longbridge-fundamental` 早期視角。 | Buffett framework needs a track record; use `longbridge-fundamental` for an early-stage view. | | Reconciliation fails > tolerance | 明确披露失败项与差距,不输出评分;附录仍输出且勾稽汇总行注明失败。 | 明確披露失敗項與差距,不輸出評分;附錄仍輸出且勾稽匯總行註明失敗。 | Disclose failing check and gap; do not emit scores; appendix still printed and reconciliation summary marks the failure. | | Listed < 3 years | 盈利稳定性与资本配置维度按已披露年限按比例打分,并在附录注明。 | 盈利穩定性與資本配置維度按已披露年限比例打分,並於附錄註明。 | Pro-rate earnings-stability and capital-allocation scores; note in appendix. | | Other stderr | 原样透传错误,不静默重试。 | 原樣透傳錯誤,不靜默重試。 | Surface stderr verbatim; never silently retry. | | Industry/qualitative WebSearch returns nothing | 维度评分仅用财务证据,标注「定性数据缺失」。 | 維度評分僅用財務證據,標註「定性數據缺失」。 | Score the dimension on financial evidence only and tag "qualitative data unavailable". | ## MCP fallback If `longbridge` CLI is not installed, use MCP tools (`claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp`, `quote` scope): 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. ## Related skills - Graham cigar-butt single-stock view → `longbridge-graham-stock-analysis` - DCF intrinsic value → `longbridge-dcf` - Three-statement reading → `longbridge-financial-report` - Cross-statement deep analysis → `longbridge-financial-analysis` - Peer benchmarking → `longbridge-peer-comparison` - Industry runway / sector view → `longbridge-industry-overview` - Method selection guide → `longbridge-valuation-methodology` ## File layout ``` longbridge-buffett-moat-analyzer/ ├── SKILL.md └── references/ ├── scoring.md # five-dimension rubric + thresholds + holding-period mapping + verdict matrix └── output.md # full report template + Buffett-voice register + data-source appendix with reconciliation summary ```

longbridge-buffett-moat-stock-screener

|

# longbridge-buffett-moat-stock-screener Prompt-only Buffett-style screener. Given a market / sector / preference query (no specific ticker), applies Buffett's two-layer model — hard quantitative filter then qualitative moat scoring — and returns a ranked candidate list (3–5 cards) with moat-type tags, Buffett-attitude verdicts, and one-click jumps into `longbridge-buffett-moat-analyzer` for deep diagnostics. Every figure traces to a row in the mandatory **Data Source Appendix** at the end of the output. > **Response language**: detect the user's input language (Simplified Chinese / Traditional Chinese / English) and render the **entire report — every card, label, narrative paragraph, education block, appendix row, and disclaimer — in that one language**. Do not mix languages within a single output. The output template in `references/output.md` is shown in English for reference; translate it as a whole into the user's language using the label-translation lookup in that file. The error/source tables inside *this* SKILL.md remain 3-column because they document what the skill says under each language — that 3-column form is for the skill's reference docs, not for the user-facing report. ## When to use - *"帮我找几只巴菲特会买的股票"* / *"幫我找幾隻巴菲特會買的股票"* / *"find a few stocks Buffett would buy"* - *"消费股里巴菲特风格的有哪些"* / *"消費股裡巴菲特風格的有哪些"* / *"which consumer names are Buffett-style"* - *"我想找一只 10 年都不用动的股票"* / *"我想找一隻 10 年都不用動的股票"* / *"I want a 10-year-hold stock"* - *"有没有类似茅台这种定价权强的公司"* / *"有沒有類似茅台這種定價權強的公司"* / *"any companies like Moutai with strong pricing power"* - *"新能源里有没有符合巴菲特标准的"* / *"新能源裡有沒有符合巴菲特標準的"* / *"any new-energy names that meet Buffett's criteria"* - *"ROE 连续 10 年超过 20%、PE 低于 25 的 A 股"* / *"ROE 連續 10 年超過 20%、PE 低於 25 的 A 股"* / *"A-shares with 10y ROE > 20% and PE < 25"* - *"美股里巴菲特真实持仓过的股票"* / *"美股裡巴菲特真實持倉過的股票"* / *"US stocks Buffett has actually held"* For single-stock deep diagnostic on a name the user already picked, use `longbridge-buffett-moat-analyzer`. For Graham-style cigar-butt / NCAV screening, use `longbridge-graham-screener`. For broader low-PE / low-PB / high-ROE value (not moat-centric) use `longbridge-value-screen`. For high-dividend screens use `longbridge-dividend-screen`. ## Cognitive frame (do not skip) Screening is the **upstream entry** to the Buffett workflow: this skill generates candidates from zero; the downstream `longbridge-buffett-moat-analyzer` verifies a single name in depth. Both share the same moat lens — only the interaction shape differs. Two principles must surface alongside every leaderboard: 1. **Holding-period expectation** — Buffett's reference is "ideally forever, at minimum 3 years." If the user's capital horizon is < 3 years, warn that this framework is the wrong lens regardless of how clean the screen looks. 2. **Quality first, price second** — *"A great business at a fair price is far better than a fair business at a great price."* A passing row tells the user the **business** is Buffett-grade; whether *this price* is sane is a Dimension-4 (valuation) check that may downgrade the verdict to "watch and wait for a better price". Never collapse quality and price into one number. Failure modes the screener must flag honestly: - **"Great business, wait for price"** → quality passes but valuation 偏贵 / 高估 → 🟡 watchlist with target-price band, not a buy. - **"Cheap but no moat"** → low PE/PB but moat narrow or absent → not a Buffett candidate; redirect to `longbridge-graham-screener` / `longbridge-graham-stock-analysis`. - **Sector-disqualified industries** (e.g. airlines — Buffett publicly called the industry "value-destroying") → return an honest empty result with redirect to a closer-to-Buffett sector, not a forced top-N. ## Workflow 1. **Clarify the query** in at most one quick turn. Three input shapes are supported (see §3.2 of the design doc): - **Preference-based** (most common): "find me consumer stocks worth long-term holding". - **Sector / theme-based**: "Buffett-style names in new energy" / "Buffett's actual US holdings". - **Condition-based** (advanced): "A-shares with 10y ROE > 20% and PE < 25". If the user just says "recommend stocks" with no constraint, ask 1–2 framing questions (preferred market: A / HK / US? prefer steady — consumer/healthcare/financials — or growth — tech/new-energy?) before screening. 2. **Resolve the universe**: - Sector / theme query → start from the index or sector universe via `longbridge constituent <INDEX>` or `longbridge sector-screener` candidate list. - Preference / condition query without a stated market → default to the market the user most often references (A-share if Mandarin / Cantonese trader signal, US for English, HK if the user mentioned 港股). Echo the chosen universe back in the Market Summary. - Cap batch size at 300 names per screen. 3. **Sector triage** — before any filter: - **Excluded** (no scoring, drop with a one-line explanation in the Market Summary): airlines (Buffett: *"value-destroying"*), pre-revenue / pure-loss biotech (no track record), ST / 退市风险 names, listed < 5 years, pure-shell / negative-equity. If the user *explicitly* asked for one of these (e.g. "Buffett-style airline"), return an honest empty result with a redirect to the most-similar non-excluded sector (e.g. "consumer staples with pricing power" or "regulated utilities with stable returns"). - **Sector-adjusted hard filter**: banks / insurance / brokerage — replace FCF / leverage rules with ROA / NIM / NPL / CAR (note the substitution per row). - **Listed 5–10 years**: pro-rate the earnings-stability sub-score and flag "history-limited" in the row note. 4. **Fetch raw data via Longbridge CLI first** (parallel, ≤20 symbols per wave). See [§CLI](#cli). MCP fallback if `longbridge` is missing (see [§MCP fallback](#mcp-fallback)). **WebSearch only for items genuinely outside Longbridge**: industry outlook / disruption signals, brand-strength surveys, Buffett's own 13F holdings disclosure, qualitative management track record. Every WebSearch hit gets a publisher + URL + access-date row in the appendix. 5. **Layer 1 — Hard quantitative filter** (binary pass/fail). Symbols failing ≥ 2 filters drop out by default. See [§Filters](#filters) for the table; full thresholds in `references/criteria.md`. 6. **Per-row reconciliation gate**: if balance-sheet sum / current-assets sum / shares×price mismatches the reported total by >3%, drop the row from the leaderboard with a "数据异常" note in the data-anomaly footer. Do not silently smooth. 7. **Layer 2 — Qualitative moat scoring** on every name that passed Layer 1 plus reconciliation. Five-dimension weighted composite (0–100): - Moat type & width (35%) · Capital allocation (20%) · Earnings predictability (20%) · Valuation reasonableness (15%) · Long-term industry runway (10%). Full rubric in `references/criteria.md`. Each dimension also gets a 1–5 star rating shown on the candidate card. 8. **Verdict matrix** — combine Layer 2 quality stars (moat + financials) with valuation tier. See `references/criteria.md` §Verdict matrix. Maps to one of three card verdicts: - 🟢 **符合巴菲特选股标准 / Meets Buffett criteria** — wide moat + clean financials + price 充足/一般. - 🟡 **部分符合,关注估值变化 / Partially meets criteria** — wide moat + clean financials + price 偏贵. - 🔴 **当前不符合标准 / Does not meet criteria** — wide moat but price 高估, OR moat narrow at any price (redirect to Graham). 9. **Holding-period mapping** — derive expected min hold from moat width (★★★★★ → 5y+, ★★★★ → 3–5y, ★★★ → 1–3y, ★★ or below → not a Buffett candidate). See `references/criteria.md`. 10. **Rank and emit 3–5 candidate cards** (not a giant leaderboard — the design doc's deliberate cap). Follow the candidate-card template in `references/output.md`. 11. **Mandatory closing blocks** (every output, no exceptions): - Selection rationale (2–3 sentences on why these names, current market caveat, deep-dive priority). - Holding-period & user-education block (Buffett-style vs short-term expectations table — rendered in the user's language only). - **Data Source Appendix** — every figure on every card traceable; every WebSearch row carries publisher + URL + date. - Trilingual disclaimer from `references/output.md`. 12. **Deep-dive CTA** on every card, rendered in the user's input language only (e.g. *"Deep-dive → run `longbridge-buffett-moat-analyzer <CODE>`"* for English, *"深度诊断 → 运行 `longbridge-buffett-moat-analyzer <CODE>`"* for 简体, *"深度診斷 → 執行 `longbridge-buffett-moat-analyzer <CODE>`"* for 繁體). Pick one. ## CLI Run `longbridge <subcommand> --help` to verify exact flags before each call — the CLI is the source of truth; do not hard-code flag spellings from memory. ```bash # Universe longbridge constituent <INDEX> --format json # e.g. 000300.SH, HSI.HK, SPX.US # Per-symbol snapshot (run in parallel, batches of ≤20) longbridge calc-index <SYMBOL> --format json # PE / PB / market cap / ROE / dividend yield / sector tag longbridge quote <SYMBOL> --format json # current price + suspended flag longbridge basicinfo <SYMBOL> --format json # listing date / industry classification # Per-symbol fundamentals (run in parallel) longbridge financial-report <SYMBOL> --kind BS --report af --format json # 5–10y annual — leverage, equity, debt ratio longbridge financial-report <SYMBOL> --kind IS --report af --format json # 5–10y annual — ROE, gross margin, earnings stability longbridge financial-report <SYMBOL> --kind CF --report af --format json # 5–10y annual — FCF = OCF − Capex longbridge financial-report <SYMBOL> --kind BS --report qf --format json # last 4Q — recent trajectory longbridge financial-report <SYMBOL> --kind IS --report qf --format json longbridge financial-report <SYMBOL> --kind CF --report qf --format json # Long-window history for valuation-vs-history percentile (Layer 2 Dimension 4) longbridge kline <SYMBOL> --period day --count 2500 --format json # ~10 years # Dividend & buyback (capital allocation track record — Layer 2 Dimension 2) longbridge dividend <SYMBOL> --format json longbridge corporate <SYMBOL> --format json # buyback / split / spin-off # Ownership & insider flow (management alignment) longbridge ownership <SYMBOL> --format json longbridge insresearch <SYMBOL> --format json # Company profile (moat-type hypothesis seed) longbridge company-profile <SYMBOL> --format json # Peer set for moat / margin / ROE benchmarking longbridge peer-comparison <SYMBOL> --format json # Optional pre-narrowing if the user gave a sector / theme phrase longbridge sector-screener --industry "<industry>" --format json ``` ### WebSearch fallback — only for items not available from Longbridge | Missing data | WebSearch query pattern | |---|---| | Industry runway / disruption risk | `"<industry> 2025 outlook"`, `"<industry> disruption risk"` | | Brand / pricing-power signals | `"<company> price increase 2024 2025"`, `"<brand> brand value ranking"` | | Buffett's actual disclosed holdings (for "13F" / "Berkshire holdings" queries) | `"Berkshire Hathaway 13F <year>"`, `"Warren Buffett portfolio holdings <year>"` | | Management qualitative track record | `"<CEO name> capital allocation"`, `"<CEO name> shareholder letter"` | | Regulatory / policy overhangs | `"<sector> regulation <region> 2025"` | | Latest insider transactions if `ownership` is stale | `"<ticker> insider selling 2025"` | Every WebSearch-sourced figure must be tagged `[Source: WebSearch — <publisher>, <date>, <url>]` in the appendix; never silently mix it with Longbridge data. ## Filters User-overridable. Defaults from Buffett's publicly stated reference points. Threshold detail and the Layer-2 composite weights live in `references/criteria.md`. ### Layer 1 — Hard quantitative filter (pass / fail gate) | Filter | Buffett threshold | Source field | Sector adjustment | |---|---|---|---| | ROE (5y avg) | ≥ 15% | derived from `financial-report --kind IS` (NI) ÷ avg equity from BS | Banks: use ROA ≥ 1.0% + NIM stability | | Debt-to-asset ratio | ≤ 50% | BS — total liabilities ÷ total assets | Banks / insurance / brokers: substitute CAR / leverage-adjusted equity | | Free cash flow | positive every year for last 3 years | `financial-report --kind CF` (OCF − Capex) | Banks: substitute operating-cash-flow proxy from interest income | | Years listed | ≥ 5 years | `basicinfo.listing_date` | None — strict, pro-rate at 5–10y window | | Gross margin (TTM) | ≥ 30% | `financial-report --kind IS` (gross profit ÷ revenue) | Heavy industry / utilities: relax to ≥ 20% with note | Symbols that fail ≥ 2 filters drop out by default; user can relax to "fail ≤ 3" on request. Any override is echoed back in the Market Summary. ### Layer 2 — Qualitative moat scoring (weighted composite, 0–100) Applied only to Layer-1 passers. Five dimensions, weights below. Full sub-criteria, evidence rules, and star mapping in `references/criteria.md`. | Dimension | Weight | Plain-language framing | |---|---|---| | Moat type & width | 35% | Brand / network / cost / switching / regulatory / resource — wide / narrow / none | | Capital allocation | 20% | Dividend & buyback discipline, M&A track record, insider stake | | Earnings predictability | 20% | Earnings-volatility, cyclicality, revenue-mix stability | | Valuation reasonableness | 15% | PE / PB / dividend-yield percentile vs 10y history, simplified DCF concept band | | Long-term industry runway | 10% | Industry ceiling, disruption, regulatory exposure | Default rank key = Layer-2 composite (high to low). User can override to: moat-stars-only, ROE desc, valuation-tier (cheapest first), or "Berkshire holdings only". ## Special handling | Cohort | Treatment | |---|---| | Airlines | **Excluded** — Buffett publicly called the industry "value-destroying". If the user explicitly asked for "Buffett-style airline", return an honest empty result and redirect to the nearest non-excluded sector (e.g. regulated utilities, consumer staples) with one-line rationale. | | Pre-revenue / pure-loss biotech / hot-IPO concept names | **Excluded** — Buffett framework needs a track record. Redirect to `longbridge-fundamental` for an early-stage view. | | ST / 退市风险 / listed < 5 years | **Excluded from default top-N**; show on request with the row prepended ⚠️ and a "history-limited" note. | | Listed 5–10 years | Pro-rate earnings-stability sub-score on available years; mark row "history-limited". | | Banks / insurance / brokers | **Included** with the sector-adjusted hard filter (ROA / NIM / NPL / CAR). Note substitution per row and in the Market Summary. | | Reconciliation fail >3% | Drop from leaderboard; surface in "数据异常待复核" footer with the failing check named. | | "最便宜的巴菲特风格股票" / "cheapest Buffett-style" query | Surface the distinction between *cheap* and *margin of safety*. Show Layer-2 valuation tier (充足 / 一般 / 偏贵 / 高估) prominently; rank by valuation tier inside the wide-moat cohort, not by raw PE. | | "巴菲特真实持仓" / "Buffett's actual holdings" query | Pull Berkshire's latest 13F via WebSearch (publisher + URL + filing date in the appendix), then run Layer 2 on the holdings as a secondary lens — note that 13F lag (≥45 days) can be material. | ## Output 3–5 candidate cards, **not a giant leaderboard**. Full card template, selection rationale block, holding-period education table, and the mandatory **Data Source Appendix** structure live in `references/output.md`. Minimum card fields: ``` Name (Code) · Market · Sector Quality stars: ★★★★★ Moat type: {brand / network / cost / switching / regulatory / resource} Top-3 highlights (quantitative first): {ROE x%}, {Gross margin x%}, {FCF / capex intensity} 评级参考: 🟢 符合巴菲特选股标准 / 🟡 部分符合,关注估值变化 / 🔴 当前不符合标准 Valuation read: {充足 / 一般 / 偏贵 / 高估} — current price vs 10y band Min. holding period: {5y+ / 3–5y / 1–3y} [深度诊断这只股票 → longbridge-buffett-moat-analyzer <CODE>] ``` After the cards, every output must include: 1. **Selection rationale** — 2–3 sentences on (a) why these names together, (b) market caveats right now, (c) which one to deep-dive first. 2. **Holding-period & user-education block** — single-language table (in the user's input language) comparing Buffett-style expectations vs short-term/speculative expectations (holding time / entry pattern / drawdown tolerance / position logic / action frequency). 3. **Data Source Appendix (MANDATORY)** — every field on every card, every Longbridge endpoint hit, every WebSearch hit (publisher + URL + access date). The final line is a per-row reconciliation summary (clean pass / within-tolerance residuals / per-row drops). 4. **Disclaimer** — disclaimer variant matching the user's input language only, picked from `references/output.md` §Disclaimer variants. Never print multiple language variants. Every output must end with the following statement (in the user's input language): - 简体:以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。 - 繁體:以上內容僅供參考,不構成投資建議。投資決策請結合自身風險承受能力獨立判斷。 - English: The above is for informational purposes only and does not constitute investment advice. Please make investment decisions independently based on your own risk tolerance. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;若不可用,请安装 longbridge-terminal。 | 回退到 MCP;若不可用,請安裝 longbridge-terminal。 | Fall back to MCP; if unavailable install longbridge-terminal. | | stderr `not logged in` / `unauthorized` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | | `constituent` / `sector-screener` returns empty | 未能获取候选池,请确认指数或行业关键词。 | 未能獲取候選池,請確認指數或行業關鍵詞。 | Cannot fetch universe; verify the index or sector keyword. | | User-named sector is on the excluded list (e.g. 航空 / pre-revenue biotech) | 该行业整体不符合巴菲特选股逻辑(已说明原因),推荐改看 {替代行业};如仍想分析,可改用 `longbridge-fundamental`。 | 該行業整體不符合巴菲特選股邏輯(已說明原因),推薦改看 {替代行業};如仍想分析,可改用 `longbridge-fundamental`。 | The sector does not fit Buffett's framework (reason given); suggest {alternative sector}; for early-stage analysis use `longbridge-fundamental`. | | BS / IS / CF partial fetch for a symbol | 该标的数据不完整,跳过并在「数据异常」脚注列出。 | 該標的數據不完整,跳過並於「數據異常」腳註列出。 | Symbol has incomplete fundamentals; skipped and listed in the data-anomaly footer. | | Industry runway / qualitative data missing (Longbridge + WebSearch both empty) | 维度评分仅用财务证据,标注「定性数据缺失」。 | 維度評分僅用財務證據,標註「定性數據缺失」。 | Score the dimension on financial evidence only and tag "qualitative data unavailable". | | Per-row reconciliation gap >3% | 从候选卡片剔除并在「数据异常」附录列出失败项及差异。 | 自候選卡片剔除並於「數據異常」附錄列出失敗項及差異。 | Drop from candidate cards; list failing check + gap in data-anomaly appendix. | | User gave no market / preference at all | 触发引导式提问:偏好市场(A/HK/美)?稳健(消费/医药/金融)还是有成长性(科技/新能源)? | 觸發引導式提問:偏好市場(A/HK/美)?穩健(消費/醫藥/金融)還是有成長性(科技/新能源)? | Ask one framing turn: preferred market (A / HK / US)? Steady (consumer / healthcare / financials) or growthier (tech / new-energy)? | | Other stderr | 原样透传错误,不静默重试。 | 原樣透傳錯誤,不靜默重試。 | Surface stderr verbatim; never silently retry. | ## MCP fallback If `longbridge` CLI is not installed, use MCP tools (`claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp`, `quote` scope): 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. ## Related skills - Single-stock Buffett deep diagnostic → `longbridge-buffett-moat-analyzer` (the natural next step from every card) - Graham cigar-butt screener → `longbridge-graham-screener` - Graham single-stock view → `longbridge-graham-stock-analysis` - Broader value (PE / PB / ROE) screen → `longbridge-value-screen` - High-dividend screen → `longbridge-dividend-screen` - DCF intrinsic value → `longbridge-dcf` - Industry runway / sector view → `longbridge-industry-overview` - Method selection guide → `longbridge-valuation-methodology` ## File layout ``` longbridge-buffett-moat-stock-screener/ ├── SKILL.md └── references/ ├── criteria.md # Layer-1 hard filters, Layer-2 weighted scoring, verdict matrix, holding-period mapping, excluded cohorts └── output.md # candidate-card template, selection rationale, user-education block, data-source appendix, disclaimer ```

longbridge-business-query

|

# longbridge-business-query Main business composition and operating data for Longbridge-covered companies — segment revenue breakdown, gross margin by business line, and key operating metrics (ROE / ROA / ROIC / working capital turnover). > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user asks about: - Revenue / gross profit breakdown by segment — *"苹果各业务收入占比"*, *"腾讯主营业务构成"* - Gross margin by business line — *"苹果硬件和服务毛利率对比"* - Operating efficiency metrics — *"AAPL 的 ROE / ROA"*, *"京东 ROIC"* - Business model composition — *"特斯拉业务结构"*, *"Tesla business breakdown"* For full P&L / balance sheet / cash flow drill-down, prefer `longbridge-fundamental` or `longbridge-finance-query`. For company filings containing segment tables, pair with `longbridge-news`. ## Workflow 1. Normalise the symbol to `<CODE>.<MARKET>`. 2. Run `longbridge financial-report` with `--kind IS` (income statement) for revenue and gross profit. 3. Run `longbridge calc-index` for ROE / ROA and other computed operating indices. 4. For HK-listed companies, try `longbridge operating` for additional operating KPIs. 5. If segment data is not in the above responses, instruct the user to pair with `longbridge-news` to extract segment tables from the company's annual / interim reports (filings search). 6. Present a structured breakdown, noting any data gaps. ## CLI ```bash # Income statement (revenue, COGS, gross profit by period) longbridge financial-report <SYMBOL> --kind IS --format json # Computed operating indices (ROE, ROA, ROIC, working capital turnover) longbridge calc-index <SYMBOL> --index roe,roa --format json # Operating data (HK-listed companies, may include operating KPIs) longbridge operating <SYMBOL> --format json # Filings for segment tables (annual / interim reports) longbridge filing <SYMBOL> --format json ``` > Run `longbridge financial-report --help`, `longbridge calc-index --help`, and `longbridge operating --help` to verify current flags before calling. ## Output Present as a two-part summary: 1. **Revenue composition** — total revenue, gross profit, gross margin by major segment (where available). 2. **Operating metrics table**: | Metric | 简体 | 繁體 | English | |---|---|---|---| | Return on equity | 净资产收益率 | 淨資產收益率 | ROE | | Return on assets | 总资产收益率 | 總資產收益率 | ROA | | Return on invested capital | 投入资本回报率 | 投入資本回報率 | ROIC | | Working capital turnover | 营运资本周转率 | 營運資本周轉率 | Working capital turnover | If segment-level detail is absent, note: *"Longbridge 暂无分部数据,建议查阅公告 (`longbridge-news`)"* / *"Segment data unavailable via Longbridge; check filings via `longbridge-news`."* ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请先安装 longbridge-terminal | 請先安裝 longbridge-terminal | Install longbridge-terminal first | | `not logged in` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | `operating` returns empty (non-HK) | 提示该命令仅支持港股 | 提示此命令僅支援港股 | Note: `operating` supports HK-listed only | | Other stderr | 原样展示,不重试 | 原樣展示,不重試 | Surface verbatim, do not retry | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills | User asks | Route to | |---|---| | Full P&L / balance sheet / cash flow | `longbridge-fundamental` | | Multi-stock financial comparison | `longbridge-finance-query` | | News / filings for segment tables | `longbridge-news` | | Shareholders / ownership structure | `longbridge-ownership` | | Analyst estimates by segment | `longbridge-insresearch` | ## File layout ``` longbridge-business-query/ └── SKILL.md ``` Prompt-only — no `scripts/`. Discover current CLI flags via `longbridge <subcommand> --help`.

longbridge-calendar

Financial calendar queries, portfolio event scanning, event impact analysis, and earnings result tracking. Use when users ask questions like "what's happening today/this week/recently", "any upcoming events for my holdings/watchlist", "impact of Fed rate hike/macro data", "earnings results just came out", or other financial calendar and event impact related questions — trigger even if the user doesn't explicitly say "financial calendar".

# Financial Calendar Tracking & Insights ## Overview This Skill targets general retail investors, proactively providing financial calendar summaries, impact analysis for holdings and watchlist, cross-market linkage conclusions — **and helping users discover market opportunities beyond their portfolio**. Users do not need professional financial knowledge; the system handles all reasoning from events to impacts. Conclusions cover all relevant securities — tagged if they belong to the user's holdings or watchlist — while also extending to noteworthy market highlights. Prerequisite: The user must have completed Longbridge account authorization. See `references/data-fetching.md` for the degradation strategy when unauthorized. Dependent files: - `references/output-template.md` — Field specifications and templates for the four output card types - `references/data-fetching.md` — Data source priorities, degradation rules, and CLI usage instructions ## Data-Driven, Not Pre-Configured This Skill does not maintain separate user preference settings. All required information is obtained from the following sources: - **Holdings & Watchlist**: Fetched in real time from the Longbridge account to automatically determine the securities and markets the user cares about. **Holdings and watchlist are equally important for event coverage — both must be fully scanned; neither source may be omitted.** Holdings and watchlist are not grouped separately; they are unified and sorted by event time, differentiated only by tags. - **Market-Wide Events**: In addition to holdings and watchlist events, fetch high-importance market-wide events (without the `--filter` parameter). These events cover securities the user does not hold, tagged with "Market" to help users discover new opportunities. Selection criteria: high market attention (e.g., marquee earnings, hot IPOs, industry leader movements), relevance to current market themes, or potential to create trading opportunities. - **Time Range**: Determined from the user's request, with the following defaults. The CLI may not support time parameters — fetch data first, then filter results by time. | User Expression | Scan Range | | --- | --- | | Today | Current day (T+0) | | Tomorrow | T+1 | | This week | Monday to Sunday of the current week | | Next week | Monday to Sunday of the following week | | Recently / Upcoming | T+0 ~ T+3 (next 3 calendar days) | | No time specified | Default T+0 ~ T+3 | **Weekend & Non-Trading Day Rules:** Time ranges are calculated in calendar days but must ensure coverage through the next trading day. Specific rules: 1. **Auto-Extension**: When the end of the time range falls on a weekend or holiday, automatically extend to that market's next trading day. For example, saying "next 3 days" on Friday (T+0 ~ T+3 = Friday to Monday) — if Monday is a trading day, cover through Monday's after-hours; if Monday is also a holiday, extend to Tuesday. 2. **Per-Market Judgment**: When a user's holdings span multiple markets (e.g., US + HK + A-shares), each market has a different trading calendar and must be evaluated separately. For example, US markets are closed on Christmas but HK markets are not — the effective time windows differ. 3. **Use Market Closure Calendar Data**: The data collection phase already fetches market closure calendars — use them to determine actual trading day boundaries for each market. 4. **Indicate in Output**: When the time window extends due to weekends/holidays, reflect the actual coverage range in the title (e.g., "May 8 to May 11" rather than "next 3 days"), and note weekend/holiday arrangements where appropriate. - **Output Style**: Default to plain language (everyday terms, no jargon); if the user demonstrates professional background or explicitly requests it, switch to fundamental-style output (preserving raw data). - **Filtering & Priority**: Prioritize high-importance events. Specific filtering strategies are determined based on the importance fields returned by data sources and the user's request. **Event scope is not limited to the user's holdings and watchlist**: major global events (e.g., Fed meetings, non-farm payrolls) and trending events related to the industries of the user's holdings/watchlist should also be included, to avoid missing important market information by focusing only on existing positions. - **Market Opportunity Discovery**: Beyond scanning events for holdings and watchlist, proactively discover market-level opportunities and trends. This includes: - **Sector Rotation & Market Themes**: What themes/sectors the market is currently focused on (e.g., AI, tech, nuclear energy, GLP-1 weight-loss drugs), which sectors show significant capital inflows. - **Cross-Market Linkages & Arbitrage Opportunities**: Recent cross-market linkage signals (e.g., A/H share premium changes, Chinese ADR and HK stock correlations, commodity and related stock correlations, ADR and underlying share price differentials), which may not be in the user's current portfolio but are worth watching. - **Event-Driven Trading Opportunities**: Short-term trading windows potentially created by upcoming events (e.g., volatility trading around earnings, sector positioning before policy announcements). - This information is proactively obtained via WebSearch, independent of the user's holdings scope, with the goal of helping users discover "the world beyond their portfolio". The above default behaviors require no pre-configuration by the user. If the user requests adjustments during a conversation, follow those instructions for the current session. ## Execution Flow Each request executes the full flow, producing output in four sections. Each section is generated if data exists and omitted if not (but the first section must always be included). Generate as much content as possible, covering all dimensions the user might care about. The same event should appear only once and not be repeated across sections. ### Data Collection (Unified Upfront) 1. Retrieve the user's holdings and watchlist (if unauthorized, stop and prompt login) 2. Following the `data-fetching.md` specification, **fetch all data sources in parallel** (all without `--filter`, fetching market-wide data): - Earnings/performance calendar, macroeconomic calendar, dividend/ex-date calendar, market closure/trading calendar, stock split calendar, IPO/new listing calendar - **Market trends and opportunity data** (proactively searched via WebSearch, fetched in parallel with the CLI data above) 3. After obtaining the full dataset, **tag each event** based on the holdings and watchlist (Holdings / Watchlist / Market) — tags are classification labels only and do not affect data retrieval scope 4. Filter results by the user's requested time range (default T+0 ~ T+3) 5. **Time direction: Focus on the future.** Only retain events that **have not yet occurred** (from today onward). The sole exception is earnings results released "last night / pre-market today" (i.e., published between the previous trading day's close and today's open), which may be briefly mentioned in sections one and three. Earlier historical events are excluded entirely. 6. If the user specifies a particular stock, provide in-depth expansion on that stock's dimension ### Section 1: Event Overview (Template 1) All events (macro, holdings, watchlist, **high-attention market-wide events**) are merged into a single timeline, sorted uniformly by date and time, without duplication: - If there are earnings results released **last night or pre-market today** (limited to the period from the previous trading day's close to present), mention them briefly without expanding on history - Group by calendar day (e.g., "May 12 (Monday)"), sorted chronologically within each day - Macro events (CPI, PPI, Fed meetings, non-farm payrolls, etc.) and security-specific events are interleaved on the same timeline, not grouped separately - Source tags for securities: - "Holdings" — currently held by the user - "Watchlist" — in the user's watchlist - "Market" — neither holdings nor watchlist, but a high-attention market event (e.g., marquee earnings, hot IPOs, industry leaders) included to help users discover opportunities - **Source of "Market" securities**: These naturally emerge from the market-wide calendar data fetched without the `--filter` parameter. After fetching unfiltered data, exclude holdings and watchlist codes, then select noteworthy events from the remainder and tag them as "Market". No hard quantity requirement — event-heavy days will naturally produce more, quiet days fewer. The key is **not to lose the ability to discover opportunities by filtering on securities** - May include, but is not limited to, these types: - Earnings from large-cap, high-attention companies (industry leaders, recently trending companies) - Hot IPOs / new listings - Securities closely related to current market themes - Catalyst events for companies with recent price anomalies or heavy market discussion - Securities with no events do not appear - No cap on the number of events — list as many as there are - Output following Template 1 format in `output-template.md` ### Section 2: Key Event Impact Analysis (Template 2) - Extract high-importance events (e.g., major earnings, Fed meetings, non-farm payrolls, significant industry policies) - Provide in-depth analysis for each key event: - Event content and core data - Impact classification for actually affected stocks (direct impact / indirect impact), tagged if they are watchlist/holdings, omitting unrelated securities - Action reference (no buy/sell instructions) - If there are no high-importance events in the time range, this section may be omitted - Output following Template 2 format in `output-template.md` ### Section 3: Earnings Results Express (Template 3) - Cover earnings results released **last night or pre-market today** across all securities (from the previous trading day's close to today's open) — earlier results are excluded. Generate an earnings result card for each: - Beat/miss assessment and magnitude - Core business highlights - Market reaction (after-hours/pre-market price movement) - Next-day market closure notice (if applicable) - If no earnings have been released, this section is omitted - Output following Template 3 format in `output-template.md` ### Section 4: Market Trends & Opportunity Discovery (Template 4) This section goes beyond the user's existing holdings and watchlist to proactively discover market-level opportunities: - **Recent Market Trends & Sector Movements**: Search via WebSearch for currently trending themes, sector rotation directions, and capital flows. Not limited to securities the user already follows — the goal is to help users discover new opportunities. - **Cross-Market Linkages & Arbitrage Signals**: Scan recent (especially yesterday's) cross-market linkage activity, including but not limited to: - A/H share premium anomalies (price spreads for the same company listed on both A-shares and HK) - Chinese ADR vs. HK underlying share price differentials - Commodity price fluctuations transmitting to related listed company stock prices (e.g., copper price rise → copper mining stocks) - Exchange rate movements creating cross-market impacts - "Time-zone arbitrage" windows where a policy/event has already been priced into one market but another market hasn't opened yet - **Event-Driven Potential Opportunities**: Based on upcoming events (earnings, policies, data releases), identify potential short-term trading opportunity windows, even if the securities involved are not in the user's portfolio - Each opportunity point must explain the logic and risks; no specific buy/sell recommendations - If searches yield no valuable opportunity information, this section may be omitted - Output following Template 4 format in `output-template.md` ### Wrap-Up - Append disclaimer text at the end (see output specifications) - Prompt the user that they can follow up: "If you'd like to dive deeper into any event, or when earnings results come out, feel free to ask me anytime." ## Output Specifications ### Language Rules - Sentence length ≤ 30 words; avoid long compound sentences - Each event conclusion should not exceed 2 lines - Use hedging language such as "may", "likely", etc.; do not make definitive predictions - Action suggestions should use phrases like "consider monitoring", "wait until after the open to assess" — not "you should buy/sell" - Do not use jargon such as EPS, guidance, Beta, IV, etc.; convert all terms to everyday language ### Terminology Conversion Reference | Professional Term | Output Phrasing | | --- | --- | | Ex-Dividend Date (Ex-Date) | Note: rules differ by market — buying after this date means you won't receive this dividend | | Half-Day Trading | HK stocks only trade until noon today | | Supply Chain Transmission | News from this company may cause related stocks to move together | | Liquidity Risk | Trading volume will be thin that day, so price swings may be larger | | Macro Data Beat | The economic data came in better than the market expected | ### Prohibitions - Never respond with "nothing important today" or empty results - No specific price predictions - No direct buy or sell recommendations - Events must always display tags; securities with no events are simply omitted from the output - Securities not held and not in the watchlist may appear in the following cases: - Major global events (e.g., Fed meetings, non-farm payrolls) should be displayed regardless of whether the user holds them - Securities tagged "Market" in Section 1 — high-attention events (marquee earnings, hot IPOs, industry leaders, etc.) - Trending event securities directly related to the industries of the user's holdings or watchlist - Securities in Section 4 (Market Trends & Opportunity Discovery) — this section is specifically designed to help users discover opportunities beyond their portfolio - Overall principle: **Full coverage** for holdings and watchlist events (no omissions); **selective coverage** for Market-tagged events (only high-value ones) ### Disclaimer Text Appended once at the end of each complete report (not repeated in each section): > If you'd like to dive deeper into any event, or when earnings results come out, feel free to ask me anytime. > The above content is compiled from Longbridge data sources and publicly available information, provided for reference only. It does not constitute investment advice. Please make decisions based on your own judgment.

longbridge-candlestick

|

# longbridge-candlestick Identifies 15 classic K-line candlestick patterns from recent OHLCV data and produces a composite bullish / bearish / neutral signal with per-pattern explanations. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"NVDA 最近有什么 K 线形态"*, *"700.HK 是否出现锤子线"* - *"TSLA candlestick patterns"*, *"看看吞没形态"*, *"有没有早晨之星"* - *"600519.SH K線形態分析"*, *"是否出現三白兵"* ## Workflow 1. Resolve the symbol to `<CODE>.<MARKET>` format. 2. Fetch 200 daily candles: ```bash longbridge kline <SYMBOL> --period day --count 200 --format json ``` 3. Run the Python analysis below to identify patterns and compute a composite score. 4. Report detected patterns (most recent first), each with date, name, and interpretation. Summarise with a composite signal. ## CLI ```bash longbridge kline NVDA.US --period day --count 200 --format json longbridge kline 700.HK --period day --count 200 --format json longbridge kline 600519.SH --period day --count 200 --format json ``` Run `longbridge kline --help` to verify current flag names and defaults. ## Python analysis ```python import pandas as pd, json, sys data = json.loads(sys.stdin.read()) # list of OHLCV dicts df = pd.DataFrame(data) df = df.rename(columns={"open": "o", "high": "h", "low": "l", "close": "c", "volume": "v"}) df[["o","h","l","c","v"]] = df[["o","h","l","c","v"]].apply(pd.to_numeric) body = (df["c"] - df["o"]).abs() rng = df["h"] - df["l"] upper = df.apply(lambda r: r["h"] - max(r["c"], r["o"]), axis=1) lower = df.apply(lambda r: min(r["c"], r["o"]) - r["l"], axis=1) bull = df["c"] > df["o"] signals, score = [], 0 # --- single-bar patterns (check last 5 bars) --- for i in range(max(0, len(df)-5), len(df)): r = df.iloc[i]; b = body.iloc[i]; u = upper.iloc[i]; lo = lower.iloc[i]; rg = rng.iloc[i] # Doji if b < 0.05 * rg: signals.append((df["time"].iloc[i], "十字星/Doji", 0)) # Hammer (bullish reversal after downtrend) elif lo > 2*b and u < 0.1*b and not bull.iloc[i]: signals.append((df["time"].iloc[i], "锤子线/Hammer", +1)) elif lo > 2*b and u < 0.1*b and bull.iloc[i]: signals.append((df["time"].iloc[i], "锤子线/Hammer(bullish)", +1)) # Hanging Man (bearish) elif lo > 2*b and u < 0.1*b and i > 0 and df["c"].iloc[i-1] < df["c"].iloc[i]: signals.append((df["time"].iloc[i], "吊颈线/Hanging Man", -1)) # Shooting Star (bearish) elif u > 2*b and lo < 0.1*b and bull.iloc[i-1] if i > 0 else False: signals.append((df["time"].iloc[i], "射击之星/Shooting Star", -1)) # Inverted Hammer (bullish) elif u > 2*b and lo < 0.1*b: signals.append((df["time"].iloc[i], "倒锤线/Inverted Hammer", +1)) # Marubozu bullish elif b > 0.9*rg and bull.iloc[i]: signals.append((df["time"].iloc[i], "光头光脚阳线/Bullish Marubozu", +1)) # Marubozu bearish elif b > 0.9*rg and not bull.iloc[i]: signals.append((df["time"].iloc[i], "光头光脚阴线/Bearish Marubozu", -1)) # --- two-bar patterns --- for i in range(max(1, len(df)-5), len(df)): p, c_ = df.iloc[i-1], df.iloc[i] pb, cb = body.iloc[i-1], body.iloc[i] # Bullish engulfing if not bull.iloc[i-1] and bull.iloc[i] and c_["o"] < p["c"] and c_["c"] > p["o"]: signals.append((df["time"].iloc[i], "看涨吞没/Bullish Engulfing", +2)); score += 2 # Bearish engulfing elif bull.iloc[i-1] and not bull.iloc[i] and c_["o"] > p["c"] and c_["c"] < p["o"]: signals.append((df["time"].iloc[i], "看跌吞没/Bearish Engulfing", -2)); score -= 2 # Piercing line elif not bull.iloc[i-1] and bull.iloc[i] and c_["o"] < p["l"] and c_["c"] > (p["o"]+p["c"])/2: signals.append((df["time"].iloc[i], "刺透线/Piercing Line", +1)); score += 1 # Dark cloud cover elif bull.iloc[i-1] and not bull.iloc[i] and c_["o"] > p["h"] and c_["c"] < (p["o"]+p["c"])/2: signals.append((df["time"].iloc[i], "乌云盖顶/Dark Cloud Cover", -1)); score -= 1 # --- three-bar patterns --- for i in range(max(2, len(df)-5), len(df)): a, b_, c_ = df.iloc[i-2], df.iloc[i-1], df.iloc[i] sb = body.iloc[i-1] # Morning star if not bull.iloc[i-2] and sb < 0.3*(body.iloc[i-2]) and bull.iloc[i] and c_["c"] > (a["o"]+a["c"])/2: signals.append((df["time"].iloc[i], "早晨之星/Morning Star", +2)); score += 2 # Evening star elif bull.iloc[i-2] and sb < 0.3*(body.iloc[i-2]) and not bull.iloc[i] and c_["c"] < (a["o"]+a["c"])/2: signals.append((df["time"].iloc[i], "暮色之星/Evening Star", -2)); score -= 2 # Three white soldiers elif bull.iloc[i-2] and bull.iloc[i-1] and bull.iloc[i] and c_["c"]>b_["c"]>a["c"]: signals.append((df["time"].iloc[i], "三白兵/Three White Soldiers", +2)); score += 2 # Three black crows elif not bull.iloc[i-2] and not bull.iloc[i-1] and not bull.iloc[i] and c_["c"]<b_["c"]<a["c"]: signals.append((df["time"].iloc[i], "三黑鸦/Three Black Crows", -2)); score -= 2 # add single-bar scores for _, _, s in signals: score += s composite = "看多/Bullish" if score >= 2 else ("看空/Bearish" if score <= -2 else "中性/Neutral") print(f"Composite score: {score} → {composite}") for ts, name, s in signals: print(f" {ts} {name} ({'+'if s>=0 else ''}{s})") ``` ## Output Report format (3 languages): | 字段 / 欄位 / Field | 简体 / 繁體 / English | |---|---| | 检测到的形态 | 检测到的形态 / 檢測到的形態 / Detected patterns | | 综合信号 | 看多 / 看空 / 中性 | 看多 / 看空 / 中性 | Bullish / Bearish / Neutral | | 解释 | 解释 / 解釋 / Explanation | Present at most 5 most-recent patterns. Conclude with the composite signal and a one-sentence interpretation. ## Error handling | Situation | 简体回复 / 繁體回覆 / English reply | |---|---| | `command not found: longbridge` | 请安装 longbridge-terminal / 請安裝 longbridge-terminal / Install longbridge-terminal first | | stderr `not logged in` / `unauthorized` | 请运行 `longbridge auth login` / 請執行 `longbridge auth login` / Run `longbridge auth login` | | Other stderr | 直接展示错误信息 / 直接顯示錯誤訊息 / Surface error verbatim | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-kline` — raw OHLCV data and charting - `longbridge-technical` — indicator-based signals (MACD, RSI, KDJ, etc.) - `longbridge-ichimoku` — Ichimoku Cloud system - `longbridge-quote` — real-time price and reference data

longbridge-capital-flow

|

# longbridge-capital-flow Today's capital flow time-series and order-size distribution for a single security. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## Subcommands > A single `capital` command handles both modes — distribution snapshot (default) and time-series (`--flow`). Run `longbridge capital --help` to confirm. | CLI command | Returns | |---|---| | `longbridge capital <SYMBOL> --format json` | Cross-section snapshot: large / medium / small / super-large order buy & sell amounts. | | `longbridge capital <SYMBOL> --flow --format json` | Today's main-capital net inflow / outflow time series. | **Single symbol per call.** Today's data only — no historical range. ## When to use - *"今天 NVDA 主力净流入"*, *"今日資金流"* → `capital --flow` - *"看下 TSLA 大单分布"*, *"大單/中單/小單"* → `capital` (default snapshot) - *"看一下 700 资金面"* (combined) → call both (with and without `--flow`) and merge - *"过去 30 天资金流"* → unsupported; redirect to `longbridge-kline` (volume) or `longbridge-quote` (`--index volume`) - *"今天哪些股票主力大幅流入"* (screener) → unsupported; ask user for a specific symbol ## Workflow 1. Resolve a single symbol to `<CODE>.<MARKET>`. 2. Decide which mode: distribution snapshot (default), time-series (`--flow`), or both. 3. Call the Longbridge CLI directly (preferred) or fall back to MCP. 4. Summarise: net inflow direction (▲ / ▼), accumulated total, distribution skew. Cite Longbridge Securities. ## CLI ```bash longbridge capital NVDA.US --format json # snapshot longbridge capital TSLA.US --flow --format json # time series # Combined view → call both and merge in the LLM ``` ## Output The default snapshot returns a cross-section object; `--flow` returns a time-series array. Field translations (LLM should map): | Field (likely) | 简体 | 繁體 | English | |---|---|---|---| | `large_in / large_out` | 大单流入/流出 | 大單流入/流出 | Large order in/out | | `medium_in / medium_out` | 中单流入/流出 | 中單流入/流出 | Medium order in/out | | `small_in / small_out` | 小单流入/流出 | 小單流入/流出 | Small order in/out | | `super_in / super_out` | 超大单流入/流出 | 超大單流入/流出 | Super-large order in/out | (Field names follow Longbridge JSON; LLM maps to the user's language.) ## Error handling If `longbridge` is missing, fall back to MCP. Other stderr messages get relayed verbatim (auth issues → `longbridge auth login`; invalid symbol → re-check format). ## MCP fallback 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. ## Related skills - Quote / change / volume → `longbridge-quote` - Candlesticks / volume history → `longbridge-kline` - Orderbook microstructure → `longbridge-depth` ## File layout ``` longbridge-capital-flow/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-catalyst-radar

>

# Catalyst Radar Skill > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## 你是什么 你是一个专业的自选股事件监控助手。核心工作是帮助散户投资者从信息洪流中筛选出真正值得关注的催化剂事件,生成简洁、可执行的每日投资简报。 你的核心工作是:发现信号、评估重要程度、给出观点、呈现给用户。每份简报末尾必须附免责声明:⚠️ 以上数据仅供参考,不构成投资建议。/ 以上數據僅供參考,不構成投資建議。/ For reference only. Not investment advice. ## 数据来源优先级 按以下顺序获取数据,优先使用上层,下层作为补充: 1. **CLI(首选)**: `longbridge <command>` — Longbridge 命令行工具,结构化输出,最直接 2. **MCP(次选)**: `https://openapi.longbridge.com/mcp` — 当 CLI 不覆盖或需要更细粒度数据时 3. **Web Search(兜底)**: 仅在政策深度解读/做空报告/传闻事件/知名投资者动态等极少数场景使用 ## 核心原则 **只推变化,不重复已知信息。** 所有输出必须经过增量过滤——如果一个信号昨天已推送且没有新进展,今天不再出现。 **按市场分组,距开盘时间最近的市场排最前面。** **三级分层**: - 🔴 重要(0-3条):今天必须知道的事 - 🟡 关注(3-8条):值得留意的变化,每条一行 - 🟢 静默:今日无新增信号 ## 意图分类 收到用户指令后,先判断意图类型。详见 [用户意图分类](references/intent-mapping.md)。 | 意图 | 触发词示例 | 操作 | |------|-----------|------| | 1. 查看晨报(默认) | "晨报"、"今天有什么"、"morning briefing" | 全市场扫描 → 模板一 | | 2. 查看特定市场 | "A股有什么信号"、"港股早报" | 单市场扫描 → 模板二 | | 3. 查看特定股票 | "NVDA最近怎么样"、"看看茅台" | 个股full_scan → 临时格式 | | 4. 查看全景档案 | "全景扫描NVDA"、"腾讯档案卡" | 7维完整扫描 → 档案卡格式 | | 5. 管理自选股 | "把PDD加到自选"、"删掉SE" | 调用Watchlist API | | 6. 调整设置 | "灵敏度调高"、"A股只看早报" | 更新用户偏好 | | 7. 回溯查看 | "上周NVDA有哪些信号"、"回顾一下" | 检索历史记录 | | 8. 跨市场联动 | "美股半导体大涨A股哪些受影响" | 联动分析 → 模板四 | **默认意图**: 无法确定时,默认为"查看晨报"。 ## 执行流程 **Step 1: 解析意图** 参考 [intent-mapping](references/intent-mapping.md) 的意图判断优先级。 **Step 2: 加载上下文** - Longbridge Watchlist API → 用户自选股列表(实时,不本地存储) - Longbridge Positions API → 用户持仓(计算关联度权重) **Step 3: 获取数据** 优先 CLI → 次选 MCP → 兜底 Web Search(详见 [获取数据的规则](references/longbridge-api-map.md)) 批量扫描策略(100只自选股按优先级分层): - 高优先级(~10只): full_scan,8-12 API calls/只 - 中优先级(~30只): quick_scan,3-4 calls/只 - 低优先级(~60只): quote_only,1 call/只 - 总计约 280 calls,30秒内完成 **Step 4: 信号分级** 根据触发维度、重要性、时效性、与用户持仓关联度综合评分: - 🔴 重大 / 🟡 关注 / 🟢 常规 **Step 5: 组装输出** 按市场分组,距开盘由近到远排列。套用输出模板([晨晚报输出模板](references/briefing-templates.md))。 ## 七维催化剂扫描框架 每只股票扫描以下7个维度,数据均通过 Longbridge API 获取: | 维度 | 美股 | A股 | 港股 | 新加坡 | |------|------|-----|------|--------| | 1. 财务与业绩 | ✅ | ✅ | ✅ | ✅ | | 2. 资金与交易 | ✅(含期权) | ✅*(龙虎榜、北向、融资融券) | ✅*(CCASS、沽空、窝轮) | ✅ | | 3. 内部人与机构 | ✅ | ✅ | ✅ | ⚠️ | | 4. 政策与监管 | ✅ | ✅ | ✅ | ✅ | | 5. 公司事件 | ✅ | ✅ | ✅ | ✅ | | 6. 市场情绪 | ✅ | ✅ | ✅ | ⚠️ | | 7. 技术面 | ✅ | ✅ | ✅ | ✅ | ✅ = 完整支持 &nbsp; ✅* = 含市场特有信号 &nbsp; ⚠️ = 部分支持 **各市场特有信号**: - **A股**: 龙虎榜、北向资金、涨跌停板、两融余额 - **港股**: CCASS持仓变化、沽空比率、窝轮/牛熊证街货、南向资金 - **新加坡**: 行情数据完整,分析师覆盖和社区数据相对有限 ## 参考文件 | 文件 | 内容 | 何时读取 | |------|------|---------| | [longbridge-api-map](references/longbridge-api-map.md) | Longbridge API 调用规则,各维度API参数与返回字段 | 执行数据获取前 | | [briefing-templates](references/briefing-templates.md) | 晨晚报四种Markdown输出模板及填充规则 | 组装输出前 | | [intent-mapping](references/intent-mapping.md) | 用户意图分类的触发词、识别逻辑和执行操作 | 解析用户指令时 |

longbridge-chanlun

|

# longbridge-chanlun 缠论(Chan Theory)形态识别引擎:基于 OHLCV 日线数据,自动检测顶底分型、笔、线段、中枢,并生成一买/一卖、二买/二卖、三买/三卖信号。 ## Requirements > ⚠️ **额外依赖 / Extra dependency required** > > 此 skill 依赖第三方 Python 库 **czsc**,使用前需手动安装: > > ```bash > pip install czsc > ``` > > 若环境无法安装,LLM 将回退到手动实现基础分型逻辑(精度较低)。 > This skill requires the **czsc** Python library. Install it before use: `pip install czsc` > **Response language**: match the user's input language — > Simplified Chinese / Traditional Chinese / English. ## When to use - 用户询问缠论相关分析:*"AAPL.US 缠论分析"*、*"700.HK 现在在哪个买点"*、*"帮我看看 TSLA 的中枢"* - 识别分型(顶分型/底分型)、笔(上升笔/下降笔)、线段结构 - 判断当前买卖点类型(一买/二买/三买/一卖/二卖/三卖) - 用户提到"缠中说禅"、"缠师"、"缠论买点"等关键词 ## Workflow 1. 从用户输入提取标的代码,标准化为 `<CODE>.<MARKET>` 格式。 2. 获取日线 OHLCV 数据(300 根 K 线): ```bash longbridge kline <SYMBOL> --period day --count 300 --format json ``` 3. 将 JSON 数据转换为 czsc 所需的 `RawBar` 列表格式(字段:`dt`, `open`, `high`, `low`, `close`, `vol`)。 4. 使用 czsc 库解析缠论结构: ```python import czsc from czsc import CZSC # bars: list of czsc.RawBar c = CZSC(bars) # 分型: c.fx_list # 笔: c.bi_list # 线段: c.seg_list (if available) # 中枢: c.zs_list (if available) ``` 5. 读取最近的笔序列和中枢,匹配买卖点逻辑: - **一买**:下降笔触及中枢下沿后出现底分型 - **二买**:中枢震荡后上升笔回撤不破中枢低点出现底分型 - **三买**:突破中枢上沿后回调不破中枢高点出现底分型 - 卖点逻辑对称(一卖/二卖/三卖) 6. 输出分析结论:当前所处买卖点、最近中枢区间、最近分型位置。 > 若环境未安装 czsc,提示用户先运行 `pip install czsc`,然后重试。 > 若不确定 CLI 参数,先运行 `longbridge kline --help` 查看最新参数。 ## CLI ```bash # 获取日线数据(主要数据源) longbridge kline AAPL.US --period day --count 300 --format json # 若需更短周期辅助判断(可选) longbridge kline 700.HK --period week --count 100 --format json ``` ## Output 以自然语言呈现,包含: - **当前买卖点**:一买 / 二买 / 三买 / 一卖 / 二卖 / 三卖(或"暂无明确信号") - **最近中枢区间**:[中枢低点, 中枢高点](含价格) - **最近分型**:类型(顶/底)+ 价格 + 日期 - **最近笔**:方向(上升/下降)+ 起止价格 - **数据来源**:Longbridge Securities / 数据来源:长桥证券 / 數據來源:長橋證券 ## Error handling | 情形 | 简体回复 | 繁體回覆 / English | |---|---|---| | `command not found: longbridge` | 尝试 MCP fallback;否则请安装 longbridge-terminal | 嘗試 MCP fallback;否則請安裝 longbridge-terminal / Try MCP fallback; otherwise install longbridge-terminal | | stderr 含 `not logged in` | 请运行 `longbridge auth login` | 請運行 `longbridge auth login` / Run `longbridge auth login` | | Python 环境缺少 czsc | 请运行 `pip install czsc` 后重试 | 請運行 `pip install czsc` 後重試 / Run `pip install czsc` then retry | | czsc 版本不兼容 | 请运行 `pip install --upgrade czsc` | 請運行 `pip install --upgrade czsc` / Run `pip install --upgrade czsc` | | 其他 stderr | 原样返回错误,不静默重试 | 原樣返回錯誤,不靜默重試 / Surface verbatim, never retry silently | ## MCP fallback 若 CLI 不可用且已配置 MCP: 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. ## Related skills | 用户询问 | 路由至 | |---|---| | 实时股价/行情 | `longbridge-quote` | | K线图/历史价格 | `longbridge-kline` | | 艾略特波浪 | `longbridge-elliott` | | 谐波形态 | `longbridge-harmonic` | | 聪明钱/SMC | `longbridge-smc` | | 资金流向 | `longbridge-capital-flow` | ## File layout ``` longbridge-chanlun/ └── SKILL.md ```

longbridge-company-profile

|

# longbridge-company-profile Professional pitch-book company profile page — positioning, financials, shareholders, and catalysts formatted for investment-banking presentations. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking for: - Pitch-book or presentation-ready company page — *"给我 TSLA 的公司画像"*, *"company profile page for AAPL"*, *"公司简介页"* - Investor or trading material — *"investor profile"*, *"公司展示页"*, *"company slide"* - IB-style company description — *"投行公司页"*, *"pitch book company page"* For a compact one-pager defer to `longbridge-company-tearsheet`. For deep financial analysis defer to `longbridge-fundamental`. ## Workflow 1. Extract and normalise the symbol (e.g. `TSLA.US`, `700.HK`). 2. Fetch in parallel: - Company profile (business description, industry, founded, employees, IPO) - Income statement KPIs (revenue, EBITDA, net income, EPS — last 3 years) - Valuation multiples (PE, PB, EV, EV/EBITDA) - 1-year daily price history (OHLCV, for trend description) - Executive team (CEO, CFO, key officers) - Major shareholders (top 5) - Latest news / catalysts (top 5) 3. Synthesise a positioning quadrant narrative (market position vs. growth rate). 4. Render the profile in structured markdown — headline block, financial matrix, shareholder table, catalyst bullets. 5. Flag any data gaps with "—". > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## CLI ```bash # Company profile (description, industry, IPO, address) longbridge company <SYMBOL> --format json # Income statement (revenue, net income, EPS) longbridge financial-report <SYMBOL> --kind IS --format json # Valuation multiples (PE, PB, EV/EBITDA) longbridge calc-index <SYMBOL> --format json # 1-year daily OHLCV for trend description longbridge kline <SYMBOL> --period day --count 252 --format json # Executive team longbridge executive <SYMBOL> --format json # Major shareholders longbridge shareholder <SYMBOL> --format json # Recent news / catalysts longbridge news <SYMBOL> --format json ``` ## Output structure ``` ╔══════════════════════════════════════════════════════╗ <Company Name> (<SYMBOL>) [Sector / Industry] ╚══════════════════════════════════════════════════════╝ COMPANY OVERVIEW <2–3 sentence business description> Founded: ... Employees: ... HQ: ... IPO: ... POSITIONING Market Position: [Leader / Challenger / Niche] Growth Profile: [High / Moderate / Mature] Competitive Moat: <key differentiator> FINANCIAL MATRIX Year Revenue EBITDA Net Income EPS FY-2 $xxxB $xxxB $xxxB $x.xx FY-1 $xxxB $xxxB $xxxB $x.xx LTM $xxxB $xxxB $xxxB $x.xx VALUATION PE: xx.x× PB: x.x× EV: $xxxB EV/EBITDA: xx.x× PRICE PERFORMANCE (1Y) Range: $xx – $xxx Current: $xxx Change: +x.x% Trend: <brief narrative of price trajectory> KEY MANAGEMENT CEO: <Name> CFO: <Name> Other: ... MAJOR SHAREHOLDERS 1. <Name> — xx.x% 2. ... RECENT CATALYSTS • <Catalyst 1> • <Catalyst 2> • <Catalyst 3> ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | Symbol not found | 未找到该代码,请确认市场和格式。 | 找不到該代碼,請確認市場和格式。 | Symbol not found — verify the exchange and ticker. | | Partial data missing | 部分数据暂不可用,已用"—"标注。 | 部分數據暫不可用,已用"—"標注。 | Some data unavailable — marked with "—". | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | | `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-company-tearsheet` — compact one-pager - `longbridge-fundamental` — deep financial analysis - `longbridge-corporate` — ownership structure and management detail - `longbridge-investment-proposal` — full investment memo - `longbridge-valuation` — historical valuation percentile ## File layout ``` skills/longbridge-company-profile/ └── SKILL.md ```

longbridge-company-tearsheet

|

# longbridge-company-tearsheet High-density company snapshot — business, financials, valuation, shareholders, and catalysts on one page. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking for: - A compact company overview — *"给我 AAPL 的公司简报"*, *"TSLA tearsheet"*, *"公司快照"* - One-pager for a stock — *"one-pager for 9988.HK"*, *"一页纸分析"* - Quick company factsheet — *"company factsheet"*, *"公司概要"* For deep financial analysis defer to `longbridge-fundamental`. For investment proposal defer to `longbridge-investment-proposal`. ## Workflow 1. Extract and normalise the symbol. 2. Fetch in parallel: - Company profile (name, industry, founded, employees, IPO date, address) - Latest income statement KPIs (revenue, net income, EPS, ROE, gross margin) - Valuation multiples (PE, PB, EV-EBITDA) - Real-time quote and 52-week range - Major shareholders (top 5) - Recent news headlines (top 3) 3. Render the tearsheet as a structured markdown output. 4. Flag any data gaps explicitly. > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## CLI ```bash # Company profile longbridge company <SYMBOL> --format json # Valuation multiples (PE, PB, etc.) longbridge calc-index <SYMBOL> --format json # Latest income statement longbridge financial-report <SYMBOL> --kind IS --format json # Major shareholders longbridge shareholder <SYMBOL> --format json # Real-time quote longbridge quote <SYMBOL> --format json # Recent news longbridge news <SYMBOL> --format json ``` ## Output structure ``` ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ <Company Name> (<SYMBOL>) <Date> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ OVERVIEW Industry: ... Founded: ... Employees: ... IPO: ... Exchange: ... PRICE SNAPSHOT Last: $xxx.xx Change: +x.x% 52w: $xx–$xxx Market Cap: $xxxB Volume: xxM KEY FINANCIALS (LTM) Revenue: $xxxB Net Income: $xxxB EPS: $x.xx Gross Margin: xx% ROE: xx% FCF: $xxxB VALUATION PE: xx.x× PB: x.x× EV/EBITDA: xx.x× TOP SHAREHOLDERS 1. <Name> — xx.x% 2. ... RECENT CATALYSTS • <Headline 1> • <Headline 2> • <Headline 3> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | Symbol not found | 未找到该代码,请确认市场和格式。 | 找不到該代碼,請確認市場和格式。 | Symbol not found — verify the exchange and ticker. | | Partial data missing | 部分数据暂不可用,已用"—"标注。 | 部分數據暫不可用,已用"—"標注。 | Some data unavailable — marked with "—". | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | | `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-fundamental` — deep financial analysis - `longbridge-corporate` — ownership structure and management team - `longbridge-investment-proposal` — full investment memo - `longbridge-valuation` — historical valuation percentile ## File layout ``` skills/longbridge-company-tearsheet/ └── SKILL.md ```

longbridge-competitive-analysis

|

# longbridge-competitive-analysis Constructs a competitive landscape analysis for a company, covering Porter five-forces dynamics, peer financial and valuation benchmarking, moat assessment, and disruptor identification. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user wants to understand a company's competitive position: - *"帮我分析一下 NVDA 的竞争格局"* / *"幫我做 700.HK 的護城河分析"* / *"What's TSLA's competitive position?"* - *"竞争对手有哪些"*, *"波特五力分析"*, *"moat analysis"*, *"who are the competitors of AAPL"* ## Workflow 1. Parse the anchor company symbol and normalise to `<CODE>.<MARKET>`. 2. If the user provides peer symbols, use them; otherwise identify top 3–5 peers from the industry-valuation data. 3. Fetch comparative financials and valuation for the anchor + peers. 4. Fetch recent news for competitive dynamics (M&A, product launches, pricing moves). 5. Synthesise into a competitive analysis report (see Output section). ## CLI > If you're unsure of exact flag names or defaults, run `longbridge <subcommand> --help` first. ```bash # Industry-level valuation (includes peer list and sector medians) longbridge industry-valuation <SYMBOL> --format json # Income statement for anchor + each peer (revenue growth, margins) longbridge financial-report <SYMBOL> --kind IS --format json # Recent competitive news (product launches, pricing, M&A) longbridge news <SYMBOL> --format json # Valuation snapshot per company longbridge valuation <SYMBOL> --format json ``` ## Output Structure the competitive analysis report: **1. Company profile** — anchor company name, sector, primary market, brief business description **2. Competitive universe** — list of identified peers with rationale for inclusion **3. Porter five-forces summary**: | Force | Intensity (High/Med/Low) | Evidence | |---|---|---| | Threat of new entrants | | | | Bargaining power of suppliers | | | | Bargaining power of buyers | | | | Threat of substitutes | | | | Rivalry among incumbents | | | **4. Peer benchmarking table**: | Company | Symbol | Market Cap | Rev Growth | Gross Margin | PE | PB | ROE | |---|---|---|---|---|---|---|---| | Anchor | | | | | | | | | Peer 1 | | | | | | | | | ... | | | | | | | | | Industry median | — | — | | | | | | **5. Moat assessment**: - **Type**: Network effects / Cost advantages / Switching costs / Intangibles / Efficient scale - **Strength**: Wide / Narrow / None - **Durability**: 1–3 year evidence **6. Disruptor watch**: - List 2–3 potential disruptors (startups, adjacent-market entrants, technology shifts) with brief rationale **7. Competitive positioning verdict**: - Overall competitive position: Leader / Strong / Moderate / Weak - Key competitive advantages and vulnerabilities ## Error handling | Situation | Simplified Chinese | Traditional Chinese / English | |---|---|---| | `command not found: longbridge` | 回退到 MCP;否则提示安装 longbridge-terminal | 回退到 MCP;否則提示安裝 / Fall back to MCP; prompt to install | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login` | 請運行 `longbridge auth login` / Run `longbridge auth login` | | Invalid symbol / `param_error` | 请确认股票代码,如 NVDA.US | 請確認股票代碼 / Check symbol format e.g. NVDA.US | | Peer data partially unavailable | 展示可用数据并标注缺失字段 | 展示可用資料並標注缺失 / Show available data, flag missing fields | | Other stderr | 原样展示错误,不重试 | 原樣展示,不重試 / Surface verbatim, no silent retry | ## Related skills | User asks | Route to | |---|---| | Industry-level overview | `longbridge-industry-overview` | | Peer valuation matrix only | `longbridge-peer-comparison` | | Full company research | `longbridge-stock-research` | | Coverage initiation | `longbridge-coverage-initiation` | | Institutional ownership | `longbridge-flows` | ## File layout ``` longbridge-competitive-analysis/ └── SKILL.md ``` Prompt-only — no `scripts/`. Discover the latest CLI flags via `longbridge <subcommand> --help`.

longbridge-consensus

|

# longbridge-consensus Prompt-only analysis skill. Orchestrates Longbridge CLI commands to surface analyst consensus estimates, estimate revision trends, beat/miss history, and post-earnings announcement drift (PEAD) signals. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"TSLA 分析师预期"*, *"TSLA analyst consensus"*, *"TSLA 分析師預期"* - *"NVDA 下季度 EPS 预期"*, *"NVDA next-quarter EPS forecast"* - *"苹果最近预期修正了吗"*, *"has AAPL had estimate revisions recently"* - *"700.HK 目标价共识"*, *"700.HK price target consensus"* - *"TSLA 上季超预期了吗"*, *"did TSLA beat last quarter"*, *"TSLA 上季超預期嗎"* - *"NVDA PEAD 信号"*, *"NVDA post-earnings drift"* For full fundamentals (revenue/margins/ROE) use `longbridge-fundamental`. For valuation use `longbridge-valuation`. ## CLI Run `longbridge --help` to see all available subcommands, then `longbridge <subcommand> --help` before calling. Types of data needed (call concurrently): - Coverage count, buy/hold/sell distribution, consensus target price - Revenue / EPS estimates (high / low / mean / median) - Forward EPS by period - Institution rating distribution + median target price - Rating and target price change history (for revision trend — run `--help` for available history flags) ```bash longbridge <subcommand> TSLA.US --format json # run --help for available flags and subcommand names ``` ## Workflow 1. **Resolve symbol** to `<CODE>.<MARKET>` format. 2. **Determine scope** from the user prompt: | Prompt intent | Data to fetch | |---|---| | Consensus snapshot | Coverage count + buy/hold/sell + EPS estimates + forward EPS | | Rating distribution / target price | Institution rating distribution + median target | | Revision trend | Rating and target price change history | | Beat / miss analysis | EPS actuals vs consensus mean | | PEAD signal | EPS actuals + consensus + price context | 3. **In-LLM analysis**: | Quantity | Method | |---|---| | **Estimate revision direction** | Compare current mean EPS vs prior period from rating history; rising / flat / falling | | **Beat / miss** | Actual EPS vs consensus mean; beat threshold > +2% | | **PEAD signal** | Consecutive beats + upward revisions → positive momentum; consecutive misses + downward revisions → negative momentum. **Note**: PEAD is a statistical tendency, not a guarantee. | | **Surprise %** | `(Actual − Estimate) / |Estimate| × 100%` | 4. Output structured report; cite **Longbridge Securities**; end with disclaimer. ## Output template ``` {Symbol} ({code}) Analyst Consensus — Source: Longbridge Securities As of: {date} [Coverage & ratings] - Analysts covering: N | Buy: X / Hold: Y / Sell: Z - Median target price: {price} ({currency}) | Upside from last: ±X% [EPS consensus] - Current-quarter estimate: mean {X}, range [{low} – {high}] - Next-quarter estimate: mean {X}, range [{low} – {high}] - FY estimate: mean {X}, range [{low} – {high}] [Revenue consensus] - Current-quarter estimate: mean {X} YoY ±Y% - FY estimate: mean {X} YoY ±Y% [Estimate revision trend] - Direction (past 30/90 days): {rising / flat / falling} - Key revisions: {summary from rating/target price change history} [Beat / miss history (last 4 quarters)] | Quarter | Actual EPS | Estimate | Surprise % | |---------|-----------|----------|-----------| | {Q} | {A} | {E} | {±X%} | ... [PEAD signal] - Pattern: {N consecutive beats / misses / mixed} - Revision bias: {upward / neutral / downward} - PEAD inference: {positive momentum / neutral / negative momentum} ⚠️ PEAD is a statistical tendency, not a forecast. ⚠️ 以上数据仅供参考,不构成投资建议。/ 以上數據僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` (Omit sections where data is unavailable; state so explicitly.) ## Error handling | Situation | 简体中文回复 | 繁體中文 / English | |---|---|---| | `command not found: longbridge` | 回退到 MCP;如 MCP 也不可用,请用户安装 longbridge-terminal。 | 回退到 MCP;如也不可用,請安裝 longbridge-terminal。/ Fall back to MCP; if also unavailable, tell user to install longbridge-terminal. | | stderr `not logged in` | 请运行 `longbridge auth login` 登录。 | 請執行 `longbridge auth login`。/ Run `longbridge auth login`. | | Consensus data has < 3 analysts | 覆盖分析师不足 3 位,一致预期仅供参考。 | 覆蓋分析師不足 3 位,僅供參考。/ Fewer than 3 analysts — consensus is indicative only. | | Analyst estimates data returns empty | "{symbol} 暂无分析师预期数据。" | "{symbol} 暫無分析師預期。" / "{symbol} has no analyst estimates." | | No actuals for beat/miss | 跳过超预期/低于预期分析,注明无历史实际值。 | 跳過超預期分析,注明無歷史數據。/ Skip beat/miss analysis; note no historical actuals available. | | Other stderr | 直接显示原始错误,不静默重试。 | 顯示原始錯誤。/ Surface verbatim — do not retry silently. | ## MCP fallback If `longbridge` CLI is not installed (`command not found`), 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 - Full fundamentals (revenue / ROE / margins) → `longbridge-fundamental` - Valuation (PE / PB / industry) → `longbridge-valuation` - Three-statement financials → `longbridge-financial-report` - News & market reaction → `longbridge-news` - Post-earnings deep-dive → `longbridge-earnings` ## File layout ``` longbridge-consensus/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-constituent

|

# longbridge-constituent List the constituent stocks of an index or ETF, ranked by a chosen indicator. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user wants the **members** of an index or ETF (not the index quote itself): - *"标普 500 有哪些股票"*, *"S&P 500 constituents"* → `SPX.US` - *"恒生指数成分股"*, *"Hang Seng constituents"* → `HSI.HK` - *"纳斯达克 100 涨幅榜"*, *"IXIC components by gain"* → `IXIC.US` - *"沪深 300 成分股"*, *"CSI 300 members"* → `000300.SH` - *"QQQ 持仓"*, *"SPY holdings"* → ETF symbol like `QQQ.US`, `SPY.US` For the index *quote* (level, change, volume), use `longbridge-quote` instead. For 2–5 explicit-symbol comparison, use `longbridge-peer-comparison`. ## Symbol format `<CODE>.<MARKET>`. Common indices: | Index | Symbol | |---|---| | 恒生指数 / Hang Seng | `HSI.HK` | | 国企指数 / HSCEI | `HSCEI.HK` | | 标普 500 / S&P 500 | `SPX.US` | | 道琼斯 / Dow Jones | `DJI.US` | | 纳斯达克综合 / Nasdaq | `IXIC.US` | | 纳指 100 / Nasdaq 100 | `NDX.US` | | 沪深 300 / CSI 300 | `000300.SH` | | 上证指数 / SSE Composite | `000001.SH` | ETFs use their own ticker (e.g. `SPY.US`, `QQQ.US`, `2800.HK`). ## CLI Run `longbridge --help` to see all available subcommands, then `longbridge <subcommand> --help` before calling. ```bash longbridge <subcommand> HSI.HK --format json # run --help for available flags and subcommand names ``` Types of data needed: - Constituent list for an index or ETF symbol - Sort/filter options: by change, price, turnover, capital inflow, turnover rate, or market cap (run `--help` for available sort flags) - Limit on number of members to return (run `--help` for the flag name) ## Workflow 1. Resolve the user's index/ETF name to `<CODE>.<MARKET>` (use the table above; if ambiguous between markets, ask). 2. Pick sort order from intent (run `--help` to confirm flag names): - "涨幅榜 / gainers" → sort by change, descending - "跌幅榜 / losers" → sort by change, ascending - "成交活跃 / most traded" → sort by turnover - "主力净流入 / net inflow" → sort by inflow - "权重股 / largest weight" → sort by market cap 3. Pick result count: default 50 unless user specifies (e.g. "前 10" → limit 10). 4. Run the CLI command with `--format json`, render the rows in a table. ## Output JSON array, one row per constituent — fields typically include `symbol`, `name`, `last`, `change_rate`, `volume`, `turnover`, `market_cap`, plus the indicator used for sorting. Render as a 5–8 column table; preserve `symbol` verbatim. ## Error handling | Situation | LLM response | |---|---| | Shell `command not found: longbridge` | Fall back to MCP if configured; otherwise tell the user to install longbridge-terminal. | | stderr `param_error` / "invalid symbol" | Confirm the index symbol — e.g. `SPX.US` not `S&P500`. | | Empty array | "No constituents returned — confirm the symbol is an index or ETF, not a single stock." | | Other stderr | Surface verbatim. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. If unsure of the exact MCP tool name, run the CLI; the binary is the canonical path. ## Related skills | User asks | Route to | |---|---| | Index level / change / volume | `longbridge-quote` | | 2–5 explicit-symbol comparison | `longbridge-peer-comparison` | | Single-stock fundamentals after picking from the list | `longbridge-fundamental` | | Single-stock valuation snapshot | `longbridge-valuation` | ## File layout ``` longbridge-constituent/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-corporate-events

|

# longbridge-corporate-events Event-driven analysis for a single listed company: identifies, classifies, and scores corporate events that may create short- to medium-term pricing dislocations. > **Response language**: match the user's input language — > Simplified Chinese / Traditional Chinese / English. ## When to use - *"AAPL 最近有什么大事件"*, *"700.HK corporate events"* → full event scan - *"大股东最近增持了吗"*, *"insider buying signal"* → shareholder change focus - *"NVDA 回购进展"*, *"share buyback update"* → news + corp-action focus - *"A 股并购重组信号"*, *"M&A catalyst"* → news + filing focus - *"指数调整对 XX 的影响"*, *"index rebalancing effect"* → calendar + news focus Do **not** use for financial KPIs / earnings (→ `longbridge-fundamental` / `longbridge-earnings`), real-time quotes (→ `longbridge-quote`), or deep broker-level ownership (→ `longbridge-flows`). ## Workflow 1. Resolve the user's symbol to `<CODE>.<MARKET>` (e.g. `AAPL.US`, `700.HK`, `600519.SH`). 2. Run `longbridge --help` to see available subcommands; run `longbridge <subcommand> --help` to confirm current flags for each. 3. Fetch **latest news and announcements** using the news subcommand with `--format json`. 4. Fetch **regulatory filings** using the filings subcommand with `--format json`. 5. Fetch **corporate actions** (dividends, splits, rights, buyback notices) using the corporate-actions subcommand with `--format json`. 6. Fetch **major shareholder changes** using the shareholder subcommand with `--format json`. 7. Optionally fetch **earnings / event calendar** using the finance-calendar subcommand with `--format json` to surface upcoming catalysts. 8. Classify each event into one of the standard types (see Output), assess sentiment (+/−/neutral), and estimate the expected price-impact window. 9. Output the event ledger and a summary directional signal. ## CLI ```bash # Discover available subcommands and their flags longbridge --help longbridge <subcommand> --help # run for each subcommand before use # Latest news and announcements longbridge <news-subcommand> AAPL.US --format json # Regulatory filings (SEC 8-K, HKEx announcements, CSRC disclosures) longbridge <filing-subcommand> AAPL.US --format json # Corporate actions (dividends, splits, rights, buybacks) longbridge <corp-action-subcommand> AAPL.US --format json # Major shareholder changes longbridge <shareholder-subcommand> AAPL.US --format json # Upcoming earnings / event calendar longbridge <finance-calendar-subcommand> --format json ``` ## Output ### Event classification table Classify each event found into one of these types: | Type | 简体 | 繁體 | English | Typical signal | |---|---|---|---|---| | `increase` | 大股东增持 | 大股東增持 | Insider / major-shareholder buy | Bullish | | `decrease` | 大股东减持 | 大股東減持 | Insider / major-shareholder sell | Bearish | | `buyback` | 股份回购 | 股份回購 | Share buyback | Bullish | | `placement` | 定增 / 配股 | 定增 / 配股 | Private placement / rights issue | Dilutive / context-dependent | | `incentive` | 股权激励 | 股權激勵 | Equity incentive plan | Moderately bullish | | `ma` | 并购重组 | 併購重組 | M&A / restructuring | Event-specific | | `index` | 指数调整 | 指數調整 | Index inclusion / exclusion | Inclusion bullish; exclusion bearish | | `mgmt` | 管理层变更 | 管理層變更 | Management change | Context-dependent | | `pledge` | 股权质押 | 股權質押 | Share pledge (high ratio) | Bearish risk flag | | `st` | ST / 摘帽 | ST / 摘帽 | A-share ST status change | ST bearish; removal bullish | | `other` | 其他公告 | 其他公告 | Other filing | Neutral until assessed | ### Output structure 1. **Event ledger** — chronological list: date / type / headline / sentiment (+/−/neutral) / expected impact window. 2. **Top signal** — the single most market-moving event from the list, with a one-sentence rationale. 3. **Directional bias** — net assessment (accumulation / distribution / neutral), based on the balance of bullish vs bearish events in the last 30 days. 4. **Watch window** — suggest the next 1–4 weeks if a pending event (placement lock-up expiry, buyback completion deadline, index review date) is identified. When no significant events are found, state so explicitly — do not invent signals. **A-share-specific notes**: - ST / 摘帽 events have mandatory trading limits and announcement timing rules; flag these clearly. - Northbound (沪深港通) quota changes and index-rebalancing announcements (CSI 300 / SSE 50) are high-impact for A-share mid/large caps. **HK-specific notes**: - General mandate issuances (general mandate for new shares) are common HK dilution signals. - Connected-transaction / related-party announcements require regulatory approval and carry governance risk. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 请安装 longbridge-terminal,或使用 MCP 回退 | 請安裝 longbridge-terminal,或使用 MCP 回退 | Install longbridge-terminal or use MCP fallback | | stderr `not logged in` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | No events found | 所查时段内无重大公司事件 | 所查時段內無重大公司事件 | No significant corporate events in the queried period | | Symbol mapping fails | 请提供 `代码.市场` 格式,如 AAPL.US | 請提供 `代碼.市場` 格式,如 AAPL.US | Provide `<CODE>.<MARKET>`, e.g. AAPL.US | | Other stderr | 原样转述,不静默重试 | 原樣轉述,不靜默重試 | Relay verbatim, no silent retry | ## MCP fallback 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. ## Related skills | Skill | Why | |---|---| | `longbridge-corporate` | Corporate structure (shareholders, executives, subsidiaries) — static profile | | `longbridge-flows` | Institutional 13F holdings, Form 4 insider trades, short interest | | `longbridge-news` | Deeper news classification and sentiment for a single stock | | `longbridge-fundamental` | Financial KPIs to contextualise event impact on earnings/valuation | | `longbridge-calendar` | Forward-looking earnings, dividend, IPO, and macro event dates | ## File layout ``` longbridge-corporate-events/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-corporate

|

# longbridge-corporate Single-symbol corporate profile: who owns the company, who runs it, what corporate actions it has taken, and how it relates to its parent / subsidiaries. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"AAPL 大股东都有谁"*, *"AAPL major shareholders"*, *"AAPL 大股東"* → `shareholder` - *"700.HK 高管", "腾讯管理层", "AAPL board"* → `executive` - *"NVDA 公司简介", "company overview", "員工人數", "上市价格"* → `company` - *"特斯拉历史拆股", "TSLA splits", "700.HK 派息历史", "rights issue"* → `corp-action` - *"700 母公司是谁", "AAPL 子公司有哪些", "subsidiaries"* → `invest-relation` - *"X 公司基本面 (结构维度)", "全面公司画像"* → call several subcommands and merge For financial KPIs (revenue / margin / EPS), use `longbridge-fundamental`. For valuation, use `longbridge-valuation`. For news / filings, use `longbridge-news`. ## Subcommands > Run `longbridge <subcommand> --help` if unsure of current flags. The CLI's built-in help is the canonical source. | Capability | Returns | |---|---| | Institutional shareholders | Name, related ticker, % held, share change, report date. Run `--help` for available filter/sort flags. | | Executives and key personnel | Officers, directors, key roles. | | Company overview | Founding date, employees, IPO price, listing date, address, business description. | | Corporate actions | Stock splits, dividends, rights issues, bonus issues. | | Investment relations | Parent company / subsidiaries / sister listings. | Single symbol per call. The CLI accepts `--lang zh-CN` or `--lang en` for content fetched from longbridge.com (defaults to system `LANG`). ## Workflow 1. Resolve to `<CODE>.<MARKET>` (e.g. `AAPL.US`, `700.HK`). 2. Pick the matching subcommand from the prompt cue (table above). 3. For composite questions ("give me a full picture of X as a company") — call several subcommands concurrently and merge. 4. Render a structured summary; cite **Longbridge Securities** and the report date when applicable. ## CLI ```bash # Discover available subcommands and their flags first longbridge --help longbridge <subcommand> --help # run for each subcommand before use longbridge <shareholder-subcommand> AAPL.US --format json # run --help for filter/sort flags longbridge <executive-subcommand> 700.HK --format json longbridge <company-subcommand> NVDA.US --format json longbridge <corp-action-subcommand> 700.HK --format json longbridge <invest-relation-subcommand> 700.HK --format json ``` ## Output Render results in the user's language. Suggested layouts: **`shareholder`** — table of name / % held / change / report date. Highlight the top 3 by holding and any change > ±10% if `--range` is `all`. **`executive`** — list of name / title / appointment date (if available). Group by role (CEO / CFO / Chair / others). **`company`** — short profile paragraph: founding year, headquarters, employees, IPO date + price, business description. **`corp-action`** — chronological list (most recent first): date / type (split / dividend / rights / bonus) / ratio or amount. Annotate split adjustments. **`invest-relation`** — tree-like list: parent → company → subsidiaries (with stake % when available). Note cross-listed sister tickers. When data is empty, state so explicitly (e.g. *"No corporate actions on record."*) — do not invent. ## Error handling | Situation | Reply | |---|---| | Shell `command not found: longbridge` | Fall back to MCP if configured; otherwise tell the user to install longbridge-terminal. | | stderr `not logged in` / `unauthorized` | These subcommands are public quote scope; if auth is requested, hint `longbridge auth login`. | | Empty result (no shareholders / no actions) | State explicitly: *"No data for this symbol."* Do not invent. | | Symbol mapping fails | Ask the user for the `<CODE>.<MARKET>` form. | | Other stderr | Relay verbatim — never silently retry. | ## MCP fallback When the CLI binary is missing, fall back via the equivalent MCP tool. Tool names typically mirror CLI subcommand names (snake_case). 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. If a name above does not resolve, fall back via the equivalent MCP tool when CLI is missing. ## Related skills | Skill | Why | |---|---| | `longbridge-fundamental` | Profitability / cash flow / dividend KPIs (the *numbers* side of the company). | | `longbridge-flows` | Fund / ETF holders, insider trades, short interest, HK broker holdings. | | `longbridge-news` | Recent filings and community discussion of corporate events. | | `longbridge-valuation` | PE / PB lens once you know the company structure. | ## File layout ``` longbridge-corporate/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-correlation

|

# longbridge-correlation Computes pairwise return correlations and cointegration statistics for a basket of 2–10 symbols. Helps identify diversification opportunities, highly correlated pairs (pairs-trading candidates), and portfolio concentration risks. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - User supplies 2–10 symbols and asks for correlation analysis, whether two stocks move together, rolling correlation trends, or pairs-trading pre-screening. - Triggers: "AAPL MSFT GOOGL 相关矩阵", "TSLA 和 NVDA 滚动相关", "correlation matrix for my watchlist", "协整检验 700.HK 5.HK". ## Workflow 1. For each symbol, fetch 252 daily candles: `longbridge kline <SYMBOL> --period day --count 252 --format json` 2. Align all series on `time`; drop dates missing in any series. 3. Compute daily log-returns for each symbol. 4. **Pearson correlation matrix**: pairwise Pearson correlation of returns; flag pairs with |ρ| > 0.8 (high) or < 0.2 (low). 5. **Spearman correlation** (rank-based, robust to outliers): compute alongside Pearson for comparison. 6. **Rolling 60-day correlation** for the highest-correlated pair: show trend over time. 7. **Cointegration screen** (for pairs only): - OLS spread residuals → ADF test → report p-value and verdict - Half-life = −ln(2) / OLS slope of Δspread ~ spread_{t-1} 8. Output correlation matrix heatmap description (text-based) and a summary of key relationships. Run `longbridge kline --help` to confirm current flag names. ## CLI ```bash longbridge kline --help # Repeat for each symbol (2–10) longbridge kline <SYMBOL> --period day --count 252 --format json ``` ## Output | Metric | 简体 | 繁體 | English | |---|---|---|---| | Pearson ρ matrix | 皮尔森相关矩阵 | 皮爾森相關矩陣 | Pearson correlation matrix | | Spearman ρ | 斯皮尔曼相关 | 斯皮爾曼相關 | Spearman correlation | | Rolling 60d corr | 60日滚动相关 | 60日滾動相關 | 60-day rolling correlation | | ADF p-value | 协整 p 值 | 協整 p 值 | ADF p-value | | Half-life | 半衰期(天) | 半衰期(天) | Half-life (days) | | Cluster | 相关聚类 | 相關聚類 | Correlation cluster | Present: (1) full correlation matrix table with colour coding (high ≥ 0.8 = red, low ≤ 0.2 = green); (2) rolling-correlation narrative; (3) cointegration results if relevant; (4) portfolio implication note. Cite **Longbridge Securities** / **数据来源:长桥证券** / **數據來源:長橋證券**. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP 或提示安装 longbridge-terminal | 回退到 MCP 或提示安裝 longbridge-terminal | Fall back to MCP or install longbridge-terminal | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | Only 1 symbol provided | 至少需要2个标的才能计算相关性 | 至少需要2個標的 | Need at least 2 symbols | | > 10 symbols | 最多支持10个标的,请精简列表 | 最多支持10個標的 | Max 10 symbols; please reduce list | | Other stderr | 直接显示原始错误 | 直接顯示原始錯誤 | Surface verbatim | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-kline` — raw OHLCV data - `longbridge-pairs-trading` — execute a pairs trade after correlation pre-screen - `longbridge-multifactor` — factor correlation and collinearity check - `longbridge-performance-attribution` — covariance matrix for factor decomposition ## File layout ``` longbridge-correlation/ └── SKILL.md ```

longbridge-coverage-initiation

|

# longbridge-coverage-initiation Generates a structured initiating-coverage report framework for a single listed company, following a five-step institutional workflow. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user wants to establish formal research coverage of a company: - *"帮我写一份 NVDA 的首次覆盖报告"* / *"幫我做 700.HK 的覆蓋報告"* / *"Initiate coverage on TSLA"* - *"覆盖报告框架"*, *"首次评级报告"*, *"initiating coverage report"* ## Workflow Five-step coverage initiation process: 1. **Company overview** — business description, history, key products/services, geographic exposure 2. **Industry positioning** — sector dynamics, competitive landscape, market share, tailwinds/headwinds 3. **Financial modelling** — historical P&L, balance sheet health, free cash flow, key ratios 4. **Valuation analysis** — current multiples vs peers vs historical range, DCF considerations, target price rationale 5. **Investment conclusion** — rating (Buy / Hold / Sell), 12-month price target, key catalysts, key risks Run these CLI commands (parallel is fine): ```bash # Company profile (business overview, sector, executives) longbridge company <SYMBOL> --format json # Full financial report (IS + BS + CF — all periods available) longbridge financial-report <SYMBOL> --kind ALL --format json # Industry-level valuation comparison longbridge industry-valuation <SYMBOL> --format json # Recent news and regulatory filings for context longbridge news <SYMBOL> --format json ``` > If you're unsure of exact flag names or defaults, run `longbridge <subcommand> --help` first. ## Symbol format `<CODE>.<MARKET>` — e.g. `NVDA.US`, `700.HK`, `600519.SH`. If the market is ambiguous, ask the user. ## Output Structure the output as a formatted research report with clearly labelled sections: **Cover page metadata**: Symbol, company name, date, analyst note (LLM-generated) **Section 1 — Company overview**: 2–3 paragraphs on business model, history, geography **Section 2 — Industry positioning**: market size, growth drivers, Porter five-forces summary, competitive moat assessment **Section 3 — Financial highlights** (table): | Metric | Year -2 | Year -1 | LTM | |---|---|---|---| | Revenue | | | | | Net Income | | | | | EPS | | | | | Gross Margin % | | | | | ROE | | | | **Section 4 — Valuation**: - Current PE / PB / PS vs industry median - Historical percentile (if available) - Implied price target rationale **Section 5 — Investment conclusion**: - Rating, price target, upside/downside - Top 3 catalysts (bull case) - Top 3 risks (bear case) ## Error handling | Situation | Simplified Chinese | Traditional Chinese / English | |---|---|---| | `command not found: longbridge` | 回退到 MCP;否则提示安装 longbridge-terminal | 回退到 MCP;否則提示安裝 / Fall back to MCP; prompt to install longbridge-terminal | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login` | 請運行 `longbridge auth login` / Run `longbridge auth login` | | `company` subcommand missing data | 从其他子命令补充可用信息,标注缺失字段 | 從其他命令補充,標注缺失 / Supplement from other commands, flag missing fields | | Other stderr | 原样展示错误,不重试 | 原樣展示,不重試 / Surface verbatim, no silent retry | ## Related skills | User asks | Route to | |---|---| | Quick stock research snapshot | `longbridge-stock-research` | | Peer valuation comparison | `longbridge-peer-comparison` | | Industry overview | `longbridge-industry-overview` | | Post-earnings update | `longbridge-earnings` | | Competitive landscape | `longbridge-competitive-analysis` | ## File layout ``` longbridge-coverage-initiation/ └── SKILL.md ``` Prompt-only — no `scripts/`. Discover the latest CLI flags via `longbridge <subcommand> --help`.

longbridge-dca

|

# longbridge-dca ⚠️ **EXTRA-HIGH-RISK mutating skill**: a recurring-investment plan **commits real money on a schedule** — every active plan will automatically place buy orders against the user's brokerage account on the chosen frequency, until paused or stopped. Mistakes here cost real money. Treat creation and modification with extreme caution. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## Extra risk note (read this before every `create` / `update`) DCA commits real money on a recurring schedule. **Read the plan back including amount / frequency / symbol / start date / end date or duration / day-of-week or day-of-month before asking for confirmation.** If the user is not 100% sure of any parameter, **ask before executing — never paper over uncertainty**. Specifically: - If the user did not specify the **amount**, ask. Do not default. - If the user did not specify the **frequency** (`daily` / `weekly` / `fortnightly` / `monthly`), ask. - If the user said "weekly" without naming a `day-of-week`, ask. - If the user said "monthly" without naming a `day-of-month`, ask. - If the user did not specify when to **stop** (or that the plan is open-ended), confirm explicitly. - If the user gave an amount in an ambiguous currency, ask which currency (USD vs HKD vs CNY). If anything is unclear after one round of clarification, **do not proceed** — escalate back to the user instead of guessing. ## When to use Trigger only on **clear imperatives** about recurring investment plans: - *"给 AAPL 每月 500 美元定投,每月 15 号"* - *"create a weekly DCA on TSLA.US for 200 USD every Monday"* - *"暂停定投 plan 12345"* / *"停止 700.HK 的定投"* Vague prompts (*"帮我看看定投怎么样"*, *"我应不应该定投"*) must be **refused with a clarifying question** — never trigger automated execution from advice-style prompts. For **read-only** listing (`longbridge dca`, `longbridge dca --status Active`, `longbridge dca history <PLAN_ID>`, `longbridge dca stats`, `longbridge dca check <SYMBOL>...`, `longbridge dca calc-date ...`) you may run the CLI directly without the preview/confirm gate. Mutations always need the gate. ## Two-step protocol (mandatory) Every mutation must run as **two distinct turns**: 1. **Preview** — describe exactly what you are about to do (symbol, amount + currency, frequency, day-of-week / day-of-month, plan id for pause/resume/stop/update), in the user's language. **Do not run the CLI yet.** For `create`, list every parameter on a separate line and explicitly note that this will execute real buy orders going forward. 2. **Wait for explicit confirmation** containing "确认 / yes / 是的 / confirm". If the user replies anything ambiguous, ask again — do **not** assume consent. Casual acknowledgements like "好" / "ok" / "嗯" alone are NOT confirmation for a `create` — require an explicit "确认" / "confirm" / "是的". 3. **Execute** — only after step 2, run the actual `longbridge dca <subcommand> ...` command. ## CLI subcommands `longbridge dca` carries read modes (no subcommand, plus `history` / `stats` / `calc-date` / `check`) and several mutating subcommands. **Always run `longbridge dca <subcommand> --help` first if you are not 100% sure of the current flag spelling, defaults, or argument order** — this protects against version drift, especially because monetary parameters are involved. | Action | CLI invocation (typical shape — verify with `--help` before use) | |---|---| | List all plans | `longbridge dca --format json` | | Filter by status | `longbridge dca --status <Active\|Suspended\|Finished> --format json` | | Filter by symbol | `longbridge dca --symbol <SYMBOL> --format json` | | Plan trade history (read) | `longbridge dca history <PLAN_ID> --format json` | | Stats summary (read) | `longbridge dca stats --format json` | | Calculate next trade date (read) | `longbridge dca calc-date ... --format json` | | Check symbol eligibility (read) | `longbridge dca check <SYMBOL>... --format json` | | Create monthly plan (mutating) | `longbridge dca create <SYMBOL> --amount <N> --frequency monthly --day-of-month <D> --format json` | | Create weekly plan (mutating) | `longbridge dca create <SYMBOL> --amount <N> --frequency weekly --day-of-week <mon\|tue\|...> --format json` | | Update an existing plan (mutating) | `longbridge dca update <PLAN_ID> [...flags] --format json` | | Pause a plan (mutating) | `longbridge dca pause <PLAN_ID> --format json` | | Resume a paused plan (mutating) | `longbridge dca resume <PLAN_ID> --format json` | | Stop a plan permanently (mutating) | `longbridge dca stop <PLAN_ID> --format json` | | Set pre-trade reminder hours | `longbridge dca set-reminder ... --format json` | > Other flags exist (start date, end date, daily / fortnightly frequency, etc.). The exact spelling can drift between CLI versions — **always verify with `longbridge dca create --help` before issuing the command, and quote the exact command back to the user in the preview.** If the user gives a **symbol** but no plan id for pause/resume/stop/update, first run `longbridge dca --symbol <SYMBOL> --format json` to look up the plan id and current status, then quote the id back in your preview before asking for confirmation. ## Preview templates (LLM) For `create` (the highest-risk action): > ⚠️ 即将创建定投计划: > - 标的:{SYMBOL} > - 金额:{AMOUNT} {CURRENCY} > - 频率:{frequency}({day-of-week / day-of-month}) > - 起始日:{start date} > - 结束:{end date 或 "无结束日,持续运行"} > > 此计划生效后,系统会按计划自动从你的账户下单买入。是否确认执行?(请回复"确认"/"confirm"/"是的") > ⚠️ About to create a recurring investment plan: > - Symbol: {SYMBOL} > - Amount: {AMOUNT} {CURRENCY} > - Frequency: {frequency} ({day-of-week / day-of-month}) > - Start date: {start date} > - End: {end date or "open-ended, runs until paused/stopped"} > > Once active, the system will automatically place buy orders from your brokerage account on every scheduled date. Confirm? (Reply "confirm" / "yes" / "确认" to proceed.) > ⚠️ 即將建立定投計劃: > - 標的:{SYMBOL} > - 金額:{AMOUNT} {CURRENCY} > - 頻率:{frequency}({day-of-week / day-of-month}) > - 起始日:{start date} > - 結束:{end date 或 "無結束日,持續運行"} > > 此計劃生效後,系統會按計劃自動從你的賬戶下單買入。是否確認執行?(請回覆「確認」/「confirm」/「是的」) For pause / resume / stop / update — list plan id + symbol + amount + frequency + new state, then ask: - *"即将暂停定投计划 12345 (AAPL.US,每月 500 USD,每月 15 号)。是否确认执行?"* - *"About to permanently stop DCA plan 12345 (AAPL.US, 500 USD monthly). Confirm?"* - *"即將恢復定投 12345。是否確認?"* ## OAuth scope DCA mutations require the **trade scope**. Without it, both CLI and MCP fail with `unauthorized` / `not in authorized scope`. Tell the user to `longbridge auth logout && longbridge auth login` and tick "Trade" in the browser. Read-only DCA listing also requires trade scope to view account-bound plan data. ## Error handling | Situation | LLM response | |---|---| | Shell `command not found: longbridge` | Tell the user to install [longbridge-terminal](https://github.com/longportapp/longbridge-terminal); MCP fallback may apply (see below) but **only after user confirmation** — never use MCP to bypass the preview / confirm protocol. | | stderr contains `not logged in` / `unauthorized` / `not in authorized scope` | Tell the user to run `longbridge auth logout && longbridge auth login` and tick "Trade". | | Symbol not eligible for DCA | Run `longbridge dca check <SYMBOL> --format json` and surface the reason verbatim. Do not retry. | | Insufficient buying power on the scheduled date | This typically surfaces as a downstream order failure, not at create-time. Surface the message verbatim and ask the user how to proceed (top-up cash / pause / lower amount). | | Bad `<PLAN_ID>` (not found) | Re-run `longbridge dca --format json` and re-check the id. | | Other stderr | Surface verbatim. **Do not silently retry** — if a mutating call failed, ask the user before any second attempt. Money is involved; a silent retry could double-execute. | ## MCP fallback (only after confirmation) When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. > **Important**: the preview / confirm cycle still applies when going through MCP. MCP write tools have no built-in confirmation prompt; this SKILL is responsible for the gate. The extra read-back-of-parameters rule applies in full to MCP calls. ## Related skills - `longbridge-positions` — check cash balance and buying power before sizing a DCA plan. - `longbridge-portfolio` — review existing exposure before adding a new recurring buy. - `longbridge-orders` — review the actual fills produced by an active DCA plan. - `longbridge-quote` — sanity-check current price vs. plan amount. ## File layout ``` longbridge-dca/ └── SKILL.md # prompt-only, no scripts/ ``` Prompt-only — no `scripts/`. Discover the latest CLI flags via `longbridge dca <subcommand> --help`. Because money is at stake, **always** run `--help` before issuing a `create` or `update` you have not run in this session.

longbridge-dcf

|

# longbridge-dcf Build a step-by-step DCF model for any listed company using Longbridge financial data, arriving at an intrinsic value per share and margin of safety versus the current price. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我做 AAPL 的 DCF 估值"*, *"run a DCF on AAPL"*, *"幫我做 AAPL 的 DCF 估值"* - *"NVDA 内在价值是多少"*, *"what is NVDA's intrinsic value"* - *"用现金流折现算一下茅台"*, *"discounted cash flow for Maotai"* - *"WACC 怎么计算"*, *"how do I calculate WACC for this stock"* - *"给我算安全边际"*, *"margin of safety vs intrinsic value"* For valuation multiples (PE/PB/EV-EBITDA), use `longbridge-valuation`. For methodology overview, use `longbridge-valuation-methodology`. ## Workflow ### Step 1 — Fetch raw financial data ```bash # Cash flow statement (FCF inputs) longbridge financial-report <SYMBOL> --kind CF --format json # Income statement (revenue growth, margins) longbridge financial-report <SYMBOL> --kind IS --format json # Beta and market cap for WACC longbridge calc-index <SYMBOL> --format json ``` Run `longbridge financial-report --help` and `longbridge calc-index --help` to verify available flags. ### Step 2 — Calculate historical FCF `FCF = Operating Cash Flow − Capital Expenditure` Extract the last 3–5 years of operating cash flow and capex from the CF statement. Compute FCF for each year and derive the compound annual growth rate (CAGR). ### Step 3 — Project FCF Use a two-stage model: - **Stage 1 (years 1–5)**: Apply an analyst-estimated or CAGR-derived growth rate. Ask the user if they want a bull / base / bear case. - **Stage 2 (terminal)**: Apply a long-run growth rate `g` (default: GDP growth rate of the company's primary market, typically 2–4%). ### Step 4 — Estimate WACC ``` WACC = Wd × Rd × (1 − t) + We × Re Re = Rf + β × ERP ``` | Input | Source | |---|---| | Beta (β) | `longbridge calc-index <SYMBOL> --format json` | | Risk-free rate (Rf) | 10-year government bond yield of primary market (US: ~4.2%, CN: ~2.3%, HK: ~4.0%) | | Equity risk premium (ERP) | Damodaran country ERP (US: ~4.6%, CN: ~7%, HK: ~6%) | | Debt ratio (Wd) | From balance sheet (total debt / (total debt + market cap)) | | Cost of debt (Rd) | Interest expense / total debt from IS + BS | | Tax rate (t) | Effective tax rate from IS | ### Step 5 — Terminal value `TV = FCF₅ × (1 + g) / (WACC − g)` Common alternative: exit multiple method — apply an EV/EBITDA multiple consistent with mature peers. ### Step 6 — Intrinsic value 1. Discount each projected FCF to present value at WACC. 2. Discount terminal value to present value. 3. Sum all PVs → Enterprise Value. 4. Subtract net debt; add cash → Equity Value. 5. Divide by diluted shares outstanding → Intrinsic Value per Share. ### Step 7 — Margin of safety `Margin of Safety = (Intrinsic Value − Current Price) / Intrinsic Value × 100%` Positive = undervalued; negative = overvalued. Show sensitivity table for ±1% WACC and ±1% terminal growth. ## CLI ```bash longbridge financial-report --help longbridge calc-index --help longbridge financial-report <SYMBOL> --kind CF --format json longbridge financial-report <SYMBOL> --kind IS --format json longbridge calc-index <SYMBOL> --format json ``` ## Output Present results as: 1. Historical FCF table (3–5 years). 2. Projected FCF table (5 years, 3 scenarios if requested). 3. WACC components breakdown. 4. Intrinsic value per share. 5. Margin of safety vs current price. 6. Sensitivity matrix (WACC × terminal growth rate). 7. Key assumptions and caveats. Always include a disclaimer: DCF is highly sensitive to assumptions; treat output as a range, not a precise target. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请安装 longbridge-terminal 或检查 MCP 配置。 | 請安裝 longbridge-terminal 或檢查 MCP 配置。 | Install longbridge-terminal or check MCP config. | | stderr: `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | | No CF data available | 该标的暂无现金流数据,可能是上市不足三年或非标准财报。 | 該標的暫無現金流數據,可能是上市不足三年。 | No cash flow data; the company may be too recently listed or use non-standard reporting. | | Negative FCF history | 历史 FCF 为负,DCF 模型需用户提供未来盈利假设。 | 歷史 FCF 為負,需用戶提供未來盈利假設。 | Historical FCF is negative; DCF requires user-supplied future profitability assumptions. | ## Related skills - `longbridge-valuation-methodology` — method selection guide - `longbridge-valuation` — current PE/PB/EV-EBITDA snapshot - `longbridge-fundamental` — revenue / EPS / margin KPIs - `longbridge-financial-report` — detailed financial statements ## File layout ``` skills/longbridge-dcf/ └── SKILL.md ```

longbridge-defi-yield

|

# longbridge-defi-yield DeFi yield analysis framework — covers lending rates (AAVE / Compound), liquidity provision (LP) returns, staking yields, yield farming strategies, and risk-adjusted return comparison across DeFi protocols. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. > **Data scope notice**: Longbridge provides real-time spot prices for major cryptocurrencies (`.HAS` suffix, e.g. `BTCUSD.HAS`, `ETHUSD.HAS`). DeFi protocol metrics (APY, TVL, utilisation rates) are **not available** via the Longbridge CLI — they must be sourced via WebSearch (DefiLlama, CoinGecko, protocol dashboards). ## When to use Trigger when the user asks about: - DeFi lending / borrowing rates — *"AAVE 上 ETH 借贷利率"*, *"Compound USDC supply APY"* - Liquidity mining / LP returns — *"Uniswap LP 收益"*, *"流动性挖矿策略"* - Staking yields — *"ETH 质押收益率"*, *"SOL staking APY"* - Yield farming strategies — *"如何优化 DeFi 收益"*, *"yield farming best strategy"* - Risk-adjusted DeFi comparison — *"哪个协议收益最高且风险最低"* For crypto spot price only, prefer `longbridge-quote`. For general crypto market data, prefer `longbridge-core`. ## Workflow 1. **Identify asset and protocol** from the prompt (e.g. ETH + AAVE, USDC + Compound). 2. **Fetch spot price** from Longbridge for the underlying crypto asset (as price reference): ```bash longbridge quote ETHUSD.HAS --format json ``` 3. **Fetch DeFi protocol data** via WebSearch from canonical sources: - DefiLlama (`defillama.com`) for TVL, protocol APY, pool yields. - CoinGecko (`coingecko.com`) for staking yields and token data. - Protocol-native dashboards (app.aave.com, app.compound.finance) for live rates. 4. **Compute risk-adjusted yield**: - Nominal APY vs. inflation-adjusted real yield. - IL (impermanent loss) risk for LP positions. - Smart contract risk / audit status (note qualitatively). 5. **Present comparison table** across protocols/strategies, ranked by risk-adjusted return. ## CLI ```bash # Spot price for underlying crypto (price reference only) longbridge quote BTCUSD.HAS --format json longbridge quote ETHUSD.HAS --format json longbridge quote SOLUSD.HAS --format json ``` > Run `longbridge quote --help` to see supported `.HAS` crypto symbols. DeFi protocol data is **not available** via the Longbridge CLI. Use WebSearch to retrieve live APY/TVL from DefiLlama, CoinGecko, or protocol dashboards. ## Output Present a DeFi yield comparison table: | Field | 简体 | 繁體 | English | |---|---|---|---| | Protocol | 协议 | 協議 | Protocol | | Asset | 资产 | 資產 | Asset | | Strategy type | 策略类型 | 策略類型 | Strategy type | | Nominal APY | 名义年化收益 | 名義年化收益 | Nominal APY | | Estimated risk | 风险等级 | 風險等級 | Risk level | | TVL | 总锁仓量 | 總鎖倉量 | TVL | | Notes | 备注 | 備註 | Notes | Always include a risk disclaimer: *"DeFi 投资存在智能合约风险、无常损失和流动性风险,不构成投资建议。"* / *"DeFi investing carries smart contract, impermanent loss, and liquidity risks. This is not investment advice."* ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请先安装 longbridge-terminal(仅用于现货价格) | 請先安裝 longbridge-terminal(僅用於現貨價格) | Install longbridge-terminal (for spot prices only) | | `.HAS` symbol not found | 提示该加密货币暂不支持,尝试标准格式 | 提示該加密貨幣暫不支援 | Crypto symbol not supported; check `.HAS` format | | DeFi APY data unavailable | 提示需通过 WebSearch 获取协议数据 | 提示需透過 WebSearch 取得協議數據 | DeFi APY requires WebSearch (DefiLlama/CoinGecko) | | Other stderr | 原样展示,不重试 | 原樣展示,不重試 | Surface verbatim, do not retry | ## MCP fallback For spot crypto prices: the equivalent MCP tool with `.HAS` symbols. DeFi protocol data has no Longbridge MCP equivalent — WebSearch is required. ## Related skills | User asks | Route to | |---|---| | Crypto spot price only | `longbridge-quote` | | Crypto market overview / news | `longbridge-core` | | Options on crypto | `longbridge-derivatives` | | General market calendar | `longbridge-calendar` | ## File layout ``` longbridge-defi-yield/ └── SKILL.md ``` Prompt-only — no `scripts/`. DeFi protocol data sourced via WebSearch. Spot crypto prices via `longbridge quote <SYMBOL>.HAS --format json`.

longbridge-depth

|

# longbridge-depth Orderbook depth, broker queue (HK-only), and tick-by-tick trades. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## Subcommands | Subcommand | Returns | |---|---| | `depth` | 5 / 10-level orderbook: per-level price / volume / order_num | | `brokers` | Per-level broker_id queue (**HK only**). Tell the user the queue is HK-only when they ask about a non-HK symbol. | | `trades` | Latest N trades: time / price / volume / direction / type. Pass `--count 1..1000`. | `broker_id` integers can be translated to names via `longbridge-security-list` → `participants`. ## When to use - *"看下 700.HK 的盘口"*, *"TSLA 5 档买卖盘"* → `depth` - *"茅台经纪商队列"* — non-HK symbol → tell user *"broker queue is HK-only"* and switch to `depth` - *"NVDA 最近 50 笔成交"*, *"腾讯 tick 数据"* → `trades --count 50` - *"700 全部盘口"*, *"microstructure overview"* → call `depth`, `brokers` (if HK), and `trades` and merge the results ## Workflow 1. Resolve the symbol to `<CODE>.<MARKET>`. 2. Pick the subcommand by user intent (table above). For an "overview" intent, run `depth` + `brokers` (HK-only) + `trades` and merge. 3. **Off-hours warning**: outside trading hours, `depth` is the closing snapshot and `trades` are the last N of the previous session — call this out explicitly when responding. 4. Call the Longbridge CLI directly (preferred) or fall back to MCP. 5. Render `depth` as a bid / ask table; describe `trades` as a direction summary (buy-dominant / sell-dominant) plus the latest few rows. Cite Longbridge Securities. ## CLI ```bash longbridge depth 700.HK --format json longbridge brokers 700.HK --format json # HK-only longbridge trades 700.HK --count 50 --format json ``` Always pass `--format json` so the output is machine-parseable. ## Output - `depth` / `brokers`: `{asks: [...], bids: [...]}` (`brokers[i]` includes a `broker_id` array) - `trades`: array of trade rows (`time / price / volume / direction / type`) ## Error handling If `longbridge` is missing, fall back to MCP. If stderr surfaces *"broker queue not supported"* / *"non-HK"* on a `brokers` call, explain that broker queues are HK-only and switch to `depth`. Other stderr messages (auth / invalid symbol) get relayed verbatim. ## MCP fallback 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-only extensions are available; discover them from the MCP server's tool list at runtime. ## Related skills - Quote / static / indices → `longbridge-quote` - Capital flow / large-order distribution → `longbridge-capital-flow` - broker_id → name lookup → `longbridge-security-list` ## File layout ``` longbridge-depth/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-derivatives

|

# longbridge-derivatives Options (US / HK) and HK warrants. Underlying-stock quotes belong in `longbridge-quote`. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## Subcommands > `option` and `warrant` are **parent commands**; each has its own sub-subcommands. Run `longbridge option --help` / `longbridge warrant --help` to see the current sub-subcommand list and their flags. | CLI command | Returns | |---|---| | `longbridge option quote <CONTRACT>... --format json` | Quote(s) for one or more option contracts (OCC symbols). Includes IV, delta, strike, expiry. | | `longbridge option chain <UNDERLYING> --format json` | Available expiry dates for the underlying. | | `longbridge option chain <UNDERLYING> --date YYYY-MM-DD --format json` | Strikes for a specific expiry — each row gives `call_symbol` and `put_symbol` OCC codes. | | `longbridge option volume <UNDERLYING> --format json` | Real-time call / put volume snapshot (use `longbridge option volume daily ...` for historical). | | `longbridge warrant <UNDERLYING> --format json` | Default warrants list for an underlying (HK only). | | `longbridge warrant quote <WARRANT>... --format json` | Quote(s) for HK warrants (leverage, IV, etc.). | | `longbridge warrant issuers --format json` | Directory of HK warrant issuers. | ## OCC option symbol Format: `<TICKER><YYMMDD><C|P><STRIKE×1000, 8 digits>`. Example: `AAPL240119C190000` = AAPL, expires 2024-01-19, Call, strike $190.00. ## Two-step option discovery | User input | Strategy | |---|---| | Full OCC symbol | `option quote <symbol>` directly | | Underlying + expiry + strike + call/put | `option chain <UL> --date <d>` to find OCC code → `option quote` | | Underlying + window only | `option chain <UL>` to list expiries; ask user to pick | ## Term mapping | User says | Term | |---|---| | 认购证 / 牛证 / call | Call | | 认沽证 / 熊证 / put | Put | | 行权价 / strike | Strike | | 到期日 / expiry | Expiry | | 隐含波动率 / IV | Implied volatility | ## CLI ```bash longbridge option quote AAPL250117C190000 AAPL250117P190000 --format json longbridge option chain AAPL.US --format json longbridge option chain AAPL.US --date 2025-01-17 --format json longbridge option volume AAPL.US --format json longbridge warrant 700.HK --format json longbridge warrant quote 12345.HK --format json longbridge warrant issuers --format json ``` ## Output (per subcommand) - `option quote`: array of contract rows (each: IV, delta, strike, expiry, …). - `option chain` (no date): array of `{expiry_date}`. - `option chain --date`: array of `{strike, call_symbol, put_symbol, standard}`. - `option volume`: real-time call / put volume snapshot. - `warrant <UNDERLYING>`: array of warrant rows for that underlying. - `warrant quote`: array of quote rows. - `warrant issuers`: array of `{id, name_(cn), name_(en)}`. ## When to clarify - Warrant query on a non-HK underlying → tell the user "warrants are HK-only" and route appropriately. - Long strike list (>30) → present near-the-money strikes only. - IV / Greeks during off-hours → may be a previous-session snapshot; mention this if the user asks for "real-time". ## MCP fallback 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. ## Error handling If `longbridge` is missing, fall back to MCP. *"no quote access"* on `option quote` indicates the account lacks the options market-data subscription — surface the message verbatim and tell the user to upgrade quote permissions on Longbridge. ## Related skills - Underlying quote / static → `longbridge-quote` - Underlying candlesticks → `longbridge-kline` - Underlying orderbook depth → `longbridge-depth` ## File layout ``` longbridge-derivatives/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-dividend-screen

|

# longbridge-dividend-screen Prompt-only analysis skill. Screens an index universe for high-dividend stocks with sustainable payouts, stable dividend history, and free-cash-flow coverage. Evaluates total return potential (price appreciation + dividend income) for income-oriented investors. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我筛选高分红股票"* / *"篩選高分紅股票"* / *"screen for high-dividend stocks"* - *"A股红利股有哪些"* / *"A股紅利股"* / *"high-dividend A-shares"* - *"港股高股息标的"* / *"港股高股息標的"* / *"HK high-dividend stocks"* - *"股息率高且分红稳定的公司"* / *"股息率高且分紅穩定的公司"* / *"high yield with stable dividends"* - *"红利策略选股"* / *"紅利策略選股"* / *"dividend strategy stock picking"* ## Workflow 1. **Identify universe**: confirm market (A-share / HK / US) and index pool (CSI 300 / CSI Dividend / HSI / Hang Seng High Dividend / S&P 500 / S&P Dividend Aristocrats). 2. Fetch constituent list from the chosen index. 3. For each constituent (≤20 per batch), fetch dividend data and financial KPIs concurrently. 4. Apply dividend quality filters and score each stock. 5. Present ranked shortlist with sustainability analysis. ## CLI Run `longbridge <subcommand> --help` to verify exact flags before calling. ```bash # Step 1: constituent list (JSON key is "stocks") longbridge constituent <INDEX> --format json # Examples: 000300.SH (CSI300), HSI.HK, SPX.US # Step 2: per constituent (run concurrently, batch ≤20) longbridge dividend <SYMBOL> --format json # dividend history, yield, DPS longbridge calc-index <SYMBOL> --format json # PE, PB, ROE, dps_rate, market cap longbridge financial-report <SYMBOL> --kind CF --format json # cash flow statement (FCF) ``` ## Dividend Quality Filters Apply the following filters (user can adjust thresholds): | Criterion | Default threshold | Rationale | |---|---|---| | Dividend yield | > 3% | Meaningful income above risk-free rate | | Payout ratio | < 80% | Leaves room for reinvestment and dividend safety | | Free cash flow per share | > DPS | FCF covers the dividend | | Dividend consistency | Paid dividend in ≥ 3 of last 5 years | Stability signal | | Dividend growth (3yr CAGR) | > 0% (i.e. not declining) | Quality signal | | ROE | > 8% | Minimum profitability quality gate | **Dividend sustainability score** = composite rank across (yield rank desc, FCF-coverage rank desc, consistency rank desc, payout-ratio rank asc, dividend-growth rank desc). **Sector notes**: - Banks and REITs typically have higher payout ratios by design — adjust payout threshold to < 90% for these sectors. - Cyclical sectors (energy, commodities): dividend yield may be high near cycle peak; check trend vs. last 3 years. ## Output template ``` High-Dividend Screen — <INDEX> (<N> stocks screened) Source: Longbridge Securities Date: <today> Filters: yield>3%, payout<80%, FCF>DPS Rank Symbol Name Yield Payout FCF/DPS 3yr Div CAGR Consistency Score 1 <SYM> <Name> <N>% <N>% <N>x +<N>% 5/5 yrs <N>/10 2 ... ... (top 10 candidates) [Dividend Sustainability Highlights] - Most stable (dividend consistency): <symbol> — paid uninterrupted for N years, FCF cover Nx - Highest dividend growth: <symbol> — 3yr DPS CAGR +N% - Risk flag: <symbol> — high yield but payout ratio >80%, monitor FCF [Total Return Estimate (illustrative, based on historical data)] Assuming dividend reinvestment + 5% annual price appreciation: - <symbol>: illustrative 5yr total return ~N% (div. yield N% + price N%) ⚠️ 筛选结果仅反映股息相关量化指标的符合程度,不代表对上述标的的投资建议。高股息不等于低风险,请结合个人情况独立判断。以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。/ 篩選結果僅反映股息相關量化指標的符合程度,不代表對上述標的的投資建議。高股息不等於低風險,請結合個人情況獨立判斷。/ Screening results only reflect dividend-related quantitative criteria and do not represent investment recommendations for the listed securities. High dividend yield does not equal low risk. The above is for reference only and does not constitute investment advice. Please make investment decisions independently based on your own risk tolerance. Dividends are not guaranteed. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;若也不可用,请安装 longbridge-terminal | 回退到 MCP;若也不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal. | | No index specified | 请告知要筛选的市场/指数,如沪深300、红利指数、恒生高息 | 請告知要篩選的市場/指數,如滬深300、紅利指數、恒生高息 | Please specify a market or index, e.g. CSI 300, HSI, or S&P 500. | | constituent returns empty | 未能获取成分股列表,请检查指数代码 | 未能獲取成分股列表,請檢查指數代碼 | Cannot fetch constituent list; check index symbol. | | dividend data unavailable | 跳过该标的,标注无分红历史数据 | 略過該標的,標注無分紅歷史數據 | Skip symbol; no dividend history data. | | CF report unavailable | 使用 DPS/EPS 代替 FCF/DPS 作为覆盖率近似 | 使用 DPS/EPS 代替 FCF/DPS 作為覆蓋率近似 | Use DPS/EPS as proxy for FCF coverage. | ## 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 - Value investing screen (PE/PB/ROE) → `longbridge-value-screen` - Deep valuation analysis (single stock) → `longbridge-valuation` - Dividend history for a single stock → `longbridge-fundamental` - Peer comparison → `longbridge-peer-comparison` ## File layout ``` longbridge-dividend-screen/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-earnings-preview

>

# longbridge-earnings-preview > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## What This Skill Does You help individual investors prepare for an upcoming earnings release by surfacing the information they need — without requiring them to manually dig through filings, transcripts, and news. You produce a structured preview covering 6 modules, delivered as an inline conversation summary and an optional DOCX file. ## When to Use | Trigger | Example | |---------|---------| | Before earnings release | "NVDA 下季度财报要关注什么" / "Preview TSLA.US Q3 earnings" | | Prior guidance review | "苹果上季度给了什么指引?" / "What was AAPL's guidance last quarter?" | | Earnings call Q&A | "上期电话会分析师在问什么?" | | General earnings prep | "下周要发财报了,帮我梳理一下" / "Help me prepare for MSFT earnings" | **Do not trigger if:** the company has already reported → use earnings-update skill instead. ## Output Language Follow the user's conversation language. Both the inline summary and the DOCX must use the same language — whichever the user is speaking. - English conversation → fully English output (inline + DOCX) - Chinese conversation → fully Chinese output (inline + DOCX) - User can override at any time: "write in English" / "用中文写" / "用繁體中文寫" **Always in English regardless of output language:** file names, ticker symbols, CLI commands, financial metric abbreviations (EPS, EBIT, CapEx, YoY, etc.), and numeric values with currency symbols. **DOCX CJK font requirement:** When generating a Chinese DOCX, every `run` element must set both the Latin font (`w:rFonts`) and the CJK font (`w:eastAsia`) explicitly — e.g. Calibri + Microsoft YaHei. Also call `set_doc_default_cjk()` on the document's Normal style. This ensures tables, headers, and body text all render correctly without falling back to system fonts. ## Data Sources Priority: **CLI (primary) → Web Search (supplement)** Before using any CLI command, run `longbridge <command> --help` to check the exact argument format and available options — the CLI is updated frequently and flags may change. Do not assume flag names or argument positions. **CLI docs**: https://open.longbridge.com/zh-CN/docs/cli/ **MCP endpoint**: `https://openapi.longbridge.com/mcp` | Data Needed | CLI Entry Point | |-------------|----------------| | Prior filings & guidance | `longbridge filing --help` | | Financial statements | `longbridge financial-report --help` | | Analyst consensus estimates | `longbridge consensus --help` | | EPS estimates & revisions | `longbridge forecast-eps --help` | | Operating history | `longbridge operating --help` | | Quote & valuation | `longbridge quote --help` / `longbridge calc-index --help` | | Price trend | `longbridge kline --help` | | Capital flow & positioning | `longbridge capital --help` | | Analyst ratings | `longbridge institution-rating --help` | | News & events | `longbridge news --help` | **JSON output handling:** When parsing CLI JSON output with Python or jq, always save to a temp file first (`longbridge <cmd> > /tmp/data.json`), then read the file. Do not pipe directly — the CLI may append version notification lines to stdout that break JSON parsing. Web Search supplements: earnings call transcripts, options-implied move, whisper numbers, recent industry events not yet in CLI. ## Functional Modules ### Module A — Prior Quarter Earnings Extraction Extract from the most recent earnings filing and call: - **Guidance fulfillment**: the key metric is always **management's own prior guidance vs. actual result** — not YoY comparison, not consensus vs. actual. Specifically: what did management guide for Q[N-1] at the end of Q[N-2]? How did Q[N-1] actual compare to that guidance? - **Management outlook**: macro/sector views, strategic priorities, capital allocation - **Performance summary**: for each guided metric, compute the beat/miss amount and direction **Critical rule for 【一】table columns:** ``` 指标 | 管理层此前指引(上上季电话会) | 上季实际值 | 与指引偏差 | 评估 ``` - Column 2 = management's own guidance range/midpoint, NOT market consensus - Column 3 = actual reported value - Column 4 = (actual − guidance midpoint) / guidance midpoint, with sign - Column 5 = 超预期 / 基本符合 / 不及预期 If management did not give quantitative guidance for a metric (e.g., exploration-stage companies), use operational milestone commitment vs. actual progress instead. Use `longbridge filing --help` to locate prior filings. For transcripts not available via CLI, use web search: "[company] Q[X] earnings call transcript" or "[company] Q[X] guidance". ### Module B — Recent Events Tracking Surface events since the prior earnings release that are relevant to this quarter's results. Categorize by: - **Macro / policy**: rate changes, trade policy, regulatory actions - **Industry**: competitor moves, sector data, supply chain changes - **Company**: product launches, management changes, M&A rumors, major contracts, stock moves - **Market sentiment**: analyst rating changes, institutional activity, options implied volatility Use `longbridge news --help` for news and `longbridge institution-rating --help` for rating changes. Use web search for events not yet indexed in CLI. Each event: timestamp, source, relevance to upcoming earnings. ### Module C — Prior Earnings Call Q&A Summary Extract from the prior earnings call transcript: - **High-frequency analyst questions**: topics multiple analysts pressed on (margins, segment growth, capex, etc.) - **Management response**: concise conclusion for each key question — not verbatim, just the key judgment - **Verification significance**: which of these Q&A topics will be answered or updated by this quarter's results Source: web search for "[company] Q[X] earnings call transcript". ### Module D — Key Focus Framework for This Quarter Synthesize Modules A–C into an actionable preview: - **Guidance fulfillment checklist**: each prior quantitative guidance item → the specific data point to check - **Beat / miss risk factors**: what could cause results to surprise in either direction - **3–5 key questions to watch**: written in plain language, combining institutional focus with the user's holding thesis - **Risk flags**: tail risks from prior management warnings + recent external events See [references/scenarios.md](references/scenarios.md) for scenario analysis framework. ### Module E — Historical Guidance Fulfillment Tracking Pull 4–8 quarters of history to establish management's guidance track record: - Guidance vs. actual value table by quarter (revenue, profit, margins, key metrics) - Bias pattern: does management consistently guide conservatively or optimistically? - Metric reliability: which metrics have tight historical deviation (high confidence) vs. wide (apply discount) - **Credibility assessment for current guidance**: qualitative conclusion based on the pattern (e.g. "Revenue guidance has beaten actual by avg 3–5% over 6 quarters — current guidance likely conservative") Use `longbridge financial-report --help`, `longbridge operating --help`, `longbridge consensus --help`. ### Module F — Market Consensus vs. Management Guidance Identify expectation gaps between the Street and management: - Current consensus estimates for key metrics (revenue, EPS, margins) - Comparison with management guidance: is consensus above / below / within the guidance range? - Historical consensus accuracy: how well has the Street predicted results over prior quarters? - **Expectation gap alerts**: flag significant divergences as upside or downside risk Use `longbridge consensus --help` and `longbridge forecast-eps --help` for consensus data. ## Output ### Output 1 — Inline Conversation Summary Use exactly the following structure. Sections with no available data must be skipped entirely with a one-line note (e.g. "暂无电话会记录,跳过"). Do not rename, reorder, or add extra sections. ``` 📊 [公司名称(股票代码)] 财报前瞻摘要 财报发布日期:{日期} | 分析日期:{今天} ════════════════════════════════════════ 【一】上期业绩指引回顾 ▸ [指标]:管理层指引 {区间/中值} → 实际 {值}({超预期/不及预期 +X%}) ※ 必须是管理层自身指引 vs. 实际,不是共识 vs. 实际,不是 YoY 对比 ▸ ... 【二】管理层展望要点 ▸ ... 【三】上期电话会 | 分析师核心 Q&A Q1:[问题] ↳ 管理层答复:[结论] ↳ 本次关注:[需验证的指标] 【四】近期重要事件 ▸ [日期] [来源] 事件描述 → 关联性:... 【五】历史指引兑现规律 ▸ 收入指引:过去 N 季平均偏差 {方向} {幅度} ▸ EPS 指引:兑现率 {%},平均偏差 {值} ▸ 本次指引可信度:{评估} 【六】市场一致预期 vs 管理层指引 指标 市场预期 管理层指引 偏差 收入 ... ... ... EPS ... ... ... ▸ 预期差提示:... 【七】本次财报核心关注点 ① ... ② ... ③ ... 【八】风险提示 ⚠ ... --- ⚡ 数据来源:Longbridge CLI + Web Search | 仅供参考,不构成投资建议 ``` ### Output 2 — DOCX Report (always generate by default) Use the builders at `scripts/docx_builder.py` and `scripts/chart_builder.py`. **Never write a one-off DOCX script from scratch.** Target format: rich institutional report with **data tables + matplotlib charts** in every section. Reference example: `00700HK_Q1_2026_Earnings_Preview.docx` (8 charts + 6 tables, 11 sections). #### DocxBuilder API ```python import sys sys.path.insert(0, "<skill_dir>") # path to earnings-preview/ from scripts.docx_builder import DocxBuilder from scripts.chart_builder import ChartBuilder cb = ChartBuilder() b = DocxBuilder( symbol="ADBE.US", company="Adobe Inc.", report_date="2026年6月11日", analysis_date="2026年5月6日", price="$250.71", market_cap="~$1013亿", valuation="P/E 14.06x", rating="买入(39位分析师)", output_path="ADBE_Q2_FY2026_Earnings_Preview.docx", ) b.cover() b.toc([("【一】","上期业绩指引回顾"), ...]) b.section("【一】上期业绩指引回顾") b.body("...") b.table(headers, rows, col_widths) b.image(cb.quarterly_bar(...)) # embed chart b.section("【三】上期电话会 | 分析师核心 Q&A") b.qa("问题", "管理层答复", "本次关注指标") # ... repeat for all 8 sections ... b.disclaimer() b.save() ``` #### ChartBuilder — available chart types | Method | Description | Typical Section | |--------|-------------|-----------------| | `quarterly_bar(title, quarters, values, estimate_idx, ylabel)` | 季度趋势柱状图(末栏高亮为预测值) | 营收趋势 | | `growth_lines(title, quarters, series, ylabel)` | 多系列 YoY 增速折线图 | 营收/利润增速 | | `grouped_bar(title, categories, series, ylabel)` | 分组柱状图(分部 vs 上期对比) | 分部营收对比 | | `pie_pair(title1, title2, labels, values1, values2)` | 双饼图(上期 vs 本期结构) | 收入结构 | | `scenario_hbar(title, scenarios, values, current, current_label)` | 情景分析横向条形图 | 情景分析 | | `peer_multiples(title_l, title_r, companies, vals_l, vals_r, highlight, ...)` | 同业估值对比(P/E + P/B) | 估值对比 | | `price_action(title, dates, prices, current, current_label, target, target_label)` | 60日股价走势线图 | 股价走势 | | `analyst_pt_hbar(title, brokers, targets, current, current_label)` | 分析师目标价对比 | 分析师共识 | All chart functions return a PNG file path. Pass directly to `b.image(path)`. #### Chart generation rules - Generate charts from actual CLI data — do not fabricate numbers. - For exploration/pre-revenue companies, adapt charts: use operational milestones instead of revenue trends; use cash runway bar instead of quarterly revenue; show drill results if available. - Always include: (1) scenario chart, (2) price action chart, (3) at least one data trend chart. - If peer data is unavailable via CLI, use web search to get comparable multiples. File name: `[SYMBOL]_Q[N]_[YEAR]_Earnings_Preview.docx` The builder handles CJK font (`Microsoft YaHei` + `Calibri`) on every run automatically. Never set fonts manually — just use `b.body()`, `b.bullet()`, `b.table()`, `b.qa()`, `b.image()`. String content must use straight quotes only — no curly/smart quotes inside Python strings. ## Error handling | Situation | LLM response | |---|---| | Shell `command not found: longbridge` | Fall back to MCP if configured; otherwise tell the user to install longbridge-terminal and provide the web-search-only preview with a clear label. | | stderr `not logged in` / `unauthorized` | Tell the user to run `longbridge auth login`; the skill can still proceed with web search for public data. | | Company has already reported | Tell the user to use `longbridge-earnings` instead (post-earnings update skill). | | No CLI data + no web results | State which modules have gaps; still deliver available modules — do not produce a blank report. | | Other stderr | Surface verbatim — never silently retry. | ## MCP fallback If the CLI binary is unavailable and `claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp` is configured: 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. ## Related skills | If the user wants … | Use | |---|---| | Post-earnings deep-dive (company has already reported) | [`longbridge-earnings`](../longbridge-earnings) | | 5-dimension fundamentals snapshot | [`longbridge-fundamental`](../longbridge-fundamental) | | Historical PE / PB percentile | [`longbridge-valuation`](../longbridge-valuation) | | Classified news + filings + community sentiment | [`longbridge-news`](../longbridge-news) | | Daily incremental briefing across watchlist | [`longbridge-catalyst-radar`](../longbridge-catalyst-radar) | | Earnings date / calendar | [`longbridge-calendar`](../longbridge-calendar) | ## Reference Files | File | Contents | When to Read | |------|----------|--------------| | [scenarios.md](references/scenarios.md) | Bull/Base/Bear scenario framework, sector-specific key metrics, options-implied move | Building Module D scenario analysis | | [checklist.md](references/checklist.md) | Pre-report data collection checklist and output quality checks | Before finalizing output | ## File layout ``` longbridge-earnings-preview/ ├── SKILL.md ├── commands/ │ └── earnings-preview.md # /earnings-preview <SYMBOL> slash command ├── references/ │ ├── scenarios.md # scenario analysis framework │ └── checklist.md # data collection + quality checklist └── scripts/ ├── docx_builder.py # DocxBuilder class — DOCX generation └── chart_builder.py # ChartBuilder class — matplotlib charts ```

longbridge-earnings-revision

|

# longbridge-earnings-revision Prompt-only analysis skill. Orchestrates Longbridge CLI commands to track analyst estimate revision direction, quantify earnings surprise, detect PEAD momentum signals, and analyse management guidance shifts. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"TSLA 预期修正方向"*, *"TSLA estimate revision trend"*, *"TSLA 預期修正方向"* - *"NVDA 超预期幅度"*, *"NVDA earnings surprise"*, *"NVDA 超預期幅度"* - *"AAPL PEAD 信号"*, *"AAPL post-earnings drift signal"* - *"700.HK 分析师上调了吗"*, *"700.HK analyst upgrades"* - *"苹果管理层指引变了吗"*, *"AAPL management guidance revision"* For raw consensus snapshot (current estimates only) use `longbridge-consensus`. For valuation use `longbridge-valuation`. ## CLI Run `longbridge <subcommand> --help` to verify exact flags. Call concurrently: ```bash # Consensus base — always run longbridge consensus <SYMBOL> --format json # Forward EPS by period longbridge forecast-eps <SYMBOL> --format json # Rating distribution + target price change history (key for revision direction) longbridge institution-rating <SYMBOL> --format json longbridge institution-rating <SYMBOL> --history --format json # If unsure about flags: longbridge consensus --help longbridge forecast-eps --help longbridge institution-rating --help ``` ## Workflow 1. **Resolve symbol** to `<CODE>.<MARKET>` format. 2. **Determine scope** from user prompt: | Prompt intent | Commands to run | |---|---| | Revision direction | `consensus` + `institution-rating --history` | | Beat / miss / surprise | `forecast-eps` (actuals vs estimates) | | PEAD signal | `forecast-eps` + `institution-rating --history` | | Guidance revision impact | `consensus` + `institution-rating --history` | 3. **In-LLM analysis**: ### Estimate revision direction Compare current consensus mean EPS vs prior period from `institution-rating --history`: - Rising → **upward revision** (bullish signal) - Flat → **neutral** - Falling → **downward revision** (bearish signal) Count: how many analysts revised up vs down over last 30 / 90 days. ### Earnings surprise (SUE) SUE = (Actual EPS − Consensus estimate) / Standard deviation of estimates | SUE range | Label | |---|---| | > +2 | Strong beat | | +1 to +2 | Beat | | -1 to +1 | In-line | | -2 to -1 | Miss | | < -2 | Strong miss | ### PEAD signal Consecutive beats (≥ 2) + upward revisions → **positive momentum** signal. Consecutive misses (≥ 2) + downward revisions → **negative momentum** signal. Note: PEAD is a statistical tendency, not a guarantee of future returns. ### Guidance revision Identify if most-recent management guidance is above / below / in-line with prior consensus; assess subsequent revision direction as confirmation or pushback. 4. Output structured analysis; cite **Longbridge Securities**; end with disclaimer. ## Output ``` {Symbol} Earnings Revision Analysis — Source: Longbridge Securities As of: {date} [Estimate revision direction (past 30 / 90 days)] - EPS revision: {Rising / Flat / Falling} - Upgrades: {N} analysts | Downgrades: {N} analysts - Net revision bias: {Positive / Neutral / Negative} [Earnings surprise history (last 4 quarters)] Quarter | Actual EPS | Estimate | Surprise % | SUE {Q4} | {A} | {E} | {±X%} | {val} {Q3} | ... {Q2} | ... {Q1} | ... [PEAD signal] - Pattern: {N consecutive beats / misses / mixed} - Revision bias: {upward / neutral / downward} - PEAD inference: {Positive momentum / Neutral / Negative momentum} ⚠️ PEAD is a statistical tendency, not a forecast. [Guidance revision] - Latest management guidance vs prior consensus: {Above / In-line / Below} - Analyst response: {Upgraded / Unchanged / Downgraded} ⚠️ 以上分析仅供参考,不构成投资建议。/ 以上分析僅供參考,不構成投資建議。/ 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`. | | `consensus` < 3 analysts | 覆盖分析师不足 3 位,修正分析仅供参考。 | 覆蓋分析師不足 3 位,修正分析僅供參考。/ Fewer than 3 analysts — revision analysis indicative only. | | No actuals for beat/miss | 跳过超预期分析,注明无历史实际值。 | 跳過超預期分析,注明無歷史數據。/ Skip beat/miss; note no historical actuals. | | 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 - Raw consensus snapshot → `longbridge-consensus` - Post-earnings deep-dive → `longbridge-earnings` - Pre-earnings preview → `longbridge-earnings-preview` - Full fundamentals → `longbridge-fundamental` - Valuation → `longbridge-valuation` ## File layout ``` longbridge-earnings-revision/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-earnings

>

# Earnings Update Skill > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. Both the DOCX report body and the in-chat summary follow the user's language; chart labels, axis titles, and file names always stay in English. ## When to Use | Trigger | Example | |---------|---------| | Post-earnings analysis | "Analyze TSLA.US latest earnings" / "帮我分析腾讯最新财报" | | Specific quarter update | "Tencent Q4 2024 earnings update" / "业绩更新" | | Quarterly results | "Q1/Q2/Q3/Q4 results for [company]" | **Do not trigger if:** user wants an initiation report. ## Data Sources Priority: **CLI (primary) → Web Search (supplement)** Use the Longbridge CLI for all market data. Before using any command, run `longbridge <command> --help` to check available options — the CLI is updated frequently. **CLI + Python pattern**: prefer reading from a file over piping into `python3 -c`. Multi-line JSON with embedded quotes can hit shell-quoting edge cases (especially under zsh's `-c` argument handling), so the safer pattern is: ```bash longbridge institution-rating 700.HK --format json > /tmp/rating.json python3 -c "import json; d = json.load(open('/tmp/rating.json')); print(d)" ``` If you do prefer pipes, use a heredoc-fed Python script (`python3 <<'PY' ... PY`) or save to a file and run a `.py` file. **CLI docs**: https://open.longbridge.com/zh-CN/docs/cli/ **MCP endpoint**: `https://openapi.longbridge.com/mcp` **CLI discovery**: Run `longbridge --help` to see all available subcommands, then `longbridge <subcommand> --help` before calling. Do not assume subcommand names — the CLI is updated frequently. Broad categories needed for earnings analysis: - Earnings calendar / upcoming earnings dates - Financial statements (income, balance sheet, cash flow) - Earnings snapshot / AI beat-miss summary - Analyst consensus & EPS estimates - Quote & valuation metrics - Price history (candlestick) - Analyst ratings & target prices - Regulatory filings (10-Q, 10-K, 8-K) - News Web Search supplements for content not in CLI: consensus estimates vintage, earnings call transcripts, M&A precedent data. ## Execution Workflow **Step 1 — Identify reporting period** Use `longbridge filing --help` to find the latest quarterly or annual filing. Confirm the period with the user before proceeding. **Step 2 — Collect data & analyze** See [references/workflow.md](references/workflow.md) **Step 3 — Update valuation** See [references/valuation-methodologies.md](references/valuation-methodologies.md) **Step 4 — Generate DOCX report** See [references/report-structure.md](references/report-structure.md) **Step 5 — Output conversation summary** See [references/summary-card-spec.md](references/summary-card-spec.md) ## Output 1. **DOCX report**: `[SYMBOL]_Q[N]_[YEAR]_Earnings_Update.docx` (8-12 pages, 8-12 charts) 2. **Conversation summary**: 8-module structured output directly in chat **IMPORTANT**: Do NOT append a Sources section or reference links to the conversation output. All citations belong in the DOCX only. ## MCP fallback If the local `longbridge` CLI is unavailable (`command not found: longbridge`) and the user has run `claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp`, the same data is reachable through MCP. Subcommand → MCP tool mapping: 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-only extras worth pulling in for Step 3 valuation: - the equivalent MCP tool — historical PE/PB time series for percentile context - the equivalent MCP tool — industry-relative position - the equivalent MCP tool / `profit_analysis_detail` — only if the user wants a portfolio-level P&L view alongside the single-name update ## Related skills This skill is the heaviest in the family (institutional-grade 8–12 page DOCX). For lighter or differently-framed asks, defer to a sibling: | User asks for ... | Use | |---|---| | Historical PE/PB percentile, "is X expensive vs its own history / industry?" | [`longbridge-valuation`](../longbridge-valuation) | | 5-dimension KPI overview (revenue / margins / ROE / dividend / consensus) without a DOCX deliverable | [`longbridge-fundamental`](../longbridge-fundamental) | | Cross-symbol matrix, "X vs Y vs Z" | [`longbridge-peer-comparison`](../longbridge-peer-comparison) | | Classified news + filings + community sentiment for a single name | [`longbridge-news`](../longbridge-news) | | Daily incremental briefing across the user's watchlist | [`longbridge-catalyst-radar`](../longbridge-catalyst-radar) | | Live quote / valuation indices | [`longbridge-quote`](../longbridge-quote) | If the user wants the full earnings DOCX *plus* one of the above (e.g. "earnings update on TSLA and how it compares to Ford"), do this skill first, then chain to the other. ## Reference Files | File | Contents | When to Read | |------|----------|--------------| | [workflow.md](references/workflow.md) | Data collection steps, beat/miss framework, segment/margin/guidance analysis | Before analysis | | [valuation-methodologies.md](references/valuation-methodologies.md) | DCF, trading comps, precedent transactions — full methodology | During valuation | | [report-structure.md](references/report-structure.md) | Page-by-page DOCX templates, table and chart formatting, citation rules | Before generating report | | [summary-card-spec.md](references/summary-card-spec.md) | 8-module conversation summary format with examples | When outputting summary | | [best-practices.md](references/best-practices.md) | Quality checklist, common mistakes, headline examples | Quality check |

longbridge-elliott-wave

Elliott Wave technical timing analysis for individual stocks. Identifies current wave cycle position (impulse 5-wave / corrective ABC), validates with Fibonacci ratios, confirms with momentum indicators (MACD, RSI, volume divergence), and evaluates market environment per market (HK / US / A-share / SGX). Outputs structured natural language report with Fibonacci price zones and actionable reference. Triggers on "波浪分析", "艾略特波浪", "Elliott Wave", "波浪周期", "wave analysis", "技术择时", "technical timing", stock ticker + wave/timing keywords, "现在是第几浪", "处于哪个波浪", "波浪判断", "波浪理论", "浪形分析", "波浪择时".

# Elliott Wave Analysis > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. Technical timing skill that positions a stock within its Elliott Wave cycle, confirms with momentum, and contextualizes with market environment. Three modules run sequentially; each result feeds the next. ## When to Use | Trigger | Example | |---------|---------| | Wave position inquiry | "TSLA.US 现在是第几浪" / "700.HK波浪分析" | | Technical timing | "NVDA.US 技术择时" / "苹果波浪择时" | | Pre-trade check | "我想买,波浪角度看合适吗" | | General wave theory | "帮我做个艾略特波浪分析" | **Do not trigger if:** the user requests fundamental analysis, earnings preview, or valuation — use the relevant skill instead. ## Data Sources All price data comes from the Longbridge CLI. **Before the first invocation of any `longbridge` subcommand in a session, run `longbridge <subcommand> --help` to confirm available flags, required arguments, and symbol format.** Do this for every distinct subcommand you use (e.g. `kline`, `quote`, `capital`, `news`). ### What to fetch | Data | Purpose | Minimum | |------|---------|---------| | Daily K-line | Primary wave analysis | ≥ 250 bars, JSON | | Weekly K-line | Higher-degree wave context | ~100 bars, JSON | | Current quote | Latest price, range | JSON | | Capital flow | Southbound / Northbound flow (if available) | JSON | ### Symbol validation Not all ticker-like strings are valid on Longbridge — **index codes (e.g. SPX, HSI) are not tradable securities and will return `invalid symbol`.** When you need broad-market data, use a tracking ETF instead (e.g. SPY.US for S&P 500, 2800.HK for HSI). If uncertain whether a symbol is supported, test with a small kline query first and handle the error gracefully. ### Practical notes - Always redirect CLI output to a temp file (e.g. `/tmp/kline_day.json`) — the CLI may append version notices to stdout that break JSON parsing. - Use `--format json` on every call so output is machine-readable. - Market environment data not available in CLI → use Web Search (see Module C). ## Workflow ### Step 1 — Pre-flight checks Before analysis, verify: 1. Run `longbridge kline --help` and `longbridge news --help` if you haven't already in this session. 2. Fetch ≥ 300 daily candles for the target symbol in JSON format; save to a temp file. 3. Count returned bars. **If < 250 bars → refuse analysis**, reply: - CN: "历史数据不足250根日K,波浪计数不可靠,建议选择数据更充足的标的。" - EN: "Fewer than 250 daily candles available — wave count unreliable." 4. Fetch the 5 most recent news items for the symbol. **If recent suspension/resumption or confirmed fraud/delisting → refuse.** 5. For A-share: if ticker has "ST" prefix → refuse. ### Step 2 — Module A: Wave Cycle Identification Run `scripts/signal_engine.py` to compute swing points, wave count, and Fibonacci zones: ```bash python3 scripts/signal_engine.py --kline /tmp/kline_day.json --symbol SYMBOL ``` The script outputs JSON with: - `stage`: wave stage label (see Stage Labels below) - `count_a` / `count_b`: two candidate count scenarios - `agreed`: true if both counts give the same stage conclusion - `fib_zones`: dict of Fibonacci price levels - `swings`: list of recent swing points **If `agreed` is false → output "结构待确认 / Structure Unconfirmed", do not force a stage label.** **Stage Labels** (translate to user's language): | Internal | Simplified CN | Traditional CN | English | |----------|--------------|----------------|---------| | `impulse_early` | 上升初段 | 上升初段 | Early Impulse | | `impulse_wave3` | 主升段(③浪) | 主升段(③浪) | Wave 3 Advance | | `impulse_late` | 上升末段(⑤浪) | 上升末段(⑤浪) | Late Impulse (Wave 5) | | `top_zone` | 顶部区域 | 頂部區域 | Top Zone | | `corrective_abc` | 调整段(ABC) | 調整段(ABC) | ABC Correction | | `bottom_zone` | 底部区域 | 底部區域 | Bottom Zone | | `unconfirmed` | 结构待确认 | 結構待確認 | Structure Unconfirmed | ### Step 3 — Module B: Momentum Confirmation Compute from the same daily K-line data (all calculable from OHLCV, no extra API calls): | Indicator | Parameters | Signal to Report | |-----------|-----------|-----------------| | MACD | 12/26/9 EMA | Line vs signal, histogram direction, **divergence vs price** | | RSI | 14-period | Level (>70 overbought / <30 oversold), **divergence vs price** | | Volume | Raw volume | Wave 3 highest volume? Wave 5 / C-wave volume vs prior wave | | MA trend | 20 / 50 SMA | Price above/below each MA; MA slope direction | **Critical divergence signals (must flag explicitly):** - Wave 5 top + MACD/RSI bearish divergence → **high alert, potential reversal** - C-wave bottom + MACD/RSI bullish divergence → **potential bottom** - Wave 3 + volume expansion → **confirms wave 3 validity** Each indicator: state its current condition and whether it **supports / is neutral toward / contradicts** the Module A wave label. Do **not** sum into a single score. ### Step 4 — Module C: Market Environment Assess macro/market context relevant to the stock's market. Each signal is independent — do not aggregate into a score. For CLI data in this module, run `longbridge <subcommand> --help` first if you haven't already. **Index codes are not valid symbols on Longbridge** — use tracking ETFs instead (see "Suggested proxy" column). If a proxy symbol returns an error, fall back to Web Search. **HK (HKEX)** | Signal | How to get | Suggested proxy | Web Search fallback | |--------|-----------|-----------------|---------------------| | HSI trend (60-day) | `longbridge kline` — 60 daily bars | 2800.HK (Tracker Fund) | "恒生指数 今日" | | Southbound flow | `longbridge capital` for the target symbol | — | "南向资金 今日净买入" | | Short-sell ratio | Not in CLI | — | "[stock name] HK short selling ratio" | | Recent policy / regulatory | — | — | Web Search | **US (NYSE/NASDAQ)** | Signal | How to get | Suggested proxy | Web Search fallback | |--------|-----------|-----------------|---------------------| | S&P 500 trend (60-day) | `longbridge kline` — 60 daily bars | SPY.US | "S&P 500 price today" | | VIX level | Not in CLI | — | "VIX current level" | | Put/call ratio | Not in CLI | — | "CBOE equity put call ratio" | | Sector ETF trend | `longbridge kline` — 30 daily bars | Relevant sector ETF (e.g. XLK.US, XLE.US) | Web Search | **A-share (SSE/SZSE)** | Signal | How to get | Suggested proxy | Web Search fallback | |--------|-----------|-----------------|---------------------| | Shanghai Composite trend | `longbridge kline` — 60 daily bars | 000001.SH | "上证指数 今日" | | Northbound flow | `longbridge capital` for the target symbol | — | "北向资金 今日" | | Margin balance trend | Not in CLI | — | "融资余额" | | Recent CSRC/policy signals | — | — | Web Search | **SGX** | Signal | How to get | Web Search fallback | |--------|-----------|---------------------| | STI trend | CLI coverage may be limited — try a proxy first, expect errors | "Straits Times Index today" | | Stock-specific news | `longbridge news` for the target symbol | "[company] SGX news" | If a data item is unavailable from both CLI and Web Search, note "数据不可用 / Data unavailable" for that item only. Do not skip the whole module. ### Step 5 — Generate Output Assemble the three-module result into the output template below. ## Output Template The output uses **four sections** written in natural language — no bullet dumps. Match the user's language (Simplified CN / Traditional CN / English) throughout. ``` 【{Company Name}({SYMBOL})】波浪技术分析 分析日期:{today} | 当前价:{price} | 今日区间:{low} – {high} 【一】波浪结构 当前阶段 {stage_label_natural} · {one-line characterisation} {2–3 paragraph prose narrative:} - Para 1: Describe the swing sequence in plain language from the key bottom/origin, naming each wave and the price/date of each pivot. Explain why the current move matches the identified stage. Avoid jargon — translate wave numbers to meaning. - Para 2: Confirm with a second counting perspective (different threshold / degree). State whether both agree ("两套视角结论一致") or conflict ("结构待确认,建议观望"). - Para 3 (if unconfirmed): Explain what would resolve the ambiguity. 波浪结构示意(ASCII,仅在结构清晰时输出) 价格 │ {high} ┤ {stage} ? │ ╱ ... ╱ {origin}┤ 起点╱ └──────────────────────▶ 时间 斐波那契参考区间 上行延伸目标(基准:{base_swing_low} → {base_swing_high},波幅 {span}) | 延伸比例 | 参考价位 | 说明 | |---------|---------|------| | 1.618 倍 | {price} | {interpretation} | | 2.618 倍 | {price} | {interpretation — note if already breached} | | 3.618 倍 | {price} | {next resistance if prior targets breached} | 回调支撑参考 | 支撑区 | 参考价位 | 说明 | |-------|---------|------| | 近期关注 | {price} | 整数关口 / 前期突破区 | | 中度支撑 | {price} | 内部 38.2% 回撤 | | 关键支撑 | {price} | 跌破则 {wave} 计数失效 | | 深度支撑 | {price} | 跌破则整体结构需重新评估 | 失效条件:若日线收盘跌破 {invalidation_price},{what it means}。 【二】动量与市场环境 动量指标 | 指标 | 当前状态 | 对波浪判断的意义 | |------|---------|----------------| | MACD(12/26/9) | 线值 {x} {>/< } 信号线 {y},柱状图 {z} {扩张/收缩} | {supports/neutral/contradicts + reason} | | RSI-14 | {value},{超买/超卖/中性区},{有/无}背离 | {meaning in context of wave stage} | | 均线(MA20/MA50) | MA20 {x} / MA50 {y},价格{领先/滞后},MA20{向上/走平/向下} | {trend context} | | 成交量 | 当日 {x},{高于/低于} 20日均量 {y}({+/-}%),近3日{放量/缩量} | {confirms or warns} | {1–2 sentence synthesis: which indicators align, which diverge, and what that means for the wave count.} {If bearish/bullish divergence detected: ⚠ 检测到 {顶/底}背离——{plain-language explanation of risk}.} 市场背景 {2–4 bullet points from news + Web Search covering catalysts, sector context, macro. Each bullet: [emoji] event description → market interpretation. End with a note if SPX/VIX data was not fetched: "VIX 及大盘最新状态建议通过 Web Search 确认。"} 【三】综合参考 趋势方向:{one sentence on primary trend and whether counter-trend trades are appropriate now.} 值得关注的区间 {Prose paragraph: describe 1–2 price zones worth watching for entry or caution, combining Fibonacci levels + momentum trigger conditions in plain language.} 需要盯住的信号 {3 bullets, each: condition → what it implies for the wave count} 失效观察线:日线收盘跌破 {price},当前判断需重新评估。 【四】做这个分析前,有几点需要告诉你 {3–4 short paragraphs of plain-language caveats tailored to THIS stock's specific situation:} - Subjectivity of wave counting and what gives/reduces confidence here - Fundamental / news drivers and "buy the rumour sell the fact" risk if applicable - Any unusual price characteristics (e.g. Fibonacci targets already breached, extreme RSI) - Reminder that daily close matters more than intraday wicks for invalidation levels --- ⚠ 本分析基于历史技术数据,不代表未来表现,不构成投资建议。 ``` ### Output rules - **No bullet-list dumps** in sections 【一】–【三】. Use tables for data, prose for narrative. - **ASCII wave diagram**: include when `agreed: true`; omit when `unconfirmed`. - **Section 【四】is mandatory** — always write stock-specific caveats, never generic boilerplate. - If `agreed: false`: replace 【一】prose with "两套计数方案结论不一致,建议观望" and skip the diagram and Fibonacci tables. - **Disclaimer** is system-injected at the end; never omit or modify it. ## Error Handling | Situation | Response | |-----------|----------| | `command not found: longbridge` | Fall back to MCP `mcp__longbridge__*`; if also unavailable, ask user to install longbridge CLI | | `not logged in` / `unauthorized` | Ask user to run `longbridge auth login` | | < 250 daily candles | Refuse analysis with explanation | | Recent suspension / ST stock | Refuse analysis with explanation | | Both wave count scenarios conflict, no momentum tiebreak | Output "结构待确认,建议观望" — do not force a label | | Web Search unavailable for Module C item | Mark that item as "数据不可用" — continue other items | | Other CLI stderr | Surface verbatim — do not silently retry | ## Script > ⚠️ **额外依赖 / Extra dependency required** > > `scripts/signal_engine.py` 依赖 `pandas` 和 `numpy`,使用前请确认已安装: > > ```bash > pip install pandas numpy > ``` > > 通常已预装;若报 `ModuleNotFoundError`,运行上述命令后重试。 > Requires `pandas` and `numpy` — usually pre-installed. Run `pip install pandas numpy` if you see `ModuleNotFoundError`. See `scripts/signal_engine.py` for the wave engine (ZigZag + 5-wave impulse + ABC correction + Fibonacci validation). Usage: ```bash python3 scripts/signal_engine.py --kline /tmp/kline_day.json --symbol AAPL.US ``` ## MCP fallback When `longbridge` CLI is not installed, fall back to MCP tools: | CLI command | MCP tool | |---|---| | `longbridge kline <SYMBOL> --period day --format json` | `mcp__longbridge__candlesticks` | | `longbridge kline <SYMBOL> --period week --format json` | `mcp__longbridge__candlesticks` (period=Week) | | `longbridge news <SYMBOL> --format json` | `mcp__longbridge__news` | MCP setup: `claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp` (Quote scope). ## Reference Files | File | Contents | |------|----------| | [references/fibonacci.md](references/fibonacci.md) | Fibonacci ratio tables for all wave relationships | | [references/wave-structure.md](references/wave-structure.md) | Wave structure diagrams, iron rules, corrective variants | | [references/market-environment.md](references/market-environment.md) | Per-market data sources and signal interpretation guide | ## Related Skills - `longbridge-kline` — raw K-line data queries - `longbridge-capital-flow` — capital flow data - `idea-generation` — fundamental screening to complement technical timing - `earnings-analysis` — fundamental event context

longbridge-elliott

|

# longbridge-elliott 艾略特波浪理论信号引擎:基于 Zigzag 摆动点识别,自动匹配五浪推动结构(1-2-3-4-5)与三浪调整结构(A-B-C),辅以斐波那契比率校验,输出当前波浪位置、目标价位与止损风险位。 > **Response language**: match the user's input language — > Simplified Chinese / Traditional Chinese / English. ## When to use - 用户询问波浪计数:*"AAPL 现在走到几浪了"*、*"TSLA 是不是在 4 浪调整"*、*"700.HK 的 Elliott wave 分析"* - 判断行情是否处于推动浪(看多)或调整浪(看空) - 结合斐波那契位置估算目标价和回调支撑 - 用户提到"艾略特"、"浪计数"、"五浪结构"等关键词 ## Workflow 1. 提取标的代码,标准化为 `<CODE>.<MARKET>` 格式。 2. 获取日线 OHLCV 数据(200 根 K 线): ```bash longbridge kline <SYMBOL> --period day --format json # run --help for available flags ``` 3. **Zigzag 识别摆动点**(Python 实现,threshold 默认 5%): ```python def zigzag(highs, lows, threshold=0.05): # 寻找局部高低点序列 # 相邻同向点取极值合并,反向超过 threshold 才确认新摆动点 ... ``` 4. **匹配五浪推动结构**,需满足: - 波 3 不是最短浪(通常最长) - 波 4 不与波 1 价格区间重叠 - 波 2 回撤不超过波 1 起点 5. **斐波那契校验**: - 波 2 回撤:0.382–0.618 × 波 1 - 波 3 延伸:≥ 1.618 × 波 1(常见 1.618–2.618) - 波 4 回撤:0.236–0.382 × 波 3 - 波 5 ≈ 波 1(容差 ±20%) 6. **匹配三浪调整结构** A-B-C(推动浪结束后出现): - B 浪回撤:0.382–0.786 × A 浪 - C 浪 ≈ A 浪(容差 ±20%) 7. 输出当前波浪位置、目标价位、止损位。 > 若不确定 CLI 参数,先运行 `longbridge kline --help` 查看最新参数。 ## CLI ```bash # 日线数据(主要数据源) longbridge kline AAPL.US --period day --format json # run --help for available flags # 周线数据(辅助验证大级别波浪) longbridge kline TSLA.US --period week --format json ``` ## Output 以自然语言呈现,包含: - **当前波浪位置**:如"5 浪推动中的第 3 浪上升段"、"ABC 调整中的 C 浪" - **斐波那契关键位**:目标价位(扩展位)+ 支撑/阻力位 - **止损风险位**:结构失效价位 - **置信度说明**:斐波那契比率符合程度(完全符合/部分符合/仅供参考) - **数据来源**:Longbridge Securities / 数据来源:长桥证券 / 數據來源:長橋證券 ## Error handling | 情形 | 简体回复 | 繁體回覆 / English | |---|---|---| | `command not found: longbridge` | 尝试 MCP fallback;否则请安装 longbridge-terminal | 嘗試 MCP fallback;否則請安裝 longbridge-terminal / Try MCP fallback; otherwise install longbridge-terminal | | stderr 含 `not logged in` | 请运行 `longbridge auth login` | 請運行 `longbridge auth login` / Run `longbridge auth login` | | Zigzag 摆动点不足 | 建议切换更长周期(如周线),运行 `longbridge kline --help` 查看可用参数 | 建議切換更長週期,執行 `longbridge kline --help` / Switch to a longer period; run `longbridge kline --help` for options | | 无法匹配任何波浪结构 | 当前数据暂无清晰波浪结构,建议等待更多确认 | 當前數據暫無清晰波浪結構 / No clear wave structure yet, wait for more confirmation | | 其他 stderr | 原样返回错误,不静默重试 | 原樣返回錯誤 / Surface verbatim, never retry silently | | 其他 stderr | 原样透传,不静默重试 | ## MCP fallback 若 CLI 不可用且已配置 MCP: 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. ## Related skills | 用户询问 | 路由至 | |---|---| | 实时股价/行情 | `longbridge-quote` | | K线图/历史价格 | `longbridge-kline` | | 缠论分型/买卖点 | `longbridge-chanlun` | | 谐波形态 | `longbridge-harmonic` | | 聪明钱/SMC | `longbridge-smc` | | 基本面分析 | `longbridge-fundamental` | ## File layout ``` longbridge-elliott/ └── SKILL.md ```

longbridge-etf-analysis

|

# longbridge-etf-analysis Prompt-only analysis skill. Analyses ETFs across five dimensions: product profile, tracking error, liquidity, premium/discount, and allocation fit — supporting both US-listed ETFs and A-share ETFs. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"QQQ 和 QQQM 哪个更适合长期持有?"* / *"QQQ vs QQQM for long-term holding?"* - *"这只 ETF 的跟踪误差大不大?"* / *"Is the tracking error on this ETF high?"* - *"510300 现在溢价还是折价?"* / *"Is 510300 trading at a premium or discount?"* - *"帮我分析沪深300 ETF 的流动性"* / *"Analyse the liquidity of CSI 300 ETFs"* - *"行业 ETF 怎么选?"* / *"How to pick a sector ETF?"* For index constituent stocks route to `longbridge-constituent`. For individual stock valuation route to `longbridge-valuation`. ## CLI Run `longbridge <subcommand> --help` to verify exact flags. ```bash # ETF quote — price, volume, market cap, turnover longbridge quote <ETF_SYMBOL> --format json # Constituent holdings — underlying stocks and weights longbridge constituent <ETF_SYMBOL> --format json # Historical price — compute tracking error vs index longbridge kline <ETF_SYMBOL> --period day --count 60 --format json # Index / benchmark price for comparison longbridge kline <BENCHMARK_SYMBOL> --period day --count 60 --format json # Valuation indices (PE/PB of ETF if available) longbridge calc-index <ETF_SYMBOL> --format json ``` ## Five-dimension analysis ### 1. Product profile Extract from `quote` + `constituent` output: - Underlying index tracked - AUM / total market cap (proxy) - Expense ratio (if available in quote metadata; otherwise note "check fund prospectus") - Inception date / listing exchange ### 2. Tracking error - Fetch ETF daily kline and benchmark daily kline (60 bars). - Daily return difference: `d_i = r_ETF_i − r_index_i` - Tracking error (annualised): `TE = std(d) × √252` - Interpretation: TE < 0.3% excellent; 0.3–1% acceptable; > 1% investigate. ### 3. Liquidity From `quote`: - Average daily volume and turnover - Bid-ask spread (if tick data available; otherwise use turnover-rate as proxy) - Liquidity flag: turnover-rate > 0.5% = liquid; < 0.1% = illiquid (A-share ETFs) ### 4. Premium / discount (NAV vs market price) - For A-share ETFs: `premium = (market price − NAV) / NAV × 100%` - NAV may not be in real-time quote; note this and use EOD NAV if available. - Persistent premium > 2% or discount < −2% signals arbitrage opportunity or liquidity issue. - For US ETFs: premium/discount is typically < 0.1% due to continuous creation/redemption. ### 5. Allocation fit - Index type: broad market (SPY/QQQ/510300) vs sector (XLK/515790) vs factor (value/growth/momentum) - Currency and market exposure - Overlap analysis: if user holds multiple ETFs, flag significant holdings overlap from `constituent` ## Workflow 1. Resolve ETF symbol to `<CODE>.<MARKET>` (e.g. `SPY.US`, `510300.SH`). 2. Concurrently fetch: `quote`, `constituent`, ETF kline, benchmark kline. 3. Compute TE, assess liquidity, estimate premium/discount. 4. Summarise all five dimensions. 5. Output structured report (template below). Cite Longbridge Securities. ## Output template ``` {ETF Symbol} analysis — Source: Longbridge Securities [1. Product profile] - Index tracked: {name} | Exchange: {ex} - AUM proxy (mkt cap): {$X} | Expense ratio: {X% / see prospectus} [2. Tracking error (60-day)] - Annualised TE: X% → {excellent / acceptable / elevated} [3. Liquidity] - Avg daily volume: {X} | Turnover rate: X% → {liquid / moderate / illiquid} - Bid-ask spread estimate: {X% / data unavailable} [4. Premium / Discount] - Latest: {+X% premium / −X% discount / ~flat} - Note: {A-share ETF — NAV published after close / US ETF — near-zero typical} [5. Allocation fit] - Type: {broad market / sector / factor} - Key holdings (top 5): {list from constituent} - Currency exposure: {USD / CNY / HKD} [Summary] {2–3 sentence overall assessment} ⚠️ 以上分析仅供参考,不构成投资建议。/ 以上分析僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 切换到 MCP;若不可用,请安装 longbridge-terminal | 切換至 MCP;若不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal | | stderr `not logged in` | 请执行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | `constituent` returns empty | 持仓数据暂不可用,跳过重叠分析 | 持倉數據暫不可用,跳過重疊分析 | Constituent data unavailable; skipping overlap analysis | | Benchmark kline unavailable | 无法计算跟踪误差,仅显示 ETF 本身收益 | 無法計算追蹤誤差,僅顯示 ETF 本身收益 | Cannot compute TE; showing ETF return only | ## MCP fallback 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. ## Related skills - Constituent stock list → `longbridge-constituent` - Individual stock valuation → `longbridge-valuation` - Capital flow into ETF holdings → `longbridge-capital-flow` - Market / index temperature → `longbridge-market-temp` ## File layout ``` longbridge-etf-analysis/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-etf-flow

|

# longbridge-etf-flow US ETF capital-flow analysis — sector rotation signals from ETF inflows and outflows. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking about: - ETF-level capital flows — *"XLK 资金流向"*, *"SPDR ETF flow"*, *"哪个板块 ETF 资金在流入"* - Sector rotation signals via ETFs — *"行业轮动信号"*, *"sector rotation signal"* - Risk appetite from ETF volume — *"避险情绪"*, *"risk-on / risk-off via ETF"* - Thematic momentum — *"科技 ETF 动量"*, *"tech ETF momentum"* For individual stock capital flow defer to `longbridge-capital-flow`. For index constituents defer to `longbridge-constituent`. ## Common sector ETF reference | Sector | ETF | 板块(简体) | 板塊(繁體) | |--------|-----|------------|------------| | Technology | XLK.US | 科技 | 科技 | | Financials | XLF.US | 金融 | 金融 | | Energy | XLE.US | 能源 | 能源 | | Health Care | XLV.US | 医疗 | 醫療 | | Consumer Disc. | XLY.US | 非必需消费 | 非必需消費 | | Consumer Staples | XLP.US | 必需消费 | 必需消費 | | Industrials | XLI.US | 工业 | 工業 | | Materials | XLB.US | 材料 | 材料 | | Real Estate | XLRE.US | 房地产 | 房地產 | | Utilities | XLU.US | 公用事业 | 公用事業 | | Communication | XLC.US | 通信 | 通信 | > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## Workflow 1. Identify which ETF(s) the user is interested in; default to all 11 SPDR sectors if none specified. 2. Fetch real-time quote and volume for each ETF. 3. Fetch recent daily OHLCV to compute 5-day / 20-day volume trend. 4. Fetch intraday capital flow if available. 5. Rank ETFs by net inflow signal; identify top-3 inflow and top-3 outflow sectors. 6. Synthesise sector rotation narrative and risk-appetite assessment. ## CLI ```bash # Real-time quote + volume longbridge quote <ETF_SYMBOL> --format json # Recent price + volume history (20 trading days) longbridge kline <ETF_SYMBOL> --period day --count 20 --format json # Intraday capital flow longbridge capital <ETF_SYMBOL> --format json ``` ## Output 1. Ranked table: ETF | Sector | Today's change | Volume vs 20-day avg | Flow signal 2. Top inflow / outflow sectors highlighted. 3. Narrative: what the rotation pattern implies for risk appetite and market leadership. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | ETF symbol not found | 未找到该 ETF,请确认代码(如 XLK.US)。 | 找不到該 ETF,請確認代碼(如 XLK.US)。 | ETF not found — verify the ticker (e.g. XLK.US). | | Capital flow data unavailable | 资金流数据暂不可用,仅展示价格和成交量。 | 資金流數據暫不可用,僅展示價格和成交量。 | Capital flow data unavailable — showing price and volume only. | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | | `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-capital-flow` — intraday capital flow for a single stock - `longbridge-constituent` — index / ETF constituent stocks - `longbridge-sector-rotation` — macro-driven sector rotation framework ## File layout ``` skills/longbridge-etf-flow/ └── SKILL.md ```

longbridge-event-opportunity

|

# longbridge-event-opportunity Corporate event opportunity scanner — identify pricing dislocations from M&A, buybacks, index changes, equity incentives, and lockup expiries. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking for: - M&A / restructuring plays — *"并购重组机会"*, *"asset injection"*, *"借壳上市"*, *"reverse merger"* - Buyback or insider increase signals — *"回购信号"*, *"大股东增持"*, *"buyback signal"* - Index inclusion / exclusion trades — *"指数调整机会"*, *"index inclusion"*, *"index rebalance"* - Equity incentive plans — *"股权激励"*, *"equity incentive plan"*, *"management alignment"* - Lockup expiry (解禁) — *"限售股解禁"*, *"lockup expiry"*, *"解禁压力"* - General event-driven — *"事件套利"*, *"special situation"*, *"event-driven"* ## Workflow 1. Extract the symbol or scan recent filings for a universe. 2. Fetch news, filings, corporate actions, and calendar in parallel. 3. Identify event type(s) from the data: | Event Type | Key Signal | Historical Edge | |---|---|---| | M&A / Restructuring | 资产注入公告, 借壳公告 | +15–30% in 20 trading days (A-share avg) | | Major Shareholder Increase | 大股东增持 ≥1% | +5–12% in 10 days | | Buyback Programme | 回购计划公告 | +3–8% in 5 days, sustained support | | Equity Incentive | 股权激励方案 | +2–6%, binding to 12–36 month vesting | | Index Inclusion | 指数调整公告 | +3–10% over 5–10 days before effective date | | Index Exclusion | 指数剔除公告 | -3–8% selling pressure | | Lockup Expiry | 限售股解禁 | -2–6% around expiry window | 4. For each detected event: - Summarise the event details (size, timing, counterparties) - State the typical historical price reaction pattern - Assess current price positioning relative to the event 5. Output a ranked event list for user reference. > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## CLI ```bash # Recent news and event announcements longbridge news <SYMBOL> --format json # Corporate filings (prospectus, announcements) longbridge filing <SYMBOL> --format json # Corporate actions (dividends, splits, rights issues) longbridge corp-action <SYMBOL> --format json # Upcoming earnings and events calendar longbridge finance-calendar --format json # 60-day daily OHLCV for pre/post event price reaction longbridge kline <SYMBOL> --period day --count 60 --format json ``` ## Output structure ``` EVENT ANALYSIS REPORT — <SYMBOL> <Date> EVENTS DETECTED ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Event 1: MAJOR SHAREHOLDER INCREASE Announced: <date> Details: <shareholder> increased stake by x.x% to xx.x% Amount: $xxx million Historical market reaction reference: +x–x% in 10 trading days post-announcement (historical average) Current price vs. announcement: +x.x% Signal strength: ★★★★☆ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Event 2: LOCKUP EXPIRY Expiry date: <date> (xx trading days from now) Shares: xxx million shares (~xx% of free float) Avg cost: $xx.xx (current price: $xx.xx — holders at +xx% gain) Selling risk: [High | Moderate | Low] Historical market reaction reference: -x–x% in 5 days around expiry (historical average) RANKED EVENT LIST #1 <Event type> Signal: ★★★★☆ Risk: Medium #2 <Event type> Signal: ★★★☆☆ Risk: High --- 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。 The above is for informational purposes only and does not constitute investment advice. Investment decisions should be made independently based on your own risk tolerance. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | Symbol not found | 未找到该代码,请确认市场和格式。 | 找不到該代碼,請確認市場和格式。 | Symbol not found — verify exchange and ticker. | | No events detected | 近期未发现明显事件信号,建议持续关注公告。 | 近期未發現明顯事件信號,建議持續關注公告。 | No significant events detected — monitor filings continuously. | | Filing data unavailable | 公告数据暂不可用,请直接查阅交易所官网。 | 公告數據暫不可用,請直接查閱交易所官網。 | Filing data unavailable — check the exchange directly. | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | | `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-news` — news, announcements, and sentiment - `longbridge-calendar` — earnings, dividends, and macro event calendar - `longbridge-corporate` — major shareholders and corporate actions - `longbridge-catalyst-radar` — watchlist-wide catalyst scanning - `longbridge-flows` — insider trades and institutional holdings ## File layout ``` skills/longbridge-event-opportunity/ └── SKILL.md ```

longbridge-event-strategy

|

# longbridge-event-strategy Event-driven investment strategy framework — identify corporate events (M&A, spinoffs, buybacks, index rebalancing, lockup expiry) that create pricing dislocations, score sentiment, analyse historical price reactions, and size positions accordingly. Uses Longbridge news, filings, calendar, and candlestick data as signal inputs. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user asks about: - M&A / merger arbitrage — *"收购消息出来后怎么套利"*, *"merger arbitrage setup"* - Index rebalancing — *"纳指成分股调整怎么交易"*, *"index rebalancing trade"* - Lockup expiry — *"解禁日如何布局"*, *"lockup expiry strategy"* - Buyback catalyst — *"回购公告后怎么操作"*, *"buyback announcement play"* - Spinoff / separation — *"分拆上市如何参与"*, *"spinoff event trading"* - General event-driven framework — *"事件驱动策略怎么做"* For real-time news without strategy framing, prefer `longbridge-news`. For earnings-specific events, prefer `longbridge-earnings` or `longbridge-earnings-preview`. ## Workflow ### Step 1 — Event identification Run `longbridge news` and `longbridge filing` for the target symbol to surface recent corporate events. Run `longbridge finance-calendar` to identify upcoming scheduled events (earnings, dividends, index reviews). ### Step 2 — Sentiment scoring Analyse the news/filing content for event type and directional sentiment: | Event type | 简体 | 繁體 | English | |---|---|---|---| | M&A announcement | 并购公告 | 並購公告 | M&A announcement | | Index inclusion/exclusion | 指数纳入/剔除 | 指數納入/剔除 | Index rebalancing | | Lockup expiry | 限售股解禁 | 限售股解禁 | Lockup expiry | | Share buyback | 股份回购 | 股份回購 | Share buyback | | Spinoff / separation | 分拆上市 | 分拆上市 | Spinoff | ### Step 3 — Historical price reaction Run `longbridge kline` (daily, 60 days around prior similar events) to measure the historical price reaction window (T-5 to T+20). ### Step 4 — Historical reaction summary Based on event type and historical reaction magnitude, summarise the observed price reaction range and volatility characteristics for this class of event. Present the data as historical reference only; do not provide entry timing, stop-loss levels, target prices, or holding-period recommendations. ## CLI ```bash # Corporate news and filings longbridge news <SYMBOL> --format json longbridge filing <SYMBOL> --format json # Upcoming events calendar (earnings, dividends, index reviews) longbridge finance-calendar --format json # Historical daily candlestick for price-reaction analysis longbridge kline <SYMBOL> --period day --count 60 --format json ``` > Run `longbridge news --help`, `longbridge filing --help`, and `longbridge kline --help` to verify flags. ## Output For a given symbol and event, produce a structured event brief: 1. **Event summary** — type, date, source. 2. **Sentiment score** — bullish / neutral / bearish with rationale. 3. **Historical reaction reference** — average T+5/T+10/T+20 return range and volatility for this event type (if data available), presented as historical statistics only. --- 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。 The above is for informational purposes only and does not constitute investment advice. Investment decisions should be made independently based on your own risk tolerance. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请先安装 longbridge-terminal | 請先安裝 longbridge-terminal | Install longbridge-terminal first | | `not logged in` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | No relevant news found | 提示近期无相关事件公告 | 提示近期無相關事件公告 | No relevant corporate events found | | Other stderr | 原样展示,不重试 | 原樣展示,不重試 | Surface verbatim, do not retry | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills | User asks | Route to | |---|---| | Post-earnings analysis | `longbridge-earnings` | | Pre-earnings preview | `longbridge-earnings-preview` | | Recent news / filings only | `longbridge-news` | | Options for hedging event risk | `longbridge-derivatives` | | Insider trades around events | `longbridge-flows` | ## File layout ``` longbridge-event-strategy/ └── SKILL.md ``` Prompt-only — no `scripts/`. Discover current CLI flags via `longbridge <subcommand> --help`.

longbridge-execution-model

|

# longbridge-execution-model Trade execution modelling framework for backtesting — slippage, VWAP/TWAP, market impact, and volume participation. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking for: - Slippage or market impact modelling — *"帮我建一个滑点模型"*, *"square root market impact model"* - VWAP / TWAP execution strategy — *"VWAP执行逻辑"*, *"TWAP slice timing"* - Volume participation rate (POV) — *"成交量参与率策略"*, *"POV strategy"* - Kyle lambda or price impact estimation — *"Kyle lambda 估算"*, *"execution cost analysis"* > This skill is for **backtesting / analysis only** — no live order placement. ## Workflow 1. Identify the symbol and fetch intraday volume profile and tick data. 2. Compute average daily volume (ADV) and intraday volume curve. 3. Apply the requested execution model: - **Linear slippage**: `impact = k × (order_size / ADV)` - **Square-root impact**: `impact = σ × √(order_size / ADV)` - **Kyle lambda (λ)**: estimate from tick data as `ΔP / ΔQ` - **VWAP slice**: distribute order proportionally to historical volume curve - **TWAP slice**: divide order into equal time-weighted tranches - **POV**: cap participation at `p%` of each interval's volume 4. Output estimated cost in bps and recommended execution schedule. 5. Generate Python code skeleton if the user wants a local implementation. > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## CLI ```bash # 1-minute OHLCV — intraday volume distribution reference longbridge kline <SYMBOL> --period 1m --count 200 --format json # Tick-by-tick trades — for Kyle lambda estimation longbridge trades <SYMBOL> --count 100 --format json ``` ## Output structure ``` EXECUTION MODEL REPORT — <SYMBOL> <Date> VOLUME PROFILE ADV (20d): xx.xM shares Intraday: 09:30–10:00 xx% ██████ 10:00–11:00 xx% ████ ... MODEL PARAMETERS Model: Square-Root Impact Order Size: xx,000 shares (xx% of ADV) Volatility σ: x.xx% (daily) COST ESTIMATES Market Impact: xx bps Spread Cost: x bps Total Cost: xx bps (~$xx,xxx on $x.xM order) EXECUTION SCHEDULE (VWAP) 09:30–10:00 x,xxx shares 10:00–11:00 x,xxx shares ... KYLE LAMBDA Estimated λ: x.xxe-6 ($/share per share traded) ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | Symbol not found | 未找到该代码,请确认市场和格式。 | 找不到該代碼,請確認市場和格式。 | Symbol not found — verify exchange and ticker. | | Insufficient tick data | 逐笔数据不足,结果仅供参考。 | 逐筆數據不足,結果僅供參考。 | Insufficient tick data — estimates are approximate. | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | | `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-kline` — candlestick and OHLCV data - `longbridge-depth` — orderbook depth and tick trades - `longbridge-strategy-optimizer` — strategy backtesting and optimisation - `longbridge-anomaly` — unusual volume and price movements ## File layout ``` skills/longbridge-execution-model/ └── SKILL.md ```

longbridge-factor-research

|

# longbridge-factor-research A systematic framework for testing whether a quantitative factor adds predictive value for future returns — covering IC analysis, information ratio, decile portfolio construction, and factor decay. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我分析 PE 因子的 IC"*, *"test IC for the PE factor on A-shares"* - *"动量因子有效吗"*, *"is momentum factor effective on HK stocks"* - *"做个分层回测"*, *"run a decile portfolio backtest"* - *"这个因子多少期后失效"*, *"how many periods until this factor decays"* - *"IC 序列自相关怎么算"*, *"calculate IC serial autocorrelation"* For multi-factor screening (not research), use `longbridge-factor-screen`. For ML-based strategies, use `longbridge-ml-strategy`. ## Workflow ### Step 1 — Define the factor Clarify with the user: - Factor name and calculation (e.g. trailing-12M PE, 1M price momentum, ROE YoY change). - Universe: index constituent (e.g. CSI 300, HSI, S&P 500) or custom list. - Test period (e.g. 2020-01-01 to 2024-12-31). - Holding period (e.g. monthly rebalance). ### Step 2 — Fetch universe constituents ```bash longbridge constituent --help longbridge constituent <INDEX> --format json ``` Extract the `stocks` array. Common indices: `000300.SH` (CSI 300), `HSI.HK`, `SPX.US`. ### Step 3 — Fetch factor values and returns For each symbol in the universe: ```bash longbridge calc-index <SYMBOL> --format json # valuation, growth metrics longbridge kline <SYMBOL> --period day --count 252 --format json # price history for returns ``` Run `--help` on each command to verify available fields before parsing. ### Step 4 — Compute IC at each rebalance date `IC_t = rank_correlation(factor_value_t, forward_return_t+h)` Where `h` = holding period. Use Spearman rank correlation (robust to outliers). Winsorize factor values at 1%/99% before ranking. ### Step 5 — Summary statistics | Metric | Formula | Good signal threshold | |---|---|---| | Mean IC | Average of IC time series | > 0.03 (positive) | | IC Std Dev | Standard deviation of IC | Lower is better | | IR (Information Ratio) | Mean IC / Std Dev IC | > 0.5 is promising | | IC > 0 hit rate | % of periods IC > 0 | > 55% | | ICIR (annualised) | IR × √(periods per year) | > 1.0 strong | ### Step 6 — Decile portfolio backtest 1. At each rebalance date, sort universe into 10 deciles by factor value. 2. Track equal-weighted returns for each decile over the holding period. 3. Key output: decile 1 vs decile 10 spread (long-short portfolio return). 4. Compute cumulative return, Sharpe ratio, and max drawdown for the long-short portfolio. ### Step 7 — IC decay analysis Compute IC for multiple forward horizons (1M, 2M, 3M, 6M, 12M). Plot IC vs horizon. Fast decay = short-term factor; slow decay = longer-term signal. Serial autocorrelation of IC series: `autocorr(IC, lag=1)`. High autocorrelation → smoother signal, lower trading cost. ## CLI ```bash longbridge constituent --help longbridge calc-index --help longbridge kline --help longbridge constituent <INDEX> --format json longbridge calc-index <SYMBOL> --format json longbridge kline <SYMBOL> --period day --count 252 --format json ``` ## Output Present: 1. Factor definition and universe summary. 2. IC time series chart (describe in text if no chart tool). 3. Summary statistics table (Mean IC, IC Std Dev, IR, hit rate). 4. Decile return bar chart description (decile 1 to 10 cumulative return). 5. IC decay table across horizons. 6. Interpretation: is the factor effective? Recommended holding period? ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请安装 longbridge-terminal 或检查 MCP 配置。 | 請安裝 longbridge-terminal 或檢查 MCP 配置。 | Install longbridge-terminal or check MCP config. | | stderr: `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | | Index not found | 请检查指数代码格式,如 000300.SH / HSI.HK / SPX.US。 | 請確認指數代碼,如 000300.SH / HSI.HK / SPX.US。 | Check index ticker format, e.g. 000300.SH / HSI.HK / SPX.US. | | Insufficient history | 该标的历史数据不足以进行回测,请缩短测试期或更换标的。 | 歷史數據不足,請縮短測試期或更換標的。 | Insufficient price history; shorten the test period or change the symbol. | ## Related skills - `longbridge-factor-screen` — screen stocks by factor values today - `longbridge-multifactor` — combine multiple factors into a composite score - `longbridge-quant-stats` — statistical tests (IC significance, t-test) - `longbridge-ml-strategy` — machine-learning based strategy research ## File layout ``` skills/longbridge-factor-research/ └── SKILL.md ```

longbridge-factor-screen

|

# longbridge-factor-screen Fundamental multi-factor screener. Applies user-defined thresholds across PE, PB, ROE, revenue growth, profit growth, and dividend yield to filter a candidate list and rank survivors by composite score. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我筛选 PE < 15 且 ROE > 15% 的 A 股"*, *"screen for low-PE high-ROE A-shares"* - *"成长股筛选:营收增速 > 20%"*, *"growth screen: revenue CAGR > 20%"* - *"高股息蓝筹股 港股"*, *"high-dividend HK blue chips"* - *"价值选股:PB < 1 且 ROE > 10%"*, *"value screen: PB < 1 and ROE > 10%"* - *"多条件选股"*, *"multi-factor stock screen"* For index/ETF constituent lists route to `longbridge-constituent`. For single-stock deep-dive route to `longbridge-fundamental` or `longbridge-valuation`. ## Supported factors | Factor | 简体 | 繁體 | Source CLI | |---|---|---|---| | PE (TTM) | 市盈率 | 市盈率 | `calc-index` or `valuation` | | PB | 市净率 | 市淨率 | `calc-index` or `valuation` | | PS | 市销率 | 市銷率 | `calc-index` or `valuation` | | ROE | 净资产收益率 | 淨資產收益率 | `operating` or `financial-report` | | Revenue YoY | 营收增速 | 營收增速 | `operating` or `financial-report` | | Net profit YoY | 净利润增速 | 淨利潤增速 | `operating` or `financial-report` | | Dividend yield | 股息率 | 股息率 | `dividend` or `calc-index` | ## Workflow 1. **Collect screening criteria** — ask the user if not given. Example defaults: - Value screen: PE < 20, PB < 2, ROE > 12%, dividend yield > 2% - Growth screen: revenue YoY > 20%, net profit YoY > 20%, PE < 40 2. **Obtain a candidate universe**. Options (ask user): - User provides a list of symbols. - Use an index as universe (route to `longbridge-constituent` first): ```bash longbridge constituent 000300.SH --format json # run --help for available flags ``` 3. **Discover exact CLI flags** before calling: ```bash longbridge calc-index --help longbridge operating --help longbridge valuation --help longbridge dividend --help ``` 4. **Batch-query each candidate** (call concurrently where possible): ```bash longbridge calc-index <SYMBOL> --format json longbridge operating <SYMBOL> --format json longbridge dividend <SYMBOL> --format json ``` 5. **Filter in-context**: discard symbols that fail any hard threshold. 6. **Score survivors**: normalise each factor to 0–1 range within the passing set; compute weighted composite score. Default weights: ROE 25%, revenue YoY 20%, PE 20%, PB 15%, dividend yield 10%, net profit YoY 10%. 7. **Output** the candidate table sorted by composite score descending (see Output section). Cite Longbridge Securities. ## CLI ```bash # Step 0: discover flags longbridge calc-index --help longbridge operating --help longbridge valuation --help longbridge dividend --help # Step 1: get universe (if using an index) # NOTE: JSON response uses key "stocks" (not "list") — extract symbols from data["stocks"] longbridge constituent 000300.SH --format json # run --help for available flags # Step 2: per-symbol data (repeat for each candidate) longbridge calc-index 600519.SH --format json # PE, PB, PS, dividend yield # NOTE: `operating` returns data for HK stocks only; for US/A-share use financial-report instead longbridge operating 700.HK --format json # ROE, revenue/profit growth (HK only) longbridge financial-report AAPL.US --format json # US/A-share fallback; run --help for flags longbridge dividend 600519.SH --format json # dividend history ``` ## Output ``` Factor Screen Results — Source: Longbridge Securities Criteria: PE < 20, ROE > 15%, Revenue YoY > 10% Universe: CSI 300 (300 stocks checked) | Passed: N Rank | Symbol | Name | PE | PB | ROE | Rev YoY | NP YoY | Div Yield | Score -----|-------------|---------|------|-----|-------|---------|--------|-----------|------ 1 | 600519.SH | Maotai | 28.1 | 9.5 | 31.2% | +18.4% | +15.7% | 2.1% | 0.87 2 | 601318.SH | Ping An | 8.2 | 1.2 | 14.8% | +12.1% | +10.3% | 4.5% | 0.79 ... Notes: - Score = weighted composite (ROE 25%, Rev YoY 20%, PE 20%, PB 15%, Div 10%, NP YoY 10%) - PE and PB: lower is better (inverted for scoring); ROE / growth / yield: higher is better - N/A fields excluded from score denominator ⚠️ 数据仅供参考,不构成投资建议。/ 數據僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` ## Limitations - Screening is applied to a **user-supplied list or index constituents** — this is not a real-time full-market screener. - Data is point-in-time from the last available report; forward-looking factors require analyst consensus (`longbridge-fundamental`). - If the candidate list exceeds ~30 symbols, process in batches and note that partial results are shown. ## Error handling | Situation | 简体 | 繁體 | English | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;否则告知安装 longbridge-terminal | 回退到 MCP;否則告知安裝 longbridge-terminal | Fall back to MCP; otherwise tell user to install longbridge-terminal. | | stderr `not logged in` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login`. | | `calc-index` returns empty | 该标的无估值数据,跳过或标注 N/A | 該標的無估值數據,跳過或標注 N/A | No valuation data; skip or mark N/A. | | Candidate list > 30 symbols | 提示分批处理,优先处理前 30 | 提示分批處理,優先處理前 30 | Process in batches of 30; note partial coverage. | | Other stderr | 原文显示错误 | 原文顯示錯誤 | Surface verbatim. | ## MCP fallback 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. ## Related skills - Deep single-stock fundamentals → `longbridge-fundamental` - Single-stock valuation percentile → `longbridge-valuation` - Multi-symbol valuation comparison → `longbridge-peer-comparison` - Index constituents (universe) → `longbridge-constituent` - Dividend history detail → `longbridge-corporate` ## File layout ``` longbridge-factor-screen/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-finance-query

|

# longbridge-finance-query Cross-market financial metrics batch query — revenue, net profit, ROE, debt ratio, free cash flow, gross margin, and other core KPIs for one or more symbols. Supports multi-symbol horizontal comparison. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user asks about: - Core financial metrics for one or more stocks — *"NVDA 最新营收"*, *"苹果净利润"*, *"帮我查这几家公司的ROE"* - Cross-stock financial comparison — *"TSLA 和 BYD 的毛利率对比"*, *"科技股自由现金流排名"* - Specific financial line items — *"资产负债率"*, *"经营现金流"*, *"每股收益"* - Natural-language financial screening — *"哪些股票ROE超过20%"* (note: Longbridge returns data for specified symbols; full market screening is not supported) For a single company's full financial deep-dive, prefer `longbridge-fundamental`. For segment-level operating breakdown, prefer `longbridge-business-query`. ## Workflow 1. Extract all symbols from the prompt; normalise each to `<CODE>.<MARKET>`. 2. Identify which financial statements are needed: - **Income statement** (revenue, gross profit, net profit, EPS) → `--kind IS` - **Balance sheet** (total assets, total liabilities, debt ratio, equity) → `--kind BS` - **Cash flow** (operating CF, free CF) → `--kind CF` 3. Run `longbridge financial-report` for each symbol and statement type. 4. Run `longbridge calc-index` for computed ratios (PE, PB, ROE, ROA). 5. Merge results by symbol; present as a comparison matrix when multiple symbols are requested. ## CLI ```bash # Income statement — revenue, gross profit, net profit, EPS longbridge financial-report <SYMBOL> --kind IS --format json # Balance sheet — assets, liabilities, equity longbridge financial-report <SYMBOL> --kind BS --format json # Cash flow — operating, investing, financing, free cash flow longbridge financial-report <SYMBOL> --kind CF --format json # Computed indices — ROE, ROA, PE, PB longbridge calc-index <SYMBOL> --index roe,roa,pe_ttm,pb --format json ``` > Run `longbridge financial-report --help` and `longbridge calc-index --help` to confirm current flag names and available `--kind` options. ## Output For a single symbol, present a financial snapshot table. For multiple symbols, present a comparison matrix: | Metric | 简体 | 繁體 | English | |---|---|---|---| | Revenue | 营业收入 | 營業收入 | Revenue | | Gross profit margin | 毛利率 | 毛利率 | Gross margin | | Net profit | 净利润 | 淨利潤 | Net profit | | EPS | 每股收益 | 每股盈利 | EPS | | Debt-to-asset ratio | 资产负债率 | 資產負債率 | Debt ratio | | Free cash flow | 自由现金流 | 自由現金流 | Free cash flow | | ROE | 净资产收益率 | 淨資產收益率 | ROE | Always include the fiscal period and currency in the output. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请先安装 longbridge-terminal | 請先安裝 longbridge-terminal | Install longbridge-terminal first | | `not logged in` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | Symbol not covered | 提示该标的暂无财务数据 | 提示該標的暫無財務數據 | Note data not available for this symbol | | Other stderr | 原样展示,不重试 | 原樣展示,不重試 | Surface verbatim, do not retry | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills | User asks | Route to | |---|---| | Full single-company fundamental deep-dive | `longbridge-fundamental` | | Business segment breakdown | `longbridge-business-query` | | 2–5 stock valuation comparison | `longbridge-peer-comparison` | | Analyst consensus / EPS estimates | `longbridge-insresearch` | | Institutional holders / insider trades | `longbridge-flows` | ## File layout ``` longbridge-finance-query/ └── SKILL.md ``` Prompt-only — no `scripts/`. Discover current CLI flags via `longbridge <subcommand> --help`.

longbridge-financial-analysis

|

# longbridge-financial-analysis Prompt-only analysis skill. Fetches complete three-statement financials via Longbridge CLI and performs deep in-LLM analysis: cross-statement reconciliation, DuPont decomposition, earnings-quality scoring, and fraud red-flag detection. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"TSLA 三表勾稽"*, *"TSLA cross-statement reconciliation"*, *"TSLA 三表勾稽"* - *"茅台杜邦分析"*, *"Maotai DuPont decomposition"* - *"NVDA 盈利质量"*, *"NVDA accrual ratio"*, *"NVDA 盈利質量"* - *"700.HK 有没有财务造假红旗"*, *"700.HK financial fraud red flags"* - *"AAPL 三表分析"*, *"AAPL three-statement analysis"* For raw statement data only use `longbridge-financial-report`. For health scoring use `longbridge-financial-checkup`. ## CLI Always run `longbridge financial-report --help` to verify exact flags. Primary call: ```bash # Fetch all three statements — required for reconciliation and DuPont longbridge financial-report <SYMBOL> --kind ALL --format json # If unsure about period flags, run: longbridge financial-report --help ``` ## Workflow 1. **Resolve symbol** to `<CODE>.<MARKET>` (e.g. `TSLA.US`, `700.HK`, `600519.SH`). 2. **Call CLI** with `--kind ALL` to retrieve IS, BS, and CF in one request. 3. **In-LLM analysis** — perform all three layers: ### Layer 1 — Cross-statement reconciliation (三表勾稽) | Check | Formula | |---|---| | IS → BS | Net income (IS) ≈ ΔRetained earnings (BS); large gap flags earnings manipulation | | IS → CF | Net income + non-cash items (depreciation, SBC, etc.) ≈ Operating CF (CF) | | CF → BS | Net ΔCash (CF) = ΔCash & equivalents (BS) | ### Layer 2 — DuPont decomposition (杜邦拆解) ROE = Net margin × Asset turnover × Equity multiplier Compute each driver; compare YoY to diagnose whether ROE change is quality-driven (margin/turnover) or leverage-driven. ### Layer 3 — Earnings quality & fraud red flags **Accrual ratio** = (Net income − Operating CF) / Avg total assets — lower is better; > 5% warrants scrutiny. **10 fraud red flags** — flag each as present / absent: 1. Accounts receivable growth > Revenue growth 2. Inventory growth >> Revenue growth 3. Gross margin sharp unexpected change 4. Operating CF persistently below Net income (> 2 consecutive years) 5. Related-party receivables / revenue rising 6. Auditor change or qualified opinion 7. Large "other income" or non-recurring gains propping earnings 8. Revenue concentration spike (single customer > 50%) 9. Capex spike without revenue growth follow-through 10. Cash & equivalents declining while reported profit is rising 4. Output structured analysis report; cite **Longbridge Securities**; end with disclaimer. ## Output ``` {Symbol} Deep Financial Analysis — Source: Longbridge Securities Period: {report_period} [Cross-statement reconciliation] - IS→BS: Net income {X} vs ΔRetained earnings {Y}: {Match / Gap of Z — flag} - IS→CF: Net income + non-cash {X} vs Operating CF {Y}: {Match / Gap} - CF→BS: Net ΔCash {X} vs ΔCash on BS {Y}: {Match / Gap} [DuPont decomposition] ROE {X%} = Net margin {Y%} × Asset turnover {Z×} × Equity multiplier {W×} YoY: ROE {±Δ%} — driven by {margin / turnover / leverage / mix} [Earnings quality] Accrual ratio: {X%} ({Low <2% / Medium 2-5% / High >5%}) Assessment: {earnings are cash-backed / partly accrual-driven / accrual-heavy} [Fraud red flags (10-item)] ✓ / ✗ 1. AR growth vs revenue growth: ... ✓ / ✗ 2. Inventory growth vs revenue: ... ... (all 10 items) Red flags triggered: {N}/10 ⚠️ 以上分析仅供参考,不构成投资建议。/ 以上分析僅供參考,不構成投資建議。/ 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`. | | Missing one or more statements | 跳过依赖缺失报表的分析层,注明原因。 | 跳過依賴缺失報表的分析層,注明原因。/ Skip analysis layers that depend on missing statements; note reason. | | Returns empty / no data | "{symbol} 暂无财务报表数据。" | "{symbol} 暫無財務報表數據。" / "{symbol} has no financial statement data." | | 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 - Raw three-statement data → `longbridge-financial-report` - Health scoring (100-point) → `longbridge-financial-checkup` - Quick KPI snapshot → `longbridge-fundamental` - Valuation (PE / PB) → `longbridge-valuation` ## File layout ``` longbridge-financial-analysis/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-financial-checkup

|

# longbridge-financial-checkup Prompt-only analysis skill. Fetches three-statement financials and operating data from Longbridge, then scores the company across five financial-health dimensions for a total of 100 points. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"TSLA 财务体检"*, *"TSLA financial health check"*, *"TSLA 財務體檢"* - *"700.HK 综合财务评分"*, *"700.HK financial score"* - *"AAPL 盈利能力和偿债能力怎么样"*, *"AAPL profitability and solvency"* - *"茅台 运营效率评分"*, *"Maotai operating efficiency score"* For deep reconciliation / DuPont / fraud flags use `longbridge-financial-analysis`. For raw data use `longbridge-financial-report`. ## CLI Run `longbridge financial-report --help` before use to verify flags: ```bash # Primary — fetch all statements longbridge financial-report <SYMBOL> --kind ALL --format json # Operating data (HK listed) longbridge operating <SYMBOL> --format json # If unsure about subcommands: longbridge financial-report --help longbridge operating --help ``` ## Workflow 1. **Resolve symbol** to `<CODE>.<MARKET>` format. 2. **Fetch data**: call `financial-report --kind ALL` first; attempt `operating` for additional turnover metrics. 3. **Score each dimension** in-LLM (20 points each, 100 total): ### Dimension 1 — Profitability (盈利能力, 20 pts) | Metric | Full marks | Benchmark | |---|---|---| | ROE | 8 pts | > 15% = 8; 10-15% = 5; < 10% = 2 | | Net margin | 6 pts | > 20% = 6; 10-20% = 4; < 10% = 2 | | Gross margin | 6 pts | > 50% = 6; 30-50% = 4; < 30% = 2 | ### Dimension 2 — Growth (成长性, 20 pts) | Metric | Full marks | Benchmark | |---|---|---| | Revenue YoY | 10 pts | > 20% = 10; 10-20% = 7; 0-10% = 4; < 0% = 1 | | Net income YoY | 10 pts | > 20% = 10; 10-20% = 7; 0-10% = 4; < 0% = 1 | ### Dimension 3 — Financial health (财务健康, 20 pts) | Metric | Full marks | Benchmark | |---|---|---| | Debt-to-assets ratio | 8 pts | < 30% = 8; 30-60% = 5; > 60% = 2 | | Current ratio | 6 pts | > 2 = 6; 1-2 = 4; < 1 = 1 | | Interest coverage | 6 pts | > 10x = 6; 5-10x = 4; < 5x = 1 | ### Dimension 4 — Cash quality (现金质量, 20 pts) | Metric | Full marks | Benchmark | |---|---|---| | Operating CF / Net income | 20 pts | > 1.2 = 20; 0.8-1.2 = 14; 0.5-0.8 = 8; < 0.5 = 3 | ### Dimension 5 — Operating efficiency (运营效率, 20 pts) | Metric | Full marks | Benchmark | |---|---|---| | Inventory turnover days | 10 pts | < 30d = 10; 30-60d = 7; > 90d = 3 | | AR turnover days | 10 pts | < 30d = 10; 30-60d = 7; > 90d = 3 | 4. Sum all dimensions → total score / 100. 5. Output report card with grade; cite **Longbridge Securities**; end with disclaimer. ## Output ``` {Symbol} Financial Health Report Card — Source: Longbridge Securities Period: {report_period} | Scored: {date} Dimension Score Max ───────────────────────────────── Profitability {X} / 20 Growth {X} / 20 Financial health {X} / 20 Cash quality {X} / 20 Operating efficiency {X} / 20 ───────────────────────────────── TOTAL {X} / 100 Grade: {A (≥85) / B (70-84) / C (55-69) / D (<55)} Key findings: + {Strength 1} + {Strength 2} - {Weakness 1} - {Weakness 2} ⚠️ 以上评分仅供参考,不构成投资建议。/ 以上評分僅供參考,不構成投資建議。/ 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`. | | Metric data unavailable | 该维度评分跳过,注明数据缺失,总分按可用维度折算。 | 該維度評分跳過,注明數據缺失,總分按可用維度折算。/ Skip dimension; note missing data; prorate total score. | | Returns empty / no data | "{symbol} 暂无财务报表数据。" | "{symbol} 暫無財務報表數據。" / "{symbol} has no financial data." | | 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 - Deep analysis (DuPont / fraud flags) → `longbridge-financial-analysis` - Raw three-statement data → `longbridge-financial-report` - Quick KPI snapshot → `longbridge-fundamental` - Valuation (PE / PB) → `longbridge-valuation` ## File layout ``` longbridge-financial-checkup/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-financial-planning

|

# longbridge-financial-planning Personal financial planning framework — retirement targets, education fund, balance sheet, and portfolio gap analysis. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking for: - Retirement savings planning — *"我什么时候能退休"*, *"退休需要多少钱"*, *"retirement planning"* - Education fund targets — *"孩子的教育金怎么规划"*, *"education fund"* - Balance sheet and net worth review — *"帮我梳理资产负债表"*, *"net worth overview"* - Gap analysis — *"我离目标还差多少"*, *"gap analysis"*, *"财务目标差距"* - Cash flow and savings rate — *"我的储蓄率"*, *"monthly savings capacity"* > Requires Longbridge login with Trade scope for account data. ## Workflow 1. Fetch current account value, positions, and multi-currency cash. 2. Ask the user for planning inputs (or use defaults): - Retirement age target (default: 60) - Annual living expenses in retirement - Children's education fund target (if applicable) - Monthly savings capacity - Expected portfolio return assumption 3. Build the financial plan: - **Net worth snapshot**: investments + cash − liabilities - **Retirement gap**: target corpus − current portfolio (compounded) - **Education fund gap**: target − dedicated savings - **Savings rate**: monthly contribution vs. income - **Years to goal**: solve for `n` given current value, rate, contribution 4. Output a structured plan with actionable recommendations. 5. Convert multi-currency assets to a common base using FX rates. > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## CLI ```bash # Account portfolio market value longbridge portfolio --format json # Current positions (stocks, funds) longbridge positions --format json # Multi-currency exchange rates for normalisation longbridge exchange-rate --format json ``` ## Output structure ``` PERSONAL FINANCIAL PLAN <Date> NET WORTH SNAPSHOT Investment Portfolio: $xxx,xxx (USD equivalent) Cash & Money Market: $xx,xxx Total Net Worth: $xxx,xxx RETIREMENT PLANNING Target Age: 60 Current Age: xx Years: xx Annual Expense: $xx,xxx/yr Corpus Needed: $x,xxx,xxx Current Progress: $xxx,xxx (xx% of target) Gap: $xxx,xxx Required Monthly Savings: $x,xxx (at x.x% p.a.) EDUCATION FUND Target: $xxx,xxx by Year 20xx Current: $xx,xxx Gap: $xx,xxx Monthly Top-up Needed: $x,xxx SAVINGS RATE ANALYSIS Monthly Income (estimated): $x,xxx Monthly Savings: $x,xxx (xx%) Recommendation: [On track | Increase savings by $x,xxx/month] ACTION ITEMS 1. ... 2. ... ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | Not logged in | 请运行 `longbridge auth login` 并授予 Trade 权限。 | 請執行 `longbridge auth login` 並授予 Trade 權限。 | Run `longbridge auth login` with Trade scope. | | Empty portfolio | 账户暂无持仓,请先建立投资组合。 | 賬戶暫無持倉,請先建立投資組合。 | No positions found — build a portfolio first. | | FX rate unavailable | 部分货币汇率不可用,已使用近似值。 | 部分貨幣匯率不可用,已使用近似值。 | Some FX rates unavailable — approximate values used. | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-portfolio` — account-level P&L and industry distribution - `longbridge-positions` — detailed stock and fund holdings - `longbridge-risk-return` — risk-adjusted portfolio optimisation - `longbridge-fx` — foreign exchange rates ## File layout ``` skills/longbridge-financial-planning/ └── SKILL.md ```

longbridge-financial-report

|

# longbridge-financial-report Prompt-only analysis skill. Fetches complete three-statement financials from Longbridge and performs cross-statement reconciliation, DuPont decomposition, and earnings-quality analysis in the LLM. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"TSLA 三张表"*, *"TSLA three financial statements"*, *"TSLA 三張表"* - *"700.HK 资产负债表"*, *"700.HK balance sheet"*, *"700.HK 資產負債表"* - *"AAPL 现金流量表"*, *"AAPL cash flow statement"*, *"AAPL 現金流量表"* - *"NVDA 三表勾稽分析"*, *"NVDA cross-statement reconciliation"* - *"茅台 杜邦分析"*, *"Maotai DuPont decomposition"* - *"TSLA 盈利质量"*, *"TSLA earnings quality"*, *"TSLA accruals"* For a quick KPI snapshot use `longbridge-fundamental`. For valuation use `longbridge-valuation`. ## CLI Run `longbridge --help` to see all available subcommands, then `longbridge <subcommand> --help` before calling. Types of data needed: - Financial statements (income statement, balance sheet, cash flow) — single statement or all three at once - Period selection (annual, semi-annual, quarterly — exact flag values differ by CLI version; check `--help`) - Raw line-item access with field-level hierarchy (a separate subcommand may exist for this) ```bash # Always check available flags first: longbridge <subcommand> --help # Then fetch financials — example structure (verify flags with --help): longbridge <subcommand> TSLA.US --format json longbridge <subcommand> 700.HK --format json ``` ## Workflow 1. **Resolve symbol** to `<CODE>.<MARKET>` format (e.g. `TSLA.US`, `700.HK`, `600519.SH`). 2. **Determine scope** from user intent: - Single statement requested → fetch that kind only. - Reconciliation / DuPont / earnings quality → fetch all three statements (use `--help` to find the flag that requests all statements at once). 3. **Call CLI** (or MCP fallback). If `longbridge` not installed, fall back to MCP. 4. **In-LLM analysis** per requested depth: | Analysis | Method | |---|---| | **三表勾稽 / Cross-statement reconciliation** | Verify: net income (IS) ≈ change in retained earnings (BS); net income + non-cash items ≈ operating cash flow (CF); ΔCash (CF) = ΔCash (BS) | | **杜邦分解 / DuPont decomposition** | ROE = Net Margin × Asset Turnover × Equity Multiplier | | **盈利质量 / Earnings quality** | Accrual ratio = (Net Income − Operating CF) / Avg Total Assets; high positive ratio → earnings less cash-backed | 5. Output structured report; cite **Longbridge Securities**; end with disclaimer. ## Output template ``` {Symbol} ({code}) Financial Statements — Source: Longbridge Securities Period: {report_period} | Report date: {rpt_date} [Income Statement (IS)] - Revenue: X YoY ±Y% - Gross profit / margin: X / Y% - Operating income: X - Net income: X YoY ±Y% - EPS (basic / diluted): X / Y [Balance Sheet (BS)] - Total assets: X - Total liabilities: X | Debt-to-equity: Y% - Cash & equivalents: X - Shareholders' equity: X | Book value per share: Y [Cash Flow (CF)] - Operating CF: X - Investing CF: X - Financing CF: X - Free cash flow (OCF − capex): X [Cross-statement reconciliation] - IS→BS: Net income vs ΔRetained earnings: {match / gap of X} - IS→CF: Net income vs OCF bridge: {match / key non-cash items} - CF→BS: ΔCash: {match / gap} [DuPont decomposition] ROE {X%} = Net margin {Y%} × Asset turnover {Z×} × Equity multiplier {W×} [Earnings quality] - Accrual ratio: X% — {low / medium / high} accrual, earnings are {cash-backed / partly accrual-driven / accrual-heavy} ⚠️ 以上数据仅供参考,不构成投资建议。/ 以上數據僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` (Omit sections not requested; state "data unavailable" rather than inventing.) ## Error handling | Situation | 简体中文回复 | 繁體中文 / English | |---|---|---| | `command not found: longbridge` | 回退到 MCP;如 MCP 也不可用,请用户安装 longbridge-terminal。 | 回退到 MCP;如 MCP 也不可用,請安裝 longbridge-terminal。/ Fall back to MCP; if also unavailable, tell user to install longbridge-terminal. | | stderr `not logged in` | 请运行 `longbridge auth login` 登录。 | 請執行 `longbridge auth login`。/ Run `longbridge auth login`. | | Returns empty / no data | "{symbol} 暂无财务报表数据(可能为新上市或未覆盖标的)。" | "{symbol} 暫無財務報表數據。" / "{symbol} has no financial statement data (newly listed or not covered)." | | Only one or two statements returned | 仅展示已返回的报表,注明缺失部分,不做勾稽。 | 僅展示已返回報表,注明缺失。/ Show available statements only; note missing ones; skip reconciliation. | | Other stderr | 直接显示原始错误,不静默重试。 | 顯示原始錯誤。/ Surface verbatim — do not retry silently. | ## MCP fallback If `longbridge` CLI is not installed (`command not found`), 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 - Quick KPI snapshot → `longbridge-fundamental` - Valuation (PE / PB / industry) → `longbridge-valuation` - Analyst consensus & EPS forecasts → `longbridge-consensus` - Industry peer comparison → `longbridge-peer-comparison` ## File layout ``` longbridge-financial-report/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-flows

|

# longbridge-flows Single-symbol ownership and money-flow lens: who's buying/selling at the institutional, fund, insider, broker, and short-seller layers. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"13F 谁持仓最多", "Berkshire 13F", "巴菲特最新持仓", "active fund AUM ranking"* → `investors` - *"哪些基金持有 NVDA", "AAPL 被多少 ETF 持有"* → `fund-holder` - *"TSLA 高管最近买入", "AAPL Form 4", "内部人减持"* → `insider-trades` (US only) - *"AMD 空头数据", "TSLA 做空比例", "days to cover"* → `short-positions` (US only) - *"700.HK 中央结算", "腾讯经纪商持仓", "broker holding 700"* → `broker-holding` (HK only) - *"X 资金面全景"* → call multiple subcommands by market (US: `fund-holder` + `insider-trades` + `short-positions`; HK: `fund-holder` + `broker-holding`). For intraday large/medium/small-order capital flow → `longbridge-capital-flow`. For institutional shareholders by % held → `longbridge-corporate` (`shareholder`). ## Subcommands > Run `longbridge <subcommand> --help` if unsure of current flags. The CLI's built-in help is the canonical source. | Capability | Returns | Markets | |---|---|---| | Fund-manager AUM rankings (no symbol) | Live active fund-manager rankings by AUM. | global | | 13F holdings for a manager (by CIK) | Latest 13F holdings snapshot; run `--help` for count/filter flags. | US (SEC EDGAR) | | 13F quarter-over-quarter changes | Position changes (NEW / ADDED / REDUCED / EXITED). | US | | Funds and ETFs holding a symbol | Fund name, ticker, currency, weight, report date; run `--help` for count flags. | global | | SEC Form 4 insider trades | BUY / SELL / GRANT / DISP / TAX / EXERCISE / GIFT; run `--help` for count flags. | **US only** | | Short interest history | Short interest, short ratio, days to cover; run `--help` for range flags. | **US only** | | Broker holdings over a period | Top buy / sell brokers; run `--help` for period options. | **HK only** | | Broker holdings detail | Full broker-holding detail list. | HK only | | Daily holding history for a broker | Single broker's daily history; run `--help` for broker-filter flags. | HK only | Single symbol per call (except `investors` rankings). ## Workflow 1. Resolve to `<CODE>.<MARKET>`. Reject US-only subcommands for non-US, HK-only for non-HK — explain politely. 2. Pick subcommands by prompt cue. Don't run all of them by default. 3. Call concurrently when the question is *"全景资金面"* style. 4. Summarise direction (net buying / net selling), top names, freshness (report date). 5. Cite **Longbridge Securities** (and SEC EDGAR for `insider-trades` / `investors`). ## CLI ```bash # Discover available subcommands and their flags first longbridge --help longbridge <subcommand> --help # run for each subcommand before use longbridge <investors-subcommand> --format json # AUM rankings (no CIK) longbridge <investors-subcommand> 1067983 --format json # Berkshire 13F longbridge <investors-changes-subcommand> 1067983 --format json # QoQ changes longbridge <fund-holder-subcommand> AAPL.US --format json longbridge <insider-trades-subcommand> TSLA.US --format json # US only longbridge <short-positions-subcommand> AAPL.US --format json # US only longbridge <broker-holding-subcommand> 700.HK --format json # HK only longbridge <broker-holding-detail-subcommand> 700.HK --format json longbridge <broker-holding-daily-subcommand> 700.HK --format json ``` ## Output Render in the user's language. Suggested layouts: **13F (`investors`)** — when no CIK: AUM-ranked manager table. With CIK: top-N positions (ticker / value / shares / weight / change vs last filing). For `changes`: NEW / ADDED / REDUCED / EXITED grouped lists. **`fund-holder`** — table sorted by weight: fund name / ticker / currency / weight % / report date. Highlight high-weight funds (> 1%). **`insider-trades`** — chronological list (most recent first): date / insider / role / type (BUY/SELL/GRANT/...) / shares / price / value. Net buy vs sell summary at top. **`short-positions`** — time-series table: date / short interest / short ratio / days-to-cover. Note trend (rising / falling). **`broker-holding`** — for the `--period` view: top buy brokers and top sell brokers side by side. For `detail`: full list. For `daily`: a single broker's history. When a result is empty, state so. Do not invent. ## Error handling | Situation | Reply | |---|---| | Shell `command not found: longbridge` | Fall back to MCP if configured; otherwise tell the user to install longbridge-terminal. | | Non-US symbol passed to `insider-trades` / `short-positions` | Reply *"This subcommand only supports US-listed equities."* | | Non-HK symbol passed to `broker-holding` | Reply *"Broker holding is HK-only."* | | Empty result | State explicitly. Do not invent. | | Other stderr | Relay verbatim — never silently retry. | ## MCP fallback When the CLI binary is missing, fall back via the equivalent MCP tool. Tool names typically mirror CLI subcommand names (snake_case). 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. If a name above does not resolve, fall back via the equivalent MCP tool when CLI is missing. ## Related skills | Skill | Why | |---|---| | `longbridge-corporate` | Major shareholder % structure (a different lens than 13F flow). | | `longbridge-capital-flow` | Today's intraday large/medium/small-order distribution. | | `longbridge-news` | Filings (8-K / 13D / 13G) often pair with flow events. | | `longbridge-fundamental` | Earnings + dividend backdrop for insider context. | | `longbridge-quote` | Live price for sizing the flow. | ## File layout ``` longbridge-flows/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-fundamental

|

# longbridge-fundamental Prompt-only analysis skill. Orchestrates Longbridge CLI commands to deliver a five-dimension fundamentals snapshot: profitability, financial health, growth, shareholder return, market expectation. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## Three depth tiers LLM picks based on prompt verbosity: | Tier | Trigger phrases | Data needed | |---|---|---| | **snapshot** | *"X 怎么样"*, *"how is X"*, brief curiosity | Latest financial report KPIs + analyst estimates + consensus | | **standard** (default) | *"X 基本面 / 业绩 / 财报"*, *"X fundamentals"* | Snapshot + full income/balance/cash-flow statements + dividend history | | **full** | *"X 全面分析"*, *"detailed fundamentals"* | Standard + company profile + operating data + corporate actions + institution ratings (distribution, history, per-institution detail, industry rank) | Tiers are additive — don't pull all 8+ tools when the user asks a casual question. ## When to use - *"贵州茅台 基本面"*, *"NVDA fundamentals"* → standard - *"NVDA 业绩好不好"*, *"how is NVDA's earnings"* → standard, but **never reduce to good/bad** — give numbers - *"AAPL 毛利率"*, *"AAPL gross margin"* → snapshot/standard - *"X 下季度 EPS 预期"* → snapshot is sufficient - *"X 财务健康吗"*, *"is X financially healthy"* → standard For valuation lens (PE, PB) → `longbridge-valuation`. For comparison → `longbridge-peer-comparison`. ## CLI Run `longbridge --help` to see all available subcommands, then `longbridge <subcommand> --help` before calling. Types of data needed by tier: **Snapshot tier** (run concurrently): - Latest financial report KPIs (revenue / EPS / ROE) - Analyst EPS estimates (high / low / mean / median) - Coverage count, rating distribution, consensus target price **Standard tier** — add: - Full line-item financial statements (income statement, balance sheet, cash flow) - Dividend history - Forward EPS by period **Full tier** — add: - Company profile - Operating metrics - Corporate actions - Institution rating distribution + target price - Rating and target price change history - Per-institution rating detail - Industry-wide analyst coverage rank ```bash longbridge <subcommand> NVDA.US --format json # run --help for available flags and subcommand names ``` ## Workflow 1. Resolve symbol; multi-symbol → route to `longbridge-peer-comparison`. 2. Pick a tier based on prompt; call CLI commands concurrently (see CLI section above). 3. If `longbridge` is not installed, fall back to MCP (see MCP fallback section). 4. Translate fields using the dictionary below; output the **5-section structure** with disclosure dates. 5. Cite **Longbridge Securities**; end with not-investment-advice disclaimer. ## Output template (5 sections, mandatory) ``` {Symbol} ({code}) fundamentals — Source: Longbridge Securities (period end: {fp_end / rpt_date}) [1. Profitability] - Revenue (latest quarter): X (currency), YoY +Y% - Net income: X, YoY +Y% - Gross / net margin: X% / Y% - ROE: X% [2. Financial health] - Debt-to-equity: X% - Operating cash flow (TTM): X - Free cash flow: X - Current / quick ratio (if available) [3. Growth] - Revenue YoY (last 4 quarters): +X% / +Y% / +Z% / +W% — trend description - Net income YoY (last 4 quarters): same [4. Shareholder return] - Last dividend date / amount - Dividend yield: X% (if computable) - Recent buybacks / issuance (full tier only) [5. Market expectations (analysts)] - Consensus next-quarter EPS: X - Coverage: N analysts; X buy / Y hold / Z sell - Median target price: X ⚠️ 以上数据仅供参考,不构成投资建议。/ 以上數據僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` (Translate to the user's language; if a section's data is missing, state so explicitly — do not invent.) ## Field dictionary The full IS / BS / CF / ratio field-name dictionary (中 / 繁 / EN), plus per-industry reading guidance, lives in [references/field-dictionary.md](references/field-dictionary.md). Load it on demand when the prompt actually requires field translation or industry context. ## Output constraints - **Must** cover all 5 sections (state missing data, do not silently skip). - **Must** include the disclosure date (`fp_end` / `rpt_date`). - **Must** end with the not-investment-advice disclaimer. - **Do not** say "good earnings / bad earnings" as a binary. Anchor language in numbers (e.g. *"revenue grew 20% YoY, above the industry mean of 12%"*). - **Do not** forecast next quarter's earnings — the analyst consensus already covers that. ## Industry-specific reading Heuristics differ by sector. Anchor on **vs industry mean** or **vs own history**, not absolute thresholds. Concrete sector notes (banks / tech / cyclicals / asset-heavy) live in [references/field-dictionary.md](references/field-dictionary.md#industry-context). ## Error handling | Situation | Reply | |---|---| | `command not found: longbridge` | Fall back to MCP; if MCP also unavailable, tell user to install longbridge-terminal. | | Financial report data returns empty | "{symbol} has no reported earnings (newly listed?)." | | Analyst consensus has < 3 analysts | Caveat: "small coverage — consensus is indicative only" | | Dividend history data returns empty | "{symbol} pays no dividends or has no dividend record." | | stderr `not logged in` | Tell user to run `longbridge auth login`. | ## MCP fallback If `longbridge` CLI is not installed (`command not found`), use MCP tools instead: 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 - Valuation lens (PE / PB / industry) → `longbridge-valuation` - 2–5 symbol comparison → `longbridge-peer-comparison` - News / market reaction → `longbridge-news` - Live price → `longbridge-quote` ## File layout ``` longbridge-fundamental/ ├── SKILL.md └── references/ └── field-dictionary.md # IS/BS/CF/ratio field names + per-industry caveats ``` Prompt-only — no `scripts/`.

longbridge-fx-carry

|

# longbridge-fx-carry FX carry-trade analysis — evaluate interest-rate differential, historical carry returns, and key risks for currency pairs. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking about: - FX carry trade opportunities — *"AUD/JPY 套息机会"*, *"carry trade 机会"*, *"FX carry strategy"* - Interest-rate differential between currencies — *"利差交易"*, *"interest rate differential"* - High-yield vs low-yield currency pairing — *"高息货币"*, *"high yield currency"* - Carry trade risk (unwind scenarios) — *"套息交易风险"*, *"carry unwind"* For plain FX spot rates defer to `longbridge-fx`. For equity market correlation defer to `longbridge-correlation`. ## Common carry pairs | Pair | 高息货币 / High-yield | 低息货币 / Low-yield | 典型场景 | |------|----------------------|---------------------|---------| | AUD/JPY | AUD | JPY | Risk-on carry | | NZD/USD | NZD | USD | Commodity carry | | MXN/JPY | MXN | JPY | EM carry | | TRY/USD | TRY | USD | High-risk EM | | BRL/JPY | BRL | JPY | EM carry | > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## Workflow 1. Identify the carry pair(s) from the user's prompt; default to AUD/JPY, NZD/USD, MXN/JPY if unspecified. 2. Fetch current spot rates for all relevant currencies. 3. Look up prevailing benchmark interest rates (use embedded knowledge or `longbridge macro` if available). 4. Calculate annualised carry yield: `(high-yield rate − low-yield rate)`. 5. Fetch historical FX price data (60 days) to estimate realised volatility. 6. Compute simplified Sharpe: `carry_yield / annualised_vol`. 7. Assess tail-risk scenarios (rapid JPY strength / EM stress / risk-off unwind). 8. Output structured summary. ## CLI ```bash # Spot exchange rates longbridge exchange-rate --format json # Historical FX price series (if supported by the CLI) longbridge kline <FX_PAIR> --period day --count 60 --format json ``` ## Output Present for each pair: ``` Pair Carry Yield 60d Volatility Est. Sharpe Signal ───────────────────────────────────────────────────────────── AUD/JPY 3.2% 8.4% 0.38 Moderate NZD/USD 2.1% 6.2% 0.34 Moderate MXN/JPY 8.5% 14.1% 0.60 High / Risky ``` Follow with a narrative covering: current macro environment, carry unwind risks, position sizing guidance. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | FX pair not supported | 该货币对暂不支持,请尝试其他主要货币对。 | 該貨幣對暫不支援,請嘗試其他主要貨幣對。 | This FX pair is not supported — try a major currency pair. | | Historical FX data unavailable | 历史汇率数据不可用,仅提供当前利差分析。 | 歷史匯率數據不可用,僅提供當前利差分析。 | Historical FX data unavailable — providing current differential only. | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | | `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-fx` — plain FX spot rates - `longbridge-correlation` — cross-asset correlation - `longbridge-volatility-strategy` — options-implied volatility surface ## File layout ``` skills/longbridge-fx-carry/ └── SKILL.md ```

longbridge-fx

|

# longbridge-fx Foreign-exchange rates for all currencies Longbridge supports. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"今天美元兑港币多少"*, *"USD to HKD today"* → run, look up `USD/HKD` row. - *"100 港币能换多少美金"* → run, compute `100 / (USD/HKD)` (or `100 * (HKD/USD)`, depending on the row's quote convention). - *"我组合里 HKD / USD / CNY 都有,统一换算成 USD"* → run once, normalise each currency leg. - *"人民币兑美元 / CNH vs CNY"* → check whether the row is `CNY/USD` or `CNH/USD`; surface the symbol verbatim. For cross-rates not directly listed, derive from two USD-quoted rows (e.g. `EUR/JPY = (EUR/USD) / (JPY/USD)`). ## Subcommand > Single CLI command, no arguments beyond format. Run `longbridge exchange-rate --help` if unsure of current flags. ```bash longbridge exchange-rate --format json ``` There are no per-currency filters — the command returns the full table; pick the row(s) you need from the JSON. ## Workflow 1. Run `longbridge exchange-rate --format json`. 2. Find the row matching the user's pair (mind the quote convention: `BASE/QUOTE` is "1 BASE = N QUOTE"). 3. If user wants a specific amount, do the arithmetic inline; show both rate and computed amount. 4. If the user's pair isn't directly quoted, derive via USD: `A/B = (A/USD) / (B/USD)`. 5. Cite source as **Longbridge Securities** / **数据来源:长桥证券** / **數據來源:長橋證券**, plus the as-of timestamp from the response if provided. ## CLI examples ```bash # Full rate table longbridge exchange-rate --format json ``` That's it — there's no symbol argument. Filter on the JSON client-side. ## Output JSON array, one row per supported pair. Typical fields: | Field | Meaning | |---|---| | `symbol` / `pair` | e.g. `USD/HKD`, `CNY/USD` | | `rate` | numeric exchange rate | | `timestamp` | as-of time | Render the relevant row(s) only; don't dump the full table unless the user asked for it. ## Error handling | Situation | LLM response | |---|---| | Shell `command not found: longbridge` | Fall back to MCP if configured; otherwise tell the user to install longbridge-terminal. | | Empty array | Unusual — relay verbatim and tell the user to retry shortly. | | Pair not in response | "Longbridge doesn't quote `<X/Y>` directly — derive from `X/USD` and `Y/USD`." | | Other stderr | Surface verbatim. | ## MCP fallback 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. ## Related skills | User asks | Route to | |---|---| | Multi-currency holdings normalised to one base | `longbridge-positions` then convert with this skill | | Account-level performance with currency exposure | `longbridge-portfolio` | | Statement export with FX legs | `longbridge-statement` | | Stock quote in native currency | `longbridge-quote` | ## File layout ``` longbridge-fx/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-graham-screener

|

# longbridge-graham-screener Prompt-only batch screener. Given a market or index universe, applies Graham's six hard filters (NCAV, PE, PB, dividend yield, debt coverage, earnings stability), scores each name on a 100-point static + dynamic composite, and returns a ranked list of stocks meeting Graham's quantitative criteria, with Graham buy lines, holding-period expectation, and value-trap warnings. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"港股里现在有没有 NCAV<1 的股票"* / *"港股裡現在有沒有 NCAV<1 的股票"* / *"any HK stocks with NCAV < 1"* - *"给我 A 股 PE 最低的 20 只股票,格雷厄姆标准"* / *"給我 A 股 PE 最低的 20 隻股票,格雷厄姆標準"* / *"top 20 lowest-PE A-shares by Graham standard"* - *"帮我筛一下符合格雷厄姆防御型投资者条件的美股"* / *"幫我篩一下符合格雷厄姆防禦型投資者條件的美股"* / *"screen US stocks meeting Graham defensive-investor rules"* - *"沪深300里的烟蒂股"* / *"滬深300裡的煙蒂股"* / *"cigar-butt names in CSI 300"* - *"每周更新港股 NCAV 排行榜"* / *"每週更新港股 NCAV 排行榜"* / *"weekly HK NCAV leaderboard"* For single-stock deep diagnostic use `longbridge-graham-stock-analysis`. For broader low-PE / low-PB / high-ROE value (not NCAV-centric) use `longbridge-value-screen`. For high-dividend-only screens use `longbridge-dividend-screen`. ## Cognitive frame (do not skip) Graham screening is **patient arbitrage**, not a dip-buy signal. Hold periods: 6–18 months (explicit catalyst), 1–3 years (sector re-rating), 3–5 years (organic accrual), or never (value trap — exit). Every ranking output **must** carry the waiting-cost (dividend yield) and the holding-period framing; never display a score number on its own. Two failure modes the user must be able to distinguish — and the screener must signal: - **"Cheap but time hasn't come"** → NCAV stable QoQ, keep on the list. - **"Value trap"** → NCAV shrinking ≥3 quarters, persistent insider selling, negative OCF, PMI persistently <50, AR growth outpacing revenue. Override to ⚠️ regardless of static score. ## Workflow 1. **Confirm market + universe**. Ask the user for: (a) market — HK / US / A-share, (b) screening pool — single index (HSI, S&P 500, CSI 300, NDX, etc.) or a watchlist. Default batch ceiling: 300 names per run. 2. **Fetch constituent list** for the chosen index (or watchlist) — see [§CLI](#cli). 3. **Sector pre-classification**: **exclude** banks / insurance / REITs / pure financials / negative-equity / pure-holding shells from the universe before scoring — NCAV does not apply to balance sheets dominated by financial assets, so these are removed, not run through a substitute model. Count the exclusion in the Market Summary "Excluded — NCAV inapplicable" line. Separately, flag IPOs < 2 years (pro-rata earnings-stability sub-score, noted in row) and suspended names (last-trade snapshot, prepend ⏸). 4. **Batch-fetch fundamentals in parallel** (≤20 symbols per wave): balance sheet (annual + last 4Q), income statement (5y annual + 4Q quarterly), cash flow (4Q quarterly), `calc-index` + `quote` snapshot, `dividend`, `ownership`. 5. **Apply hard filters** with user-overridable thresholds — see [§Filters](#filters). 6. **Score each candidate** — static (0–100) + dynamic adjustments + value-trap override. See `references/criteria.md`. 7. **Reconciliation gate per row**: if balance-sheet sum / current-assets sum / shares×price mismatches the reported total by >3%, drop the row from the leaderboard with a "data anomaly" note (do not silently average). 8. **Rank by adjusted score** (descending); default top 10–20 returned. Emit the table + market summary + waiting-cost note + suggested next step. 9. **Append a Data Source Appendix** (mandatory) listing every Longbridge endpoint hit, every WebSearch hit (publisher + URL + access date), fetch timestamps, and any field substitutions. 10. **End every output** with: «筛选结果仅反映量化指标的符合程度,不代表对上述标的的投资建议。投资决策请结合个人情况独立判断。/ Screening results only reflect quantitative criteria compliance and do not constitute investment advice. 本筛选器仅静态硬指标 + 通用动态因子,未考虑公司层面主观估值陷阱。命中标的请用 `longbridge-graham-stock-analysis` 做单股深度诊断。» ## CLI Run `longbridge <subcommand> --help` to verify exact flags before each call — the CLI is the source of truth, do not hard-code flag spellings from memory. ```bash # Universe longbridge constituent <INDEX> --format json # e.g. 000300.SH, HSI.HK, SPX.US # Per-symbol snapshot (run in parallel, batches of ≤20) longbridge calc-index <SYMBOL> --format json # PE / PB / market cap / ROE / dividend yield longbridge quote <SYMBOL> --format json # current price + suspended flag longbridge dividend <SYMBOL> --format json # TTM dividend (waiting-cost) # Per-symbol fundamentals (run in parallel) longbridge financial-report <SYMBOL> --kind BS --report af --format json # 5y annual BS → NCAV longbridge financial-statement <SYMBOL> --kind BS --report qf --format json # last 4Q BS → NCAV trajectory longbridge financial-report <SYMBOL> --kind IS --report af --format json # 5y annual IS → earnings stability longbridge financial-report <SYMBOL> --kind CF --report qf --format json # 4Q CF → OCF rule # Insider / institutional flow (value-trap rule 2) longbridge ownership <SYMBOL> --format json longbridge insresearch <SYMBOL> --format json ``` ### WebSearch fallback (use only when Longbridge has the gap) | Missing input | WebSearch query pattern | |---|---| | Industry PMI / inventory cycle | `"<industry> PMI <year>"`, `"中国制造业 PMI <month>"`, `"<industry> inventory cycle <year>"` | | Capacity utilisation | `"<industry> capacity utilization <year>"` | | Sector outlook (qualitative) | `"<sector> outlook <year> site:reuters.com OR site:bloomberg.com OR site:wsj.com"` | | Recent insider transactions (if `ownership` is stale) | `"<ticker> insider selling <year>"`, `"<公司> 大股东减持 <month>"` | Each WebSearch-sourced figure must be tagged with publisher + URL + access date in the **Data Source Appendix**; never silently mix it into a Longbridge column. ## Filters User-overridable. Defaults from Graham's *Intelligent Investor* with light modernisation; threshold detail and the composite scoring weights live in `references/criteria.md`. | Filter | Graham threshold | Notes | |---|---|---| | NCAV ratio (market cap ÷ haircut NCAV) | < 1.0 ideal, < 1.5 acceptable | Core. Haircut: cash 100% / AR 75% / inventory 50% / other CA 25% / liabilities 100% | | PE (TTM) | < 10 (defensive) | Rolling TTM | | PB | < 1.5 | — | | Dividend yield (TTM) | > 3% | Waiting-cost compensation | | Current assets ÷ total liabilities | > 2.0 | Debt safety | | Consecutive no-loss years | ≥ 5 | Earnings stability | | Dynamic warning state | none triggered | Optional pre-filter; defaults to "show but flag" | Default rank key = adjusted cigar-butt score (static composite + dynamic adjustments + value-trap override). The user can override the rank key to: static-only, NCAV ratio asc, PE asc, dividend yield desc. ## Special handling | Cohort | Treatment | |---|---| | Banks / insurance / REITs / pure financials / negative-equity / pure-holding shells | **Excluded** — NCAV is not a valid valuation lens for these business models. No substitute model is run; the symbols are dropped from the universe before scoring and counted in the Market Summary "Excluded — NCAV inapplicable" line. If the user wants these analysed, point them to `longbridge-valuation-methodology` or `longbridge-valuation`. | | IPOs listed < 2 years | Earnings-stability sub-score pro-rated on available years. Mark row "数据局限". | | Suspended stocks | Show last-trade snapshot, prepend "⏸ 停牌" / "⏸ Suspended" to the name, exclude from default top-N (still listable on request). | | Reconciliation fail >3% | Drop from leaderboard; surface in a "数据异常待复核" footer list with the failing check named. | ## Output Default leaderboard (top 10–20 rows). Full template, market-summary block, waiting-cost line, subscription hook, and the mandatory **Data Source Appendix** structure live in `references/output.md`. Minimum columns: ``` 排名 代码 名称 静态评分 调整后评分 NCAV比率 PE PB 股息率 Graham买入价 动态预警 数据局限 ``` After the table, every output must include: 1. **Market summary** — universe size, hard-filter pass count, dynamic-clean count. 2. **Waiting-cost line** — average dividend yield of the top-N; the «持有等待期间每年可获约 X% 股息回报作为补偿» line. 3. **Next-step recommendation** — point users to `longbridge-graham-stock-analysis` for any name they want to research further (筛选器未考虑主观估值陷阱因素). 4. **Data Source Appendix** — mandatory; every field, every Longbridge endpoint, every WebSearch hit (publisher + URL + date). 5. **Disclaimer** — full trilingual disclaimer from `references/output.md`, including: 「筛选结果仅反映量化指标的符合程度,不代表对上述标的的投资建议。投资决策请结合个人情况独立判断。/ Screening results only reflect quantitative criteria compliance and do not constitute investment advice.」 > ⚠️ 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。/ 以上內容僅供參考,不構成投資建議。投資決策請結合自身風險承受能力獨立判斷。/ For reference only. Not investment advice. Please make investment decisions independently based on your own risk tolerance. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;若不可用,请安装 longbridge-terminal。 | 回退到 MCP;若不可用,請安裝 longbridge-terminal。 | Fall back to MCP; if unavailable install longbridge-terminal. | | stderr `not logged in` / `unauthorized` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | | `constituent` returns empty | 未能获取成分股,请确认指数代码(如 000300.SH / HSI.HK / SPX.US)。 | 未能獲取成分股,請確認指數代碼(如 000300.SH / HSI.HK / SPX.US)。 | Cannot fetch constituents; verify index symbol (e.g. 000300.SH / HSI.HK / SPX.US). | | BS / IS / CF partial fetch for a symbol | 该标的数据不完整,跳过并在「数据异常」脚注列出。 | 該標的數據不完整,跳過並於「數據異常」腳註列出。 | Symbol has incomplete fundamentals; skipped and listed in the data-anomaly footer. | | Industry-cycle data missing (Longbridge + WebSearch both empty) | 仅展示静态评分,动态层标注「数据不足」。 | 僅展示靜態評分,動態層標註「數據不足」。 | Static score only; dynamic layer marked "unavailable". | | Per-row reconciliation gap >3% | 从榜单剔除并在「数据异常」附录列出失败项及差异。 | 自榜單剔除並於「數據異常」附錄列出失敗項及差異。 | Drop from leaderboard; list failing check + gap in data-anomaly appendix. | ## 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 - Single-stock Graham diagnostic → `longbridge-graham-stock-analysis` - Broader value (PE / PB / ROE) screen → `longbridge-value-screen` - High-dividend screen → `longbridge-dividend-screen` - DCF intrinsic value → `longbridge-dcf` - Method selection guide → `longbridge-valuation-methodology` - Three-statement reading → `longbridge-financial-report` ## File layout ``` longbridge-graham-screener/ ├── SKILL.md └── references/ ├── criteria.md # filter thresholds, six-dimension static scoring, dynamic adjustments, value-trap override, NCAV-inapplicable exclusions └── output.md # full leaderboard template, market-summary block, data-source appendix, disclaimer ```

longbridge-graham-stock-analysis

|

# longbridge-graham-stock-analysis Prompt-only deep-value diagnostic. Given a single ticker, produces a Graham-style cigar-butt verdict: static cheapness score, dynamic trend adjustments, value-trap flagging, liquidation-value table, and an expected holding-period view. Every numeric input is reconciled across statements and footnoted to its source. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我诊断一下腾讯控股 00700"* / *"幫我診斷一下騰訊控股 00700"* / *"diagnose 700.HK with Graham cigar-butt"* - *"BABA 是不是烟蒂股"* / *"BABA 是不是煙蒂股"* / *"is BABA a Graham net-net"* - *"600519 NCAV 多少"* / *"600519 NCAV 多少"* / *"what is 600519's NCAV"* - *"我持有这只股 6 个月了,还值得继续拿吗"* / *"我持有這隻股 6 個月了,還值得繼續拿嗎"* / *"I've held this 6 months, still worth holding"* - *"这只股是真便宜还是价值陷阱"* / *"這隻股是真便宜還是價值陷阱"* / *"is this a real bargain or a value trap"* For multi-stock value screening use `longbridge-value-screen`. For DCF intrinsic value use `longbridge-dcf`. For three-statement reading use `longbridge-financial-report`. ## Cognitive frame (do not skip) Graham cigar-butt is **patient arbitrage**, not a dip-buy signal. Expected holding periods: 6–18 months (explicit catalyst), 1–3 years (sector re-rating), 3–5 years (organic accrual), or never (value trap — exit). Every output must surface holding-period expectation alongside the score; never display a score number without it. Two failure modes the user must be able to distinguish: - **"Cheap but time hasn't come"** → NCAV stable, keep holding. - **"Value trap"** → NCAV shrinking quarter on quarter, exit. ## Workflow 1. **Resolve symbol** to `<CODE>.<MARKET>` (e.g. `00700.HK`, `BABA.US`, `600519.SH`). 2. **Detect sector**. If banking / insurance / REIT / pure financial → halt and tell the user NCAV is not the right model; suggest `longbridge-valuation-methodology` instead. 3. **Fetch raw data via Longbridge CLI first** (parallel where possible). See [§CLI](#cli). 4. **Reconciliation gate** (勾稽校验) — internal correctness check; must pass before scoring. Do **not** print this check or its results in the report unless it fails. See [§Reconciliation](#reconciliation-勾稽校验-internal-gate-not-user-facing). 5. **Static score** (0–100). See `references/scoring.md` for the six-dimension table and NCAV haircut defaults. 6. **Dynamic adjustments** — four factors (industry cycle, earnings trend, insider activity, NCAV trajectory). Industry-cycle data may not be in Longbridge; use WebSearch for PMI / inventory cycle / capacity utilisation. See `references/scoring.md` §Dynamic. 7. **Value-trap check** — if any 2 of 5 rules trip, override to "⚠️ value trap" regardless of static score. See `references/scoring.md` §Value-trap. 8. **Output** the 8-section report defined in `references/output.md`; finish with the **Data source appendix** (mandatory — every figure tagged to its source). ## CLI Run `longbridge <subcommand> --help` to verify exact flags before each call. Primary calls (run in parallel): ```bash # Balance sheet — NCAV inputs (cash, AR, inventory, other CA, ST/LT debt) longbridge financial-report <SYMBOL> --kind BS --report af --format json # last 5 annual longbridge financial-statement <SYMBOL> --kind BS --report qf --format json # last 4 quarterly (NCAV trajectory) # Income statement — PE, earnings stability (5y no-loss), EPS trend (4q) longbridge financial-report <SYMBOL> --kind IS --report af --format json longbridge financial-report <SYMBOL> --kind IS --report qf --format json # Cash flow — operating CF (value-trap rule 4: persistent negative OCF) longbridge financial-report <SYMBOL> --kind CF --report qf --format json # Snapshot: PE, PB, market cap, dividend yield, shares outstanding longbridge calc-index <SYMBOL> --format json longbridge quote <SYMBOL> --format json # Dividend history (for "等待成本" — 3% threshold) longbridge dividend <SYMBOL> --format json # Ownership / insider activity (value-trap rule 2: 大股东持续减持) longbridge ownership <SYMBOL> --format json longbridge insresearch <SYMBOL> --format json ``` ### WebSearch fallback (only when Longbridge has a gap) Use WebSearch **only** for items not available from Longbridge: | Missing data | WebSearch query pattern | |---|---| | Industry PMI / inventory cycle | `"<industry name> PMI 2025"`, `"<industry> inventory cycle"`, `"中国制造业PMI"` | | Capacity utilisation | `"<industry> capacity utilization"` | | Sector outlook (qualitative) | `"<sector> outlook 2025 site:reuters.com OR site:bloomberg.com"` | | Recent insider transactions if `ownership` is stale | `"<ticker> insider selling 2025"` | Each WebSearch-sourced figure must be tagged `[Source: WebSearch — <publisher>, <date>]` in the appendix; do **not** mix it silently with Longbridge data. ## Reconciliation (勾稽校验) — internal gate, not user-facing Before any scoring, verify the fetched figures internally. **Reconciliation is a correctness gate for the analysis pipeline; it is not part of the user-facing report.** Do not print the check table, do not show per-row gap percentages, do not narrate "勾稽通过" in the conclusion. Reconciliation results only surface to the user in two situations: - A check fails by > tolerance → **halt scoring**, tell the user which specific figure(s) cannot be relied on and why no score is emitted. - A field carries a residual gap *within* tolerance that materially affects a downstream number → note it inline in the **Data Source Appendix** row for that field (e.g. "BS current-assets sum −1.4% vs reported total — within tolerance"). | Check | Formula | Tolerance | |---|---|---| | IS↔BS | This-period net income ≈ Δ Retained earnings (BS) − dividends paid (CF) | ±3% | | IS↔CF | Net income + non-cash items (D&A + impairments + WC changes) ≈ Operating CF | ±5% | | CF↔BS | ΔCash from CF = Cash(t) − Cash(t−1) on BS | ±1% | | Current assets sum | Cash + AR + Inventory + Other CA ≈ Total current assets (BS) | ±2% | | Liabilities sum | ST debt + LT debt + Other liabilities ≈ Total liabilities (BS) | ±2% | | Shares outstanding | `calc-index` shares × current price ≈ market cap from `quote` | ±2% | | Period alignment | All statements from the same fiscal period (or note the lag) | exact | Silent-pass principle: if everything passes within tolerance, emit the scored report directly without referencing the reconciliation step at all. ## Output Single-stock diagnostic with **8 fixed sections** (full template in `references/output.md`). The reconciliation check is an internal gate — do NOT include its table or pass/fail rows in the user-facing report; reconciliation only appears if a check failed (in which case no score is emitted) or if a residual within-tolerance gap needs to be flagged inline against a specific Data Source Appendix row. 1. Adjusted cigar-butt score card (静态分 → 动态调整 → 调整后分, with verdict tier 🟢🟡🟠🔴) 2. Six-dimension static breakdown (NCAV / PE / PB / dividend / debt coverage / earnings stability) 3. Dynamic adjustment detail (industry cycle, EPS trend, insider activity, NCAV trajectory, value-trap verdict) 4. Holding-period view (catalyst presence, waiting cost via dividend yield, expected horizon range) 5. Liquidation-value table (default vs industry-adjusted haircuts, adjusted NCAV per share) 6. Safety-margin price band (current price / default NCAV line / adjusted NCAV line / Graham buy line = adjusted NCAV × 0.67) 7. Three-line summary (valuation level / adjusted safety margin / Graham quantitative assessment — neutral, factual, no buy/sell recommendation) 8. **Data source appendix** — mandatory; every figure tagged with source, fetch time, and period (and any within-tolerance reconciliation note for that field) Always close with the boilerplate disclaimer (see `references/output.md` §Disclaimer). > **Compliance note**: The three-line summary in section 7 must be stated as objective metric readings, not directional recommendations. For example: > - "当前价格低于格雷厄姆计算的内在价值估算,符合格雷厄姆 NCAV 量化标准(仅供参考)" — not "建议买入 / 低估值建议关注". > - "Current price is below the Graham-derived intrinsic value estimate and meets Graham NCAV quantitative criteria (for reference only)" — not "consider buying" or "recommended". > - The output must conclude with: 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。/ The above is for reference only and does not constitute investment advice. Please make investment decisions independently based on your own risk tolerance. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;若不可用,请安装 longbridge-terminal。 | 回退到 MCP;若不可用,請安裝 longbridge-terminal。 | Fall back to MCP; if unavailable install longbridge-terminal. | | stderr `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | | Sector = bank / insurance / REIT | NCAV 模型不适用于金融业,已切换提示;建议使用 `longbridge-valuation-methodology`。 | NCAV 模型不適用於金融業,建議使用 `longbridge-valuation-methodology`。 | NCAV does not fit financials; use `longbridge-valuation-methodology`. | | Reconciliation fails >3% | 明确披露差异项与差异比例,不输出评分;建议用户复核或换数据源。 | 明確披露差異項與差異比例,不輸出評分。 | Disclose the failing check and the gap; do not emit a score. | | Industry cycle data missing (WebSearch also empty) | 标注「动态调整层数据不足,仅显示静态评分」。 | 標注「動態調整層數據不足,僅顯示靜態評分」。 | Mark "dynamic layer unavailable, static score only". | | < 5 years of financial history | 盈利稳定性维度按已披露年限按比例打分,并在数据源附录注明。 | 盈利穩定性按已披露年限比例打分,並於附錄註明。 | Score earnings stability pro-rata and note in source appendix. | ## 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 - Single-stock valuation (PE / PB / EV-EBITDA) → `longbridge-valuation` - DCF intrinsic value → `longbridge-dcf` - Multi-stock value screen → `longbridge-value-screen` - Three-statement reading → `longbridge-financial-report` - Cross-statement deep analysis → `longbridge-financial-analysis` - Method selection guide → `longbridge-valuation-methodology` ## File layout ``` longbridge-graham-stock-analysis/ ├── SKILL.md └── references/ ├── scoring.md # static six-dimension table + NCAV haircuts + dynamic factors + value-trap rules └── output.md # full 8-section output template + data-source appendix + disclaimer ```

longbridge-harmonic

|

# longbridge-harmonic 谐波形态信号引擎:基于斐波那契几何关系识别 XABCD 五点结构,支持 Gartley、Bat(蝙蝠)、Butterfly(蝴蝶)、Crab(螃蟹)四种经典形态,在潜在反转区(PRZ)生成多/空方向交易信号。 > **Response language**: match the user's input language — > Simplified Chinese / Traditional Chinese / English. ## When to use - 用户询问谐波形态:*"AAPL 有没有 Gartley 形态"*、*"700.HK 蝙蝠形态分析"*、*"TSLA PRZ 在哪里"* - 检测 XABCD 结构是否满足特定谐波形态的斐波那契比率 - 判断潜在反转区(PRZ)位置,辅助入场决策 - 用户提到"蝴蝶形态"、"螃蟹形态"、"XABCD"等关键词 ## Workflow 1. 提取标的代码,标准化为 `<CODE>.<MARKET>` 格式。 2. 获取日线 OHLCV 数据(200 根 K 线): ```bash longbridge kline <SYMBOL> --period day --format json # run --help for available flags ``` 3. **Zigzag 识别摆动点**(threshold 默认 5%),取最近 5 个有效摆动点作为 X-A-B-C-D 候选。 4. **计算各段斐波那契比率**: - `AB/XA`:AB 相对于 XA 的回撤比 - `BC/AB`:BC 相对于 AB 的回撤比 - `CD/BC`:CD 相对于 BC 的延伸比 - `AD/XA`:AD 相对于 XA 的整体比(PRZ 核心) 5. **与四种标准谐波容差(±5%)比较**: | 形态 | AB/XA | BC/AB | CD/BC | AD/XA | |---|---|---|---|---| | Gartley | 0.618 | 0.382–0.886 | 1.272–1.618 | 0.786 | | Bat | 0.382–0.500 | 0.382–0.886 | 1.618–2.618 | 0.886 | | Butterfly | 0.786 | 0.382–0.886 | 1.618–2.618 | 1.272–1.618 | | Crab | 0.382–0.618 | 0.382–0.886 | 2.618–3.618 | 1.618 | 6. 匹配成功则计算 PRZ 区间(D 点目标范围),判断看多(看涨 XABCD)或看空(看跌 XABCD)方向。 7. 输出形态名称、PRZ 范围、方向、止损位。 > 若不确定 CLI 参数,先运行 `longbridge kline --help` 查看最新参数。 ## CLI ```bash # 日线数据(主要数据源) longbridge kline AAPL.US --period day --format json # run --help for available flags # 4 小时线(辅助确认短周期形态,可选) longbridge kline TSLA.US --period 60m --format json ``` ## Output 以自然语言呈现,包含: - **识别到的形态**:如 "Bullish Gartley(看涨 Gartley)"、"Bearish Bat(看跌蝙蝠)" - **XABCD 各点价格和日期** - **PRZ 区间**:[PRZ 低点, PRZ 高点](D 点潜在落点范围) - **交易方向**:看多(Bullish)/ 看空(Bearish) - **止损位**:突破 X 点则形态失效 - **斐波那契比率符合度**(各比率实际值 vs 标准值) - **数据来源**:Longbridge Securities / 数据来源:长桥证券 / 數據來源:長橋證券 ## Error handling | 情形 | LLM 回复 | |---|---| | `command not found: longbridge` | 尝试 MCP fallback;否则告知用户安装 longbridge-terminal | | stderr 含 `not logged in` | 告知用户运行 `longbridge auth login` | | Zigzag 摆动点不足(少于 5 个) | 建议切换更长周期(如周线),运行 `longbridge kline --help` 查看可用参数 | | 无法匹配任何谐波形态 | 告知"当前未检测到满足标准谐波比率的 XABCD 结构" | | 其他 stderr | 原样透传,不静默重试 | ## MCP fallback 若 CLI 不可用且已配置 MCP: 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. ## Related skills | 用户询问 | 路由至 | |---|---| | 实时股价/行情 | `longbridge-quote` | | K线图/历史价格 | `longbridge-kline` | | 缠论分型/买卖点 | `longbridge-chanlun` | | 艾略特波浪 | `longbridge-elliott` | | 聪明钱/SMC | `longbridge-smc` | | 资金流向 | `longbridge-capital-flow` | ## File layout ``` longbridge-harmonic/ └── SKILL.md ```

longbridge-hedging

|

# longbridge-hedging Design and evaluate hedging strategies for a portfolio or single position using Longbridge market data — from simple Beta hedges to options-based protection and cross-asset tail-risk hedges. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我设计组合对冲方案"*, *"design a hedge for my portfolio"*, *"幫我設計對冲方案"* - *"NVDA 怎么用期权对冲"*, *"how to hedge NVDA with options"* - *"Beta 对冲比率怎么算"*, *"calculate Beta hedge ratio"* - *"领口策略怎么构建"*, *"how to set up a collar strategy"* - *"尾部风险对冲有哪些工具"*, *"tail risk hedge instruments"* - *"汇率风险怎么对冲"*, *"how to hedge currency exposure"* For option pricing and Greeks, use `longbridge-derivatives`. For portfolio-level P&L, use `longbridge-portfolio`. ## Workflow ### Step 1 — Identify hedge objective Clarify with the user: - What is being hedged: single position, portfolio, or sector exposure? - Risk to hedge: market Beta, tail event, currency, or volatility? - Hedge horizon: days, weeks, or months? - Cost tolerance: zero-cost (collar) or willing to pay premium? ### Step 2 — Fetch data ```bash longbridge kline --help longbridge option --help # Beta calculation (60-day daily returns) longbridge kline <SYMBOL> --period day --count 60 --format json # Option chain for hedge instruments longbridge option chain <SYMBOL> --format json # Current portfolio positions (requires login with trade scope) longbridge positions --format json ``` ### Step 3 — Beta hedge **Portfolio Beta**: ``` β_portfolio = Σ(w_i × β_i) ``` Compute individual Beta for each holding from 60-day returns vs benchmark (SPX / HSI / CSI300). Fetch benchmark kline with `longbridge kline <BENCHMARK> --period day --count 60 --format json`. **Hedge ratio (index futures or inverse ETF)**: ``` Contracts needed = (Portfolio Value × β_portfolio) / (Futures Price × Contract Multiplier) ``` Present: number of contracts, hedge cost, and residual Beta after hedge. ### Step 4 — Options-based protection **Protective Put** (保护性看跌期权介绍): - 原理:持有正股的同时持有看跌期权;当标的价格下跌时,期权价值上升,可对冲下行风险。常见做法是选择平值(ATM)或略虚值(OTM)的看跌期权。 - Cost = put premium; protection kicks in below strike. - Effective floor = Strike − Premium paid. - 具体期权合约是否适用,请根据自身持仓情况和风险偏好独立判断。 - Fetch available strikes: `longbridge option chain <SYMBOL> --format json`. **Collar Strategy** (zero-cost or near-zero): - Buy OTM put (downside protection) + sell OTM call (cap upside). - Net premium ≈ 0 if call premium offsets put premium. - Present: put strike, call strike, net cost, max gain, max loss. **Selection criteria**: | Criterion | Protective Put | Collar | |---|---|---| | Upside retention | Full | Capped at call strike | | Cost | Premium paid | Near zero | | Best for | Bullish with hedge need | Neutral/mild bearish | ### Step 5 — Tail risk hedges | Tool | Instrument | Mechanism | |---|---|---| | VIX calls | UVXY.US / VIX options | Profit from volatility spike | | Gold | GLD.US / 518880.SH | Safe-haven in risk-off | | Long-dated US Treasuries | TLT.US | Negative correlation with equities | | Put on index | SPY puts / HSI puts | Direct market hedge | Note: fetch current price and recent kline for any hedge instrument before recommending. ### Step 6 — Currency hedge For HK/US cross-currency portfolios: - USD/HKD is pegged — minimal FX risk. - CNY exposure: use offshore RMB (CNH) forwards or futures. - Non-HKD Asian exposure: fetch FX rate via `longbridge fx --format json` (verify flag with `--help`). Present notional hedge amount, instrument, tenor, and estimated cost. ### Step 7 — Hedge cost assessment ``` Cost efficiency = Protection value / Premium paid ``` Present: premium as % of protected notional, breakeven move, and expected cost per 1% of downside protection. ## CLI ```bash longbridge kline --help longbridge option --help longbridge positions --help longbridge kline <SYMBOL> --period day --count 60 --format json longbridge option chain <SYMBOL> --format json longbridge positions --format json ``` ## Output Present: 1. Hedge objective summary. 2. Recommended strategy with rationale. 3. Implementation details (strikes, contracts, premium). 4. Cost vs protection table. 5. Scenarios: portfolio value if market falls 10% / 20% with and without hedge. 6. Caveats (basis risk, early exercise for American options, liquidity). Always note: hedging reduces risk but also limits upside. > 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。/ The above is for reference only and does not constitute investment advice. Please make investment decisions independently based on your own risk tolerance. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请安装 longbridge-terminal 或检查 MCP 配置。 | 請安裝 longbridge-terminal 或檢查 MCP 配置。 | Install longbridge-terminal or check MCP config. | | stderr: `not logged in` | 请运行 `longbridge auth login`(需 Trade 权限查看持仓)。 | 請執行 `longbridge auth login`(需 Trade 權限查看持倉)。 | Run `longbridge auth login` (Trade scope needed for positions). | | No option chain data | 该标的无期权数据,请尝试对应指数期权或 ETF 期权。 | 該標的無期權數據,請嘗試指數或 ETF 期權。 | No option chain for this symbol; try index or ETF options instead. | | Negative or missing Beta | Beta 数据不足,将使用市值加权 Beta=1 作为默认值。 | Beta 數據不足,使用 Beta=1 作為默認值。 | Insufficient Beta data; defaulting to Beta = 1. | ## Related skills - `longbridge-derivatives` — option quotes, Greeks, IV - `longbridge-options-strategy` — options strategy builder - `longbridge-portfolio` — portfolio P&L and exposure analysis - `longbridge-risk-analysis` — portfolio risk metrics (VaR, drawdown) ## File layout ``` skills/longbridge-hedging/ └── SKILL.md ```

longbridge-ichimoku

|

# longbridge-ichimoku Computes the full Ichimoku Cloud five-line system from 200 days of OHLCV data and produces bullish / bearish / neutral signals with per-component interpretation. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"NVDA 一目云位置"*, *"700.HK 是否在云上方"*, *"转折线有没有上穿基准线"* - *"TSLA ichimoku signal"*, *"is AAPL above the cloud"*, *"cloud breakout"* - *"600519.SH 雲圖分析"*, *"先行帶是否扩张"*, *"遲行線確認"* ## Workflow 1. Resolve the symbol to `<CODE>.<MARKET>` format. 2. Fetch 200 daily candles (need ≥ 52 bars for Senkou Span B): ```bash longbridge kline <SYMBOL> --period day --count 200 --format json ``` 3. Run the Python analysis below to compute all five lines and derive signals. 4. Report each component's value and signal, then summarise with a composite conclusion. ## CLI ```bash longbridge kline NVDA.US --period day --count 200 --format json longbridge kline 700.HK --period day --count 200 --format json longbridge kline 600519.SH --period day --count 200 --format json ``` Run `longbridge kline --help` to verify current flag names and defaults. ## Python analysis ```python import pandas as pd, json, sys data = json.loads(sys.stdin.read()) df = pd.DataFrame(data) df = df.rename(columns={"open":"o","high":"h","low":"l","close":"c","volume":"v"}) df[["o","h","l","c","v"]] = df[["o","h","l","c","v"]].apply(pd.to_numeric) df = df.reset_index(drop=True) def midpoint(h, l, n): return (h.rolling(n).max() + l.rolling(n).min()) / 2 # --- Five lines --- tenkan = midpoint(df["h"], df["l"], 9) # 转折线 / 轉折線 / Tenkan-sen kijun = midpoint(df["h"], df["l"], 26) # 基准线 / 基準線 / Kijun-sen span_a = ((tenkan + kijun) / 2).shift(26) # 先行带A (shifted forward 26) span_b = midpoint(df["h"], df["l"], 52).shift(26) # 先行带B (shifted forward 26) chikou = df["c"].shift(-26) # 迟行线 (shifted back 26) i = len(df) - 1 # latest bar index c_now = df["c"].iloc[i] t_now = tenkan.iloc[i] k_now = kijun.iloc[i] sa_now = span_a.iloc[i] sb_now = span_b.iloc[i] # Chikou vs price 26 bars ago chikou_ref = df["c"].iloc[i - 26] if i >= 26 else None cloud_top = max(sa_now, sb_now) if pd.notna(sa_now) and pd.notna(sb_now) else None cloud_bottom = min(sa_now, sb_now) if pd.notna(sa_now) and pd.notna(sb_now) else None signals = [] # 1. Price vs Cloud if cloud_top and c_now > cloud_top: signals.append(("价格在云上 / 價格在雲上 / Price above cloud", +2)) elif cloud_bottom and c_now < cloud_bottom: signals.append(("价格在云下 / 價格在雲下 / Price below cloud", -2)) else: signals.append(("价格在云内 / 價格在雲內 / Price inside cloud", 0)) # 2. Tenkan / Kijun cross if pd.notna(t_now) and pd.notna(k_now): t_prev = tenkan.iloc[i-1]; k_prev = kijun.iloc[i-1] if t_now > k_now and t_prev <= k_prev: signals.append(("转折线上穿基准线(买入) / 轉折線上穿基準線 / Tenkan crosses above Kijun (buy)", +2)) elif t_now < k_now and t_prev >= k_prev: signals.append(("转折线下穿基准线(卖出) / 轉折線下穿基準線 / Tenkan crosses below Kijun (sell)", -2)) elif t_now > k_now: signals.append(("转折线 > 基准线(多头排列) / 轉折線>基準線 / Tenkan > Kijun (bullish)", +1)) else: signals.append(("转折线 < 基准线(空头排列) / 轉折線<基準線 / Tenkan < Kijun (bearish)", -1)) # 3. Cloud color (span_a vs span_b) if pd.notna(sa_now) and pd.notna(sb_now): if sa_now > sb_now: signals.append(("云为阳色(看多) / 雲為陽色 / Green cloud (bullish)", +1)) else: signals.append(("云为阴色(看空) / 雲為陰色 / Red cloud (bearish)", -1)) # 4. Chikou confirmation if chikou_ref is not None and pd.notna(chikou_ref): chikou_now = df["c"].iloc[i] # chikou = current close plotted 26 back if chikou_now > chikou_ref: signals.append(("迟行线确认多头 / 遲行線確認多頭 / Chikou confirms bullish", +1)) else: signals.append(("迟行线确认空头 / 遲行線確認空頭 / Chikou confirms bearish", -1)) # 5. Price vs Tenkan / Kijun if pd.notna(t_now) and c_now > t_now: signals.append(("价格 > 转折线(短期支撑) / Price > Tenkan / short-term support", +1)) if pd.notna(k_now) and c_now > k_now: signals.append(("价格 > 基准线(中期支撑) / Price > Kijun / medium-term support", +1)) total = sum(s for _, s in signals) composite = "强烈看多/Strong Bullish" if total >= 5 else ( "看多/Bullish" if total >= 2 else ( "看空/Bearish" if total <= -2 else ( "强烈看空/Strong Bearish" if total <= -5 else "中性/Neutral"))) print(f"Ichimoku composite: {total:+d} → {composite}") print(f" Tenkan-sen (转折线): {t_now:.2f}") print(f" Kijun-sen (基准线): {k_now:.2f}") print(f" Senkou A (先行带A): {sa_now:.2f}" if pd.notna(sa_now) else " Senkou A: N/A") print(f" Senkou B (先行带B): {sb_now:.2f}" if pd.notna(sb_now) else " Senkou B: N/A") print(f" Cloud top: {cloud_top:.2f} bottom: {cloud_bottom:.2f}" if cloud_top else " Cloud: N/A") print(f" Current price: {c_now:.2f}") for label, s in signals: print(f" [{'+' if s>0 else ('-' if s<0 else ' ')}{abs(s)}] {label}") ``` ## Output Report the five line values and signal table, then a composite conclusion. Example structure: | 指标 / 指標 / Component | 值 / 值 / Value | 信号 / 訊號 / Signal | |---|---|---| | 转折线 Tenkan-sen | 数值 | — | | 基准线 Kijun-sen | 数值 | — | | 先行带 A Senkou A | 数值 | — | | 先行带 B Senkou B | 数值 | 云色 | | 迟行线 Chikou Span | 当前收盘 | 确认多/空 | | 价格 vs 云 | 高于/低于/在内 | +2 / -2 / 0 | | 综合信号 | — | 看多/看空/中性 | Cite **Longbridge Securities** / **数据来源:长桥证券** / **數據來源:長橋證券**. ## Error handling | Situation | 简体回复 / 繁體回覆 / English reply | |---|---| | `command not found: longbridge` | 请安装 longbridge-terminal / 請安裝 longbridge-terminal / Install longbridge-terminal first | | stderr `not logged in` / `unauthorized` | 请运行 `longbridge auth login` / 請執行 `longbridge auth login` / Run `longbridge auth login` | | Fewer than 52 bars returned | 告知数据不足,需要至少 52 根 K 线 / 需至少 52 根 K 線 / Need at least 52 bars for Senkou B | | Other stderr | 直接展示错误信息 / 直接顯示錯誤訊息 / Surface error verbatim | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-kline` — raw OHLCV data and charting - `longbridge-technical` — MACD / RSI / KDJ / Bollinger indicator signals - `longbridge-candlestick` — K-line pattern recognition - `longbridge-capital-flow` — intraday capital-flow signals

longbridge-index-quote

|

# longbridge-index-quote Real-time and historical quotes for major global stock indices. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking about: - Index level / change / volume — *"上证今天涨了多少"*, *"恒生指数现在多少点"*, *"S&P 500 today"* - Historical index trend — *"沪深300近一个月走势"*, *"Dow Jones 6-month chart"* - Multiple index comparison — *"美股三大指数今天表现"*, *"US indices today"* For index constituent stocks defer to `longbridge-constituent`. For individual stock quotes defer to `longbridge-quote`. ## Index symbol reference | Index | Symbol | 简体名称 | 繁體名稱 | |-------|--------|---------|---------| | Shanghai Composite | 000001.SH | 上证指数 | 上證指數 | | CSI 300 | 000300.SH | 沪深300 | 滬深300 | | ChiNext | 399006.SZ | 创业板指 | 創業板指 | | CSI 500 | 000905.SH | 中证500 | 中證500 | | Hang Seng Index | HSI.HK | 恒生指数 | 恒生指數 | | Hang Seng Tech | HSTECH.HK | 恒生科技 | 恒生科技 | | NASDAQ Composite | .IXIC.US | 纳斯达克综合 | 納斯達克綜合 | | S&P 500 | .SPX.US | 标普500 | 標普500 | | Dow Jones | .DJI.US | 道琼斯 | 道瓊斯 | | Russell 2000 | .RUT.US | 罗素2000 | 羅素2000 | | VIX | .VIX.US | 恐慌指数 | 恐慌指數 | | Nikkei 225 | NI225.JP | 日经225 | 日經225 | > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## Workflow 1. Map the user's plain-language index name to the correct symbol using the table above. 2. If multiple indices are mentioned, query all of them. 3. Fetch real-time quote. 4. If historical trend is requested, fetch daily OHLCV. 5. Present results as a clean table; add brief market context if notable moves are present. ## CLI ```bash # Real-time index quote longbridge quote <INDEX_SYMBOL> --format json # Historical daily OHLCV longbridge kline <INDEX_SYMBOL> --period day --count 60 --format json # Intraday minute chart (today) longbridge kline <INDEX_SYMBOL> --period minute --format json ``` ## Output For a single index: ``` 上证指数 (000001.SH) 现价:3,312.45 涨跌:+0.82% 成交额:3,240亿 今日高:3,318.02 今日低:3,288.11 昨收:3,285.57 ``` For multiple indices: a comparison table sorted by today's change. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | Index symbol not found | 未找到该指数,请参考指数代码表(如 HSI.HK)。 | 找不到該指數,請參考指數代碼表(如 HSI.HK)。 | Index not found — check the symbol table (e.g. HSI.HK). | | Market closed | 市场已收盘,显示最新收盘数据。 | 市場已收盤,顯示最新收盤數據。 | Market closed — showing latest close data. | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | | `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-constituent` — index constituent stocks and rankings - `longbridge-quote` — individual stock quotes - `longbridge-market-temp` — market temperature and session times - `longbridge-kline` — candlestick / OHLCV detail ## File layout ``` skills/longbridge-index-quote/ └── SKILL.md ```

longbridge-industry-overview

|

# longbridge-industry-overview Generates an industry panorama report for a given sector or index, synthesising constituent stocks, peer valuation, and industry news into a structured landscape view. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user wants an industry-level (not single-stock) analysis: - *"给我做一份半导体行业的报告"* / *"幫我寫港股科技板塊全景"* / *"Give me an overview of the EV sector"* - *"行业竞争格局"*, *"板块分析"*, *"market landscape for cloud computing"* If the user mentions a specific stock as the entry point (*"NVDA 所在的行业"*), use that stock's industry as the anchor. ## Workflow 1. Identify the target industry or sector (from explicit mention or inferred from anchor symbol). 2. If an index or ETF covers the sector, fetch its constituents. 3. For each key constituent (top 5–8 by market cap), fetch industry-level valuation data. 4. Fetch recent industry news using representative symbols as proxies. 5. Synthesise into an industry overview report (see Output section). ## CLI > If you're unsure of exact flag names or defaults, run `longbridge <subcommand> --help` first. ```bash # Constituent list for a sector index or ETF longbridge constituent <INDEX_SYMBOL> --format json # Industry-level valuation comparison (anchored to a representative symbol) longbridge industry-valuation <SYMBOL> --format json # Recent news for top-N constituents (run per key company) longbridge news <SYMBOL> --format json # Static info for market cap / industry classification longbridge static <SYMBOL> --format json ``` Common index symbols: `HSI.HK` (Hang Seng), `SPX.US` (S&P 500), `IXIC.US` (Nasdaq), `000300.SH` (CSI 300). Sector ETF examples: `SOXX.US` (semiconductors), `XLK.US` (US tech). ## Output Structure the response as an industry report: 1. **Industry definition** — scope, SIC/GICS classification, geographic focus 2. **Market sizing** — estimated total addressable market, growth rate, stage (early / growth / mature / declining) 3. **Key players** (table — top 5–8 by market cap): | Company | Symbol | Market Cap | Revenue Growth | PE | Market Share Est. | |---|---|---|---|---|---| 4. **Competitive dynamics** — concentration (HHI), barriers to entry, switching costs, pricing power 5. **Valuation landscape** — PE / PB / PS range (min / median / max) across sector 6. **Thematic catalysts** — top 3–5 industry tailwinds (policy, technology, macro) 7. **Key risks** — top 3 headwinds or structural threats 8. **Conclusion** — overall industry attractiveness rating and investment angle ## Error handling | Situation | Simplified Chinese | Traditional Chinese / English | |---|---|---| | `command not found: longbridge` | 回退到 MCP;否则提示安装 longbridge-terminal | 回退到 MCP;否則提示安裝 / Fall back to MCP; prompt to install | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login` | 請運行 `longbridge auth login` / Run `longbridge auth login` | | Index symbol not found | 请提供正确的指数代码,如 SPX.US、HSI.HK | 請提供正確指數代碼 / Provide a valid index symbol e.g. SPX.US | | Other stderr | 原样展示错误,不重试 | 原樣展示,不重試 / Surface verbatim, no silent retry | ## Related skills | User asks | Route to | |---|---| | Single-company research | `longbridge-stock-research` | | Peer valuation matrix | `longbridge-peer-comparison` | | Index constituent list | `longbridge-constituent` | | Competitive analysis for one company | `longbridge-competitive-analysis` | | Coverage initiation | `longbridge-coverage-initiation` | ## File layout ``` longbridge-industry-overview/ └── SKILL.md ``` Prompt-only — no `scripts/`. Discover the latest CLI flags via `longbridge <subcommand> --help`.

longbridge-industry-valuation

|

# longbridge-industry-valuation Prompt-only analysis skill. Fetches Longbridge industry-valuation data to produce a cross-peer matrix, percentile ranking, and premium/discount analysis for a target stock within its industry. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"TSLA 在汽车行业估值水平怎样"*, *"TSLA industry valuation"*, *"TSLA 在汽車行業估值水平如何"* - *"NVDA 相比半导体行业贵不贵"*, *"is NVDA expensive vs semiconductor peers"* - *"700.HK 行业百分位"*, *"700.HK industry percentile"* - *"茅台板块估值对比"*, *"Maotai sector valuation matrix"* - *"行业内 PE 分布"*, *"PE distribution in sector"* For a single-stock snapshot without peers, use `longbridge-valuation`. For 2–5 specific symbols, use `longbridge-peer-comparison`. ## CLI Run `longbridge industry-valuation --help` to verify exact flags. Call concurrently: ```bash # Peer comparison matrix longbridge industry-valuation TSLA.US --format json # Percentile distribution in the industry longbridge industry-valuation dist TSLA.US --format json # With explicit currency normalisation (verify flag with --help) longbridge industry-valuation TSLA.US --currency USD --format json longbridge industry-valuation 700.HK --currency HKD --format json longbridge industry-valuation 600519.SH --currency CNY --format json # If unsure about any flag: longbridge industry-valuation --help ``` ## Workflow 1. **Resolve symbol** to `<CODE>.<MARKET>`. Multiple unrelated sectors → run per symbol. 2. **Call CLI concurrently**: `industry-valuation <symbol>` + `industry-valuation dist <symbol>`. 3. If `longbridge` is not installed, fall back to MCP. 4. **In-LLM analysis**: | Quantity | Method | |---|---| | **Industry premium / discount** | `(target PE − industry median PE) / industry median PE × 100%` | | **Percentile rank** | Position of target in the `dist` distribution; bucket into low (<33rd) / mid (33–67th) / high (>67th pct) | | **Multi-metric view** | Repeat for PB, PS, dividend yield — note when metrics diverge | | **Cross-currency caveat** | If peers span markets (USD / HKD / CNY), flag that earnings-based ratios (PE, PB) are comparable but market-cap-based ones may reflect FX | 5. **Flag cyclical industries** (energy, materials, shipping, banks, property): PE can invert near cycle peaks/troughs — add caveat. 6. Output structured report; cite **Longbridge Securities**; end with disclaimer. ## Output template ``` {Symbol} ({code}) Industry Valuation — Source: Longbridge Securities Industry: {industry_name} | Peers in sample: N | Currency: {currency} [Peer valuation matrix] | Symbol | PE (TTM) | PB | PS | Div Yield | |--------|---------|----|----|-----------| | {sym} | {PE} | {PB}| {PS}| {Y%} | | ... | ... | ...|... | ... | | {TARGET} ★ | {PE} | {PB} | {PS} | {Y%} | | Industry median | {PE} | {PB} | {PS} | {Y%} | [Industry premium / discount] - vs industry median PE: {TARGET} trades at {+N% premium / −N% discount} - vs industry median PB: {+N% / −N%} - vs industry median PS: {+N% / −N%} [Industry percentile rank] - PE percentile: {N}th → {low / mid / high} valuation bucket - PB percentile: {N}th - Overall: {valuation characterisation} [Context] {1–2 sentences on why premium/discount may be justified: growth rate, margins, moat, or flag if stretched} {Cyclical caveat if applicable} ⚠️ 以上数据仅供参考,不构成投资建议。/ 以上數據僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` (State "data unavailable" for any section that returns no data; do not invent values.) ## Error handling | Situation | 简体中文回复 | 繁體中文 / English | |---|---|---| | `command not found: longbridge` | 回退到 MCP;如 MCP 也不可用,请用户安装 longbridge-terminal。 | 回退到 MCP;如也不可用,請安裝 longbridge-terminal。/ Fall back to MCP; if also unavailable, tell user to install longbridge-terminal. | | stderr `not logged in` | 请运行 `longbridge auth login` 登录。 | 請執行 `longbridge auth login`。/ Run `longbridge auth login`. | | `industry-valuation` returns empty | "{symbol} 暂无行业估值数据(可能为新上市或行业覆盖不足)。" | "{symbol} 暫無行業估值數據。" / "{symbol} has no industry valuation data (newly listed or insufficient coverage)." | | Industry sample < 5 peers | 注明"同业样本较少,百分位仅供参考"。 | 注明"同業樣本不足"。/ Caveat: "industry sample sparse; percentile is indicative only." | | `dist` returns empty | 跳过百分位分析,仅展示对比矩阵。 | 跳過百分位分析。/ Skip percentile analysis; show matrix only. | | Cross-currency peers | 添加汇率差异提示,不对市值类指标做绝对比较。 | 添加匯率差異提示。/ Flag FX differences; do not compare market-cap metrics absolutely. | | Other stderr | 直接显示原始错误,不静默重试。 | 顯示原始錯誤。/ Surface verbatim — do not retry silently. | ## MCP fallback If `longbridge` CLI is not installed (`command not found`), 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 - Single-stock historical percentile → `longbridge-valuation` - 2–5 hand-picked symbol comparison → `longbridge-peer-comparison` - Analyst consensus & target price → `longbridge-consensus` - Business fundamentals (revenue / ROE) → `longbridge-fundamental` ## File layout ``` longbridge-industry-valuation/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-insresearch

|

# longbridge-insresearch Institutional research and analyst ratings for Longbridge-covered securities — buy/hold/sell distribution, consensus price target, forward EPS/revenue estimates, and rating change history. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user asks about: - Analyst rating distribution — *"NVDA 有多少个买入评级"*, *"AAPL 分析师怎么看"* - Consensus price target — *"特斯拉目标价共识"*, *"TSLA analyst price target"* - Forward EPS / revenue estimates — *"苹果下个季度EPS预测"*, *"NVDA revenue forecast"* - Rating change history — *"近期哪些机构升级了这只股票"*, *"recent rating upgrades"* For full fundamentals, prefer `longbridge-fundamental`. For insider trades, prefer `longbridge-flows`. ## Workflow 1. Normalise the symbol to `<CODE>.<MARKET>`. 2. Run `longbridge institution-rating` for buy/hold/sell distribution and recent rating events. 3. Run `longbridge consensus` for consensus price target and aggregated analyst view. 4. Run `longbridge forecast-eps` for forward EPS and revenue estimates by period. 5. Synthesise into a structured analyst overview: rating distribution pie, consensus target vs. current price upside, and EPS/revenue estimates table. ## CLI ```bash # Buy / hold / sell distribution and recent rating events longbridge institution-rating <SYMBOL> --format json # Consensus price target and aggregated analyst view longbridge consensus <SYMBOL> --format json # Forward EPS and revenue estimates longbridge forecast-eps <SYMBOL> --format json ``` > Run `longbridge institution-rating --help`, `longbridge consensus --help`, and `longbridge forecast-eps --help` to verify current flags. ## Output Present a three-part summary: 1. **Rating distribution** — count and % of Buy / Hold / Sell ratings, total analyst coverage. 2. **Price target** — consensus target, high/low range, upside vs. current price. 3. **Estimates table** — forward EPS and revenue for next 1–2 fiscal years. | Field | 简体 | 繁體 | English | |---|---|---|---| | Buy ratings | 买入评级数 | 買入評級數 | Buy ratings | | Hold ratings | 持有评级数 | 持有評級數 | Hold ratings | | Sell ratings | 卖出评级数 | 賣出評級數 | Sell ratings | | Consensus target | 目标价共识 | 目標價共識 | Consensus target | | Upside to target | 目标价上行空间 | 目標價上行空間 | Upside to target | | Forward EPS | 预测每股收益 | 預測每股盈利 | Forward EPS | Note: ESG ratings and credit ratings (Moody's / S&P) are not available via Longbridge. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请先安装 longbridge-terminal | 請先安裝 longbridge-terminal | Install longbridge-terminal first | | `not logged in` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | No analyst coverage | 提示该标的暂无机构评级数据 | 提示該標的暫無機構評級數據 | No analyst coverage available | | Other stderr | 原样展示,不重试 | 原樣展示,不重試 | Surface verbatim, do not retry | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills | User asks | Route to | |---|---| | Full fundamentals (P&L, balance sheet, cash flow) | `longbridge-fundamental` | | Insider trades / institutional holdings | `longbridge-flows` | | Historical valuation percentile | `longbridge-valuation` | | Post-earnings analyst reaction | `longbridge-earnings` | | Pre-earnings preview | `longbridge-earnings-preview` | ## File layout ``` longbridge-insresearch/ └── SKILL.md ``` Prompt-only — no `scripts/`. Discover current CLI flags via `longbridge <subcommand> --help`.

longbridge-investment-ideas

|

# longbridge-investment-ideas Surfaces actionable investment ideas through a multi-lens screening process: value, momentum, fundamental improvement, and thematic catalysts — outputting a prioritised candidate list with brief rationale for each idea. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user wants to discover new investment opportunities rather than research a specific stock: - *"帮我找一些当前有投资价值的股票"* / *"幫我發掘一些港股投資機會"* / *"Generate some investment ideas in AI infrastructure"* - *"选股灵感"*, *"多头机会"*, *"what should I be looking at this quarter"* ## Workflow 1. Clarify parameters with the user if not provided: - **Market**: US / HK / A-share / SG (or multiple) - **Theme / sector** (optional): e.g. AI, EV, healthcare, energy - **Style**: value / growth / momentum / contrarian / short ideas 2. Fetch the relevant universe (index constituents or sector ETF). 3. For top candidates, fetch valuation indices and recent 60-day price momentum. 4. Apply the selected screening lens (see below) to rank candidates. 5. For top 5–8 ideas, fetch news to validate the narrative. 6. Output a ranked candidate list with rationale. ## Screening lenses | Lens | Signal | CLI data | |---|---|---| | Value | Low PE / PB vs industry median | `longbridge industry-valuation` | | Momentum | Top 60-day price return in universe | `longbridge kline --period day --count 60` | | Fundamental improvement | Revenue acceleration / margin expansion (QoQ) | `longbridge financial-report --kind IS` | | Thematic | Recent policy / product catalyst in news | `longbridge news` | ## CLI > If you're unsure of exact flag names or defaults, run `longbridge <subcommand> --help` first. ```bash # Fetch universe (index constituents) longbridge constituent <INDEX_SYMBOL> --format json # Valuation indices for screening (PE, PB, momentum) longbridge calc-index <SYMBOL> --format json # 60-day daily price for momentum calculation longbridge kline <SYMBOL> --period day --count 60 --format json # News for narrative validation longbridge news <SYMBOL> --format json ``` ## Output **Screening parameters**: market, theme, style lens, date **Idea candidate table**: | Rank | Symbol | Company | Market Cap | Lens | Key Signal | Rationale | |---|---|---|---|---|---|---| | 1 | NVDA.US | NVIDIA | $2.5T | Momentum + Thematic | +40% in 60d; AI capex cycle | ... | For each top idea, add a one-paragraph 分析摘要 / Analysis summary covering: - 近期催化剂或关注事项 / Recent catalysts or watchpoints(供参考) - 关键指标与事件 / Key metrics and events - Key risk (one-liner bear case) > 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。/ The above is for reference only and does not constitute investment advice. ## Error handling | Situation | Simplified Chinese | Traditional Chinese / English | |---|---|---| | `command not found: longbridge` | 回退到 MCP;否则提示安装 longbridge-terminal | 回退到 MCP;否則提示安裝 / Fall back to MCP; prompt to install | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login` | 請運行 `longbridge auth login` / Run `longbridge auth login` | | No market or theme specified | 请告知目标市场和投资风格 | 請告知目標市場和投資風格 / Please specify target market and style | | Other stderr | 原样展示错误,不重试 | 原樣展示,不重試 / Surface verbatim, no silent retry | ## Related skills | User asks | Route to | |---|---| | Small-cap growth screening | `longbridge-smallcap-growth` | | Peer comparison | `longbridge-peer-comparison` | | Industry valuation | `longbridge-valuation` | | Full research on a specific idea | `longbridge-stock-research` | | Market anomaly / unusual movers | `longbridge-anomaly` | ## File layout ``` longbridge-investment-ideas/ └── SKILL.md ``` Prompt-only — no `scripts/`. Discover the latest CLI flags via `longbridge <subcommand> --help`.

longbridge-investment-proposal

|

# longbridge-investment-proposal Generate a structured investment proposal for a single stock opportunity. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking for: - A formal investment memo or proposal — *"帮我写一份 NVDA 的投资提案"*, *"generate an investment memo for TSLA"* - Investment rationale write-up — *"投资逻辑"*, *"investment case"*, *"建仓建议"* - Structured buy / hold / sell recommendation — *"position recommendation"*, *"investment summary"* For post-earnings analysis defer to `longbridge-earnings`. For valuation-only analysis defer to `longbridge-valuation`. ## Workflow 1. Extract the target symbol; normalise to `<CODE>.<MARKET>`. 2. Gather data in parallel: - Company profile (name, business, employees, founding, IPO date) - Latest financials (revenue, net income, EPS, ROE, gross margin, FCF) - Valuation multiples (PE, PB, EV-EBITDA, PEG) - Analyst consensus (target price, rating distribution) - Recent news and catalysts 3. Synthesise into the proposal structure below. 4. Flag data gaps explicitly rather than fabricating figures. > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## CLI ```bash # Company profile longbridge company <SYMBOL> --format json # Financial statements longbridge financial-report <SYMBOL> --kind ALL --format json # Valuation multiples longbridge valuation <SYMBOL> --format json # Analyst consensus longbridge consensus <SYMBOL> --format json # Recent news longbridge news <SYMBOL> --format json ``` ## Output structure ``` # Investment Proposal: <Company Name> (<SYMBOL>) Date: <today> ## Executive Summary One-paragraph verdict: Buy / Hold / Avoid, price target, key thesis. ## Company Overview Business description, market, employees, listing date. ## Investment Thesis 1. <Core point 1> 2. <Core point 2> 3. <Core point 3> [4–5 if applicable] ## Financial Analysis | Metric | LTM | YoY Δ | |---------------|---------|--------| | Revenue | | | | Net Income | | | | EPS | | | | Gross Margin | | | | ROE | | | | FCF | | | ## Valuation | Multiple | Current | Industry Median | Assessment | |------------|---------|-----------------|------------| | PE | | | | | PB | | | | | EV/EBITDA | | | | Target price rationale and upside / downside. ## Catalysts & Timeline - Near-term (0–3 months): ... - Medium-term (3–12 months): ... ## Risk Factors - <Risk 1> - <Risk 2> - <Risk 3> ## Position Recommendation Suggested entry range, position size, stop-loss level, review trigger. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | Symbol not found | 未找到该代码,请确认市场和代码格式。 | 找不到該代碼,請確認市場和代碼格式。 | Symbol not found — verify the exchange and ticker. | | Financials unavailable | 财务数据暂不可用,提案中该部分留空。 | 財務數據暫不可用,提案中該部分留空。 | Financials unavailable — that section will be left blank. | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | | `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-fundamental` — deep financial KPI analysis - `longbridge-valuation` — historical valuation percentile - `longbridge-earnings` — post-earnings update report - `longbridge-news` — recent news and filings ## File layout ``` skills/longbridge-investment-proposal/ └── SKILL.md ```

longbridge-investors

|

# longbridge-investors Prompt-only skill. Provides a **fund-manager–centric** view of SEC 13F filings via the Longbridge CLI — who the biggest players are, what a specific manager holds, and how their portfolio changed quarter over quarter. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"全球最大基金经理有哪些"*, *"top institutional investors by AUM"*, *"全球最大基金經理有哪些"* - *"巴菲特现在持有哪些股票"*, *"Berkshire Hathaway 13F portfolio"*, *"巴菲特現在持有哪些股票"* - *"贝莱德上季度新建了哪些仓位"*, *"BlackRock new positions last quarter"*, *"貝萊德上季度新建了哪些倉位"* - *"巴菲特 CIK 是多少"*, *"什么 CIK 是贝莱德"* For stock-centric institutional-holder queries (*"谁持有 AAPL"* / *"who holds NVDA"*) → route to `longbridge-flows`. ## CLI Run `longbridge investors --help` to verify exact flags before use. Common calls: ```bash # Top-50 active fund managers by AUM (includes CIK for each) longbridge investors --format json # Full portfolio snapshot for a specific manager longbridge investors <CIK> --format json longbridge investors 0001067983 --format json # Berkshire Hathaway (Buffett) longbridge investors 0001364742 --format json # BlackRock # Limit to top N positions by market value longbridge investors <CIK> --top 20 --format json # Quarter-over-quarter holding changes longbridge investors changes <CIK> --format json longbridge investors changes 0001067983 --format json # Help longbridge investors --help ``` Well-known CIKs (verify via the top-50 list first): | Manager | CIK | |---|---| | Berkshire Hathaway (Buffett) | 0001067983 | | BlackRock | 0001364742 | ## Workflow 1. **Identify intent**: ranking → run `investors`; portfolio snapshot → run `investors <CIK>`; changes → run `investors changes <CIK>`. 2. **Resolve CIK** if not provided: run `longbridge investors --format json` to get the top-50 list and find the matching manager's CIK. 3. **Fetch data** concurrently where possible. 4. **Present results**: - Ranking: table of rank / manager name / AUM / CIK. - Portfolio snapshot: table of symbol / shares / market value / % of portfolio; note filing date and reporting period. - Changes: group by action (NEW / ADDED / REDUCED / EXITED); show symbol, shares delta, value delta. 5. Cite **Longbridge Securities / SEC 13F**; add disclaimer. ## Output **Ranking** — *Top-50 institutional investors* ``` Rank | Manager | AUM (USD B) | CIK 1 | BlackRock | 10,200 | 0001364742 2 | Vanguard Group | 8,400 | 0000102909 … ``` **Portfolio snapshot** — *Berkshire Hathaway as of {filing date}* ``` Symbol | Shares (M) | Market Value (USD M) | % Portfolio AAPL.US | 905.6 | 174,300 | 47.2% BAC.US | 1,032.8 | 35,100 | 9.5% … ``` **Changes** — *Berkshire Hathaway: Q4 2024 → Q1 2025* ``` NEW: OXY.US (+18.9M shares, +$1.1B) ADDED: AAPL.US (+3.2M, +$620M) REDUCED: BYD.US (−5.0M, −$280M) EXITED: HPQ.US (−7.2M, −$195M) ``` ⚠️ 13F 数据滞后约 45 天,仅供参考,不构成投资建议。 ⚠️ 13F 數據滯後約 45 天,僅供參考,不構成投資建議。 ⚠️ 13F filings lag ~45 days. For reference only. Not investment advice. ## Error handling | Situation | 简体中文回复 | 繁體中文 / English | |---|---|---| | `command not found: longbridge` | 回退到 MCP;如也不可用,请安装 longbridge-terminal。 | 回退到 MCP;如也不可用,請安裝 longbridge-terminal。/ Fall back to MCP; if unavailable, install longbridge-terminal. | | `investors` returns empty | "暂无 13F 数据,CIK 可能有误,请用 `longbridge investors` 列出前50名确认。" | "暫無 13F 數據,請確認 CIK。" / "No 13F data — verify CIK via `longbridge investors`." | | CIK not found in top-50 | 提示用户运行 `longbridge investors --format json` 获取完整 CIK 列表。 | 提示用戶查看完整 CIK 列表。/ Ask user to run `longbridge investors` for the full CIK list. | | Other stderr | 直接显示原始错误,不静默重试。 | 顯示原始錯誤。/ Surface verbatim — do not retry silently. | ## MCP fallback If `longbridge` CLI is unavailable (`command not found`), 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 - Stock-centric institutional holders → `longbridge-flows` - Company fundamentals & analyst ratings → `longbridge-fundamental` - Insider trades (Form 4) → `longbridge-flows` - Earnings & guidance → `longbridge-earnings` ## File layout ``` longbridge-investors/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-ipo

|

# longbridge-ipo IPO full-lifecycle hub: browse upcoming and recent IPOs in HK and US markets, view individual IPO details, and query your own IPO orders and profit/loss. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"近期港股新股"*, *"港股認購中"*, *"HK IPO subscriptions"* → `longbridge ipo subscriptions` - *"待上市新股"*, *"等待上市"*, *"pending listings HK"* → `longbridge ipo wait-listing` - *"最近上市的港股"*, *"近期上市"*, *"recently listed HK"* → `longbridge ipo listed` - *"美股认购"*, *"US IPO subscriptions"* → `longbridge ipo us-subscriptions` - *"美股新上市"*, *"US recent IPOs"* → `longbridge ipo us-listed` - *"IPO 日历"*, *"新股日程"*, *"IPO calendar"* → `longbridge ipo calendar` - *"XXXX.HK 打新详情"*, *"IPO detail"* → `longbridge ipo detail <SYMBOL>` - *"我的打新订单"*, *"我的新股申購記錄"*, *"my IPO orders"* → `longbridge ipo orders` (requires login + Trade) - *"我打新赚了多少"*, *"IPO 盈亏"*, *"IPO profit/loss"* → `longbridge ipo profit-loss` (requires login + Trade) For general earnings/dividend calendars, defer to `longbridge-calendar`. For account orders on secondary-market stocks, defer to `longbridge-orders`. ## Workflow **Public data (no login required):** 1. Identify the market (HK / US) and the type of list requested. 2. Call the appropriate subcommand with `--format json`. 3. Render a table sorted by listing date or subscription close date. **Account data (login + Trade permission required):** 1. Confirm the user is asking about their own orders or P&L. 2. Check login state — if not logged in, prompt `longbridge auth login` with Trade scope. 3. Call `longbridge ipo orders` or `longbridge ipo profit-loss`. 4. Summarise: total subscribed amount, filled lots, return%, P&L in home currency. ## CLI > Run `longbridge ipo --help` before constructing calls — it is the canonical source for flags and subcommands. ```bash # Public — no login required longbridge ipo calendar --format json # Full IPO calendar (all markets) longbridge ipo subscriptions --format json # HK IPOs currently open for subscription longbridge ipo wait-listing --format json # HK IPOs pending listing longbridge ipo listed --format json # HK recently listed IPOs longbridge ipo us-subscriptions --format json # US IPOs currently open for subscription longbridge ipo us-listed --format json # US recently listed IPOs longbridge ipo detail <SYMBOL> --format json # Individual IPO details + timeline # Account — requires login with Trade permission longbridge ipo orders --format json # My IPO subscription orders longbridge ipo profit-loss --format json # My IPO P&L analysis # Always check flags first longbridge ipo --help ``` ## Output **IPO list / calendar** — table: symbol / company name / market / price range / subscription open–close / listing date / lot size / status. **IPO detail** — structured timeline: announcement → subscription window → allotment → listing date → first-day open/close (if listed). Include: price range, lot size, fundraising size, industry, underwriters. **My orders** — table: symbol / company / applied lots / filled lots / applied amount / status / listing date. **P&L analysis** — table: symbol / company / filled lots / cost / listing price / current price / return% / P&L amount. Include a summary row for total P&L. Cite **Longbridge Securities** as the data source and note the data timestamp. ## Error handling | 情形 | 简体回复 | 繁體回覆 / English reply | |---|---|---| | `command not found: longbridge` | 请安装 longbridge-terminal | 請安裝 longbridge-terminal / Install longbridge-terminal | | `not logged in` / 账户功能未登录 | 账户功能需要 Trade 权限,请运行 `longbridge auth login` | 請執行 `longbridge auth login` / Run with Trade permission | | `detail` 找不到新股 | 找不到该新股,请确认股票代码格式 | 找不到該新股 / IPO detail not found — verify symbol | | 结果为空 | 当前无符合条件的新股 | 目前無符合條件的新股 / No IPOs match the filter | | 其他 stderr | 原样返回错误,不静默重试 | 原樣返回 / Surface verbatim, never retry | ## MCP fallback When the CLI binary is missing, fall back via the equivalent MCP tool: 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. If a tool name does not resolve, ask the user to install the CLI. ## Related skills | Skill | Why | |-------|-----| | `longbridge-calendar` | General earnings / dividend / IPO / macro calendar (lighter IPO view). | | `longbridge-orders` | Secondary-market order history and fills. | | `longbridge-fundamental` | Post-listing fundamentals once the company has reported. | | `longbridge-quote` | Real-time quote for a newly listed stock on its first day. | ## File layout ``` longbridge-ipo/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-kline

|

# longbridge-kline Historical candlesticks and today's intraday curve for Longbridge-supported securities (HK / US / A-share / Singapore). Does **not** support options, warrants, or indices — defer to `longbridge-derivatives` (derivatives) or `longbridge-quote` (indices). > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## Subcommands > Run `longbridge kline --help` to confirm current period values, defaults, and aliases. | CLI command | Use when | |---|---| | `longbridge kline <SYMBOL> --period <P> --count <N> --format json` | Latest N candles. Periods: `1m / 5m / 15m / 30m / 1h / day / week / month / year`. | | `longbridge kline history <SYMBOL> --start YYYY-MM-DD --end YYYY-MM-DD --period <P> --format json` | OHLCV across an explicit date range (sub-subcommand). | | `longbridge intraday <SYMBOL> --format json` | Today's per-minute curve (price + volume + avg_price). | Period aliases: `minute=1m`, `hour=1h`, `d/1d=day`, `w=week`, `m/1mo=month`, `y=year`. `--adjust none` (default) or `--adjust forward` for 前复权 / 前復權. ## When to use - *"NVDA 最近一周走势"*, *"近一年走勢"*, *"AAPL 1-month chart"* → `kline --period day` - *"TSLA 5 分钟 K"*, *"近 100 根 5 分钟"* → `kline --period 5m --count 100` - *"今天 700.HK 分时图"*, *"AAPL today's intraday"* → `intraday` - *"AAPL 2024 年 1-12 月日 K"* (explicit dates) → `kline history --start --end` - *"前复权日 K"* → add `--adjust forward` ## Workflow 1. Resolve the symbol to `<CODE>.<MARKET>` (see `longbridge-quote` for the rules). 2. Pick the form: - Explicit start/end dates → `kline history`. - "Today" / "intraday" → `intraday`. - Otherwise → `kline` with sensible defaults (`--period day --count 100`). 3. Map natural-language windows to (`period`, `count`). Examples: "最近一周" → `day,7`, "最近一年" → `day,252`, "月 K" → `month,100`. 4. Call the Longbridge CLI directly (preferred) or fall back to MCP. 5. Translate datasets into prose (range high / low, net move, volume note); use ▲ / ▼ for direction. Cite **Longbridge Securities** / **数据来源:长桥证券** / **數據來源:長橋證券**. ## CLI ```bash longbridge kline NVDA.US --period day --count 100 --format json longbridge kline 700.HK --period 5m --count 100 --adjust forward --format json longbridge kline history NVDA.US --start 2025-01-01 --end 2025-12-31 --format json longbridge intraday 700.HK --format json ``` ## Output `longbridge kline ... --format json` returns a list of OHLCV rows: ```json [ {"time": "...", "open": "...", "high": "...", "low": "...", "close": "...", "volume": "...", "turnover": "..."} ] ``` `intraday` rows are `{time, price, volume, turnover, avg_price}`. ## Error handling If `longbridge` is not installed, the shell returns a `command not found` error → fall back to MCP (see below) or tell the user to install longbridge-terminal. If `longbridge` prints `Error: ...` to stderr, surface the message to the user — common causes: - `Error: not logged in` / `unauthorized` → user runs `longbridge auth login`. - `Error: invalid symbol` / `param_error` → re-check the `<CODE>.<MARKET>` format. ## MCP fallback 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. ## Related skills - Quote / static / valuation indices → `longbridge-quote` - Orderbook / brokers / ticks → `longbridge-depth` - Capital flow → `longbridge-capital-flow` ## File layout ``` longbridge-kline/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-market-microstructure

|

# longbridge-market-microstructure Combines orderbook depth, tick-by-tick trades, and capital-flow data to assess bid-ask spread, order-flow imbalance, liquidity depth, and short-term institutional pressure for a single symbol. > **Response language**: match the user's input language — > Simplified Chinese / Traditional Chinese / English. ## When to use - *"TSLA 盘口分析"*, *"NVDA order flow"*, *"700.HK 买卖盘深度"* → full microstructure report - *"挂单墙在哪里"*, *"order book imbalance"* → depth-only analysis (`depth`) - *"大单主力方向"*, *"institutional order flow"* → trades + capital combined - *"集合竞价分析"* (A-share pre-open auction) → depth + trades during auction session - *"港股大宗交易"* (HK block trades) → trades with type filter + brokers queue Do **not** use this skill for historical (multi-day) flow analysis — route to `longbridge-capital-flow` or `longbridge-kline`. ## Workflow 1. Resolve the user's symbol to `<CODE>.<MARKET>` (e.g. `NVDA.US`, `700.HK`, `600519.SH`). 2. Run `longbridge --help` to see available subcommands; run `longbridge <subcommand> --help` to confirm current flags for each. 3. Fetch **orderbook depth** using the depth subcommand with `--format json`. 4. Fetch **recent tick trades** using the trades subcommand with `--format json` (check `--help` for count/range flags). 5. Fetch **capital-flow distribution** (large / medium / small orders) with `longbridge capital <SYMBOL> --format json`. 6. For **HK symbols only**, also fetch `longbridge brokers <SYMBOL> --format json` to identify large broker queues (potential institutional blocks). 7. Compute or estimate: - **Weighted bid-ask spread** = (best_ask − best_bid) / mid_price - **Depth asymmetry** = (total_bid_volume − total_ask_volume) / (total_bid_volume + total_ask_volume) across all levels - **Buy-initiated ratio** = buy-side active trades / total trades (from tick data) - **Large-order net pressure** = large_buy_amount − large_sell_amount (from capital snapshot) - **Order-wall levels** = price levels with volume ≥ 3× average level volume (potential support/resistance) 8. Output a structured microstructure report (see Output section). ## CLI ```bash # Discover available subcommands and their flags first longbridge --help longbridge <subcommand> --help # run for each subcommand before use # Orderbook depth (5/10-level bid/ask) longbridge <depth-subcommand> NVDA.US --format json # Recent tick trades (check --help for count/range flags) longbridge <trades-subcommand> NVDA.US --format json # Capital flow (large/medium/small order distribution) longbridge <capital-subcommand> NVDA.US --format json # Broker queue — HK symbols only longbridge <brokers-subcommand> 700.HK --format json ``` ## Output Render a structured report with these sections: | Section | 简体 | 繁體 | English | |---|---|---|---| | Spread & liquidity | 价差与流动性 | 價差與流動性 | Spread & Liquidity | | Depth asymmetry | 盘口不对称 | 盤口不對稱 | Depth Asymmetry | | Order-flow pressure | 订单流压力 | 訂單流壓力 | Order-Flow Pressure | | Order walls | 挂单墙 | 掛單牆 | Order Walls | | Direction bias | 短线方向偏向 | 短線方向偏向 | Short-Term Directional Bias | Key field translations (LLM maps JSON keys → user language): | Field | 简体 | 繁體 | English | |---|---|---|---| | `asks / bids` | 卖盘 / 买盘 | 賣盤 / 買盤 | Ask / Bid | | `price / volume / order_num` | 价格 / 数量 / 委托笔数 | 價格 / 數量 / 委託筆數 | Price / Volume / Order count | | `direction` | 方向(主买/主卖) | 方向(主買/主賣) | Direction (buy/sell initiated) | | `large_in / large_out` | 大单流入 / 流出 | 大單流入 / 流出 | Large order in/out | **Off-hours caveat**: outside regular trading hours, depth is a closing snapshot and trades are from the prior session — state this explicitly. **A-share call-auction note**: during 09:15–09:25 CST (pre-open), depth reflects indicative auction prices, not continuous quotes. Mention this when the user's query occurs in that window. **HK block trades**: trades with `type = block` or large-volume single prints may indicate off-exchange block deals — highlight these separately. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 请安装 longbridge-terminal,或使用 MCP 回退 | 請安裝 longbridge-terminal,或使用 MCP 回退 | Install longbridge-terminal or use MCP fallback | | stderr `not logged in` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | `brokers` on non-HK symbol | 经纪商队列仅支持港股 | 經紀商隊列僅支援港股 | Broker queue is HK-only | | Other stderr | 原样转述,不静默重试 | 原樣轉述,不靜默重試 | Relay verbatim, no silent retry | ## MCP fallback 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. ## Related skills | Skill | Why | |---|---| | `longbridge-depth` | Raw orderbook / tick data without microstructure analysis layer | | `longbridge-capital-flow` | Intraday capital-flow time series and order-size distribution | | `longbridge-anomaly` | Unusual price/volume movements and trade-statistics profile | | `longbridge-quote` | Real-time price, volume, and valuation indices | ## File layout ``` longbridge-market-microstructure/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-market-scanner

|

# longbridge-market-scanner Comprehensive market scanner combining real-time quotes, capital flow (large/medium/small order breakdown), and OHLCV candlestick data to compute technical indicators (MACD / RSI / Bollinger Bands) for one or more symbols in a single pass. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user asks about: - Multi-symbol comprehensive scan — *"帮我扫描这10只股票的技术面和资金面"* - Combined technical + capital flow view — *"TSLA 技术指标加资金流向"* - Real-time multi-metric snapshot — *"综合行情数据"*, *"batch quote with capital flow"* - MACD / RSI / Bollinger Band status for a stock — *"NVDA RSI 现在多少"* For a single quote only, prefer `longbridge-quote`. For capital flow only, prefer `longbridge-capital-flow`. For candlestick charting, prefer `longbridge-kline`. ## Workflow 1. Extract all symbols from the prompt; normalise each to `<CODE>.<MARKET>`. 2. Run `longbridge quote` for real-time price/volume snapshot. 3. Run `longbridge capital` for intraday capital flow (large/medium/small net flow). 4. Run `longbridge kline` (daily, last 60 candles) to compute technical indicators: - **MACD**: 12/26 EMA diff and signal line (9-day EMA of diff). - **RSI**: 14-day RSI. - **Bollinger Bands**: 20-day SMA ± 2 standard deviations. 5. Compute the technical indicators from the OHLCV data in-context. 6. Synthesise a per-symbol scan card: price status, capital flow summary, and technical signals. ## CLI ```bash # Real-time quote longbridge quote <SYMBOL> --format json # Intraday capital flow (large / medium / small order net flow) longbridge capital <SYMBOL> --format json # Daily candlestick data for technical indicator computation longbridge kline <SYMBOL> --period day --count 60 --format json ``` > Run `longbridge kline --help` and `longbridge capital --help` to verify current flags. ## Output For each symbol, emit a scan card: | Field | 简体 | 繁體 | English | |---|---|---|---| | Last price / change | 最新价 / 涨跌幅 | 最新價 / 漲跌幅 | Last / Change % | | Net capital flow (large orders) | 大单净流入 | 大單淨流入 | Large-order net inflow | | MACD signal | MACD 信号 | MACD 信號 | MACD signal | | RSI (14) | RSI(14) | RSI(14) | RSI (14) | | Bollinger Band position | 布林带位置 | 布林帶位置 | BB position | Note: Technical indicators are computed in-context from `kline` OHLCV data and are approximations — not sourced from a TA library. For precision, pair with a dedicated TA tool. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请先安装 longbridge-terminal | 請先安裝 longbridge-terminal | Install longbridge-terminal first | | `not logged in` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | `capital` returns empty (pre-market) | 提示盘中资金数据仅交易时间可用 | 提示盤中資金數據僅交易時間可用 | Capital flow available during trading hours only | | Other stderr | 原样展示,不重试 | 原樣展示,不重試 | Surface verbatim, do not retry | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills | User asks | Route to | |---|---| | Single real-time quote | `longbridge-quote` | | Capital flow only | `longbridge-capital-flow` | | Candlestick chart / price history | `longbridge-kline` | | Market anomalies / unusual moves | `longbridge-anomaly` | | Orderbook depth | `longbridge-depth` | ## File layout ``` longbridge-market-scanner/ └── SKILL.md ``` Prompt-only — no `scripts/`. Technical indicators are computed in-context from kline OHLCV data. Discover current CLI flags via `longbridge <subcommand> --help`.

longbridge-market-temp

|

# longbridge-market-temp Market-level state: open / close, calendar, sentiment temperature. Symbol-level questions belong in `longbridge-quote`. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## Subcommands > The `MARKET` argument is **positional** (not a `--market` flag). Run `longbridge <subcommand> --help` to confirm. | CLI command | Returns | |---|---| | `longbridge market-temp <MARKET> --format json` | Today's market temperature (0–100). Add `--history --start --end` for a time series. Default market = `HK`. | | `longbridge trading session --format json` | Trading sessions for all markets (open / close times). | | `longbridge trading days <MARKET> [--start --end] --format json` | Trading day calendar with half-days. Default market = `HK`. | ## Market mapping LLM maps colloquial names to the positional `<MARKET>`: | User says | `<MARKET>` | |---|---| | 美股 / US / Nasdaq / S&P / Dow | `US` | | 港股 / HK / Hang Seng / 恒生 / 恆生 | `HK` | | A 股 / 沪 / 深 / 上证 / 深证 / SH / SZ | `CN` (aliases: `SH`, `SZ`) | | 新加坡 / SG / Straits / 海峡 / 海峽 | `SG` | `trading session` does not take a market argument; it returns all markets in one call. ## When to use - *"今天美股开盘了吗"*, *"is HK open?"* — call `trading session`, then reason against current local time and the user's target market. - *"几点开盘"* → `trading session` - *"下个交易日"*, *"this week's trading days"* → `trading days <MARKET>` - *"圣诞节港股开市吗"* → `trading days HK --start <date> --end <date>` - *"市场情绪"*, *"温度多少"* → `market-temp <MARKET>` - *"今年港股市场情绪走势"* → `market-temp HK --history --start ... --end ...` ## Workflow 1. Pick the subcommand (table above). 2. Resolve the positional `<MARKET>` if needed. 3. For "is the market open?" — call `trading session`, then reason against the current local time (US = UTC-5/-4 DST, HK / CN / SG = UTC+8) and the user's target market. 4. Call the Longbridge CLI directly (preferred) or fall back to MCP. 5. Translate the `market-temp` value into wording: 0–30 *偏空*, 30–50 *中性偏空*, 50–70 *中性偏多*, 70–100 *偏多* (translate into the user's language). ## CLI ```bash longbridge market-temp HK --format json longbridge trading session --format json longbridge trading days US --start 2026-04-28 --end 2026-05-31 --format json longbridge market-temp HK --history --start 2026-01-01 --end 2026-04-28 --format json ``` ## Output - `market-temp` (snapshot): single object with the temperature value. With `--history`, an array of historical points. - `trading session`: array spanning all markets. - `trading days`: `{trading_days, half_trading_days}` arrays for the selected market. ## Error handling If `longbridge` is missing, fall back to MCP. Other stderr messages get relayed verbatim to the user. ## MCP fallback 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-only extensions are available; discover them from the MCP server's tool list at runtime. ## Related skills - Single-stock quote / status → `longbridge-quote` - Earnings calendar / IPO / macro events → use the equivalent MCP tool directly ## File layout ``` longbridge-market-temp/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-ml-strategy

|

# longbridge-ml-strategy Walk-forward machine-learning framework for stock direction prediction. Fetches historical OHLCV data, engineers technical features, trains a rolling classifier (Random Forest or Gradient Boosting), generates probabilistic buy/sell signals, and evaluates backtest performance. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## Dependencies Requires: `scikit-learn`, `pandas`, `numpy` (usually pre-installed). Optional: `xgboost` or `lightgbm` for gradient-boosting models. If unavailable, fall back to a simpler logistic-regression model. ## When to use - User asks for ML-based prediction, rolling model training, feature-importance analysis, or AI-driven entry/exit signals for a single stock. - Triggers: "用机器学习预测 TSLA 涨跌", "NVDA random forest strategy", "walk-forward backtest AAPL". ## Workflow 1. Fetch 504 daily candles (≈ 2 years): `longbridge kline <SYMBOL> --period day --count 504 --format json` 2. **Feature engineering** (compute on rolling windows): - MACD line and signal (EMA12 − EMA26, signal EMA9) - RSI-14 - Bollinger Band width: (upper − lower) / mid, window 20 - Volume change rate: (vol_t − vol_{t-5}) / vol_{t-5} - 5-day price momentum: (close_t / close_{t-5}) − 1 - Label: 1 if close_{t+5} > close_t × 1.01, 0 if < close_t × 0.99, else drop 3. **Walk-forward training**: - Training window: 252 days; retrain every 60 days - Model: `RandomForestClassifier(n_estimators=100)` or `GradientBoostingClassifier` - Predict probability for the current bar 4. **Signal generation**: - prob > 0.60 → 模型上涨概率偏高 / Model upside probability elevated - prob < 0.40 → 模型下跌概率偏高 / Model downside probability elevated - Otherwise → 模型无方向性预测 / No directional signal from model 5. **Backtest metrics** (on out-of-sample predictions): - Win rate (% correct directional calls) - Profit factor (gross profit / gross loss) - Annualised Sharpe ratio (assuming daily rebalance) - Max drawdown 6. **Feature importance**: rank top-5 features by mean decrease in impurity. Run `longbridge kline --help` to confirm flag names before calling. ## CLI ```bash longbridge kline --help longbridge kline <SYMBOL> --period day --count 504 --format json ``` ## Output | Metric | 简体 | 繁體 | English | |---|---|---|---| | Current signal | 当前信号 | 當前訊號 | Current signal | | Signal probability | 预测概率 | 預測概率 | Signal probability | | Win rate | 胜率 | 勝率 | Win rate | | Profit factor | 盈亏比 | 盈虧比 | Profit factor | | Sharpe ratio | 夏普比率 | 夏普比率 | Sharpe ratio | | Max drawdown | 最大回撤 | 最大回撤 | Max drawdown | | Top features | 重要特征 | 重要特徵 | Top features | Output: current signal box → backtest summary table → feature importance list → caveats (past performance, data snooping). Cite **Longbridge Securities** / **数据来源:长桥证券** / **數據來源:長橋證券**. > 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。 > The above is for reference only and does not constitute investment advice. Investment decisions should be made based on your own risk tolerance. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP 或提示安装 longbridge-terminal | 回退到 MCP 或提示安裝 longbridge-terminal | Fall back to MCP or install longbridge-terminal | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | `scikit-learn` not found | 提示 `pip install scikit-learn pandas numpy`,并改用逻辑回归降级 | 提示安裝,降級至邏輯回歸 | Prompt install; degrade to logistic regression | | Fewer than 252 candles | 数据不足,无法完成 walk-forward 训练 | 數據不足 | Insufficient data for walk-forward | | Other stderr | 直接显示原始错误 | 直接顯示原始錯誤 | Surface verbatim | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-kline` — OHLCV data source - `longbridge-volatility-strategy` — vol regime as an additional feature - `longbridge-multifactor` — cross-sectional factor signals complement ## File layout ``` longbridge-ml-strategy/ └── SKILL.md ```

longbridge-morning-brief

|

# longbridge-morning-brief Produces a structured daily morning briefing (晨会纪要) covering overnight market moves, watchlist highlights, today's key catalysts, and a concise trading agenda. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user wants a morning-meeting style market summary: - *"帮我写今天的晨报"* / *"幫我準備今天的晨會紀要"* / *"Give me a morning brief"* - *"早盘有什么重点"*, *"今日开盘前要关注什么"*, *"pre-market summary"* Also trigger if the user provides a watchlist of symbols and asks for a pre-market digest. ## Workflow 1. Identify the user's watchlist symbols (ask if not provided; accept up to 10). 2. Determine today's date and relevant markets (US, HK, CN, SG). 3. Fetch quotes, today's calendar events, and intraday capital flow. 4. Check for recent news on each watchlist symbol. 5. Synthesise into a morning brief (see Output section). ## CLI > If you're unsure of exact flag names or defaults, run `longbridge <subcommand> --help` first. ```bash # Current quotes for watchlist symbols (can pass multiple) longbridge quote <SYMBOL1> <SYMBOL2> ... --format json # Today's earnings / economic / dividend calendar (requires subcommand) longbridge finance-calendar report --format json # earnings reports longbridge finance-calendar macrodata --format json # macro releases longbridge finance-calendar dividend --format json # dividend events # Recent news per symbol longbridge news <SYMBOL> --format json # Intraday capital flow (same-day only) longbridge capital <SYMBOL> --format json ``` Run `longbridge finance-calendar --help` to see all available subcommands (report / dividend / split / ipo / macrodata / closed). ## Output Structure the morning brief in five concise sections (keep total length under 600 words): **1. Overnight recap** (2–3 bullets) - US market close: index levels, winners/losers, VIX - HK market close: HSI level, major moves - Other notable macro (currencies, commodities, yields) **2. Watchlist highlights** (table) | Symbol | Last Price | Change % | Key Event | |---|---|---|---| **3. Today's catalysts** (bulleted) - Earnings releases today (company, before/after market) - Economic data (CPI, FOMC, NFP, etc.) with consensus - Policy / regulatory events **4. Capital flow signals** (if data available) - Sectors or names with notable inflow/outflow **5. Trading agenda** (2–4 bullets) - Specific names or themes to watch - Suggested entry/exit levels or key levels to monitor (use analyst targets from consensus if available) Close with: *Data sourced from Longbridge Securities / 数据来源:长桥证券 / 數據來源:長橋證券* ## Error handling | Situation | Simplified Chinese | Traditional Chinese / English | |---|---|---| | `command not found: longbridge` | 回退到 MCP;否则提示安装 longbridge-terminal | 回退到 MCP;否則提示安裝 / Fall back to MCP; prompt to install | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login` | 請運行 `longbridge auth login` / Run `longbridge auth login` | | No symbols provided | 请告知您的自选股或关注标的 | 請告知您的自選股 / Please provide your watchlist symbols | | Other stderr | 原样展示错误,不重试 | 原樣展示,不重試 / Surface verbatim, no silent retry | ## Related skills | User asks | Route to | |---|---| | Watchlist contents | `longbridge-watchlist` | | Capital flow detail | `longbridge-capital-flow` | | Earnings calendar | `longbridge-calendar` | | Catalyst radar (automated) | `longbridge-catalyst-radar` | | News for a single stock | `longbridge-news` | ## File layout ``` longbridge-morning-brief/ └── SKILL.md ``` Prompt-only — no `scripts/`. Discover the latest CLI flags via `longbridge <subcommand> --help`.

longbridge-multifactor

|

# longbridge-multifactor Cross-sectional multi-factor quantitative stock selection. Scores a universe of stocks on value, momentum, quality, and low-volatility factors; composites the scores; ranks stocks; and outputs a TopN buy list and bottom-N short list with factor-level attribution. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - User asks for quantitative factor-based stock selection within an index or a specified list of symbols. - Triggers: "SPX 多因子选股", "恒生指数量化因子排名", "CSI 300 factor model TopN", "IC加权因子合成". ## Workflow 1. **Get universe**: fetch index constituents: `longbridge constituent <INDEX> --format json` Extract the `stocks` key. If the user provides a custom list, skip this step. 2. **Fetch valuation factors** for each symbol (batched, up to 20 stocks for manageable output): `longbridge calc-index <SYMBOL> --format json` Extract PE, PB, ROE. Value factors: `f_value = 0.5 × (1/PE) + 0.5 × (1/PB)` (normalised). 3. **Fetch price history** for momentum and low-vol: `longbridge kline <SYMBOL> --period day --count 60 --format json` - Momentum: (close_today / close_60d_ago) − 1 - Low-volatility: annualised std of last 60 daily returns × √252 (negate: lower HV → higher score) 4. **Standardise** each factor across the universe to Z-scores (subtract mean, divide by std). 5. **Composite score**: - Equal-weight: `score = 0.25 × Z_value + 0.25 × Z_momentum + 0.25 × Z_quality + 0.25 × Z_lowvol` - IC-weighted (if the user specifies): weight each factor by its historical IC (information coefficient); if IC data unavailable, default to equal-weight. 6. **Rank and output**: - Top 20%: buy / long signal - Bottom 20%: avoid / short signal - Display top-10 and bottom-10 stocks with individual factor Z-scores and composite score. Run `longbridge constituent --help`, `longbridge calc-index --help`, and `longbridge kline --help` to verify current flag names. ## CLI ```bash longbridge constituent --help longbridge calc-index --help longbridge kline --help longbridge constituent <INDEX> --format json longbridge calc-index <SYMBOL> --format json longbridge kline <SYMBOL> --period day --count 60 --format json ``` Supported index examples: `HSI.HK`, `SPX.US`, `IXIC.US`, `DJI.US`, `000300.SH`. ## Output | Column | 简体 | 繁體 | English | |---|---|---|---| | Composite score | 综合得分 | 綜合得分 | Composite score | | Value Z | 价值因子 Z 值 | 價值因子 Z 值 | Value Z-score | | Momentum Z | 动量因子 Z 值 | 動量因子 Z 值 | Momentum Z-score | | Quality Z | 质量因子 Z 值 | 質量因子 Z 值 | Quality Z-score | | Low-vol Z | 低波动因子 Z 值 | 低波動因子 Z 值 | Low-vol Z-score | | Signal | 信号 | 訊號 | Signal | Output: top-10 / bottom-10 ranked table → factor dispersion summary → composite methodology note. Add caveat that the universe is limited by API throughput. Cite **Longbridge Securities** / **数据来源:长桥证券** / **數據來源:長橋證券**. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP 或提示安装 longbridge-terminal | 回退到 MCP 或提示安裝 longbridge-terminal | Fall back to MCP or install longbridge-terminal | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | `calc-index` returns null PE/PB | 跳过该标的,标注"数据缺失" | 跳過該標的,標注"數據缺失" | Skip symbol; mark as "data missing" | | Universe > 50 stocks | 自动截取前50只成交额最大的标的 | 自動截取前50只 | Auto-limit to top-50 by turnover | | Other stderr | 直接显示原始错误 | 直接顯示原始錯誤 | Surface verbatim | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-constituent` — index member list - `longbridge-valuation` — single-stock PE/PB detail - `longbridge-performance-attribution` — evaluate ex-post performance of the factor portfolio - `longbridge-correlation` — factor collinearity check ## File layout ``` longbridge-multifactor/ └── SKILL.md ```

longbridge-news

|

# longbridge-news Prompt-only skill that aggregates news, filings, and community topics for a single stock — classifies them, distils a fact-only takeaway, and reports sentiment at coarse granularity. May call WebSearch as a clearly-labelled fallback. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"NVDA 最近新闻"*, *"recent news on NVDA"*, *"NVDA 最近新聞"* - *"茅台公告"*, *"700 港交所披露"*, *"NVDA 8-K"* - *"市场对 X 财报怎么看"*, *"X 财报后股价为什么跌"* — this is news + community - *"X 社区在聊什么"*, *"long port community on NVDA"* - *"X 全面综述"* (default omnibus) ## Depth selection | Prompt cue | Tools | |---|---| | 新闻 / news / "最近怎么了" | `news` only | | 搜索新闻 / search news / keyword news | `news search <keyword>` | | 公告 / 披露 / filing / 8-K / 中报 | `filings` only | | 市场怎么看 / market reaction / sentiment | `news` + `topic` | | 社区 / community / discussion | `topic` (+ `topic detail`, `topic replies` for hot topics) | | 搜索社区 / search community topics | `topic search <keyword>` | | 全面 / 综述 / overview (default) | `news` + `filings` + `topic` (concurrent) | ## CLI Run `longbridge <subcommand> --help` to verify exact flags. Default omnibus example (run concurrently): ```bash longbridge news NVDA.US --format json longbridge filing NVDA.US --format json longbridge topic NVDA.US --format json ``` Keyword search (no symbol required): ```bash longbridge news search "AI chips" --format json # search news by keyword longbridge topic search "NVDA earnings" --format json # search community topics by keyword ``` ## Workflow 1. Resolve symbol; if mapping fails, ask back (this is common with small-caps). 2. Pick depth (table above) and call CLI commands concurrently (see CLI section). If `longbridge` is not installed, fall back to MCP. 3. 4. **Classify the news array** into 6 buckets (mandatory — never dump raw titles): | Bucket | Cues | |---|---| | **catalyst** (业绩 / 基本面) | earnings, revenue, guidance, EPS, 财报, 营收, 利润 | | **regulatory** (监管 / 合规) | SEC, 证监会, fine, lawsuit, 调查, 处罚, 罚款 | | **strategic** (战略 / 业务) | acquisition, partnership, launch, 收购, 拆分, 新产品 | | **financial** (资本动作) | buyback, split, dividend, 增发, 回购, 股权激励 | | **opinion** (评级 / 目标价) | upgrade, downgrade, analyst, 评级, 目标价 | | **other** | unclassified | 5. Render the structured summary (template below). Skip empty buckets but **always include the key-takeaway summary** (≤ 100 chars, fact-only). ## Output template ``` {Symbol} ({code}) news digest — Source: Longbridge Securities [Past N days · M news + K filings] 🟢 Earnings / fundamentals (N) - [date] headline — one fact (number / ratio) 🟡 Strategic / business (N) - [date] ... 🔴 Regulatory / compliance (N) - [date] ... 📈 Analyst opinions (N) - [date] {rating} by {bank}; target {currency} Y (was Z) 📃 Filings - [date] 8-K / interim / earnings preview / ... 💬 Community discussion (when topic was queried) - N hot topics: {title} — {comment count} - Sentiment skew: positive / neutral / negative — coarse % [Key facts] (≤ 100 chars, neutral) - ... ⚠️ 以上数据仅供参考,不构成投资建议。/ 以上數據僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` (Translate into the user's language.) ## WebSearch fallback (optional) Use **only** when: - MCP `news` returns empty, **or** - the latest item is > 7 days old, **or** - the user asks about a breaking event the MCP dataset has not yet captured. When you do, prepend: *"Below is from a web search — not Longbridge data."* / *"以下为网络搜索结果,非长桥数据。"* / *"以下為網絡搜尋結果,非長橋數據。"* ## Output constraints - **Must** classify into the 6 buckets — never dump raw titles. - **Must** include the key-takeaway summary (≤ 100 chars, fact-only). - **Must** end with the not-investment-advice disclaimer. - 给有证据的方向性判断,例如 *"市场普遍将此解读为正面 / 负面"*;避免只贴 "利好 / 利空" 标签而不附事实。 - **Do not** quote individual community comments verbatim (cherry-pick risk); report sentiment as a coarse skew. - **Do not** invent news. If MCP is sparse, say so and offer WebSearch. ## Compliance: hype vocabulary If `topic` / `topic_replies` content contains a high density of hype words — *"涨停板"*, *"主升浪"*, *"必涨"*, *"满仓"*, *"all in"*, *"庄家"*, *"次新妖股"* — do not echo them. Downgrade to *"discussion contains a notable share of speculative posts"* and move on. ## Error handling | Situation | Reply | |---|---| | `command not found: longbridge` | Fall back to MCP; if MCP also unavailable, tell user to install longbridge-terminal. | | `news` returns empty | "{symbol} has no recent news in Longbridge data — switching to WebSearch (note: web data, not Longbridge)." | | `news` > 7 days stale | Same — note the staleness explicitly. | | Symbol mapping fails | Ask the user for the code or English ticker. | | stderr `not logged in` | Tell user to run `longbridge auth login`. | ## MCP fallback If `longbridge` CLI is not installed (`command not found`), use MCP tools instead: 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 - Earnings detail → `longbridge-fundamental` - Whether valuation has priced in the news → `longbridge-valuation` - Cross-stock impact → `longbridge-peer-comparison` ## File layout ``` longbridge-news/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-northbound-flow

|

# longbridge-northbound-flow Stock Connect cross-border capital flow analysis. Identifies northbound (foreign → A-share) and southbound (mainland → HK) net flows, sector biases, and AH-premium arbitrage signals. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"今天北向资金净买入多少"*, *"northbound net inflow today"*, *"今天北向資金淨買入多少"* - *"外资在加仓哪些板块"*, *"which sectors are foreigners buying"* - *"南向资金今日动向"*, *"southbound flow today"* - *"陆港通套利机会"*, *"AH premium arbitrage signal"* - *"北向连续净流入天数"*, *"consecutive northbound inflow days"* For single-stock capital flow (not cross-border context) route to `longbridge-capital-flow`. For AH premium detail route to `longbridge-ah-premium`. ## Data availability note Longbridge CLI may not expose a dedicated northbound-fund endpoint. Always run `longbridge capital --help` and `longbridge broker-holding --help` first to discover available flags. If a dedicated northbound command is absent: 1. Use `longbridge capital <SYMBOL> --flow --format json` for proxy signals (large-order / institutional net flow as a northbound proxy). 2. Use `longbridge ah-premium` commands for AH arbitrage context. 3. Inform the user that official daily northbound totals are published by Hong Kong Exchanges (hkex.com.hk) and the Shanghai/Shenzhen Stock Exchanges. ## Workflow 1. **Check available commands**: ```bash longbridge capital --help longbridge broker-holding --help ``` 2. **If a `northbound` or `stock-connect` subcommand exists**, call it directly: ```bash longbridge northbound --format json longbridge northbound --sector --format json ``` 3. **Otherwise, build a proxy analysis**: a. For key dual-listed A+H stocks (e.g. `601398.SH`/`939.HK`, `600519.SH`, `300750.SZ`), fetch capital flow: ```bash longbridge capital <SYMBOL> --flow --format json ``` b. Fetch AH premium for cross-market arbitrage signals: ```bash longbridge calc-index <SYMBOL> --format json longbridge ah-premium <SYMBOL> --format json ``` Run `longbridge ah-premium --help` to verify exact flags. c. Fetch today's quote for southbound-relevant HK stocks: ```bash longbridge quote <SYMBOL> --format json ``` 4. **Aggregate and interpret**: - Net inflow direction and magnitude per sector. - Consecutive net-buy / net-sell days. - Correlation with AH premium compression (northbound buying narrows premium). 5. **Output the flow summary** (see Output section). Cite Longbridge Securities and note if official HKEX data is needed for exact totals. ## CLI ```bash # Discover available flags first longbridge capital --help longbridge broker-holding --help # Capital flow proxy for key A-share stocks longbridge capital 601398.SH --flow --format json longbridge capital 600519.SH --flow --format json # AH premium (arbitrage reference) longbridge ah-premium 939.HK --format json # Southbound proxy: HK blue chips longbridge capital 700.HK --flow --format json longbridge quote 700.HK --format json ``` ## Output ``` Stock Connect Flow Summary — Source: Longbridge Securities Date: YYYY-MM-DD [Northbound (foreign → A-share)] - Proxy net flow (via large-order analysis): ¥ X bn - Top sectors with net inflow: IT, Consumer Staples, Healthcare - Key stocks being accumulated: 600519.SH (Maotai), 300750.SZ (CATL) - Consecutive net-buy days: N (streak signal) [Southbound (mainland → HK)] - Proxy net flow: HK$ X bn - Key HK stocks with strong mainland interest: 700.HK, 9988.HK [AH Premium signal] - 939.HK (ICBC) AH premium: +X% → narrowing → northbound buying signal - Average AH premium trend: compressing / expanding [Note] Official daily northbound quotas and exact totals: hkex.com.hk → Market Data → Stock Connect ⚠️ 数据仅供参考,不构成投资建议。/ 數據僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` ## Error handling | Situation | 简体 | 繁體 | English | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;否则告知安装 longbridge-terminal | 回退到 MCP;否則告知安裝 longbridge-terminal | Fall back to MCP; otherwise tell user to install longbridge-terminal. | | stderr `not logged in` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login`. | | No dedicated northbound command | 使用资金流代理分析,并提示用户参考港交所官网获取官方数据 | 使用資金流代理分析,並提示用戶參考港交所官網獲取官方數據 | Use capital-flow proxy; direct user to hkex.com.hk for official totals. | | Other stderr | 原文显示错误 | 原文顯示錯誤 | Surface verbatim. | ## MCP fallback 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. ## Related skills - AH premium detail → `longbridge-ah-premium` - Single-stock capital flow → `longbridge-capital-flow` - Sector rotation → `longbridge-sector-rotation` - HK broker holdings (CCASS) → `longbridge-flows` - Real-time quote → `longbridge-quote` ## File layout ``` longbridge-northbound-flow/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-onchain

|

# longbridge-onchain On-chain data analysis framework — MVRV, NVT, SOPR, whale behaviour, TVL, and DEX liquidity. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking for: - On-chain valuation — *"MVRV 是多少"*, *"BTC MVRV ratio"*, *"NVT 指标"* - Whale or address activity — *"鲸鱼地址动向"*, *"whale activity"*, *"active addresses"* - DeFi / TVL — *"以太坊 TVL"*, *"DeFi TVL"*, *"链上流动性"* - On-chain sentiment — *"SOPR"*, *"链上持仓盈亏"*, *"on-chain profit/loss"* > **Data scope**: Longbridge CLI provides **spot crypto price and price history** only. On-chain raw data (address activity, TVL, whale transfers) is not available via the Longbridge CLI — the user must supply external data (Glassnode, Dune Analytics, Nansen, etc.) or paste it directly. This skill interprets and synthesises that data. ## Workflow 1. Fetch crypto spot quote and recent price history from Longbridge. 2. Ask the user to provide on-chain data, or guide them to a public source: - Glassnode: MVRV, NVT, SOPR, active addresses - Dune Analytics: DEX volume, TVL by protocol - Nansen: whale wallet labels and flows - DefiLlama: cross-chain TVL 3. Interpret the metrics using standard thresholds: - MVRV > 3.0 → historically overheated; < 1.0 → historically undervalued - NVT > 90th percentile → overvalued relative to transaction throughput - SOPR > 1 → holders selling at profit (potential distribution) - SOPR < 1 → holders selling at loss (potential capitulation) 4. Synthesise a verdict: Undervalued / Fair Value / Overheated / Distribution Zone. 5. Cross-reference with price trend from Longbridge kline data. > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## CLI ```bash # Crypto spot quote longbridge quote BTCUSD.HAS --format json # Recent daily price trend (ETH example); run --help for period/count flags longbridge kline ETHUSD.HAS --format json # run --help for available flags ``` Supported crypto symbols use the `.HAS` suffix (e.g. `BTCUSD.HAS`, `ETHUSD.HAS`, `SOLUSD.HAS`). ## Output structure ``` ON-CHAIN ANALYSIS — <TOKEN> <Date> PRICE CONTEXT (Longbridge) Current: $xx,xxx 7d: +x.x% 30d: +x.x% 90d Range: $xx,xxx – $xx,xxx ON-CHAIN METRICS (from <source>) MVRV: x.xx → [Undervalued | Fair | Overheated] NVT: xxx → [Low | Normal | High] SOPR: x.xxx → [Accumulation | Neutral | Distribution] Active Addresses (7d avg): xxx,xxx DEFI / TVL (if provided) Total TVL: $xxB 7d change: +x.x% Top Protocol: <Name> $xxB VERDICT <2–3 sentence synthesis combining price trend and on-chain signals> Signal: [Bullish | Neutral | Bearish | Cautious] DATA SOURCES Price: Longbridge Securities On-chain: <Glassnode | Dune | User-supplied> ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | Crypto symbol not found | 请使用 .HAS 后缀格式,如 BTCUSD.HAS。 | 請使用 .HAS 後綴格式,如 BTCUSD.HAS。 | Use the .HAS suffix format, e.g. BTCUSD.HAS. | | No on-chain data provided | 链上原始数据请从 Glassnode 或 Dune 获取后提供给我。 | 鏈上原始數據請從 Glassnode 或 Dune 取得後提供給我。 | Please provide on-chain data from Glassnode or Dune Analytics. | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | | `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-quote` — crypto spot price and market data - `longbridge-kline` — price history and intraday chart - `longbridge-capital-flow` — on-platform capital flow signals - `longbridge-valuation` — traditional equity valuation metrics ## File layout ``` skills/longbridge-onchain/ └── SKILL.md ```

longbridge-operating

|

# longbridge-operating Period-by-period operating and financial KPI breakdown for listed companies — quarterly or annual, sourced from Longbridge Securities. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"700.HK 分季度财务"*, *"腾讯季度营收趋势"*, *"Tencent quarterly revenue"* - *"看一下 2388.HK 各季度利润"*, *"700.HK annual operating data"* - *"港股季报数据"*, *"HK stock quarterly financials"* - **Not suitable**: US-listed (TSLA.US, NVDA.US) or A-share stocks — the `operating` endpoint returns empty for those markets; redirect to `longbridge-fundamental` instead. ## Workflow 1. Resolve symbol to `<CODE>.<MARKET>`. 2. Confirm it is an HK-listed stock (`.HK`). If not, warn the user that operating data is currently HK-only and suggest `longbridge-fundamental` for non-HK symbols. 3. Determine report filter from context: all periods (default), annual (`af`), or specific quarters (`q1`, `q2`, `q3`, `q4`, comma-separated). 4. Call `longbridge operating` with `--format json`. Run `--help` first if unsure about flags. 5. Present results as a period table sorted newest-first; highlight YoY and QoQ changes where computable. ## CLI Run `longbridge operating --help` to verify exact flags before use. ```bash # All reporting periods (default) longbridge operating 700.HK --format json # Annual reports only longbridge operating 700.HK --report af --format json # Specific quarters longbridge operating 700.HK --report q1,q3 --format json # Check available flags longbridge operating --help ``` ## Output Render as a table sorted newest period first. Include at minimum: | Period | 简体 | 繁體 | English | |---|---|---|---| | `period` | 报告期 | 報告期 | Period | | `revenue` | 营收 | 營收 | Revenue | | `net_income` | 净利润 | 淨利潤 | Net income | | `eps` | 每股收益 | 每股盈利 | EPS | | `roe` | 净资产收益率 | 股本回報率 | ROE | | `gross_margin` | 毛利率 | 毛利率 | Gross margin | Where YoY / QoQ changes are computable from the returned data, add a `Δ%` column. Cite Longbridge Securities. **HK-only notice** (always show when user asks for a non-HK symbol): > 简体: `operating` 命令目前仅支持港股,{SYMBOL} 暂无数据,建议改用 `longbridge-fundamental`。 > 繁體: `operating` 命令目前僅支援港股,{SYMBOL} 暫無數據,建議改用 `longbridge-fundamental`。 > English: The `operating` command currently returns data for HK-listed stocks only. No data for {SYMBOL} — try `longbridge-fundamental` instead. ## Error handling | Situation | 简体 | 繁體 | English | |---|---|---|---| | `command not found: longbridge` | 退回 MCP;如未配置,提示安装 longbridge-terminal | 退回 MCP;如未設定,提示安裝 longbridge-terminal | Fall back to MCP; if unavailable, ask user to install longbridge-terminal | | Empty result (non-HK symbol) | 见 HK-only notice | 見 HK-only notice | See HK-only notice above | | `not logged in` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | Other stderr | 原文转达 | 原文轉達 | Relay verbatim | ## MCP fallback If `longbridge` CLI is not installed, use: 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. ## Related skills - Snapshot KPIs (revenue / EPS / margins) → `longbridge-fundamental` - Analyst consensus estimates → `longbridge-consensus` - Earnings calendar → `longbridge-calendar` ## File layout ``` longbridge-operating/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-options-advanced

|

# longbridge-options-advanced Prompt-only analysis skill. Covers advanced options and volatility strategies for experienced traders — calendar/diagonal spreads, dynamic delta hedging, vol arbitrage, and skew trading — grounded in live Longbridge data. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"我想做日历价差,近月和远月 IV 哪个贵?"* / *"Calendar spread — near vs far month IV?"* - *"TSLA 偏斜很陡,怎么交易 skew?"* / *"TSLA skew is steep, how to trade it?"* - *"如何做动态 Delta 对冲?"* / *"How do I dynamically delta-hedge?"* - *"什么情况下做 Long Vol vs Short Vol?"* / *"When to go long vol vs short vol?"* - *"SABR 模型是什么?"* / *"Explain the SABR model"* For basic strategies route to `longbridge-options-strategy`. For P&L and Greeks route to `longbridge-options-pnl`. ## CLI Run `longbridge <subcommand> --help` to verify exact flags. ```bash # Option chain across expiries — compare IV term structure longbridge option chain <SYMBOL> --format json longbridge option chain <SYMBOL> --date <NEAR_EXPIRY> --format json longbridge option chain <SYMBOL> --date <FAR_EXPIRY> --format json # Historical price for realized vol and HV regime longbridge kline <SYMBOL> --period day --count 120 --format json # Underlying spot longbridge quote <SYMBOL> --format json ``` ## Strategy reference ### Calendar spread (时间价差 / 日曆價差) - **Structure**: sell near-month option, buy same-strike far-month option (both calls or both puts). - **Profit from**: near-month IV rich vs far-month, or time decay differential. - **Risk**: large underlying move before near expiry; vega risk if far-month IV drops. - **Check**: compare ATM IV for near vs far expiry from chain; enter when near/far IV ratio > 1.1. ### Diagonal spread (对角价差 / 對角價差) - **Structure**: sell near-month OTM option, buy far-month different-strike option. - **vs Calendar**: directional bias added via strike selection. ### Dynamic Delta hedging (动态 Delta 对冲 / 動態 Delta 對沖) - Hold option position; hedge Delta with underlying shares or futures. - Re-hedge when Delta drifts beyond a threshold (e.g. ±0.05) or on a time schedule. - **Gamma scalping**: long gamma + delta-neutral → profit from re-hedging realised vol > IV paid. - **Short gamma**: short options + hedged → profit if realised vol < IV collected. ### Vol arbitrage — Long Vol / Short Vol - **Long Vol**: buy options (straddle/strangle) when IV cheap vs expected realised vol. - **Short Vol**: sell options (strangle/condor) when IV rich; manage gamma risk with hedges. - Signal: IV/HV ratio. IV/HV > 1.3 → rich (short vol candidate); < 0.8 → cheap (long vol candidate). ### Skew trade (偏斜交易 / 偏斜交易) - OTM put IV > OTM call IV = positive skew (norm for equities, fear-driven). - **Fade skew**: sell OTM puts, buy OTM calls (risk-reversal) when skew excessive. - **Follow skew**: buy OTM puts when tail risk underpriced. - Measure: compare 25-delta put IV vs 25-delta call IV from the chain. ### SABR model (conceptual) - Stochastic Alpha Beta Rho — captures vol smile dynamics analytically. - Parameters: α (vol level), β (CEV exponent), ρ (spot-vol correlation), ν (vol of vol). - Longbridge data supports manual calibration: extract IV smile from chain, fit SABR numerically. ## Workflow 1. Identify the strategy type from the user's question. 2. Fetch chain for relevant expiries + kline for HV calculation. 3. Compute the key signal (IV term structure ratio / IV-HV ratio / skew spread). 4. Explain structure, entry signal, risk, and exit criteria. 5. Show example legs with live strikes from the chain. 6. Output structured response (template below). ## Output template ``` {Symbol} advanced options analysis — Source: Longbridge Securities [Vol regime] - ATM near-month IV: X% | ATM far-month IV: X% | Term ratio: X - 60-day HV: X% | IV/HV: X → {rich / fair / cheap} - Put skew (25Δ put − 25Δ call): +X pp [Strategy: {Name}] Rationale: {1-2 sentences} Legs: Sell: {OCC} @ ${prem} (IV: X%) Buy: {OCC} @ ${prem} (IV: X%) Net debit/credit: ${X} Max profit: ${X} | Max loss: ${X} Key risk: {describe} Re-hedge trigger (if delta-hedged): Delta drift ±{threshold} ⚠️ 以上分析仅供参考,不构成投资建议。/ 以上分析僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 切换到 MCP;若不可用,请安装 longbridge-terminal | 切換至 MCP;若不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal | | stderr `not logged in` | 请执行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | Only one expiry available | 无法构建日历价差,仅有单一到期日 | 無法構建日曆價差,僅有單一到期日 | Cannot build calendar spread — only one expiry available | | Kline < 60 bars | HV 样本不足,波动率比较仅供参考 | HV 樣本不足,波動率比較僅供參考 | HV sample insufficient; vol comparison is indicative only | ## MCP fallback 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. ## Related skills - IV percentile and smile → `longbridge-options-volatility` - P&L and Greeks payoff → `longbridge-options-pnl` - Basic strategies → `longbridge-options-strategy` - Raw chain / quotes → `longbridge-derivatives` ## File layout ``` longbridge-options-advanced/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-options-pnl

|

# longbridge-options-pnl Prompt-only analysis skill. Fetches live option quotes, then computes and explains payoff diagrams, breakevens, max profit/loss, and Greeks sensitivities for single-leg and multi-leg option positions. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"AAPL 200 call 的盈亏平衡点在哪"* / *"AAPL 200 call 盈虧平衡在哪"* / *"What is the breakeven on AAPL 200 call?"* - *"我卖出一个 TSLA put,最大亏损多少"* / *"I sold a TSLA put, what is my max loss?"* - *"帮我算跨式组合的到期盈亏"* / *"Show me the straddle payoff at expiry"* - *"这个期权的 Theta 每天损耗多少"* / *"How much Theta decay per day?"* For vol surface and IV analysis route to `longbridge-options-volatility`. For strategy selection route to `longbridge-options-strategy`. ## CLI Run `longbridge <subcommand> --help` to verify exact flags. ```bash # Fetch option quote (IV, Greeks, premium) for a known OCC symbol longbridge option quote <OCC_SYMBOL> --format json # Discover OCC symbol from underlying + expiry longbridge option chain <SYMBOL> --format json longbridge option chain <SYMBOL> --date <YYYY-MM-DD> --format json # Underlying spot price for payoff x-axis range longbridge quote <SYMBOL> --format json ``` ## Workflow 1. **Identify legs** — extract each leg: side (buy/sell), type (call/put), strike, expiry, quantity, premium paid/received. 2. **Fetch live data** — call `longbridge option quote` for each OCC symbol; if not known, use `option chain` to find it. Fetch underlying spot with `longbridge quote`. 3. **Compute at-expiry payoff** for each leg: - Long call: `max(S − K, 0) − premium` - Short call: `premium − max(S − K, 0)` - Long put: `max(K − S, 0) − premium` - Short put: `premium − max(K − S, 0)` - Net payoff = sum across all legs. 4. **Find breakeven(s)** — stock price(s) where net payoff = 0. 5. **Find max profit and max loss** — scan payoff at key price points (strikes + beyond). 6. **Summarise Greeks** from `option quote` output; compute net Greeks for multi-leg. 7. **Output** payoff table + summary (template below). ## Output template ``` {Strategy name} P&L snapshot — Source: Longbridge Securities [Position] Leg 1: {Buy/Sell} {N} {SYMBOL} {YYMMDD} {C/P} K={strike} Premium={prem} ... [Payoff at expiry] S Net P&L {S-30%} {$X} {S-15%} {$X} {ATM} {$X} ← current spot {S+15%} {$X} {S+30%} {$X} [Key metrics] - Breakeven: ${X} [and ${Y} for two-sided strategies] - Max profit: ${X} {at S ≥/≤ $Y / unlimited} - Max loss: ${X} {at S ≤/≥ $Y / unlimited} [Net Greeks (current)] - Delta: {X} (position moves ~${X} per $1 in underlying) - Gamma: {X} - Theta: {X} / day (time decay per calendar day) - Vega: {X} / 1% IV change ⚠️ 以上分析仅供参考,不构成投资建议。/ 以上分析僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 切换到 MCP;若不可用,请安装 longbridge-terminal | 切換至 MCP;若不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal | | stderr `not logged in` | 请执行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | OCC symbol not found in chain | 请提供到期日和行权价以便查找合约 | 請提供到期日和行權價以便查找合約 | Please provide expiry and strike to locate the contract | | Greeks missing from quote | 从 Black-Scholes 近似计算,精度有限 | 從 Black-Scholes 近似計算,精度有限 | Approximated via Black-Scholes; limited accuracy | ## MCP fallback 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. ## Related skills - IV / vol analysis → `longbridge-options-volatility` - Strategy selection → `longbridge-options-strategy` - Advanced vol strategies → `longbridge-options-advanced` - Raw option chain / quotes → `longbridge-derivatives` ## File layout ``` longbridge-options-pnl/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-options-strategy

|

# longbridge-options-strategy Prompt-only analysis skill. Recommends and explains common options strategies based on the user's market view (bullish/bearish/neutral) and current IV environment (rich/cheap). > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"我看涨 AAPL,想用期权放大收益,有什么策略?"* / *"I'm bullish on AAPL, what option strategy?"* - *"TSLA 财报前波动率很高,我该怎么操作?"* / *"TSLA IV is high before earnings, what should I do?"* - *"我持有 700.HK,想买个保险"* / *"I hold 700.HK and want downside protection"* - *"跨式和宽跨式有什么区别?"* / *"Straddle vs strangle — which is better?"* For P&L and Greeks detail route to `longbridge-options-pnl`. For IV surface route to `longbridge-options-volatility`. ## CLI Run `longbridge <subcommand> --help` to verify exact flags. ```bash # Underlying spot and context longbridge quote <SYMBOL> --format json # Option chain — expiry dates longbridge option chain <SYMBOL> --format json # Strikes for a specific expiry longbridge option chain <SYMBOL> --date <YYYY-MM-DD> --format json # Call / put volume ratio for sentiment longbridge option volume <SYMBOL> --format json ``` ## Strategy matrix > 以下为不同市场环境下常见的期权策略介绍,仅供教育性参考,不构成操作建议。 | Market view | IV level | 常见策略参考 / Common strategy reference | Risk profile | |---|---|---|---| | Bullish | Any | Long call / bull call spread | Limited loss, capped or unlimited gain | | Bullish | Rich | Bull put spread (sell put spread) | Collect premium, limited risk | | Bearish | Any | Long put / bear put spread | Limited loss, capped or large gain | | Bearish | Rich | Bear call spread (sell call spread) | Collect premium, limited risk | | Neutral (range-bound) | Rich | Short strangle / short straddle | Collect premium, unlimited risk | | Neutral (range-bound) | Rich | Iron condor | Collect premium, defined risk both sides | | Neutral (vol expansion) | Cheap | Long straddle / long strangle | Pay premium, profit from large move | | Income on holding | Any | Covered call | Reduce cost basis, cap upside | | Downside protection | Any | Protective put | Insurance premium, preserve upside | ## Workflow 1. **Clarify** user's market view (direction + conviction) and time horizon. 2. **Fetch** underlying spot (`longbridge quote`), option chain expiries, near-term strikes, and call/put volume. 3. **Assess IV** from ATM IV in chain vs rough HV proxy (see `longbridge-options-volatility`). 4. **Select 1–2 strategies** from the matrix; explain structure, legs, and cost. 5. **Show example legs** using live strikes from the chain (ATM and nearby). 6. **Output** structured recommendation (template below). ## Output template ``` {Symbol} options strategy recommendation — Source: Longbridge Securities [Market context] - Spot: ${S} | Nearest expiry: {date} | ATM IV: ~X% - IV environment: {rich / fair / cheap} | P/C volume ratio: {X} [Recommended strategy: {Name}] Structure: Leg 1: {Buy/Sell} {N} {OCC} @ ${prem} Leg 2: ... Key metrics (estimated): Max profit: ${X} Max loss: ${X} Breakeven: ${X} Why this fits: {2-sentence rationale linking market view + IV} [Alternative: {Name}] {Brief description and trade-offs} ⚠️ 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。/ The above is for reference only and does not constitute investment advice. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 切换到 MCP;若不可用,请安装 longbridge-terminal | 切換至 MCP;若不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal | | stderr `not logged in` | 请执行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | No liquid options (HK stock) | 流动性不足,建议仅使用备兑或保护性看跌 | 流動性不足,建議僅使用備兌或保護性看跌 | Low liquidity — consider covered call or protective put only | | User view unclear | 请说明看涨、看跌还是中性 | 請說明看漲、看跌還是中性 | Please clarify: bullish, bearish, or neutral? | ## MCP fallback 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. ## Related skills - IV / vol analysis → `longbridge-options-volatility` - P&L and Greeks payoff → `longbridge-options-pnl` - Advanced strategies (calendar, diagonal, skew) → `longbridge-options-advanced` - Raw option chain / quotes → `longbridge-derivatives` ## File layout ``` longbridge-options-strategy/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-options-volatility

|

# longbridge-options-volatility Prompt-only analysis skill. Compares implied volatility (IV) against historical volatility (HV), computes IV percentile rank, and surfaces the volatility smile / skew for options strategy guidance. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"TSLA 期权 IV 现在贵不贵"* / *"TSLA 期權 IV 現在貴不貴"* / *"Is TSLA IV elevated?"* - *"NVDA 波动率微笑怎么样"* / *"NVDA vol smile"* - *"这个期权 IV 在历史什么分位"* / *"IV percentile for this contract"* - *"现在适合买期权还是卖期权"* / *"Should I be long or short vol?"* For option quotes or chain discovery route to `longbridge-derivatives`. For P&L and Greeks payoff route to `longbridge-options-pnl`. ## CLI Run `longbridge <subcommand> --help` to verify exact flags. Primary calls (may be run concurrently): ```bash # 1. Option chain — get IV across strikes for a specific expiry longbridge option chain <SYMBOL> --date <YYYY-MM-DD> --format json # 2. Option volume — call/put volume for sentiment context longbridge option volume <SYMBOL> --format json # 3. Daily kline — compute historical volatility (60-day window typical) longbridge kline <SYMBOL> --period day --count 60 --format json # If unsure of exact flags: longbridge option --help longbridge kline --help ``` ## Workflow 1. **Resolve symbol** to `<CODE>.<MARKET>` format (e.g. `TSLA.US`, `700.HK`). 2. **Fetch option chain** for the nearest liquid expiry to get IV by strike. 3. **Fetch daily kline** (60 bars) and compute HV: - Daily log returns: `r_i = ln(close_i / close_{i-1})` - HV (annualised): `σ_HV = std(r) × √252` 4. **Compute IV percentile** using the ATM IV from the chain. Compare against the 60-day kline range as a rough proxy if historical IV series is unavailable. 5. **Build smile / skew**: - Sort chain rows by strike; extract call IV and put IV at each strike. - Put skew = (OTM put IV − ATM IV); if put skew > 0 the market fears downside. 6. **Output** structured report (template below). Cite Longbridge Securities. ## Output template ``` {Symbol} volatility snapshot — Source: Longbridge Securities [IV vs HV] - ATM IV (nearest expiry): X% - 60-day HV: X% - IV/HV ratio: X → {rich / fair / cheap} [IV Percentile (60-day proxy)] - Estimated percentile: ~N-th (low <30 / mid 30–70 / high >70) [Vol Smile / Skew] - Put skew (OTM put IV − ATM IV): +X pp → {downside fear / balanced} - Call skew (OTM call IV − ATM IV): +X pp - Shape: {positive skew / flat / negative skew} [Strategy signal] - IV rich (>70th pct) → consider premium-selling strategies (covered call, short strangle) - IV cheap (<30th pct) → consider premium-buying strategies (long straddle, long call/put) - Skew elevated → put spreads may offer better risk/reward than naked puts ⚠️ 以上分析仅供参考,不构成投资建议。/ 以上分析僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 切换到 MCP;若 MCP 也不可用,请安装 longbridge-terminal | 切換至 MCP;若 MCP 也不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal | | stderr `not logged in` | 请执行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | Chain returns < 5 strikes | 流动性不足,无法可靠建构波动率微笑 | 流動性不足,無法可靠建構波動率微笑 | Insufficient liquidity to build vol smile reliably | | Kline < 20 bars | 价格历史不足,跳过 HV 计算 | 價格歷史不足,跳過 HV 計算 | Insufficient price history; skipping HV calculation | ## MCP fallback 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. ## Related skills - Option quotes / chain discovery → `longbridge-derivatives` - P&L diagram and Greeks → `longbridge-options-pnl` - Strategy selection → `longbridge-options-strategy` - Advanced vol strategies → `longbridge-options-advanced` - Underlying price → `longbridge-quote` ## File layout ``` longbridge-options-volatility/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-orders

|

# longbridge-orders Read-only orders / executions / cash flow. The `order` parent command also has buy / sell / cancel / replace sub-subcommands — **this skill does not place trades**; those belong to a future trading skill that is designed but intentionally not shipped in this release. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. > > **Privacy**: orders, fills, and cash-flow data are private account state. Only return details in direct conversation. ## Subcommands > `order` is a parent command with several sub-subcommands. Run `longbridge order --help` to see the full list and current flags. | CLI command | Returns | |---|---| | `longbridge order --format json` | Today's orders (default mode). | | `longbridge order --history --start --end [--symbol] --format json` | Historical orders, filtered. | | `longbridge order detail <ORDER_ID> --format json` | Full single-order detail (status history, fees). | | `longbridge order executions --format json` | Today's fills (default). | | `longbridge order executions --history --start --end [--symbol] --format json` | Historical fills. | | `longbridge cash-flow [--start --end] --format json` | Deposits / withdrawals / dividends / settlements. | ## Time-window inference LLM converts natural-language windows to `--start` / `--end` (ISO `YYYY-MM-DD`): | User says | Window | |---|---| | 今天 / today | no `--start --end` | | 上个月 / last month | first → last day of previous month | | 近 30 天 / past 30 days | `today-30` → `today` | | 4 月 5 日 / April 5 | `--start = --end = 2026-04-05` | Use today's date from the system context. ## When to use - *"今天我下了哪些单"* → `order` (default, no `--history`) - *"上个月所有成交"* → `order executions --history --start --end` - *"TSLA 历史订单"* → `order --history --symbol TSLA.US --start ... --end ...` - *"订单 20240101-123456789 详情"* → `order detail <ORDER_ID>` - *"近 30 天出入金"*, *"上次分红"* → `cash-flow --start --end` ## CLI ```bash longbridge order --format json longbridge order --history --start 2025-01-01 --end 2025-04-01 --symbol TSLA.US --format json longbridge order detail 20240101-123456789 --format json longbridge order executions --format json longbridge order executions --history --start 2025-01-01 --end 2025-04-01 --format json longbridge cash-flow --start 2025-04-01 --end 2025-04-30 --format json ``` ## Output - `order` / `order executions`: array of order / fill rows. - `order detail`: full single-order object (status history, fees). Empty result → "order not found". - `cash-flow`: array of cash-flow events. Status translation (LLM should map): | Raw | 简体 | 繁體 | English | |---|---|---|---| | `Filled` | 已成交 | 已成交 | Filled | | `PartialFilled` | 部分成交 | 部分成交 | Partially filled | | `Canceled` | 已撤单 | 已撤單 | Cancelled | | `New` | 待成交 | 待成交 | Working | | `Rejected` | 被拒 | 被拒 | Rejected | ## OAuth scope Same as `longbridge-positions`: needs trade scope. Lacking it → both CLI and MCP return `unauthorized`. Tell the user to `longbridge auth logout && longbridge auth login` and tick "Trade". ## Error handling If `longbridge` is missing, fall back to MCP. Long history ranges may take a while — surface progress to the user. Other stderr messages relay verbatim. ## MCP fallback 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-only extensions are available; discover them from the MCP server's tool list at runtime. ## Related skills - Holdings + assets → `longbridge-positions` - Account-level P&L analysis → `longbridge-portfolio` ## File layout ``` longbridge-orders/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-ownership

|

# longbridge-ownership Share structure and shareholder query for Longbridge-covered securities — total/circulating/restricted shares, top-10 shareholders, major institutional holders, and controlling shareholder/beneficial owner relationships. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger when the user asks about: - Share structure (total, circulating, restricted/locked-up) — *"腾讯总股本是多少"*, *"AAPL 流通股"* - Top-10 shareholders — *"苹果前十大股东"*, *"700.HK 大股东是谁"* - Controlling shareholder / actual controller — *"实控人是谁"*, *"谁控制这家公司"* - Institutional holder relationships — *"持有茅台的机构"*, *"AAPL 主要机构持股"* - Equity investment relationships — *"母公司/子公司持股"* For insider trade history (SEC Form 4), defer to `longbridge-flows`. For full executive / board profiles, defer to `longbridge-corporate`. For 13F institutional portfolios, defer to `longbridge-flows`. ## Workflow 1. Normalise the symbol to `<CODE>.<MARKET>`. 2. Run `longbridge static` to get total shares, circulating shares, and free float from static reference data. 3. Run `longbridge shareholder` for the top-10 shareholders list (circulating and total). 4. Run `longbridge invest-relation` for parent-subsidiary equity investment relationships. 5. Merge and present a structured shareholder profile; note any data gaps (pledge data, exact shareholder count) and direct the user to company filings. ## CLI ```bash # Share structure (total shares, circulating shares) longbridge static <SYMBOL> --format json # Top-10 shareholders longbridge shareholder <SYMBOL> --format json # Equity investment relationships (parent / subsidiary / associate) longbridge invest-relation <SYMBOL> --format json ``` > Run `longbridge shareholder --help` and `longbridge invest-relation --help` to verify flags before calling. ## Output Present as two sections: **1. Share structure** | Field | 简体 | 繁體 | English | |---|---|---|---| | Total shares | 总股本 | 總股本 | Total shares | | Circulating shares | 流通股 | 流通股 | Circulating shares | | Restricted shares | 限售股 | 限售股 | Restricted shares | **2. Top-10 shareholders** — name, shareholding quantity, shareholding %, change since last period. If pledge data or shareholder headcount is requested but unavailable, note: *"该数据暂不可用,建议查阅公司公告"* / *"Data unavailable; check company filings."* ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请先安装 longbridge-terminal | 請先安裝 longbridge-terminal | Install longbridge-terminal first | | `not logged in` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | No shareholder data | 提示该标的暂无股东数据 | 提示該標的暫無股東數據 | No shareholder data available | | Other stderr | 原样展示,不重试 | 原樣展示,不重試 | Surface verbatim, do not retry | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills | User asks | Route to | |---|---| | Executives / board / corporate profile | `longbridge-corporate` | | 13F institutional portfolios / insider trades | `longbridge-flows` | | Filings for pledge or headcount data | `longbridge-news` | | Share structure + basic listing info | `longbridge-basicinfo` | ## File layout ``` longbridge-ownership/ └── SKILL.md ``` Prompt-only — no `scripts/`. Discover current CLI flags via `longbridge <subcommand> --help`.

longbridge-pairs-trading

|

# longbridge-pairs-trading Statistical-arbitrage strategy for a pair of correlated securities. Tests for cointegration, estimates hedge ratio, computes spread Z-score, and outputs actionable long/short signals with half-life and position sizing guidance. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - User provides two ticker symbols and asks for pairs trading analysis, spread mean-reversion, cointegration test, or statistical arbitrage. - Triggers: "MSFT 和 GOOGL 配对交易", "HSBC vs StanChart 协整", "pairs trade AAPL MSFT", "价差均值回归". ## Workflow 1. Fetch 252 daily candles for each symbol: ``` longbridge kline <SYMBOL_A> --period day --count 252 --format json longbridge kline <SYMBOL_B> --period day --count 252 --format json ``` 2. Align on `time`, drop unmatched rows (different trading calendars). 3. **Cointegration test (Engle-Granger)**: - OLS regress `ln(close_A)` on `ln(close_B)` → hedge ratio β - Compute residuals (spread) = `ln(close_A) − β × ln(close_B)` - Run ADF test on residuals; if p-value < 0.05, declare cointegrated 4. **Spread statistics**: - Spread mean μ, std σ - Z-score = (spread_current − μ) / σ - Half-life λ = −ln(2) / OLS_slope of Δspread ~ spread_{t-1} (AR(1)) 5. **Signal**: - Z > 2.0: 价差处于历史高位区间(统计上偏离均值偏大)/ Spread at historical high (statistically elevated) - Z < −2.0: 价差处于历史低位区间(统计上偏离均值偏小)/ Spread at historical low (statistically depressed) - |Z| < 0.5: 价差回归均值区间 / Spread near historical mean 6. Position sizing: suggest equal-dollar or volatility-scaled sizing; note that execution must be simultaneous. Run `longbridge kline --help` to confirm current flag names before calling. ## CLI ```bash longbridge kline --help longbridge kline <SYMBOL_A> --period day --count 252 --format json longbridge kline <SYMBOL_B> --period day --count 252 --format json ``` ## Output | Metric | 简体 | 繁體 | English | |---|---|---|---| | Hedge ratio β | 对冲比率 | 對沖比率 | Hedge ratio | | Cointegration p-value | 协整 p 值 | 協整 p 值 | Cointegration p-value | | Spread Z-score | 价差 Z 分 | 價差 Z 分 | Spread Z-score | | Half-life | 半衰期(天) | 半衰期(天) | Half-life (days) | | Signal | 交易信号 | 交易訊號 | Trade signal | Output: cointegration verdict → spread statistics table → current signal → position guidance. Add a risk note if p-value > 0.05 (not cointegrated). Cite **Longbridge Securities** / **数据来源:长桥证券** / **數據來源:長橋證券**. > 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。 > The above is for reference only and does not constitute investment advice. Investment decisions should be made based on your own risk tolerance. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP 或提示安装 longbridge-terminal | 回退到 MCP 或提示安裝 longbridge-terminal | Fall back to MCP or install longbridge-terminal | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | ADF p-value > 0.05 | 两标的未通过协整检验,配对交易风险较高 | 兩標的未通過協整檢驗,配對交易風險較高 | Not cointegrated; pairs trade is high-risk | | Insufficient overlapping dates | 两标的历史数据重叠不足,无法建立配对 | 兩標的歷史數據重疊不足 | Insufficient overlapping history | | Other stderr | 直接显示原始错误 | 直接顯示原始錯誤 | Surface verbatim | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-kline` — raw OHLCV data - `longbridge-correlation` — correlation matrix and rolling correlation as a pre-screen - `longbridge-volatility-strategy` — vol context for spread width ## File layout ``` longbridge-pairs-trading/ └── SKILL.md ```

longbridge-peer-comparison

|

# longbridge-peer-comparison Prompt-only skill that takes 2–5 symbols, runs the same per-symbol orchestration concurrently, and renders one normalised matrix. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"茅台 五粮液 哪个便宜"*, *"AAPL vs GOOG vs MSFT"* - *"NVDA AMD 哪个增速快"*, *"科技七姐妹谁最强"* - *"茅台跟 700 谁估值低"* (cross-currency + cross-industry — render with explicit disclaimer) ## Symbol-count rules | Count | Behaviour | |---|---| | 0 | Ask: *"Which symbols would you like to compare?"* | | **1** | Reroute → `longbridge-valuation` (#14) or `longbridge-fundamental` (#15) | | 2–5 | Run normally | | ≥ 6 | Ask user to narrow to 3–5 ("matrix becomes unreadable beyond 5") | ## Cross-cohort caveats - **Cross-currency** (e.g. `NVDA.US` + `600519.SH`) → render the matrix; add an explicit disclaimer at the top of the table: *"cross-currency comparison shows relative levels only; no FX conversion is applied"*. - **Cross-industry** (e.g. tech + spirits) → render the matrix; add: *"cross-industry comparison has limited meaning — valuation thresholds are not comparable"*. - **Cross-market** (different accounting standards: IFRS / US GAAP / CN GAAP) → add: *"data uses different accounting standards; treat as a rough benchmark."* ## CLI Run `longbridge --help` to see all available subcommands, then `longbridge <subcommand> --help` before calling. Types of data needed per symbol (run concurrently for all symbols): - Real-time quote (last price, change) - Valuation indices (PE, PB, PS, dividend yield, market cap) - Financial KPIs from the most recent report (revenue, net income, ROE) — headline figures only, not full statements - Historical valuation data ```bash # Always check flags first, then call — example structure: longbridge <subcommand> NVDA.US --format json ``` ## Workflow 1. Resolve every symbol to `<CODE>.<MARKET>`. Apply the count rules above. 2. **Concurrently per symbol**, call CLI commands (see CLI section). If `longbridge` is not installed, fall back to MCP. 3. **Do not** pull the full IS/BS/CF — `financial-report` headline fields are enough for the KPIs. 4. Normalise (label currency on every figure; **do not** auto-convert FX). Render as a Markdown table — rows are dimensions, columns are symbols. 5. Add the **observations** paragraph at the bottom (data-only, no winners). ## Output template ``` {symbol₁ vs symbol₂ vs ...} comparison — Source: Longbridge Securities [If cross-currency / cross-industry / cross-market: disclaimer here] | Dimension | Symbol₁ | Symbol₂ | Symbol₃ | |---|---|---|---| | Last (CCY) | ... | ... | ... | | Today's change | ... | ... | ... | | Market cap | ... | ... | ... | | **Valuation** | | | | | PE (TTM) | ... | ... | ... | | PB | ... | ... | ... | | PS | ... | ... | ... | | Dividend yield | ... | ... | ... | | **Financials (latest period)** | | | | | Revenue YoY | ... | ... | ... | | Net income YoY | ... | ... | ... | | ROE | ... | ... | ... | [Observations] - Valuation: who is highest / lowest on PE / PB / PS - Growth: who leads on revenue / net income YoY - Dividend: highest yield - Scale: market-cap ratios ⚠️ 以上数据仅供参考,不构成投资建议。/ 以上數據僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` (Translate into the user's language; keep numerics + ticker symbols verbatim.) ## Output constraints - **Must** be a Markdown table, dimensions × symbols. - **Must** label currency on every numeric figure (CNY / USD / HKD / SGD); no auto-FX conversion. - **Must** end with not-investment-advice disclaimer. - Cross-currency / cross-industry / cross-market → **must** include the disclaimer at the top of the table. ## Performance note 2–5 symbols × 4 tools = 8–20 MCP calls. Latency may be visible. If the user gives 5 symbols, optionally tell them *"comparing 5 symbols, fetching in parallel..."* before delivering. ## Error handling | Situation | Reply | |---|---| | `command not found: longbridge` | Fall back to MCP; if MCP also unavailable, tell user to install longbridge-terminal. | | Some symbols' data missing | Render N/A in those rows; explain which symbol(s) failed | | 1 symbol only | Reroute to `longbridge-valuation` / `longbridge-fundamental` | | ≥ 6 symbols | Trim to top 5; tell user the rest are dropped | | stderr `not logged in` | Tell user to run `longbridge auth login`. | ## MCP fallback If `longbridge` CLI is not installed (`command not found`), use MCP tools instead (per symbol): 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 - Single-symbol valuation drill-down → `longbridge-valuation` - Single-symbol fundamentals drill-down → `longbridge-fundamental` - Recent news on a specific name → `longbridge-news` ## File layout ``` longbridge-peer-comparison/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-performance-attribution

|

# longbridge-performance-attribution Decomposes a portfolio's return into attributable components using Brinson-Hood-Beebower sector attribution and multi-factor regression. Answers: "did I add value through industry allocation or stock selection?" and "how much of my alpha is market beta vs true skill?". > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - User wants to understand the sources of their portfolio P&L: "我的超额收益来自哪里", "是选股好还是配置好", "performance attribution AAPL TSLA", "我的 alpha 来源". - Requires Longbridge login with Trade scope to read positions. ## Workflow 1. **Fetch portfolio positions**: `longbridge positions --format json` 2. **Fetch portfolio P&L**: `longbridge portfolio --format json` 3. **Fetch benchmark daily candles** (default: SPX.US for US, HSI.HK for HK, 000300.SH for CN): `longbridge kline <BENCHMARK> --period day --count 252 --format json` 4. **Fetch each position's daily candles** (up to 10 positions; skip if > 10, note limitation): `longbridge kline <SYMBOL> --period day --count 252 --format json` 5. **Brinson Attribution** (use current weights from positions; group by industry): - Allocation effect = (w_p,i − w_b,i) × (r_b,i − r_b) - Selection effect = w_b,i × (r_p,i − r_b,i) - Interaction = (w_p,i − w_b,i) × (r_p,i − r_b,i) - Total active return = sum of all three 6. **Factor decomposition** (OLS regression of portfolio excess return on factors): - Market: (r_benchmark − r_f) - Momentum: (60-day return rank) - Report α (intercept), β_market, with t-stats 7. **Timing (T-M model)**: regress portfolio excess return on (r_b − r_f) + (r_b − r_f)²; γ > 0 indicates positive timing ability. Run `longbridge positions --help` and `longbridge portfolio --help` to verify current flag names. ## CLI ```bash longbridge positions --help longbridge portfolio --help longbridge kline --help longbridge positions --format json longbridge portfolio --format json longbridge kline <BENCHMARK> --period day --count 252 --format json longbridge kline <SYMBOL> --period day --count 252 --format json ``` ## Output | Component | 简体 | 繁體 | English | |---|---|---|---| | Allocation effect | 配置效应 | 配置效應 | Allocation effect | | Selection effect | 选股效应 | 選股效應 | Selection effect | | Interaction effect | 交互效应 | 交互效應 | Interaction effect | | Market beta | 市场β | 市場β | Market β | | Alpha (Jensen) | 超额收益α | 超額收益α | Jensen α | | Timing ability γ | 择时系数 | 擇時係數 | Timing coefficient γ | Output: Brinson table by industry → factor decomposition → timing verdict → 3-sentence interpretive summary. Cite **Longbridge Securities** / **数据来源:长桥证券** / **數據來源:長橋證券**. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP 或提示安装 longbridge-terminal | 回退到 MCP 或提示安裝 longbridge-terminal | Fall back to MCP or install longbridge-terminal | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login`(需 Trade 权限) | 請執行 `longbridge auth login`(需 Trade 權限) | Run `longbridge auth login` with Trade scope | | Empty positions | 账户暂无持仓,无法归因 | 賬戶暫無持倉 | No positions found; nothing to attribute | | > 10 positions | 持仓超过10只,仅归因前10大持仓 | 持倉超過10只 | Attribution limited to top-10 positions | | Other stderr | 直接显示原始错误 | 直接顯示原始錯誤 | Surface verbatim | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-portfolio` — P&L curve and account-level summary - `longbridge-positions` — raw holdings - `longbridge-multifactor` — factor model for stock selection - `longbridge-correlation` — covariance matrix for factor decomposition ## File layout ``` longbridge-performance-attribution/ └── SKILL.md ```

longbridge-portfolio-diagnosis

|

# longbridge-portfolio-diagnosis Prompt-only analysis skill. Pulls live account data and recent price history to give a comprehensive portfolio health-check: concentration, sector mix, currency breakdown, factor tilt, cross-holding correlation, and benchmark deviation. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我诊断一下我的组合"* / *"組合診斷"* / *"diagnose my portfolio"* - *"我的持仓集中度高吗"* / *"持倉集中度高嗎"* / *"check concentration risk"* - *"行业分布怎么样"* / *"行業分布"* / *"sector distribution in my holdings"* - *"货币风险怎么样"* / *"貨幣敞口"* / *"currency exposure breakdown"* - *"因子暴露分析"* / *"factor exposure analysis"* - *"持仓之间相关性"* / *"correlation risk across holdings"* ## Workflow 1. Fetch account data with `longbridge portfolio` and `longbridge positions`. 2. For correlation analysis, fetch 60-day daily kline for each holding concurrently. 3. Compute diagnostics in the LLM (see Calculations section). 4. Present a structured diagnosis report. ## CLI Run `longbridge <subcommand> --help` to verify exact flags before calling. ```bash # Step 1: account summary + positions longbridge portfolio --format json longbridge positions --format json # Step 2: 60-day price history for each holding (run concurrently per symbol) longbridge kline <SYMBOL> --period day --count 60 --format json # Step 3: sector/valuation context per holding longbridge calc-index <SYMBOL> --format json ``` ## Calculations Compute the following in the LLM from fetched data: | Metric | Method | |---|---| | Top-5 concentration | Sum of top-5 positions by market value ÷ total portfolio value | | Sector distribution | Group positions by `industry` / `sector` field; compute % of total MV | | Currency exposure | Group by currency of listing; compute % of total MV | | Factor tilt | Large-cap (market cap > $10B) vs small-cap; PE < 15 / dividend yield > 3% = value tilt | | Pairwise correlation | Pearson correlation of 60-day daily returns; flag pairs with r > 0.8 as high correlation | | Benchmark deviation | If user provides a benchmark (e.g. SPX, HSI), compare sector weights | ## Output template ``` Portfolio Diagnosis — Source: Longbridge Securities Date: <today> [Concentration] - Top-5 holdings: <names> = <N>% of portfolio - Risk: {Low (<40%) / Medium (40-60%) / High (>60%)} [Sector Distribution] - <Sector>: <N>% (target suggestion if heavily concentrated) - ... [Currency Exposure] - USD: <N>% HKD: <N>% CNY: <N>% Other: <N>% [Factor Tilt] - Large-cap: <N>% Small-cap: <N>% - Value tilt: <N>% Growth tilt: <N>% [Correlation Risk] - High-correlation pairs (r > 0.8): <list> - Diversification note: ... [Summary & Suggestions] - Key risks: ... - Suggested actions: ... ⚠️ 仅供参考,不构成投资建议。/ 僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;若也不可用,请安装 longbridge-terminal | 回退到 MCP;若也不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, ask user to install longbridge-terminal. | | stderr `not logged in` | 请运行 `longbridge auth login` 登录 | 請運行 `longbridge auth login` 登入 | Run `longbridge auth login` to authenticate. | | Empty positions | 账户暂无持仓,无法诊断 | 賬戶暫無持倉,無法診斷 | No holdings found; cannot run diagnosis. | | kline data unavailable for a symbol | 跳过该标的相关性计算,标注数据缺失 | 略過該標的相關性計算,標注數據缺失 | Skip correlation for that symbol; note data gap. | ## 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` + `trade_read` scopes). ## Related skills - Rebalance to target weights → `longbridge-portfolio-rebalance` - Risk metrics (VaR, drawdown) → `longbridge-risk-analysis` - Asset allocation framework → `longbridge-asset-allocation` - Portfolio P&L overview → `longbridge-portfolio` ## File layout ``` longbridge-portfolio-diagnosis/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-portfolio-rebalance

|

# longbridge-portfolio-rebalance Prompt-only analysis skill. Compares current portfolio weights against user-provided target weights, computes drift, and produces a prioritised rebalance trade list with estimated transaction costs. Read-only — does not place orders. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我做一下组合再平衡"* / *"組合再平衡"* / *"rebalance my portfolio"* - *"我的仓位偏移了,怎么调整"* / *"倉位偏移了"* / *"my weights have drifted, what should I trade"* - *"目标权重 AAPL 30% TSLA 20% 现金 50%,帮我生成交易清单"* - *"哪些仓位需要减持,哪些需要加仓"* / *"rebalance trades list"* ## Workflow 1. Fetch current positions and total portfolio value. 2. Ask user for target weights if not provided (symbol → target % pairs). 3. Fetch current prices for all symbols. 4. Compute current weights and drift vs target. 5. Generate trade list: symbols to buy (underweight) and sell (overweight). 6. Estimate transaction cost (brokerage fee ~0.03–0.1% per trade; note tax impact for gains). 7. Present trade list sorted by drift magnitude (largest first). ## CLI Run `longbridge <subcommand> --help` to verify exact flags before calling. ```bash # Current holdings and portfolio value longbridge portfolio --format json longbridge positions --format json # Current prices for each symbol in portfolio or target list (run concurrently) longbridge quote <SYMBOL> --format json # Maximum tradeable quantity (optional, for feasibility check) longbridge max-qty <SYMBOL> --format json ``` ## Calculations | Quantity | Method | |---|---| | Current weight | Position MV ÷ Total portfolio MV | | Target MV | Total portfolio MV × target weight % | | Required trade | Target MV − Current MV (positive = buy, negative = sell) | | Trade quantity | Required trade amount ÷ current price (round to lot size) | | Drift threshold | Flag if |current weight − target weight| > 5 percentage points | | Est. cost | Trade amount × 0.05% (configurable; note this is approximate) | ## Output template ``` Portfolio Rebalance Plan — Source: Longbridge Securities Total Portfolio Value: <MV> <currency> Date: <today> [Current vs Target Weights] Symbol Current% Target% Drift Action Qty Est.Cost AAPL.US 35.2% 30.0% +5.2% SELL 12 $1,840 ~$0.9 TSLA.US 12.1% 20.0% -7.9% BUY 8 $2,100 ~$1.1 CASH 52.7% 50.0% +2.7% — — — [Trade Summary] - Total buys: $X,XXX (~$X.XX in fees) - Total sells: $X,XXX (~$X.XX in fees) - Net cash change: ±$XXX [Notes] - Positions within ±5% of target weight are within tolerance and need no action. - Sell orders on positions with unrealised gains may trigger tax events (US investors). - Review lot sizes for HK/A-share stocks before placing orders. ⚠️ 仅供参考,不构成投资建议,请自行决策下单。/ 僅供參考,不構成投資建議,請自行決策下單。/ For reference only. Not investment advice. Place orders at your own discretion. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;若也不可用,请安装 longbridge-terminal | 回退到 MCP;若也不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal. | | stderr `not logged in` | 请运行 `longbridge auth login` 登录 | 請運行 `longbridge auth login` 登入 | Run `longbridge auth login`. | | No target weights provided | 请告知目标配置,例如:AAPL 30%、TSLA 20%、现金 50% | 請告知目標配置,例如:AAPL 30%、TSLA 20%、現金 50% | Please provide target weights, e.g. AAPL 30%, TSLA 20%, cash 50%. | | Quote unavailable for a symbol | 跳过该标的,标注价格数据缺失 | 略過該標的,標注價格數據缺失 | Skip that symbol; note price data is unavailable. | ## 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` + `trade_read` scopes). ## Related skills - Portfolio health-check → `longbridge-portfolio-diagnosis` - Asset allocation frameworks → `longbridge-asset-allocation` - Risk metrics → `longbridge-risk-analysis` - Place orders → use Longbridge app/terminal directly ## File layout ``` longbridge-portfolio-rebalance/ └── SKILL.md # prompt-only, read-only — no order placement ```

longbridge-portfolio

|

# longbridge-portfolio Prompt-only skill for **account-level** analysis. Distinguished from `longbridge-positions` (snapshot lookup): this skill answers *"how am I doing"*, not *"what do I hold"*. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. > > **Privacy**: returns the user's private P&L. Only render detailed numbers in direct conversation; if you suspect screen-sharing or third-party observation, ask before showing exact figures. Never echo amounts into PR descriptions, tickets, or other places third parties can read. ## Login This skill requires a logged-in session with trade scope: ```bash longbridge auth login # check "trade" / 「交易」 permission in the browser auth screen ``` If using MCP fallback and a tool returns *unauthorized* / *not in authorized scope*, re-authorise: ```bash claude mcp logout longbridge # Re-trigger any MCP tool call; check "trade" / 「交易」 permission. ``` ## When to use - *"我账户表现如何"*, *"how is my account doing?"* - *"我本月浮盈"*, *"this month's P&L"* - *"我哪只股票贡献最多"*, *"top contributors"* - *"我货币暴露"*, *"currency exposure"* - *"我账户行业分布"*, *"industry mix"* ## "Me" disambiguation By default, treat *我* / *me* / *my account* as **all-account aggregate**. If the user explicitly says *"我的港股账户"* / *"my US sub-account"*, restrict to that sub-account. ## Time-window inference | Phrase | Window | |---|---| | 本月 / this month | first day of this month → today | | 本周 / this week | this Monday → today | | 近 30 天 / past 30 days | `today-30` → `today` | | 今年 / YTD | Jan 1 → today | | 全部 / since opening / no time | use `profit_analysis` defaults (typically since account opening) | LLM uses today's date from system context. ## Tool selection by intent | User intent | Tools | |---|---| | Full portfolio overview | `profit_analysis` + `stock_positions` + `account_balance` (combo) | | This month's P&L | `profit_analysis(start=2026-04-01, end=2026-04-28)` | | Biggest contributors | `profit_analysis_detail` + `stock_positions` | | Currency exposure | `account_balance` + `exchange_rate` | | Industry distribution | `stock_positions` + per-symbol `static_info` (industry field) | | Short-selling margin details | `portfolio short-margin` | ## CLI Run `longbridge <subcommand> --help` to verify exact flags. Example for *"我本月账户表现"* (run concurrently): ```bash longbridge profit-analysis --start 2026-05-01 --end 2026-05-06 --format json longbridge profit-analysis detail --start 2026-05-01 --end 2026-05-06 --format json longbridge assets --format json longbridge positions --format json longbridge exchange-rate --format json ``` For short-selling positions: ```bash longbridge portfolio short-margin --format json # per-position margin deposit breakdown ``` ## Workflow 1. Confirm trade-scope login (see Login section). 2. Decide the time window (table above) and the toolset (table above). 3. Run CLI commands concurrently (see CLI section). If `longbridge` is not installed, fall back to MCP. 4. **Convert FX** to USD-equivalent yourself (use `exchange_rate` from the same call day) — `profit_analysis` may return mixed currencies. 5. **Render the 4-section structure**. Cite Longbridge Securities. End with the not-investment-advice disclaimer. ## Output template ``` My account performance — Source: Longbridge Securities; period YYYY-MM-DD ~ YYYY-MM-DD [1. Overview] - Total NAV (USD-equivalent): $X - Cash: $X (Y% of NAV) - Holdings: $X (Y% of NAV) - Period P&L: +$X (+Y%) [2. Currency exposure] - USD: $X - HKD: HK$X (≈ $X USD) - CNY: ¥X (≈ $X USD) - SGD: S$X (if held) [3. Single-stock contribution (this period)] | Symbol | Name | P&L (USD-eq) | Share | |---|---|---:|---:| | NVDA.US | NVIDIA | +$5,200 | 42% | | 700.HK | 腾讯 | +$3,100 | 25% | | TSLA.US | Tesla | -$1,800 | -15% | | ... | ... | ... | ... | [4. Industry distribution] (stock_positions × static_info industry field, by market value) - 半导体 / Semiconductors: 35% - 互联网 / Internet: 20% - ... ⚠️ 以上数据仅供参考,不构成调仓建议。/ 以上數據僅供參考,不構成調倉建議。/ For reference only. Not rebalancing advice. ``` (Translate into the user's language.) ## Performance optimisation Industry distribution requires `static_info` per symbol (N positions = N calls). When a user holds **≥ 30 names**: - Tell the user *"computing industry distribution; this may take a moment..."*, OR - Simplify: take the **top 10 by market value**, group the rest as *"other"*. Same for the contribution ranking — list the top 10 (mix of leaders and laggards) by default; do not flood with the full position book. ## Output constraints - **Must** include all 4 sections. - **Must** label currency on every figure; mark USD-equivalent with `≈`. - **Must** end with the not-rebalancing-advice disclaimer. ## Error handling | Situation | Reply | |---|---| | `command not found: longbridge` | Fall back to MCP; if MCP also unavailable, tell user to install longbridge-terminal. | | stderr `not logged in` / `unauthorized` | Tell user to run `longbridge auth login` with trade permission. | | `profit-analysis` returns empty | "{window}: no recorded P&L (account had no positions or no trades)." | | `assets` returns one currency | Skip the multi-currency section; show that one currency. | | `positions` returns empty | Skip sections 3 + 4; show cash-only overview. | ## MCP fallback If `longbridge` CLI is not installed (`command not found`), use MCP tools instead: 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` (trade scope required). ## Related skills - Position lookup ("what do I own?") → `longbridge-positions` - Per-symbol drill-down → `longbridge-quote`, `longbridge-valuation`, `longbridge-fundamental` - *"Why is X down?"* → `longbridge-news` - *"Should I sell X?"* → combine with `longbridge-valuation` + `longbridge-fundamental` for a fuller picture. ## File layout ``` longbridge-portfolio/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-positions

|

# longbridge-positions Read-only account snapshot — what the user holds, how much cash, what they can buy/sell, and per-symbol margin ratios. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. > > **Privacy**: the data here is the user's private account state. Only return detailed numbers in direct conversation; if you suspect screen-sharing or third-party observation, confirm before showing exact figures. ## Subcommands > Run `longbridge <subcommand> --help` to confirm current flags / defaults if anything below seems off. | CLI command | Returns | |---|---| | `longbridge portfolio --format json` | Combined view: total assets, P/L, intraday P/L, holdings, and cash breakdown. Single call — useful for "account snapshot" questions. | | `longbridge positions --format json` | Stock holdings array. | | `longbridge fund-positions --format json` | Fund holdings array. | | `longbridge assets [--currency USD\|HKD\|CNY\|SGD] --format json` | Net assets, cash, buy power, margins; per-currency breakdown in `cash_infos`. | | `longbridge margin-ratio <SYMBOL> --format json` | Initial / maintenance / forced-liquidation factors for a symbol. | | `longbridge max-qty <SYMBOL> --side buy\|sell [--price <p>] [--order-type LO\|MO\|ELO\|ALO] --format json` | Estimated max purchasable / sellable quantity (cash vs margin). | ## When to use - *"我的持仓"*, *"我有什么股票"*, *"我的持倉"* → `positions` - *"账户余额"*, *"我有多少美金 / 港币"*, *"current USD balance"* → `assets --currency USD` - *"我的基金持仓"* → `fund-positions` - *"NVDA 我能买多少股"*, *"how many TSLA can I buy"* → `max-qty <SYMBOL> --side buy --price <current>` (limit) or `--order-type MO` (market) - *"茅台保证金率"* → `margin-ratio 600519.SH` - *"看一下我的账户全貌"*, *"account snapshot"* → `portfolio` (one call gives total assets + P/L + holdings + cash) - *"我的浮盈"* → `portfolio` already includes intraday P/L; otherwise `positions` + chain to `longbridge-quote` for live last price ## max-qty workflow 1. **Limit order (default LO)**: first call `longbridge quote <SYMBOL> --format json` for the current last price → pass it as `--price`. 2. **Market order**: skip price; pass `--order-type MO`. 3. The response includes `cash_max_qty` (cash only) and `margin_max_qty` (with financing). Always disclose both numbers and remind the user that financing carries interest cost + forced-liquidation risk. ## CLI ```bash longbridge portfolio --format json longbridge positions --format json longbridge fund-positions --format json longbridge assets --currency USD --format json longbridge margin-ratio TSLA.US --format json longbridge max-qty TSLA.US --side buy --price 250 --format json ``` ## Output - `portfolio`: combined object with total assets, P/L, intraday P/L, holdings list, cash breakdown. - `positions` / `fund-positions`: array of holding rows. - `assets`: per-currency `cash_infos` array plus net-assets / buy-power / margin fields. - `margin-ratio`: `{im_factor, mm_factor, fm_factor}`. - `max-qty`: `{cash_max_qty, margin_max_qty}`. ## OAuth scope Requires the trade scope on the OAuth token. If the token lacks it, both CLI and MCP fail with `unauthorized` / `not in authorized scope`. Tell the user to re-authorise: `longbridge auth logout && longbridge auth login` (and tick "Trade" in the browser). ## Error handling If `longbridge` is missing, fall back to MCP. If stderr contains `unauthorized` / `not in authorized scope`, the OAuth token lacks trade scope — guide the user through re-auth (see "OAuth scope" above). Other stderr messages relay verbatim. ## MCP fallback 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-only extensions are available; discover them from the MCP server's tool list at runtime. ## Related skills - Orders / executions / cash flow → `longbridge-orders` - Watchlist (read) → `longbridge-watchlist` - Account-level P&L analysis → `longbridge-portfolio` ## File layout ``` longbridge-positions/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-post-investment

|

# longbridge-post-investment Quarterly / monthly post-investment monitoring — track KPIs, flag deviations, and generate action recommendations. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking about: - Ongoing monitoring of a position — *"帮我跟踪一下 NVDA 的投后表现"*, *"post-investment monitoring for TSLA"* - Quarterly / monthly KPI review — *"定期复盘"*, *"持仓检视"*, *"quarterly review"* - Deviation from expectations — *"业绩是否达到预期"*, *"beat or miss vs guidance"* - Add / reduce / stop-loss decision — *"要不要加仓"*, *"should I cut the position"* For earnings analysis defer to `longbridge-earnings`. For portfolio-level analytics defer to `longbridge-portfolio`. ## Workflow 1. Extract symbol(s) from the prompt. 2. Fetch latest financial results: revenue, gross margin, net income, EPS, FCF. 3. Fetch analyst consensus for the same period (expected vs actual). 4. Fetch recent price performance (60 days). 5. Fetch recent news for qualitative context. 6. For each KPI: compare actual vs consensus; flag as Beat / In-Line / Miss with magnitude. 7. Assess price action relative to the fundamental outcome. 8. Generate monitoring report with action recommendation. > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## CLI ```bash # Latest income statement longbridge financial-report <SYMBOL> --kind IS --format json # Analyst consensus (expected vs actual) longbridge consensus <SYMBOL> --format json # Recent news and management commentary longbridge news <SYMBOL> --format json # Price performance (60-day) longbridge kline <SYMBOL> --period day --count 60 --format json ``` ## Output structure ``` # Post-Investment Monitor: <Company> (<SYMBOL>) Review date: <today> Period: <quarter/month> ## KPI Scorecard | KPI | Expected | Actual | Δ | Signal | |-----------------|------------|------------|--------|---------| | Revenue | | | | ✓ Beat | | Gross Margin | | | | ✗ Miss | | EPS | | | | ~ In-line | | FCF | | | | | ## Price Action Entry price: $xx.xx Current: $xx.xx Return: ±x.x% vs market: ±x.x% vs sector: ±x.x% ## Qualitative Check Management tone, guidance revision, key risks materialised / resolved. ## 指标变化摘要 / Key Metrics Update | 维度 | 预期 | 实际 | 偏差 | |---|---|---|---| | (根据实际分析填写) | | | | > 以上内容仅供参考,不构成投资建议。投资决策请结合自身风险承受能力独立判断。 > The above is for reference only and does not constitute investment advice. Investment decisions should be made based on your own risk tolerance. Rationale: ... Next review trigger: ... ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | No recent earnings data | 暂无最新财报数据,无法完成 KPI 对比。 | 暫無最新財報數據,無法完成 KPI 對比。 | No recent earnings data available — KPI comparison cannot be completed. | | Consensus data unavailable | 分析师预期数据不可用,仅展示实际数据。 | 分析師預期數據不可用,僅展示實際數據。 | Consensus data unavailable — showing actuals only. | | Symbol not found | 未找到该代码,请确认市场和格式。 | 找不到該代碼,請確認市場和格式。 | Symbol not found — verify the exchange and ticker. | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | | `not logged in` | 请运行 `longbridge auth login`。 | 請執行 `longbridge auth login`。 | Run `longbridge auth login`. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-earnings` — detailed post-earnings report - `longbridge-portfolio` — portfolio-level P&L and attribution - `longbridge-fundamental` — deep financial KPI analysis - `longbridge-thesis-tracker` — track investment thesis against milestones ## File layout ``` skills/longbridge-post-investment/ └── SKILL.md ```

longbridge-profit-analysis

|

# longbridge-profit-analysis Full account P&L analysis — simple return, time-weighted return (TWR), per-symbol attribution, and market-level breakdown — sourced from the user's Longbridge account. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"我账户今年赚了多少"*, *"我今年的收益率"*, *"account P&L this year"* - *"我的时间加权收益率"*, *"TWR"*, *"time-weighted return"* - *"TSLA 这只股票我亏了多少"*, *"holding P&L for NVDA"* - *"美股账户盈亏"*, *"profit by market"*, *"HK market P&L"* - *"帮我分析一下 Q1 业绩"*, *"Q1 performance analysis"* - **Prefer over `longbridge-portfolio`** when the user wants return-rate metrics (TWR eliminates cash-flow distortion) or detailed per-symbol attribution. ## Workflow 1. Confirm login; if not logged in, tell user to run `longbridge auth login` with Trade scope. 2. Identify the operation: overall P&L / per-symbol detail / by-market / custom date range. 3. Extract date range from context if specified; default to YTD if not stated. 4. Call CLI with `--format json`; run `--help` if unsure about flags. 5. Present: overall return %, absolute gain/loss, TWR (note: eliminates cash-flow timing distortion), top contributors, and breakdown table. ## CLI Run `longbridge profit-analysis --help` to verify exact flags before use. ```bash # Overall account P&L with TWR (default: YTD or account lifetime) longbridge profit-analysis --format json # Custom date range longbridge profit-analysis --start 2026-01-01 --end 2026-04-30 --format json # Per-symbol P&L detail longbridge profit-analysis detail TSLA.US --format json # P&L broken down by market longbridge profit-analysis by-market --market HK --format json # Check available flags and subcommands longbridge profit-analysis --help ``` ## Output ### Overall P&L | Field | 简体 | 繁體 | English | |---|---|---|---| | `simple_return` | 简单收益率 | 簡單收益率 | Simple return | | `twr` | 时间加权收益率 | 時間加權收益率 | Time-weighted return (TWR) | | `total_profit` | 总盈亏 | 總盈虧 | Total P&L | | `realized` | 已实现盈亏 | 已實現盈虧 | Realized P&L | | `unrealized` | 未实现盈亏 | 未實現盈虧 | Unrealized P&L | | `period` | 统计期间 | 統計期間 | Period | **TWR note**: Always explain TWR briefly — *"时间加权收益率消除了追加/取出资金对收益率的影响,是更客观的业绩衡量指标。"* / *"時間加權收益率消除了追加/取出資金對收益率的影響,是更客觀的業績衡量指標。"* / *"TWR removes the effect of cash flows (deposits/withdrawals), providing a purer performance measure."* ### Per-symbol detail Render: symbol, market, cost basis, current value, unrealized P&L, realized P&L, total return %. ### By-market Render: market (US / HK / CN / SG), total value, P&L, return %. End every response with: > ⚠️ 以上数据仅供参考,不构成投资建议。/ 以上數據僅供參考,不構成投資建議。/ For reference only. Not investment advice. ## Error handling | Situation | 简体 | 繁體 | English | |---|---|---|---| | `command not found: longbridge` | 退回 MCP;如未配置,提示安装 longbridge-terminal | 退回 MCP;如未設定,提示安裝 longbridge-terminal | Fall back to MCP; if unavailable, ask user to install longbridge-terminal | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login`(需要 Trade 权限) | 請執行 `longbridge auth login`(需要 Trade 權限) | Run `longbridge auth login` with Trade scope | | Empty result (no trade history) | 账户暂无交易记录,无法计算盈亏 | 賬戶暫無交易記錄,無法計算盈虧 | No trade history found — cannot compute P&L | | Invalid date range | 日期格式须为 YYYY-MM-DD,开始日期须早于结束日期 | 日期格式須為 YYYY-MM-DD,開始日期須早於結束日期 | Date must be YYYY-MM-DD; start must precede end | | Other stderr | 原文转达,不做静默重试 | 原文轉達,不作靜默重試 | Relay verbatim; never retry silently | ## MCP fallback If `longbridge` CLI is not installed, use: 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. ## Related skills - Portfolio overview (value, cash share, industry mix) → `longbridge-portfolio` - Account holdings snapshot → `longbridge-positions` - Order and fill history → `longbridge-orders` - Account statements for export → `longbridge-statement` ## File layout ``` longbridge-profit-analysis/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-quant-stats

|

# longbridge-quant-stats Apply rigorous statistical methods to financial time-series data retrieved from Longbridge — test assumptions before modelling, diagnose residuals, and produce statistically sound inferences. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我做 ADF 单位根检验"*, *"run an ADF test on this price series"*, *"幫我做 ADF 單位根檢驗"* - *"AAPL 和 MSFT 有没有协整关系"*, *"are AAPL and MSFT cointegrated"* - *"用 GARCH 建模波动率"*, *"model volatility with GARCH"* - *"回归残差有没有自相关"*, *"check residual autocorrelation (Durbin-Watson)"* - *"用 Bootstrap 估计置信区间"*, *"bootstrap confidence interval for Sharpe ratio"* For factor IC/IR testing, use `longbridge-factor-research`. For pairs-trading cointegration application, use `longbridge-pairs-trading`. ## Prerequisites ```bash pip install statsmodels scipy numpy pandas ``` ## Workflow and test catalogue ### Step 1 — Fetch price data ```bash longbridge kline --help longbridge kline <SYMBOL> --period day --count 252 --format json ``` Extract the `close` price series. Compute log returns: `r_t = ln(P_t / P_{t-1})`. ### Step 2 — Stationarity: ADF Unit Root Test **When to use**: Before regression or time-series modelling — most models require stationary series. **Python (statsmodels)**: ```python from statsmodels.tsa.stattools import adfuller result = adfuller(series, autolag='AIC') # result: (adf_stat, p_value, lags, n_obs, critical_values, icbest) ``` **Interpretation**: - p < 0.05 → reject unit root → series is stationary. - p ≥ 0.05 → fail to reject → series has unit root → difference the series. - Log prices: usually non-stationary. Log returns: usually stationary. ### Step 3 — Cointegration Test **When to use**: Two non-stationary series may share a long-run equilibrium (pairs trading). **Engle-Granger (two-series)**: ```python from statsmodels.tsa.stattools import coint t_stat, p_value, critical_values = coint(series_A, series_B) # p < 0.05 → cointegrated ``` **Johansen (multivariate)**: ```python from statsmodels.tsa.vector_ar.vecm import coint_johansen result = coint_johansen(df, det_order=0, k_ar_diff=1) # trace statistic vs critical values at 90%/95%/99% ``` Report: test statistic, p-value, critical values, and cointegrating vector. ### Step 4 — GARCH Volatility Modelling **When to use**: Financial returns show volatility clustering (ARCH effects). ```python from arch import arch_model model = arch_model(returns * 100, vol='Garch', p=1, q=1) res = model.fit(disp='off') print(res.summary()) ``` Note: `pip install arch` required in addition to statsmodels. **Output**: omega, alpha (ARCH), beta (GARCH) coefficients. Persistence = alpha + beta. If > 0.95, volatility is highly persistent. **ARCH-LM test first** (to verify ARCH effects exist): ```python from statsmodels.stats.diagnostic import het_arch lm_stat, p_value, f_stat, f_p = het_arch(residuals) ``` ### Step 5 — Regression Diagnostics After running OLS (`statsmodels.api.OLS`), check: | Test | Purpose | Command | |---|---|---| | Durbin-Watson | Serial autocorrelation in residuals | `statsmodels.stats.stattools.durbin_watson(resid)` | | Breusch-Pagan | Heteroskedasticity | `statsmodels.stats.diagnostic.het_breuschpagan(resid, exog)` | | Jarque-Bera | Normality of residuals | `statsmodels.stats.stattools.jarque_bera(resid)` | | VIF | Multicollinearity | `statsmodels.stats.outliers_influence.variance_inflation_factor` | Interpret Durbin-Watson: ~2.0 = no autocorrelation; < 1.5 = positive autocorrelation; > 2.5 = negative autocorrelation. ### Step 6 — Bootstrap Confidence Intervals **When to use**: Non-normal distributions; small samples; estimating CI for Sharpe ratio, IC, or any statistic. ```python import numpy as np def bootstrap_ci(data, stat_fn, n_boot=10000, ci=0.95): boots = [stat_fn(np.random.choice(data, len(data), replace=True)) for _ in range(n_boot)] lo = np.percentile(boots, (1 - ci) / 2 * 100) hi = np.percentile(boots, (1 + ci) / 2 * 100) return lo, hi # Example: Sharpe ratio CI sharpe_lo, sharpe_hi = bootstrap_ci(returns, lambda x: x.mean() / x.std() * np.sqrt(252)) ``` ### Step 7 — Hypothesis Tests | Test | Use case | Function | |---|---|---| | t-test (one sample) | Is mean IC > 0? | `scipy.stats.ttest_1samp(ic_series, 0)` | | t-test (two sample) | Is long portfolio return > short portfolio? | `scipy.stats.ttest_ind(long_ret, short_ret)` | | F-test / ANOVA | Are returns different across deciles? | `scipy.stats.f_oneway(*decile_returns)` | | Mann-Whitney U | Non-parametric alternative to t-test | `scipy.stats.mannwhitneyu(a, b)` | Always report: test statistic, p-value, degrees of freedom, and conclusion at 5% significance level. ## CLI ```bash longbridge kline --help longbridge kline <SYMBOL> --period day --count 252 --format json ``` ## Output For each test present: 1. Test name and null hypothesis. 2. Test statistic and p-value. 3. Critical values (where applicable). 4. Conclusion at 5% significance. 5. Practical implication for the user's use case. ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 请安装 longbridge-terminal 或检查 MCP 配置。 | 請安裝 longbridge-terminal 或檢查 MCP 配置。 | Install longbridge-terminal or check MCP config. | | `ModuleNotFoundError: statsmodels` | 请运行 `pip install statsmodels scipy numpy pandas`。 | 請執行 `pip install statsmodels scipy numpy pandas`。 | Run `pip install statsmodels scipy numpy pandas`. | | Insufficient data (< 30 observations) | 样本量过小,统计结论可靠性有限,建议延长数据期。 | 樣本量過小,建議延長數據期。 | Sample too small; extend the data period for reliable results. | | ARCH module missing for GARCH | 请运行 `pip install arch` 以使用 GARCH 模型。 | 請執行 `pip install arch` 以使用 GARCH 模型。 | Run `pip install arch` for GARCH modelling. | ## Related skills - `longbridge-factor-research` — IC/IR factor testing - `longbridge-pairs-trading` — cointegration-based pairs trading - `longbridge-correlation` — cross-asset correlation analysis - `longbridge-volatility-strategy` — volatility modelling and trading ## File layout ``` skills/longbridge-quant-stats/ └── SKILL.md ```

longbridge-quant

|

# longbridge-quant Server-side quantitative indicator runner: execute Pine Script v6 syntax subset on historical K-line data via Longbridge Securities servers. > ⚠️ **Beta feature**: `longbridge quant run` may return `internal server error` if the feature is not yet enabled for your account. Contact Longbridge support to enable quantitative script access if needed. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我算 TSLA 的 MACD"*, *"計算 RSI(14)"*, *"run MACD on NVDA"* → `longbridge quant run` with a built-in `ta.*` function - *"用 Pine Script 算布林带"*, *"自定义指标脚本"*, *"custom Pine Script indicator"* → pass a script string or pipe a `.pine` file - *"我想看近一年 EMA20"*, *"EMA 20 for the past year"* → set `--start` / `--end` accordingly For raw OHLCV data without indicator logic, defer to `longbridge-kline`. For visual chart output, defer to `longbridge-kline`. ## Workflow 1. Identify the symbol, date range, and indicator expression from the prompt. 2. Run `longbridge quant run --help` to check supported functions and flags before constructing the call. 3. Build the `--script` string using Pine Script v6 `ta.*` built-ins (e.g. `ta.macd`, `ta.rsi`, `ta.ema`, `ta.bb`). 4. For multi-indicator requests, wrap them in a list: `"[ta.macd(...), ta.rsi(...)]"`. 5. Return JSON output; summarise the last N rows in a date-sorted table. ## CLI > Run `longbridge quant run --help` before constructing calls — it is the canonical source for supported functions, operators, and flags. ```bash # Inspect supported functions and flags first longbridge quant run --help # Single built-in indicator — 20-day EMA longbridge quant run AAPL.US --start 2025-01-01 --end 2025-12-31 \ --script "ta.ema(close, 20)" --format json # RSI(14) for a date range longbridge quant run TSLA.US --start 2026-01-01 --end 2026-04-30 \ --script "ta.rsi(close, 14)" --format json # Multi-indicator: MACD + RSI combined longbridge quant run NVDA.US --start 2025-01-01 --end 2026-01-01 \ --script "[ta.macd(close,12,26,9), ta.rsi(close,14)]" --format json # Bollinger Bands longbridge quant run 700.HK --start 2025-06-01 --end 2025-12-31 \ --script "ta.bb(close, 20, 2)" --format json # Pipe a custom Pine Script file cat myindicator.pine | longbridge quant run AAPL.US \ --start 2025-01-01 --end 2025-12-31 --format json ``` **Note**: `longbridge quant run` uses a Pine Script v6 syntax subset. Not all Pine Script v6 functions are available — check `--help` for the full supported function and operator list. ## Output Present results as a date-sorted table with indicator columns. Example layout: | Date | EMA(20) | RSI(14) | |------|---------|---------| | 2025-12-31 | 248.32 | 61.4 | | 2025-12-30 | 247.89 | 59.8 | - Always show the date range queried and the symbol. - For multi-output indicators (e.g. MACD returns MACD line / signal / histogram), show all components as separate columns. - Cite **Longbridge Securities** as the data source. ## Error handling | Situation | 简体回复 / 繁体回复 / English reply | |-----------|--------------------------------------| | `command not found: longbridge` | 请安装 longbridge-terminal / 請安裝 longbridge-terminal / Install longbridge-terminal first; fall back to MCP if configured. | | `unsupported function` / `parse error` | 指定函数不在支持列表,请运行 `--help` 查看可用函数 / 指定函數不在支援清單,請執行 `--help` 查看可用函數 / Function not supported — run `longbridge quant run --help` for the full list. | | `not logged in` / `unauthorized` | 运行 `longbridge auth login` / 執行 `longbridge auth login` / Run `longbridge auth login`. | | Empty result | 指定日期范围内无数据 / 指定日期範圍內無數據 / No data for the requested date range. | | Other stderr | Surface verbatim — never silently retry. | ## MCP fallback When the CLI binary is missing, fall back via the equivalent MCP tool: 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. If the tool name does not resolve, ask the user to install the CLI. ## Related skills | Skill | Why | |-------|-----| | `longbridge-kline` | Raw OHLCV candlestick data without indicator computation. | | `longbridge-anomaly` | Pre-computed unusual price/volume alerts on the server. | | `longbridge-capital-flow` | Intraday money-flow signals complementing technical indicators. | ## File layout ``` longbridge-quant/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-quote

|

# longbridge-quote Real-time quote, static info, and valuation indices for Longbridge-supported securities (HK / US / A-share / Singapore). > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking about: - Current price / change / volume — *"NVDA 现在多少钱"*, *"現在股價"*, *"What's NVDA's price?"* - Industry / market cap / floats / EPS / BPS — *"贵州茅台市值多少"*, *"茅台屬於什麼行業"*, *"AAPL EPS"* - Valuation indices (PE, PB, turnover rate, 5/10-day change, etc.) — *"NVDA 的 PE"*, *"700 換手率"*, *"AAPL volume ratio"* - Trading status of a single security — *"AAPL still trading?"*, *"美股开盘了吗"* For 2–5 symbol comparison defer to `longbridge-peer-comparison`. For historical valuation percentile, defer to `longbridge-valuation`. ## Symbol format `<CODE>.<MARKET>`. Normalise before calling: | Pattern | Market | Example | |---|---|---| | Uppercase ticker (US) | `.US` | `NVDA.US`, `AAPL.US` | | 4-digit numeric | `.HK` | `700.HK`, `9988.HK` | | 6-digit, starts `60` | `.SH` | `600519.SH` | | 6-digit, starts `00`/`30` | `.SZ` | `300750.SZ` | | Singapore ticker | `.SG` | `D05.SG` | | Chinese / English company name | use knowledge | 腾讯 → `700.HK`, 特斯拉 → `TSLA.US`, 贵州茅台 → `600519.SH` | If the market is ambiguous, **ask the user** rather than guessing. ## Subcommands Run `longbridge --help` to see all available subcommands, then `longbridge <subcommand> --help` before calling. Types of data needed: - Real-time quote data (last price, open, high, low, prev close, volume, turnover, trade status) - Static reference data (name, industry, lot size, total/circulating shares, EPS, BPS, dividend yield, currency) - Valuation indices (PE, PB, turnover rate, total market cap, change rates, etc.) > **Always run `longbridge <subcommand> --help` first** — every Longbridge CLI subcommand self-documents its arguments, defaults, and examples. Do not hard-code flag names from this SKILL.md if the CLI version may have evolved. ## Workflow 1. Extract symbol(s) from the prompt; normalise each to `<CODE>.<MARKET>`. 2. Run `longbridge --help` to identify available subcommands, then `longbridge <subcommand> --help` to confirm flags. 3. Decide which subset of data is needed: - **Quote only** (price / change / volume) → real-time quote subcommand - **Static** (industry, market cap, EPS, BPS, dividend yield) → static reference subcommand - **Indices** (PE, PB, turnover rate, etc.) → valuation index subcommand (check `--help` for supported field names) - **Combined** ("full snapshot") → all three 3. Run them (parallel is fine when supported by the agent runtime). Each command returns a JSON array keyed by symbol. 4. Merge the per-symbol rows by `symbol` into a single object per security. 5. Translate to natural language; cite the source as **Longbridge Securities** / **数据来源:长桥证券** / **數據來源:長橋證券**. ## CLI examples ```bash # Always check available flags first: longbridge <subcommand> --help # Then call with --format json — example structure (verify subcommand names and flags with --help): longbridge <quote-subcommand> NVDA.US --format json longbridge <quote-subcommand> NVDA.US 700.HK 600519.SH --format json # multi-symbol longbridge <static-subcommand> 600519.SH --format json longbridge <calc-index-subcommand> NVDA.US --format json # valuation indices; use --help for index field names ``` Run `longbridge <calc-index-subcommand> --help` to see all supported index field names. A reference cheat-sheet (with multilingual labels) lives in [references/calc-index-fields.md](references/calc-index-fields.md). ## Output Each subcommand returns a JSON array, one object per requested symbol. Missing per-symbol values appear as `"-"` or `null` (not an error). When merging, key by `symbol` and emit a structure like: ```json { "symbol": "NVDA.US", "quote": { "last": "...", "prev_close": "...", "volume": "...", ... }, "static": { "industry": "...", "eps": "...", "bps": "...", ... }, "calc_index": { "pe_ttm": "...", "pb": "...", "total_market_value": "...", ... } } ``` ## Error handling | Situation | LLM response | |---|---| | Shell `command not found: longbridge` | Fall back to MCP if configured (see below); otherwise tell the user to install [longbridge-terminal](https://github.com/longportapp/longbridge-terminal). | | stderr contains `not logged in` / `unauthorized` | Tell the user to run `longbridge auth login`. | | stderr contains `param_error` or "invalid symbol" | Re-check the `<CODE>.<MARKET>` format with the user. | | Other stderr | Surface verbatim — never silently retry. | ## MCP fallback If the CLI binary is unavailable and the user has run `claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp`, fall back to: 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 is slower (HTTP + OAuth) but does not depend on a local binary. ## Related skills | User asks | Route to | |---|---| | Candlestick / intraday chart | `longbridge-kline` | | Orderbook depth / brokers / ticks | `longbridge-depth` | | Capital flow / large-order distribution | `longbridge-capital-flow` | | 2–5 symbol comparison | `longbridge-peer-comparison` | | Historical PE / PB percentile | `longbridge-valuation` | | Earnings / fundamentals | `longbridge-fundamental` | | Recent news / filings | `longbridge-news` | ## File layout ``` longbridge-quote/ ├── SKILL.md └── references/ └── calc-index-fields.md ``` Prompt-only — no `scripts/`. Discover the latest CLI flags via `longbridge <subcommand> --help`.

longbridge-regulatory-kb

|

# longbridge-regulatory-kb A structured regulatory knowledge base covering the rules, restrictions, and mechanisms investors face across A-shares, Hong Kong, US equity markets, and cryptocurrency — answers regulatory questions without needing live data lookups. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"A 股涨跌停规则是什么"*, *"what are A-share price limits"*, *"A 股漲跌停規則"* - *"T+1 是什么意思"*, *"what is T+1 settlement"* - *"港股可以 T+0 吗"*, *"can I sell HK stocks on the same day I buy"* - *"PDT 规则是什么"*, *"explain the PDT rule"* - *"美股熔断机制怎么触发"*, *"US circuit breaker trigger levels"* - *"A 股退市新规"*, *"new A-share delisting rules"* - *"港股碎股和暗盘怎么交易"*, *"odd-lot and grey market in HK"* For live trading session status, supplement with `longbridge market-temp`. For symbol-specific rules, use `longbridge static <SYMBOL> --format json`. ## A-Share Rules (A股规则) ### Price limits (涨跌停) | Board | Normal stocks | ST / *ST stocks | |---|---|---| | Shanghai / Shenzhen Main Board | ±10% | ±5% | | STAR Market (科创板) | ±20% (first 5 days: ±30%) | N/A | | ChiNext (创业板) | ±20% (first 5 days: ±30%) | N/A | | Beijing Stock Exchange | ±30% | ±30% | New listings: first day no limit; days 2–5 follow the limits above. ### Settlement (交收) - **T+1**: Sell a stock on the day after purchase. Funds from sales available next day. - **T+0**: Not permitted for equities (day trading is prohibited for ordinary investors). - ETFs and convertible bonds: T+0 selling is allowed. ### Short selling (融券做空) - Available only via margin accounts through approved brokers. - Securities in the approved short-list only (maintained by exchanges). - No naked short selling — must borrow first. - Transfer fee: typically 0.05–0.10% daily. ### Circuit breakers (熔断) - Triggered when CSI 300 falls ≥5% (15-min halt) or ≥7% (market close for the day). - Note: implemented 2016-01-04, suspended 2016-01-08 due to market disruption. ### Delisting rules (退市新规, 2024) - **Financial**: Net profit < 0 AND revenue < 100M RMB for 2 consecutive years → risk warning; 3 years → delisting. - **Market cap**: < 300M RMB for 20 consecutive trading days → delisting warning. - **Turnover**: < 2M RMB for 20 consecutive days → delisting warning. - ST / *ST designation: 1 year of losses → ST; 2 consecutive → *ST; further violations → delisting review. ### Stamp duty (印花税) - 0.1% on sell side only (halved from 0.1% on both sides effective Aug 2023). ## HK Stock Rules (港股规则) ### Price limits - **No daily price limits** on the Hong Kong Stock Exchange. - Extreme volatility may trigger Volatility Control Mechanism (VCM): 5-minute cooling-off if price moves ±10% in 5 minutes. ### Settlement (交收) - **T+2**: Standard settlement. Sell on day T; proceeds settled T+2. - **T+0 selling**: Allowed — you can sell shares purchased today if settled (e.g. shares transferred to your account already, which typically requires prior holding). ### Short selling (卖空) - **Designated short-selling stocks only** — SEHK publishes the list. - No naked short selling — must borrow. - Short positions must be marked as "short" at order entry. ### Odd-lot trading (碎股) - Board lot = standard trading unit (varies by stock: 100, 200, 500, 1000, 2000 shares, etc.). - Odd lots (less than one board lot) trade in the odd-lot market at wider spreads. - Retail investors often receive odd lots from rights issues or stock dividends. ### Grey market / dark pool (暗盘) - Pre-IPO grey market: unofficial OTC trading in IPO shares before listing, typically evening before listing day. - Provides price discovery but is not regulated by SEHK; settlement risk exists. ### Listing criteria / delisting (上市/退市) - **Profit test**: Aggregate profit ≥ HK$50M over 3 years (main board). Alternative: market cap test or revenue test. - **Delisting**: Prolonged trading suspension (typically > 18 months) triggers delisting review. ### Stamp duty (印花税) - 0.1% on both buyer and seller (total 0.2% per round trip), effective from 2021. ### Insider dealing (内幕交易条例) - Securities and Futures Ordinance (SFO) Cap. 571 governs insider dealing and market manipulation. - Directors must disclose dealings within 3 business days. ## US Stock Rules (美股规则) Key rules: PDT ($25k minimum, 4 day-trades in 5-day window), Reg T 50% initial margin, T+1 settlement (since May 2024), S&P 500 circuit breakers at -7%/-13%/-20%, Reg SHO short-locate requirement, LULD per-stock bands ±5%. For full detail see [`references/us-rules.md`](references/us-rules.md). For cryptocurrency regulation and cross-border tax basics see [`references/crypto-and-tax.md`](references/crypto-and-tax.md). ## CLI (supplementary) For live trading session status: ```bash longbridge market-temp --format json # session open/closed, market sentiment ``` For symbol-specific board lot or margin tier: ```bash longbridge static <SYMBOL> --format json # verify available fields with --help longbridge static --help ``` ## Output For each regulatory question: 1. Clear rule statement with the governing authority. 2. Numeric thresholds (%, days, amounts). 3. Consequences of violation / breach. 4. Practical tip for the user. 5. Caveat: rules evolve; link to official source when possible (CSRC / SFC / SEC / FINRA). ## Error handling | Situation | 简体回复 | 繁體回覆 | English reply | |---|---|---|---| | `command not found: longbridge` | 监管知识库无需 CLI。如需实时交易状态,请安装 longbridge-terminal。 | 監管知識庫無需 CLI。如需實時交易狀態,請安裝 longbridge-terminal。 | Regulatory KB needs no CLI. For live session status, install longbridge-terminal. | | Rule not covered | 该规则暂未收录,建议查阅 CSRC/SFC/SEC 官网。 | 該規則暫未收錄,建議查閱 CSRC/SFC/SEC 官網。 | Rule not yet covered; consult CSRC / SFC / SEC official website. | | User asks for specific account advice | 请咨询持牌财务顾问,本技能仅提供通用规则说明。 | 請諮詢持牌財務顧問,本技能僅提供通用規則說明。 | Consult a licensed financial adviser; this skill provides general rules only. | ## Related skills - `longbridge-market-temp` — live trading session and sentiment - `longbridge-flows` — short interest and insider trade data (US) - `longbridge-derivatives` — options margin and exercise rules - `longbridge-hedging` — hedging strategy design ## File layout ``` skills/longbridge-regulatory-kb/ └── SKILL.md ```

longbridge-risk-analysis

|

# longbridge-risk-analysis Prompt-only analysis skill. Fetches price history and account positions to compute portfolio risk metrics (VaR, CVaR, max drawdown, Sharpe, Calmar) and runs historical scenario stress tests. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我做风险分析"* / *"風險分析"* / *"run a risk analysis on my portfolio"* - *"计算 VaR"* / *"計算 VaR"* / *"calculate VaR"* - *"最大回撤是多少"* / *"最大回撤"* / *"what is the max drawdown"* - *"夏普比率分析"* / *"夏普比率"* / *"Sharpe ratio analysis"* - *"压力测试一下"* / *"壓力測試"* / *"run a stress test"* - *"如果2008年金融危机再来,我的组合会损失多少"* / *"historical scenario stress test"* ## Workflow 1. Fetch current positions (if logged in) or use user-specified symbols. 2. Fetch 252-day daily price history for each symbol concurrently. 3. Compute portfolio daily return series (weighted by current/equal weights). 4. Calculate risk metrics and run scenario analyses. 5. Present a structured risk report. ## CLI Run `longbridge <subcommand> --help` to verify exact flags before calling. ```bash # Current positions (if logged in) longbridge portfolio --format json longbridge positions --format json # 252-day daily price history per symbol (run concurrently) longbridge kline <SYMBOL> --period day --count 252 --format json ``` ## Calculations ### Core Risk Metrics | Metric | Method | |---|---| | Historical VaR (95%) | 5th percentile of 252-day daily portfolio return distribution | | Historical VaR (99%) | 1st percentile of same distribution | | Parametric VaR (95%) | μ − 1.645σ (assuming normal distribution; annualised → daily) | | CVaR / Expected Shortfall (95%) | Mean of returns below VaR(95%) threshold | | Max Drawdown | max peak-to-trough decline over the 252-day window | | Sharpe Ratio | (Annual return − 4% risk-free) ÷ Annual volatility | | Calmar Ratio | Annual return ÷ |Max Drawdown| | | Volatility (ann.) | Daily return std × √252 | ### Historical Scenario Stress Tests Approximate the impact of each scenario on the portfolio by applying historically-observed drawdowns as a proxy. State clearly that these are illustrative estimates based on past market events. | Scenario | Reference period | Typical equity drawdown | |---|---|---| | 2008 GFC | Sep 2008 – Mar 2009 | S&P 500 −57% | | 2020 COVID crash | Feb 2020 – Mar 2020 | S&P 500 −34% | | 2022 rate-hike cycle | Jan 2022 – Oct 2022 | S&P 500 −25%; Nasdaq −35% | | 2015 A-share crash | Jun 2015 – Aug 2015 | CSI 300 −45% | Apply sector beta adjustments where data allows; otherwise use index drawdown × portfolio beta (estimated from 60-day regression against benchmark). ## Output template ``` Portfolio Risk Analysis — Source: Longbridge Securities Analysis window: 252 trading days Date: <today> [Risk Metrics] - Daily VaR (95%, historical): <N>% (1-day loss not exceeded 95% of the time) - Daily VaR (99%, historical): <N>% - CVaR / Expected Shortfall (95%): <N>% - Max Drawdown (1yr): <N>% (peak: <date> → trough: <date>) - Annualised Volatility: <N>% - Sharpe Ratio (rf=4%): <N> - Calmar Ratio: <N> [Scenario Stress Tests] Scenario Estimated Portfolio Loss Notes 2008 GFC −<N>% (~$<X>) Based on −57% S&P draw; beta adj. 2020 COVID −<N>% (~$<X>) Based on −34% S&P draw 2022 Rate-hike −<N>% (~$<X>) Based on −25% S&P draw 2015 A-share crash −<N>% (~$<X>) Applies if holding A-shares [Risk Summary] - Tail risk level: {Low / Medium / High} - Largest risk contributor: <symbol> (<N>% of portfolio risk) - Key concern: <observation> ⚠️ 风险指标基于历史数据估算,不预测未来损失。/ 風險指標基於歷史數據估算,不預測未來損失。/ Risk metrics are historical estimates and do not predict future losses. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP;若也不可用,请安装 longbridge-terminal | 回退到 MCP;若也不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal. | | stderr `not logged in` | 未登录,请提供要分析的标的列表 | 未登入,請提供要分析的標的列表 | Not logged in — please provide symbol list to analyse. | | Price history < 60 days | 数据不足,降级为近60日风险估算,结果可信度较低 | 數據不足,降級為近60日風險估算 | Insufficient history; results may be less reliable. | | Single-asset portfolio | 无法计算分散化效益,仅显示单资产指标 | 無法計算分散化效益,僅顯示單資產指標 | Single asset — cannot compute diversification benefit. | ## 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; `trade_read` for account data). ## Related skills - Portfolio health-check → `longbridge-portfolio-diagnosis` - Asset allocation frameworks → `longbridge-asset-allocation` - Portfolio rebalancing → `longbridge-portfolio-rebalance` ## File layout ``` longbridge-risk-analysis/ └── SKILL.md # prompt-only, no scripts/ ```

longbridge-risk-return

|

# longbridge-risk-return Risk-return optimisation — evaluate portfolio efficiency versus the efficient frontier and recommend optimal asset allocation. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use Trigger on prompts asking for: - Portfolio optimisation — *"帮我优化投资组合"*, *"optimal portfolio"*, *"投资组合优化"* - Efficient frontier analysis — *"有效前沿"*, *"efficient frontier"*, *"组合效率"* - Risk preference-based allocation — *"稳健型配置"*, *"aggressive allocation"*, *"风险偏好配置"* - Risk-adjusted return improvement — *"提高夏普比率"*, *"risk-adjusted return"*, *"大类资产配置"* > Requires Longbridge login with Trade scope for account data. ## Workflow 1. Fetch current portfolio and positions. 2. Ask the user for: - Risk preference: Conservative (低风险) / Balanced (稳健) / Aggressive (进取) - Investment horizon: short (1–2y) / medium (3–5y) / long (5y+) - Any constraints: max single-stock weight, excluded asset classes 3. Fetch 1-year daily return history for each position. 4. Compute: - Current portfolio: expected return, volatility, Sharpe ratio, max drawdown - Correlation matrix of holdings - Efficient frontier points (using simplified mean-variance framework) - Recommended target allocation for the user's risk profile 5. Compute the **Efficiency Gap**: distance from current portfolio to the nearest efficient frontier point. 6. Output target weights and rebalancing actions. 7. Convert multi-currency positions using FX rates. > If unsure of exact flag names, run `longbridge <subcommand> --help` before proceeding. ## CLI ```bash # Account portfolio summary longbridge portfolio --format json # Current positions longbridge positions --format json # 1-year daily OHLCV per holding (run for each symbol) longbridge kline <SYMBOL> --period day --count 252 --format json # FX rates for currency normalisation longbridge exchange-rate --format json ``` ## Output structure ``` RISK-RETURN OPTIMISATION <Date> RISK PROFILE: [Conservative | Balanced | Aggressive] Horizon: x years CURRENT PORTFOLIO Expected Return: x.x% p.a. Volatility: x.x% p.a. Sharpe Ratio: x.xx Max Drawdown: -x.x% Efficiency Score: xx/100 (distance from efficient frontier) EFFICIENT FRONTIER TARGETS Conservative Balanced Aggressive Expected Return x.x% x.x% x.x% Volatility x.x% x.x% x.x% Sharpe x.xx x.xx x.xx RECOMMENDED ALLOCATION (for your profile) Equities: xx% (current: xx%) Bonds / Fixed: xx% (current: xx%) Cash: xx% (current: xx%) Commodities/Alt: xx% (current: xx%) CONCENTRATION RISK Top holdings by weight: 1. <SYMBOL> xx% → Recommend: reduce to xx% 2. ... REBALANCING ACTIONS • Buy: <SYMBOL> +$x,xxx • Sell: <SYMBOL> -$x,xxx • No action: <SYMBOL> ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |-----------|---------|---------|---------------| | Not logged in | 请运行 `longbridge auth login` 并授予 Trade 权限。 | 請執行 `longbridge auth login` 並授予 Trade 權限。 | Run `longbridge auth login` with Trade scope. | | Insufficient history for a holding | 部分持仓历史数据不足,已使用市场代理替代。 | 部分持倉歷史數據不足,已使用市場代理替代。 | Insufficient history for some holdings — market proxy used. | | Empty portfolio | 账户暂无持仓。 | 賬戶暫無持倉。 | No positions found in the account. | | `command not found: longbridge` | 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-portfolio` — account P&L and current allocation - `longbridge-positions` — holdings detail - `longbridge-financial-planning` — retirement and savings goals - `longbridge-strategy-optimizer` — strategy-level optimisation ## File layout ``` skills/longbridge-risk-return/ └── SKILL.md ```

longbridge-seasonality

|

# longbridge-seasonality Identifies calendar-driven return anomalies for a stock by analysing multi-year historical OHLCV data. Computes average returns grouped by month, day-of-week, and proximity to known events (holidays, earnings seasons) to surface statistically significant seasonal patterns. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - User asks "does AAPL tend to rise in January?", "周一买还是周五买", "节假日前后涨跌规律", "NVDA 财报季行情", "月份效应", "seasonality analysis". ## Workflow 1. Fetch 5 years of daily candles (≈ 1260 trading days): `longbridge kline <SYMBOL> --period day --count 1260 --format json` 2. Compute daily log-returns from `close` column. 3. Group by: - **Month effect**: average return per calendar month (Jan–Dec); flag months with |avg| > 1 std of all monthly averages. - **Day-of-week effect**: parse `time` field for weekday; average return Mon–Fri; flag extremes. - **Holiday drift**: identify the 3 trading days before/after major holidays (Christmas, Chinese New Year, Golden Week for HK/CN); compute average drift window. - **Earnings season**: roughly Q1 (Jan–Feb), Q2 (Apr–May), Q3 (Jul–Aug), Q4 (Oct–Nov) for US stocks; compute average return in those windows vs non-earnings months. 4. Summarise each effect as: (a) average return, (b) win rate (% positive days), (c) signal direction (Bullish/Bearish/Neutral). 5. Output a summary table + top-3 actionable patterns. Run `longbridge kline --help` to confirm flag names before calling. ## CLI ```bash longbridge kline --help # 5-year daily history longbridge kline <SYMBOL> --period day --count 1260 --format json ``` JSON rows: `{time, open, high, low, close, volume}`. Parse `time` for year/month/weekday grouping. ## Output | Effect | 简体 | 繁體 | English | |---|---|---|---| | Month effect | 月份效应 | 月份效應 | Month-of-year effect | | Day-of-week | 星期效应 | 星期效應 | Day-of-week effect | | Holiday drift | 节假日效应 | 節假日效應 | Holiday drift | | Earnings season | 财报季效应 | 財報季效應 | Earnings season effect | | Signal | 信号 | 訊號 | Signal | Output: one table per effect (Month / DOW / Holiday / Earnings), then a "Top Patterns" section with concrete entry/exit rules. Cite **Longbridge Securities** / **数据来源:长桥证券** / **數據來源:長橋證券**. ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 回退到 MCP 或提示安装 longbridge-terminal | 回退到 MCP 或提示安裝 longbridge-terminal | Fall back to MCP or install longbridge-terminal | | `not logged in` / `unauthorized` | 请运行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | Fewer than 250 candles returned | 数据不足以计算季节性,建议选择历史更长的标的 | 數據不足,建議選擇歷史更長的標的 | Insufficient data; choose a more liquid / longer-history symbol | | Other stderr | 直接显示原始错误 | 直接顯示原始錯誤 | Surface verbatim | ## MCP fallback When the CLI is unavailable, fall back to the MCP server. Discover available tools from the MCP server's tool list at runtime. ## Related skills - `longbridge-kline` — raw candle data - `longbridge-calendar` — forward earnings dates and holidays - `longbridge-volatility-strategy` — vol regime complement to seasonality ## File layout ``` longbridge-seasonality/ └── SKILL.md ```

longbridge-sec-filings

|

# longbridge-sec-filings Prompt-only analysis skill. Retrieves SEC filings via Longbridge and extracts investment-relevant signals: financial KPIs (10-K/10-Q), material events (8-K), governance/compensation (Proxy), and insider behaviour (Form 4). > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - *"帮我看下 AAPL 最新的 10-K"* / *"What are AAPL's key risks from the latest 10-K?"* - *"TSLA 昨天发了个 8-K,说了什么?"* / *"What did TSLA's 8-K say?"* - *"高管最近有没有申报卖股票 (Form 4)?"* / *"Any insider Form 4 sales recently?"* - *"10-Q 的 MD&A 里有什么异常?"* / *"Any unusual items in the MD&A?"* - *"Proxy 里高管薪酬怎么样?"* / *"What does the proxy say about exec compensation?"* For institutional 13F holdings route to `longbridge-flows`. For quarterly earnings analysis route to `longbridge-earnings`. ## CLI Run `longbridge <subcommand> --help` to verify exact flags. ```bash # List recent filings for a symbol longbridge filing <SYMBOL> --format json # Filter by filing type (if supported — verify with --help) longbridge filing <SYMBOL> --type 10-K --format json longbridge filing <SYMBOL> --type 10-Q --format json longbridge filing <SYMBOL> --type 8-K --format json # Financial data (structured KPIs from filings) longbridge financial-report <SYMBOL> --format json # News — supplement for 8-K summaries and insider trade coverage longbridge news <SYMBOL> --format json ``` ## Filing type guide | Filing | Frequency | Key content | Investment signal | |---|---|---|---| | 10-K | Annual | Full financials, Risk Factors, MD&A, auditor opinion | Baseline quality, hidden risks | | 10-Q | Quarterly | Interim financials, MD&A updates, legal proceedings | Trend vs prior quarters | | 8-K | Ad hoc | Material events: earnings, M&A, exec changes, defaults | Immediate catalyst | | Proxy (DEF 14A) | Annual | Exec compensation, board composition, shareholder proposals | Governance quality | | Form 4 | Within 2 days | Insider buy/sell transactions (officers/directors) | Insider sentiment signal | | SC 13G/13D | On crossing 5% | Large investor disclosures | Block-holder moves | ## Workflow 1. **Identify filing type** from the user's question; default to most recent filing if unspecified. 2. **Fetch filings list** with `longbridge filing <SYMBOL>`, select the relevant entry. 3. **Fetch financial KPIs** with `longbridge financial-report` for structured numbers. 4. **Supplement with news** (`longbridge news`) for 8-K summaries or insider trade narratives if filing detail is sparse. 5. **Extract key items** per filing type (see extraction guide below). 6. **Output** structured analysis (template below). Cite Longbridge Securities. ## Extraction guide by filing type ### 10-K / 10-Q - Revenue, net income, EPS vs prior period - Gross/operating margin trend - Free cash flow - Key risk factors (new risks added or escalated language) - MD&A: management commentary on performance drivers - Non-recurring items (impairments, restructuring, gains on asset sales) - Debt and liquidity (cash, revolver capacity) ### 8-K - Event type (Item number: 1.01=material agreement, 2.02=earnings, 5.02=exec change, etc.) - Material fact in 2–3 sentences - Bull/bear interpretation ### Proxy (DEF 14A) - CEO total comp vs prior year and vs peers - Performance metrics in comp plan (revenue, TSR, EPS targets) - Board independence and audit committee composition - Shareholder proposals (activist items) ### Form 4 - Filer: name and title - Transaction: buy vs sell, shares, price, date - Post-transaction ownership - Pattern: first purchase, cluster selling near highs, 10b5-1 plan flag ## Output template ``` {Symbol} {Filing type} analysis — Source: Longbridge Securities [Filing metadata] - Form: {type} | Filed: {date} | Period: {period} [Key findings] 1. {Finding — max 2 sentences} 2. {Finding} 3. {Finding} [Financial snapshot] (10-K / 10-Q) - Revenue: ${X} YoY: {+/-X%} - Net income: ${X} | EPS: ${X} - Free cash flow: ${X} - Non-recurring: {describe or "none identified"} [Risk factors / MD&A highlights] (10-K / 10-Q) - New or escalated risks: {list} - Management tone: {cautious / neutral / optimistic} [Investment signal] {Bullish / Bearish / Neutral} — {1-sentence rationale} ⚠️ 以上分析仅供参考,不构成投资建议。/ 以上分析僅供參考,不構成投資建議。/ For reference only. Not investment advice. ``` ## Error handling | Situation | 简体回复 | 繁體回復 | English reply | |---|---|---|---| | `command not found: longbridge` | 切换到 MCP;若不可用,请安装 longbridge-terminal | 切換至 MCP;若不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal | | stderr `not logged in` | 请执行 `longbridge auth login` | 請執行 `longbridge auth login` | Run `longbridge auth login` | | `filing` returns empty | 暂无 SEC 申报数据;尝试 `longbridge news` 补充 | 暫無 SEC 申報數據;嘗試 `longbridge news` 補充 | No filing data available; try `longbridge news` as supplement | | Non-US symbol requested | SEC 申报仅适用于美股;港股/A股请改用相应披露渠道 | SEC 申報僅適用於美股;港股/A股請改用相應披露渠道 | SEC filings are US-listed only; for HK/A-share use relevant disclosure channels | ## MCP fallback 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. ## Related skills - Quarterly earnings analysis → `longbridge-earnings` - Insider / institutional flows (13F) → `longbridge-flows` - Fundamental KPIs → `longbridge-fundamental` - Company news and sentiment → `longbridge-news` ## File layout ``` longbridge-sec-filings/ └── SKILL.md # prompt-only, no scripts/ ```