Commit Graph

21 Commits

Author SHA1 Message Date
袁章洪 da5181ecca docs: add longbridge-elliott-wave to README + install guide (PR #28)
- README: 120→124 skills; add elliott-wave⁶ to Technical analysis group
- install.md: add pandas/numpy entry to Python libraries table; update 'Install all' command

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-05-14 18:42:34 +08:00
Hogan b264a6fd1e feat: add 60 new skills (batch 2) — options, portfolio, quant, research, frameworks (#18)
## Summary

Adds 60 new skills bringing the total from 50 → 110. All skills pass
repo convention checks: trilingual triggers (Simplified / Traditional
Chinese / English), 3-column error handling tables, `--format json` CLI
examples, `--help` discovery pattern, ≤ 200 lines.

### New skills by category

**Options & derivatives (4)**
- `longbridge-options-volatility` — IV vs HV, vol smile/skew, IV
percentile
- `longbridge-options-pnl` — payoff diagrams, breakevens, Greeks
sensitivity
- `longbridge-options-strategy` — strategy selection matrix
(bullish/bearish/neutral × IV)
- `longbridge-options-advanced` — calendar/diagonal spreads, delta
hedging, vol arb, skew trading

**ETF & filings (2)**
- `longbridge-etf-analysis` — 5-dimension ETF analysis (TE, liquidity,
premium/discount)
- `longbridge-sec-filings` — SEC 10-K/10-Q/8-K/Form4/Proxy extraction
and analysis

**Portfolio & risk (7)**
- `longbridge-portfolio-diagnosis` — concentration, factor exposure,
correlation risk
- `longbridge-portfolio-rebalance` — drift analysis and rebalancing
recommendations
- `longbridge-asset-allocation` — MPT, Black-Litterman, risk parity
frameworks
- `longbridge-risk-analysis` — VaR, CVaR, max drawdown, Sharpe,
historical scenario stress tests
- `longbridge-tax-harvesting` — tax-loss harvesting with wash-sale
tracking
- `longbridge-financial-planning` — retirement/savings/education
planning
- `longbridge-risk-return` — risk-adjusted portfolio optimisation

**Value & screening (3)**
- `longbridge-value-screen` — PE/PB/ROE/dividend multi-factor value
screener
- `longbridge-dividend-screen` — high-dividend sustainability analysis
- `longbridge-smallcap-growth` — small-cap / 专精特新 growth stock discovery

**Research & events (8)**
- `longbridge-stock-research` — comprehensive equity research snapshot
- `longbridge-coverage-initiation` — 5-step first coverage report
framework
- `longbridge-industry-overview` — sector full-landscape report
- `longbridge-morning-brief` — daily morning briefing / 晨会纪要
- `longbridge-thesis-tracker` — investment thesis tracking and
validation
- `longbridge-investment-ideas` — systematic idea generation (quant +
thematic)
- `longbridge-event-strategy` — event-driven trading framework
- `longbridge-event-opportunity` — corporate event opportunity capture
(M&A/buyback/index)

**Quantitative strategies (7)**
- `longbridge-volatility-strategy` — HV percentile mean-reversion vol
strategy
- `longbridge-seasonality` — month/DOW/holiday/earnings-season calendar
effects
- `longbridge-pairs-trading` — cointegration test, hedge ratio, Z-score
signal
- `longbridge-ml-strategy` — sklearn walk-forward ML prediction
framework
- `longbridge-performance-attribution` — Brinson attribution, factor
alpha/beta
- `longbridge-correlation` — rolling correlation, cointegration,
half-life
- `longbridge-multifactor` — cross-sectional multi-factor scoring and
TopN portfolio

**Frameworks & methodology (8)**
- `longbridge-valuation-methodology` — DCF/DDM/SOTP/EV-EBITDA
methodology guide
- `longbridge-dcf` — step-by-step DCF model with Longbridge financial
data
- `longbridge-factor-research` — IC/IR factor effectiveness analysis
- `longbridge-hedging` — beta hedge, protective put, tail-risk hedging
- `longbridge-behavioral-finance` — 6 bias signals (overreaction,
herding, anchoring…)
- `longbridge-quant-stats` — ADF/GARCH/DW/Bootstrap statistical methods
- `longbridge-regulatory-kb` — A-share/HK/US/crypto regulatory knowledge
base
- `longbridge-execution-model` — slippage model, VWAP/TWAP, market
impact

**Market data & cross-market (9)**
- `longbridge-adr-premium` — ADR / H-share / A-share cross-market
premium analysis
- `longbridge-etf-flow` — US sector ETF fund flow and rotation signals
- `longbridge-fx-carry` — FX carry trade analysis
- `longbridge-index-quote` — dedicated index quote skill
(SPX/HSI/CSI300/NDX…)
- `longbridge-investment-proposal` — structured investment proposal
generation
- `longbridge-company-profile` — pitch-book company profile page
- `longbridge-supply-chain` — value-chain / supply-chain analysis
- `longbridge-competitive-analysis` — Porter five forces + peer
benchmarking
- `longbridge-company-tearsheet` — high-density one-pager snapshot

**Financial data queries (7)**
- `longbridge-basicinfo` — static reference data for all securities
- `longbridge-business-query` — operating revenue breakdown and segment
data
- `longbridge-finance-query` — multi-symbol financial metrics batch
query
- `longbridge-insresearch` — analyst rating distribution and consensus
target price
- `longbridge-ownership` — shareholder structure and major holder list
- `longbridge-market-scanner` — comprehensive quote + technical +
capital-flow scan
- `longbridge-sector-screener` — sector ranking by
momentum/flow/valuation

**Crypto/DeFi (2, partial)**
- `longbridge-defi-yield` — DeFi yield analysis (Longbridge `.HAS`
crypto + WebSearch)
- `longbridge-onchain` — on-chain data analysis (Longbridge `.HAS` +
external APIs)

---

## Test plan

- [x] All 60 SKILL.md files validated: slug=name, description ≤ 1024
chars, ≤ 200 lines, Response language directive, trilingual triggers,
3-column error table, CLI section
- [x] All 60 skills invoked via Claude Code skill system — 58/60 fully
operational
- [x] 2 known ⚠️: `defi-yield` and `onchain` return empty for
`BTCUSD.HAS` (account has no Crypto permission — documented in SKILL.md)
- [x] CLI bug fixed: `longbridge-morning-brief` — `finance-calendar`
requires subcommand (`report`/`macrodata`/`dividend`)
- [x] Known data quirks documented: `constituent` JSON key is `stocks`;
`operating` returns data for HK only; `instratings` field structure;
`option` requires subcommand

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-05-11 12:00:14 +08:00
Hogan 98466c9f98 feat: add 19 new skills (batch 1) — financials, technical analysis, sector & market (#17)
## Summary

Adds 19 new skills bringing the total from 31 → 50. All skills follow
repo conventions: trilingual triggers (Simplified / Traditional Chinese
/ English), 3-column error handling tables, `--format json` CLI
examples, `--help` discovery pattern, ≤ 200 lines.

### New skills

**Financials & earnings (5)**
- `longbridge-financial-report` — raw three-statement data (IS / BS /
CF), all periods
- `longbridge-financial-analysis` — 三表勾稽, DuPont decomposition,
accrual/earnings quality, fraud red flags
- `longbridge-financial-checkup` — five-dimension financial health score
(100-pt report card)
- `longbridge-consensus` — analyst consensus snapshot (revenue / EPS /
target price)
- `longbridge-earnings-revision` — estimate revision direction, SUE,
PEAD, guidance analysis

**Valuation & screening (2)**
- `longbridge-industry-valuation` — industry peer matrix + percentile
distribution
- `longbridge-factor-screen` — multi-factor fundamental screener (PE /
PB / ROE / growth / yield)

**Technical analysis (7)**
- `longbridge-candlestick` — 15 classic K-line patterns with
bullish/bearish composite score
- `longbridge-technical` — MACD / RSI / KDJ / Bollinger / EMA / ADX /
OBV voting signal engine
- `longbridge-ichimoku` — Ichimoku Cloud five-line system with six
signal checks
- `longbridge-chanlun` — 缠论 (Chan Theory) bi/zhongshu/buy-sell points
via czsc ¹
- `longbridge-elliott` — Elliott Wave zigzag + Fibonacci ratio
validation
- `longbridge-harmonic` — Gartley / Bat / Butterfly / Crab XABCD pattern
recognition
- `longbridge-smc` — Smart Money Concepts: BOS / ChoCH / FVG / Order
Block via smartmoneyconcepts ²

**Sector & market (3)**
- `longbridge-sector-rotation` — point-in-time sector momentum / capital
flow / valuation ranking
- `longbridge-sector-monitor` — 6–12 month economic cycle positioning
and sector allocation
- `longbridge-market-microstructure` — order book depth, order flow
toxicity, large-order direction

**Events & flows (2)**
- `longbridge-corporate-events` — M&A, buyback, placement, incentive,
ST/delist event classification
- `longbridge-northbound-flow` — Stock Connect cross-border capital flow
analysis

---

> ¹ `longbridge-chanlun` requires `pip install czsc` — documented in
SKILL.md and docs/install.md
> ² `longbridge-smc` requires `pip install smartmoneyconcepts` — falls
back to manual implementation if unavailable

## Test plan

- [x] All 19 SKILL.md files validated: name matches slug, description ≤
1024 chars, ≤ 200 lines, Response language directive, trilingual
triggers, 3-column error table, CLI section
- [x] Core CLI commands smoke-tested against live data:
`financial-report`, `consensus`, `industry-valuation`, `kline` + pandas
(MACD/RSI/Bollinger/candlestick/ichimoku/elliott/harmonic/SMC),
`capital`, `depth`, `news`, `corp-action`, `constituent`, `calc-index`
- [x] Known limitations documented: `operating` returns data for HK
only; `constituent --format json` key is `stocks`; czsc/smc require
separate pip install
- [x] README updated (30 → 50 skills, new skill groups table)
- [x] docs/install.md updated (new Optional Python libraries section)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-05-09 15:20:28 +08:00
袁章洪 c4e31990e5 docs: drop stale security-list param_error guidance + tighten path-selection rules
The longbridge CLI's security-list endpoint no longer hits the intermittent
param_error described in earlier docs. The behaviour now is an explicit
scope-limit message — "Only US market is supported for security-list
(Longbridge API only exposes the Overnight category)" — when invoked with
HK / CN / SG. That's a documented limitation, not a bug, so the special-case
"prefer MCP for security-list" treatment is no longer warranted.

CLAUDE.md §6 (Path selection):
- Drop "A specific subcommand has known issues (e.g. security-list
  param_error)" bullet.
- Drop the "Mark exceptions in the SKILL.md explicitly:" intro line — the
  remaining two exceptions (analysis tier + mutating watchlist-admin) read
  cleanly without the umbrella phrase.

docs/architecture.md:
- "Four exceptions" → "Three exceptions" — drop the security-list row.
- Decision flow: drop the "Skill declares MCP-preferred?" branch.
- Error-handling table: drop the param_error/security-list row (the
  generic invalid-symbol param_error guidance stays in per-skill error
  tables where it's still useful).
- Maintainer guidelines: drop "MCP-preferred → add Path-selection note"
  bullet (no skill needs that pattern anymore).
- Maintainer guideline §5 wording aligned with the recent prompt-only
  + scripts-allowed-when-justified convention.

docs/install.md:
- FAQ entry "param_error on security-list securities" → "Only US market
  is supported for security-list" with updated guidance (route the user
  to longbridge-quote for non-US per-symbol lookups).

skills/longbridge-security-list/SKILL.md:
- Description rewritten to reflect US-only scope (was ambiguously "per
  market"). Triggers updated to drop "港股一共多少", "list of HK stocks"
  etc. that no longer apply.
- Subcommand table: positional <MARKET> defaulting to HK is gone — the
  CLI takes no market arg and only returns US overnight names.
- Drop "Path-selection note" section. The MCP fallback table no longer
  marks one entry "prefer MCP".
- Error handling: replace param_error wording with the actual scope-limit
  message and tell the LLM how to redirect the user.

Triggered by validation against longbridge v0.7.0+: `longbridge
security-list HK --format json` now returns the explicit scope error
above; no param_error occurs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 18:33:52 +08:00
袁章洪 452e2d47ff docs(conventions): scripts/ and commands/ are now optional, not banned
Loosen the previously absolute "fully prompt-only / no Python wrappers"
stance to admit two opt-in subfolders with concrete justification.

CLAUDE.md:
- "What this repo is": from "All skills are prompt-only — no Python wrappers
  anywhere" to "Default style: prompt-only; scripts/ and commands/ allowed
  for clear runtime needs (DOCX, charts, slash commands)".
- Layout tree: list scripts/ and commands/ as optional siblings of references/.
- §5 renamed "No Python wrappers" → "CLI calls — prefer prompt-only, but
  scripts/ is allowed when justified". Spell out concrete justifications
  (DOCX/XLSX/PDF generation, chart helpers with bilingual fonts, runtime
  safety gates) and the narrow-helper guideline (one job, takes CLI args,
  no business templates baked in).
- New §5b documents commands/ as the Claude Code slash-command pattern.
- Quick checklist gains explicit steps for adding scripts/ and commands/
  when justified.
- Anti-patterns: replace blanket "no wrappers" with the targeted "do not
  re-wrap the longbridge CLI itself with hard-coded flags".

docs/architecture.md:
- "All 19 skills are now prompt-only" callout → "Default style: prompt-only;
  scripts/ and commands/ are opt-in for runtime needs."
- "17 skills with no Python wrapper" phrasing → "prompt-only skills (the
  default style — no scripts/cli.py between the LLM and longbridge)".
- Closing paragraph updated to reflect the optional-helper stance.

Triggered by PR #1 (longbridge-earnings) which legitimately needs DOCX +
matplotlib helpers; under the old phrasing those would have been blocking,
under the new phrasing they're acceptable as long as they stay narrow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 18:20:02 +08:00
袁章洪 9f3335cc28 fix(skills): align CLI commands with longbridge v0.7.0 actual subcommand shapes
之前 SKILL.md 引用的 longbridge CLI 命令多处对不上真实 v0.7.0:CLI 已经
重构,很多 hyphenated 顶层命令变成了 parent + sub-subcommand 结构。

逐个修复(基于 longbridge --help 真实输出):

skills/longbridge-derivatives/SKILL.md:
- option-quote / option-chain → option quote / option chain (sub-subcommand)
- warrant-quote / warrant-list / warrant-issuers →
  warrant quote / warrant <UNDERLYING> / warrant issuers
- 加 option volume(原本漏了)

skills/longbridge-kline/SKILL.md:
- kline-history → kline history(同 parent 下的 sub-subcommand)
- --adjust no_adjust / forward_adjust → none / forward(实际枚举值)

skills/longbridge-capital-flow/SKILL.md:
- capital-flow / capital-dist → capital(snapshot)/ capital --flow(time series)
  原来是两个独立命令,现在是同一命令 + flag

skills/longbridge-market-temp/SKILL.md:
- trading-session / trading-days → trading session / trading days
  (parent: trading)

skills/longbridge-orders/SKILL.md:
- orders → order(default lists today's)
- order <id> → order detail <id>
- executions → order executions
- 上一笔 commit 的 portfolio 反转(commit ac73270 误删了 portfolio,因为
  当时 CLI 还没这个命令)— 现已确认 portfolio 真实存在,在 longbridge-positions
  恢复并强调它是 single-call snapshot

skills/longbridge-positions/SKILL.md:
- balance → assets(命令改名了)
- 重新加上 portfolio 行(单次调用拿 total assets + P/L + holdings + cash)

skills/longbridge/references/{rust-sdk/content.md,cli/overview.md}:
- filings → filing(单数)
- topics → topic(单数)
- orders → order(单数)

全仓 longbridge auth login / logout 替换 longbridge login / logout
(老 CLI 顶层 login/logout 现在归到 auth parent 下):
- README / CLAUDE.md / docs/install.md / docs/architecture.md
- 各 SKILL.md 错误处理 / OAuth scope 段落
保留各 SKILL.md description 里 "Requires longbridge login" 这个英文 noun
phrase(意为"需要 Longbridge 登录态"),不是字面命令。

最后跨命令校验:62 个 skills/ 引用的 subcommands 全部出现在真实 CLI 命令清单
里(comm 输出的剩余项都是英文 prose 字符如 buy / first / https,经逐项 verify
确认是文档中正常英文,非 CLI 调用)。

教训:这就是为什么所有 SKILL.md 都强制写 "If unsure, run `longbridge
<subcommand> --help`" — CLI 升级时 SKILL.md 不会自动跟,但 LLM 跑 --help
能立刻发现差异。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 17:34:47 +08:00
袁章洪 ac73270648 fix(skills+docs): broken CLI commands + scope-aware npx install
实测发现 SKILL.md 和 docs 引用的 longbridge CLI 命令对不上真实 v0.7.0
preview1,以及 npx skills 默认 scope 跟用户预期不一致导致 remove 找不到。

#1 longbridge-positions/SKILL.md:
- `longbridge portfolio --format json` 不存在(real CLI 报 unrecognized
  subcommand)。改成"call positions + fund-positions + balance and merge"
- ## Subcommands / ## CLI / ## Output / ## MCP fallback / ## When to use 5
  处全部纠正

#3 longbridge-market-temp/SKILL.md + longbridge-security-list/SKILL.md:
- `longbridge market-temp --market HK` 错的,真实是 positional `longbridge
  market-temp HK`(`--help` 明示 [MARKET] 是位置参数,默认 HK,SH/SZ 别名
  → CN)
- 同样问题影响 `trading-days` 和 `security-list`(都是 positional)
- ## Subcommands 表头加 "MARKET is positional, not a --market flag" 显式
  警告
- ## Market mapping 表头改 `<MARKET>`(去掉 `--market`)
- ## CLI 示例全部改 positional
- security-list 同步:`securities --market HK` → `security-list HK`

#4 README.md + docs/install.md(npx scope):
- npx skills 默认装 project-level(<cwd>/.claude/skills/),不是
  ~/.claude/skills/。**用户在另一目录跑 remove 找不到 skill 是因为这个**
- README 「with npx」段所有 add 命令加 -g,补 callout 解释默认行为
- docs/install.md Path A 段加 "Pick scope intentionally" warning + 补
  global / project 两种命令对照
- docs/install.md Path A uninstall 段同步补 -g 用法 + ls -g + 全删 one-shot

跟 longbridge --help 真实输出对照后只剩 1 处未修(skills/longbridge/SKILL.md
第 29 行 verbatim 来自 developers/ 原作者文件,需用户拍板是否在我们仓里改),
其它 SKILL.md 已与 0.7.0-preview1 完全对齐。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 16:30:19 +08:00
袁章洪 4397b97ecc fix(install): correct npx skills remove syntax
实测 `npx skills remove longbridge/skills` 不工作 — 它返回:
  Found 1 unique installed skill(s)
  No matching skills found for: longbridge/skills

原因:`npx skills remove` 期望的是**已安装 skill 的 slug**(如 longbridge-quote),
不是 install 时用的 GitHub 仓路径(longbridge/skills)。

修订 docs/install.md:
- Path A 段:加 `npx skills list` 先看本机装了什么,再 `npx skills remove <slug>`
  逐个 / 批量删;给一行 list+grep+xargs 命令一次清全 19 个
- Path C 段:rm -rf 兜底章节加说明 — 不管原来是 npx/bun/marketplace/symlink 装的,
  rm 都 work,因为最终都在 ~/.claude/skills/ 下

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 16:17:24 +08:00
袁章洪 bf70bab90e chore: drop validate-skills.py + add CLAUDE.md (repo is now Python-free)
去掉最后一只 Python 工件,加 CLAUDE.md 给 Claude Code 在 repo 内开发时直接的项目规约。

删除:
- scripts/validate-skills.py(及空 scripts/ 目录)
  原因:已无 cli.py / test_cli.py 可跑,只剩 frontmatter slug/length 校验,这些
  在 install 时(npx skills add / claude /plugin marketplace)会被工具链拒绝;
  本地 sanity check 不必为这点价值留 ~127 行 Python。彻底"零 Python"叙事
  也跟 prompt-only 模式更一致。

新增:
- CLAUDE.md(152 行)— 维护者新增 / 改 skill 时的项目规约速查:
    * 仓库布局
    * Slug + frontmatter 必填项
    * 三语 trigger 强制(简繁分歧字必须分开写)
    * Response language 指令模板
    * No Python wrapper 原则 + "用 longbridge --help 验证 flag"
    * CLI vs MCP 路径选择
    * Error handling 表格规约
    * references/ 渐进披露
    * 加新 skill 9 步 checklist
    * 反模式列表

修订:
- README.md "For developers":移除 validate-skills.py 行,加 CLAUDE.md 链接
- docs/install.md:Verify 段去掉 "Repo self-test" 章节(无 validator 可跑了),
  保留真账户烟测和 Claude Code 端到端;FAQ slug 检查段改成手动指令;
  smoke test 编号 3 → 2

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 16:14:02 +08:00
袁章洪 553601477d refactor: drop the last 2 cli.py wrappers; all 19 skills now prompt-only
剩余两个保留 cli.py 的 skill(longbridge-quote / longbridge-watchlist-admin)也
按"不在 .py 中硬编码 cli 参数,改用 longbridge --help 自描述"原则去掉 wrapper。

删除:
- skills/longbridge-quote/scripts/{cli.py,test_cli.py}
- skills/longbridge-watchlist-admin/scripts/{cli.py,test_cli.py}
共 4 文件,-778 行

重写 SKILL.md(2 份):
- longbridge-quote:
    * "## CLI" 改成直接调 `longbridge quote / static / calc-index --format json`
    * 加显式提示 "If unsure of exact flag names, run `longbridge <subcommand>
      --help` first"(避免 SKILL.md 跟 CLI 版本耦合)
    * 多子命令合并的责任从 cli.py envelope 下沉到 LLM:Workflow 章节明示
      "merge per-symbol rows by symbol into a single object"
    * 删 cli.py 自定义 envelope 描述,改成描述 longbridge 原生 JSON 形态
- longbridge-watchlist-admin:
    * "Two-step protocol" 重写成纯 prompt 约定:① preview ② wait for
      explicit confirmation ③ execute,不再依赖 cli.py 的 --confirm gate
    * "Safety gates" 段去掉 binary-lock(Python 才能强制),改成依赖
      longbridge CLI 自己的 confirmation prompt(`watchlist delete` 自带)
    * CLI 调用模板用 `longbridge watchlist <create|update|delete> ...`
    * 加显式提示运行 `longbridge watchlist <subcommand> --help` 验证当前
      flag 拼写

文档同步:
- docs/architecture.md:
    * 删除"Two skills retain a Python wrapper"段,改成"all 19 skills are
      now prompt-only"
    * Decision flow 流程图删除 wrapper 路径
    * Multilingual end-to-end flow 图改用 `longbridge quote NVDA.US
      --format json` 替代 cli.py 调用
    * Maintainer guidelines #5/#6 重写 — "no Python wrappers" + "command
      not found is the path-switch signal"
- docs/install.md:
    * 移除 Python 3.8+ 先决条件(已无 .py 脚本依赖)
    * Smoke test 用 `longbridge quote/kline/watchlist --format json` 替
      代 python3 scripts/cli.py 调用
    * FAQ 把 binary_not_found 章节改名 "command not found: longbridge"
    * 5 → 6 个 analysis tier(catalyst-radar 上次没纠正)
- scripts/validate-skills.py:docstring 更新,test_cli.py runner 代码保留作
  防御(若有人重新引入 wrapper 还能跑测试)

validate 19/19 ✓。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 15:44:01 +08:00
袁章洪 a873314b0f docs: update architecture.md to match prompt-only design + tighten validator note
跟着 commit 543d587(10 skill 改成直接调 longbridge CLI 不走 cli.py),把
docs/architecture.md 与 scripts/validate-skills.py 同步更新:

architecture.md:
- "Default rule" 段:从"LLM calls python3 scripts/cli.py" 改成 "LLM calls
  longbridge <subcommand> --format json directly",fall back 时机从
  error_kind=binary_not_found 改成 shell command not found
- 新增"Two skills retain a Python wrapper" 高亮:解释 longbridge-quote 和
  longbridge-watchlist-admin 为什么仍保留 cli.py(envelope 合并 + 安全 gate)
- "Decision flow" 流程图加一层:决定是否走 wrapper(只有 quote 进 wrapper 路径,
  其它直接 longbridge CLI),原 cli.py-centric 决策改成 shell 退出码 / stderr
  关键词驱动
- "error_kind is the glue" 段改名 "Shell exit / stderr is the glue":说明 17
  个 prompt-only skill 走 stderr 解析,2 个 wrapper skill 走 7 种 error_kind
  enum;path-switch signal 从 binary_not_found 变成 shell command not found
- "Six analysis-tier skills" (原 Five,加上 catalyst-radar 算第 6 个)
- 收尾段改成 "17 of 19 skills are pure SKILL.md"

validate-skills.py:
- docstring:"For the two skills that still ship a Python wrapper..." —
  test_cli.py 现只对 quote + watchlist-admin 跑;其它 17 个没 scripts/test_cli.py,
  自然跳过(原代码本来就 if test_file.exists() check,无需改逻辑)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 15:28:30 +08:00
袁章洪 1a0a636ff9 docs: translate architecture.md + install.md to English; drop hard-coded local paths
- docs/architecture.md:全文译英,multilingual 示例(简/繁/英 trigger 演示、字段对照
  表、错误回复表)保留中文 — 它们是文档演示的内容,必须保留
- docs/install.md:全文译英,所有 /Users/hogan/work/... 替换为 <path-to-the-cloned-repo>
  / $PWD / 相对路径;Symlink 路径段补 git clone 步骤(原假设仓库在固定本机位置)
- 多语言用户提示示例(NVDA 现在多少钱 / 我的自选股 / NVDA 估值贵不贵 等)保留 —
  作为 trigger 示例,简/繁/英都演示

skill 内容未动,validate 19/19 ✓。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 14:38:36 +08:00
袁章洪 e8c0c91f00 docs: rewrite README user-facing + add npx/bun install paths
README.md 从"开发者技术参考"重写为"使用者友好":

- 顶部用一句普通话讲清楚做什么(对 AI 助手补长桥能力,中/英/繁三语,19 个 skill
  覆盖行情/账户/分析/通讯)
- "你能问什么"章节给 6 句多语言示例(NVDA 现在多少钱 / 我的持仓 / X 估值贵不贵
  / X 跟 Y 哪个增速快 / 今天有什么要关注 / 特斯拉最近怎么了)
- skill 表从 4 列拆分大表 → 4 行分组(基础 / 行情 / 账户 / 分析),每行所有 skill
  名做行内链接,扫一眼能看完
- 删去仓内目录树、Output policy、Mutating skills、Validate 等深度章节,把它们
  压成"For developers"小节链 docs/
- 19 skill 数对齐(之前 README 还停留在 17/18)

install.md 加 npx / bun 安装路径(微软 skills 同款):

- 新增方式 A:npx skills add / bunx skills add(全装 / --skill 单装)
- 老的"插件市场"成方式 B,"symlink"成方式 C,"其它 agent"成方式 D
- 卸载章节同步加方式 A 的 npx skills remove 命令
- 数字全部对齐到 19 个 skill(之前各处 17/11 等过期数)

skill 内容与三语功能不动,validate 19/19 ✓。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 14:18:54 +08:00
袁章洪 f6208a2f7c chore: remove docs/superpowers/ + ignore future re-adds
把内部设计 spec / plan 移出 public repo:

- git rm -r docs/superpowers/(原 22 份 specs + 1 份 mvp plan,共 4187 行)
  — 都是开发期的过程文档,引用旧中文 skill 名,放在公共 GitHub repo 价值低
- .gitignore 加 docs/superpowers/ 防止未来意外再次加进版本库
- README 移除 historical/design docs 章节 + 删 longbridge-trading 那条对
  skill-11-trading-risk-design.md 的死链
- README 仓树示意去掉 superpowers/ 行

skill 内容(17+1)与三语功能不受影响,validate 18/18 ✓。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 13:40:53 +08:00
袁章洪 526bf1a6ac feat: add marketplace, license, docs, validator for the merged repo
完成 longbridge-new-skills → longbridge-skills 的合并(commit 3/3):

新增:
- .claude-plugin/marketplace.json — Claude Code 插件市场入口,/plugin install
  longbridge@longbridge-skills 一次装 17 个;pluginRoot/source 配为 ./,skills 字段
  指 ./skills/ 让 Claude Code 扫子目录
- LICENSE — MIT(对齐 microsoft/skills 范式)
- docs/architecture.md — 三语支持 + CLI/MCP 路由两套设计的内部说明
- docs/install.md — 三种安装方式 + 先决条件 + 验证 + FAQ;repo URL 改为
  https://github.com/longbridge/skills
- scripts/validate-skills.py — 扫 skills/<slug>/ 校验 frontmatter + 跑 12 个 test_cli.py
- README.md — 重写为新 layout:支持单 skill symlink 与 plugin marketplace
  双安装路径,链接到 docs/architecture / docs/install / docs/superpowers/(历史)
- .gitignore — 扩展 Python / OS / 编辑器 / 构建产物常见忽略项

保留(audit trail):
- docs/superpowers/specs/ + docs/superpowers/plans/ — 18 份历史设计稿,引用旧
  中文名,仍可追溯当初的设计决定与风险评估

合并后状态:
- 17 个 skill 在 skills/ 下,全部 lowercase ASCII slug
- frontmatter / cli.py SKILL_NAME / scripts/test_cli.py 全部对齐英文 slug
- 三语 trigger 关键词 + Response language 指令 + 三列字段对照表
- python3 scripts/validate-skills.py → 17/17 ✓
- 12 个 read-tier scripts/test_cli.py → 全绿

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 11:09:46 +08:00
袁章洪 85fe7d4b0c feat(analysis-tier): implement 5 prompt-only skills (#14-#18)
落地 5 个分析层 skill,prompt-only 无 cli.py,通过编排长桥 MCP 工具:
- 估值分析(#14):PE/PB 历史与行业分位,周期股反向解读提示
- 基本面分析(#15):5 维 KPI(盈利/财务/增长/分红/预期),三档深度
- 同行对比(#16):2-5 symbol 矩阵,跨币种/跨行业 disclaim
- 投资组合分析(#17):账户级分析,trade scope 引导 + 隐私提示
- 资讯舆情(#18):news+filings+topic 6 类聚合,WebSearch fallback

README + skill-catalog 同步标 ✅。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 21:36:49 +08:00
袁章洪 f025e98856 docs(spec): add 5 analysis-tier skill designs (#14-#18)
After surveying longbridge-mcp's 110 tools and finding the CLI is a strict
subset, the gap is analysis: questions like "is X expensive", "compare A vs
B", "how is my portfolio doing", "what's the latest news on X" need
multi-tool orchestration the CLI can't supply.

Five new prompt-only skills (no cli.py — they orchestrate MCP tools and
chain to existing CLI skills):

- #14 估值分析:    valuation + valuation_history + industry_valuation +
                    industry_valuation_dist + chain to 行情查询
- #15 基本面分析:  financial_report (IS/BS/CF) + dividend + forecast_eps +
                    consensus + company + operating + corp_action
- #16 同行对比:    multi-symbol parallel quote + calc_indexes +
                    latest_financial_report + valuation; aggregates table
- #17 投资组合分析:profit_analysis + profit_analysis_detail +
                    exchange_rate + chain 持仓查询; needs trade-scope token
- #18 资讯舆情:    news + filings + topic + topic_detail + topic_replies
                    with WebSearch fallback for breaking news

Cross-cutting design constraints (encoded in each SKILL.md):
- All five output structured analysis (categorized, summarized, not raw
  dumps); each must end with "不构成投资建议"
- #16 caps comparison at 5 symbols; reroutes to #14/#15 for single symbol
- #17 chains to #14/#15 instead of giving rebalance suggestions
- #18 must classify news (catalyst/regulatory/strategic/financial/opinion)
  and avoid "利好/利空" original language
- Front-matter introduces requires_mcp: true to gate skill on MCP install
  (`claude mcp add --transport http longbridge ...`)

Protocol updated to differentiate 读取层(#01-13, cli.py-based) from
分析层(#14-18, prompt-only, MCP-strong-dep). Catalog reorganized into
the two tiers with completion checkmarks on the 12 implemented read-tier
skills.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 19:13:53 +08:00
袁章洪 59abfad25f feat(skills): add MCP fallback section to all 12 skills
Each SKILL.md now has a "## MCP 备选" section mapping its cli.py paths to
equivalent mcp__longbridge__<tool> calls. LLM defaults to cli.py (faster
local subprocess), falls back to MCP when binary_not_found, or routes
straight to MCP for capabilities CLI doesn't expose.

Protocol updated to make this section #9 (mandatory) and to document the
"MCP + CLI dual-path" routing rule. Mutating skills (#11/#12) keep the
dry-run + confirm flow regardless of path.

Notes:
- 实时订阅: MCP has no equivalent (stateless HTTP, no subscription
  concept) — this is documented in its fallback section
- 盘口深度/all combo: MCP has no all-combo tool, falls back to LLM
  composing depth + brokers + trades
- 持仓查询/订单与成交: same OAuth scope limitation applies on both paths
- 证券查找: MCP recommended over CLI when CLI returns longbridge-side
  param_error

User must register MCP once with:
  claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 17:10:12 +08:00
袁章洪 9f839d0bd3 docs(plan): record acceptance log for 行情查询 #01
All 12 unit tests + 3 real-account smoke tests + 6-prompt Claude Code
integration tests passed on 2026-04-28. Skill is live at
~/.claude/skills/longbridge-quote.

Notes the differences from the original 10-task plan: protocol
front-matter fields, envelope source/skill/skill_version, renamed
error_kind enum, new Task 11 (--index calc-index merge), --timeout
flag, 12 total unit tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 15:02:43 +08:00
袁章洪 7816552bc4 docs(spec): expand to 13-skill family with platform protocol
After surveying iwencai SkillHub (9 official skills, sample SKILL.md/cli.py
zips snapshotted to clawdbot-skills/_iwencai-snapshot/), commit a full design
catalog covering all 30+ longbridge subcommands as 13 skills, with a shared
platform protocol so each skill spec only writes its business differential.

- skill-platform-protocol.md: directory layout, SKILL.md sections, cli.py
  interface, error_kind enum (7), JSON envelope, test pattern, deployment
- skill-catalog.md: priority waves P0..P3, subcommand mapping, decisions
- 13 differential designs: quote, kline, depth, capital-flow, market-temp,
  derivatives, security-list, positions, orders, watchlist (read), trading
  (risk), watchlist (write), subscriptions
- skill-11 trading: 5 safety gates, default_install:false, 4 prerequisites
  to resolve before plan stage
- README: family overview + trading-skill warning section

Implementation plan stays incremental — MVP plan for 行情查询 (#01) is
unchanged; other skills will get their own plans in priority-wave batches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 14:30:38 +08:00
袁章洪 827dd519e3 chore: bootstrap longbridge-skills repo with spec + plan 2026-04-27 17:47:47 +08:00