← Back to Skills Marketplace
weipapa

longbridge-stock

by weipapa · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
359
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install longbridge-stock
Description
Real-time stock quotes and account queries for Longbridge (长桥证券) users. Query US/HK/China stocks, account balance, and positions. Use whenever user mentions...
README (SKILL.md)

Longbridge Stock Queries

Prerequisites

pip3 install longport

Scripts

Run from the skill directory:

Script Usage Description
quote.py python3 scripts/quote.py AAPL.US GOOGL.US Real-time stock quotes
balance.py python3 scripts/balance.py Account balance and buying power
positions.py python3 scripts/positions.py Portfolio positions

Stock Symbol Format

Market Format Examples
US \x3CTICKER>.US AAPL.US, GOOGL.US, TSLA.US
Hong Kong \x3CNUMBER>.HK 700.HK (腾讯), 9988.HK (阿里)
Shanghai A-share \x3CCODE>.SH 600519.SH (茅台)
Shenzhen A-share \x3CCODE>.SZ 300750.SZ (宁德时代)

See symbols.md for common stock codes.

Configuration

Create .longbridge_config in one of these locations (priority order):

  1. Environment variable: LONGBRIDGE_CONFIG=/path/to/.longbridge_config
  2. \x3Cskill-dir>/.longbridge_config
  3. \x3Cskill-dir>../../../.longbridge_config (workspace root)
  4. ~/.longbridge_config or ~/.config/longbridge/.longbridge_config

Config file format:

LONGPORT_APP_KEY=\x3Cyour_app_key>
LONGPORT_APP_SECRET=\x3Cyour_app_secret>
LONGPORT_ACCESS_TOKEN=\x3Cyour_access_token>
LONGPORT_REGION=cn
LONGPORT_HTTP_URL=https://openapi.longportapp.cn
LONGPORT_QUOTE_WS_URL=wss://openapi-quote.longportapp.cn
LONGPORT_TRADE_WS_URL=wss://openapi-trade.longportapp.cn

Get credentials from https://open.longport.com/

For detailed setup, see config.md.

Troubleshooting

Error Solution
配置文件不存在 Create .longbridge_config
配置文件缺少: LONGPORT_ACCESS_TOKEN Add all required fields to config
ModuleNotFoundError: No module named 'longport' Run pip3 install longport
You do not have access to market's Open API data Check Longbridge subscription
Usage Guidance
This skill appears to implement the Longbridge functionality it claims, but it requires your Longport API credentials via a .longbridge_config file (or LONGBRIDGE_CONFIG env var) even though the skill metadata doesn't declare those sensitive requirements. Before installing or using it: - Do not place your real credentials in a workspace-shared or repository-root config file. The scripts search parent directories (including ../../../ and config/secrets paths) and could pick up unrelated secrets—store credentials in a dedicated private path and set LONGBRIDGE_CONFIG to that path. - Verify the Python package to be installed (pip3 install longport) comes from a trusted source (PyPI) and inspect the longport package if you can. - Consider running the scripts locally with a test account or read-only token first, and inspect logs/output. - Ask the publisher to update the skill manifest to declare the required credentials (or a primaryEnv) and to narrow the config lookup to only the skill directory or an explicit env var to avoid reading workspace secrets. If you cannot confirm these points, treat the skill as untrusted for accounts containing real funds or sensitive credentials.
Capability Analysis
Type: OpenClaw Skill Name: longbridge-stock Version: 1.0.0 The skill bundle provides legitimate tools for querying stock market data and account information via the official Longbridge (长桥证券) OpenAPI. The Python scripts (quote.py, balance.py, positions.py) use the official 'longport' SDK and follow standard practices for configuration management, searching for credentials in a dedicated '.longbridge_config' file. There is no evidence of data exfiltration, malicious execution, or prompt injection.
Capability Assessment
Purpose & Capability
The name/description (Longbridge real-time quotes and account queries) matches the included scripts which call the Longbridge/Longport SDK. However the skill metadata declares no required credentials or env vars, while the runtime requires Longport API credentials—this is an internal inconsistency (missing declared requirements).
Instruction Scope
SKILL.md tells the agent to run the provided scripts and to create a .longbridge_config containing LONGPORT_APP_KEY/SECRET/ACCESS_TOKEN. The scripts read that config and call Longport endpoints—functionally appropriate—but the config discovery logic searches up multiple parent/workspace paths (e.g., ../../../.longbridge_config and ../../../config/secrets/.longbridge_config). That broad search increases the chance the skill will read unrelated secrets from the workspace/root, which is scope creep relative to a simple skill.
Install Mechanism
No install spec (instruction-only) and instructions tell the user to pip3 install longport. There are no downloads from untrusted URLs or extract/install steps. This is low-risk for install mechanism.
Credentials
The skill requires Longport credentials (LONGPORT_APP_KEY, LONGPORT_APP_SECRET, LONGPORT_ACCESS_TOKEN) but the metadata lists no required env vars or primary credential. Credentials are expected in a config file or via LONGBRIDGE_CONFIG env var, but this is not declared in the skill manifest—lack of declared sensitive requirements is a mismatch and should be fixed before trusting the skill.
Persistence & Privilege
always is false and the skill is user-invocable; it does not request persistent system-wide privileges or modify other skills. Autonomous invocation is allowed by default but is not combined with other high-risk flags here.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install longbridge-stock
  3. After installation, invoke the skill by name or use /longbridge-stock
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of Longbridge stock quote and account skill. - Supports real-time stock quotes for US, Hong Kong, and China A-share markets. - Allows Longbridge users to check account balance and portfolio positions. - Recognizes user requests for market data, portfolio value, or specific stocks (like Apple, Tencent, or Tesla). - Uses standard stock code formats (e.g., AAPL.US, 700.HK, 600519.SH). - Easy setup with a config file and `longport` Python package. - Includes troubleshooting steps for common setup and usage errors.
Metadata
Slug longbridge-stock
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is longbridge-stock?

Real-time stock quotes and account queries for Longbridge (长桥证券) users. Query US/HK/China stocks, account balance, and positions. Use whenever user mentions... It is an AI Agent Skill for Claude Code / OpenClaw, with 359 downloads so far.

How do I install longbridge-stock?

Run "/install longbridge-stock" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is longbridge-stock free?

Yes, longbridge-stock is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does longbridge-stock support?

longbridge-stock is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created longbridge-stock?

It is built and maintained by weipapa (@weipapa); the current version is v1.0.0.

💬 Comments