docs(skill): add Go SDK reference to longbridge skill#1061
Merged
huacnlee merged 2 commits intoJun 2, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a Go SDK reference set to the
longbridgeAI skill, mirroring the existingrust-sdkreferences but kept concise:references/go-sdk/overview.md— install, Config (env / OAuth), contexts, push callbacks, error handlingreferences/go-sdk/quote-context.md— quote methods,Subscribe+On*handlersreferences/go-sdk/trade-context.md—SubmitOrderstruct, orders, account, positionsreferences/go-sdk/types.md— SubType / Period / AdjustType / CalcIndex / OrderType / OrderSide / TimeType / OutsideRTH / OrderStatus / CurrencySKILL.mdContent 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-gov0.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:QuoteContext.CalcIndexes(...)CalcIndexQuoteContext.Watchlist(...)WatchedGroupsSecurityDepth.Asks / .Bids.Ask/.BidGetHistoryOrders.StartAt/EndAtas timeint64Unix secs (GetHistoryExecutionsusestime.Time— the two differ; now noted)GetAccountBalance{Currency: "HKD"}Currencyistrade.Currency→ usetrade.CurrencyHKDSubmittedQuantity,ReplaceOrder.Quantity) areuint64; only price fields useshopspring/decimal2. Live read-only run — against a paper-trading account, no orders placed.
Quote/StaticInfo/Candlesticks/Depth/AccountBalance/StockPositions/TodayOrdersall 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-decimalcorrection (verified via a deliberate compile-failure test).Notes
go mod tidyto pull the SDK's transitive deps — normal Go flow, no doc change needed.