Skip to content

docs(skill): add Go SDK reference to longbridge skill#1061

Merged
huacnlee merged 2 commits into
longbridge:mainfrom
UncertaintyDeterminesYou4ndMe:skill/go-sdk-reference
Jun 2, 2026
Merged

docs(skill): add Go SDK reference to longbridge skill#1061
huacnlee merged 2 commits into
longbridge:mainfrom
UncertaintyDeterminesYou4ndMe:skill/go-sdk-reference

Conversation

@UncertaintyDeterminesYou4ndMe
Copy link
Copy Markdown
Contributor

What

Adds a Go SDK reference set to the longbridge AI skill, mirroring the existing rust-sdk references but kept concise:

  • references/go-sdk/overview.md — install, Config (env / OAuth), contexts, push callbacks, error handling
  • references/go-sdk/quote-context.md — quote methods, Subscribe + On* handlers
  • references/go-sdk/trade-context.mdSubmitOrder struct, orders, account, positions
  • references/go-sdk/types.md — SubType / Period / AdjustType / CalcIndex / OrderType / OrderSide / TimeType / OutsideRTH / OrderStatus / Currency
  • linked from SKILL.md

Content stays high-level (method/struct/enum coverage) with pointers to GoDoc + source for exact signatures, consistent with the skill-authoring guidance in CLAUDE.md.

Verification

Verified against the real SDK github.com/longbridge/openapi-go v0.24.1:

1. Compile check — a program exercising every documented method, struct field and constant was built with go build / go vet. Caught and fixed 6 issues:

Doc claim Real SDK
QuoteContext.CalcIndexes(...) method is singular CalcIndex
QuoteContext.Watchlist(...) list getter is WatchedGroups
SecurityDepth.Asks / .Bids fields are .Ask / .Bid
GetHistoryOrders.StartAt/EndAt as time int64 Unix secs (GetHistoryExecutions uses time.Time — the two differ; now noted)
GetAccountBalance{Currency: "HKD"} Currency is trade.Currency → use trade.CurrencyHKD
"prices/quantities use decimal" quantities (SubmittedQuantity, ReplaceOrder.Quantity) are uint64; only price fields use shopspring/decimal

2. Live read-only run — against a paper-trading account, no orders placed. Quote / StaticInfo / Candlesticks / Depth / AccountBalance / StockPositions / TodayOrders all returned real data with the documented field names.

3. Independent cross-review — a second model (kimi) and a separate agent re-checked the docs against source; both confirmed the fixes, including the uint64-vs-decimal correction (verified via a deliberate compile-failure test).

Notes

  • Docs only; no code/build changes. No submodules touched.
  • Users will need go mod tidy to pull the SDK's transitive deps — normal Go flow, no doc change needed.

陆逊 and others added 2 commits June 2, 2026 13:40
Add references/go-sdk/ (overview, quote-context, trade-context, types)
mirroring the existing rust-sdk reference set, and link it from SKILL.md.
Content kept concise: high-level method/struct/enum coverage with pointers
to GoDoc + source for exact signatures.

Verified against the real SDK (github.com/longbridge/openapi-go v0.24.1):

1. Compile check — a program exercising every documented method, struct
   field and constant was built with `go build` / `go vet` against v0.24.1.
   Caught and fixed 6 issues:
   - QuoteContext.CalcIndexes -> CalcIndex (method is singular)
   - QuoteContext.Watchlist -> WatchedGroups (list getter)
   - SecurityDepth fields are .Ask / .Bid (not .Asks / .Bids)
   - GetHistoryOrders.StartAt/EndAt are int64 Unix secs (GetHistoryExecutions
     uses time.Time — the two differ; now noted)
   - GetAccountBalance.Currency is trade.Currency (use trade.CurrencyHKD)
   - order quantities (SubmittedQuantity, ReplaceOrder.Quantity) are uint64,
     only price fields use shopspring/decimal

2. Live read-only run — paper-trading account, no orders placed. Verified
   Quote / StaticInfo / Candlesticks / Depth / AccountBalance /
   StockPositions / TodayOrders all return real data with the documented
   field names.

3. Independent cross-review — a second model (kimi) and a separate agent
   re-checked the docs against source; both confirmed the fixes and the
   uint64-vs-decimal correction.
- types.md: 删除不存在的 OutsideRTHOvernight(照搬 Rust 的错误,会编译失败),改为真实的 OutsideRTHOnly/Any/Unknown
- 新增 go-sdk/content.md: 补齐 ContentContext(News/Topics) 与 QuoteContext.Filings,对齐 rust-sdk/content.md
- SKILL.md: Go SDK 段加 Content 条目;正文与选型决策表纳入 Go
- trade-context.md: SubmitOrder 补 LimitOffset(TSLPAMT/TSLPPCT 必填)
- overview.md: 标注版本号 v0.21.0

签名均经 openapi-go v0.21.0 源码核实。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
huacnlee added a commit to longbridge/skills that referenced this pull request Jun 2, 2026
## 背景

从 `longbridge/developers` 仓库提取 Go SDK skill 文档同步到本仓库的
`skills/longbridge`。所有 API 签名均经 `openapi-go` submodule(v0.21.0)源码核实。

## 改动

- 🆕 `references/go-sdk/`:`overview` / `quote-context` / `trade-context`
/ `content` / `types`
- `SKILL.md`:新增 Go SDK 引用段;正文 `Python/Rust SDK`→`Python/Rust/Go
SDK`;选型决策表纳入 Go;Related skills 末尾 SDK 语种补 Go

> 对应 developers 仓库 PR:longbridge/developers#1061

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

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huacnlee huacnlee merged commit 7b503f8 into longbridge:main Jun 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants