Install
openclaw skills install kungfu-financeMainland China A-share stock and sector analysis tool (中国A股个股与板块分析). Current repo build focuses on stable deterministic products for stock snapshots, basic finance indicators, chip/price levels, sector detail lookup, plus bucket, phase-2 strategy, researcher, bayesian monitor, and preview stock/sector deep research flows.
openclaw skills install kungfu-finance.mjs scripts (bundled executable scripts with zero npm dependencies — no npm install needed)https://tianshan-api.kungfu-trader.com — deterministic products (snapshot, finance, bucket, strategy, researcher, bayesian monitor)https://push2.eastmoney.com / https://push2his.eastmoney.com — stock/sector deep research market data (free public API, no key required)https://ifzq.gtimg.cn / https://qt.gtimg.cn — fallback market data via Tencent Finance (free public API, no key required)https://wry-manatee-359.convex.site / https://clawhub.ai — check-update version query (ClawHub registry, public, no key required)KUNGFU_OPENKEY environment variable, sent as Authorization: Bearer <token> (Tianshan API only; EastMoney/Tencent/ClawHub APIs require no authentication)KUNGFU_PLATFORM (optional, defaults to openclaw)~/.openclaw/workspace/finance-master/charts/inkscape for SVG→PNG conversion; no other subprocessesAll environment variables are read from the host process; none are accepted from user prompts.
When separately configured, stock/sector deep research may call an additional search endpoint. This surface is independent from the Tianshan API and uses its own credential boundary:
| Env Var | Purpose |
|---|---|
KUNGFU_ENABLE_RESEARCH_SEARCH | Set to 1 to enable |
KUNGFU_RESEARCH_SEARCH_PROVIDER | Provider name (currently web_search) |
KUNGFU_RESEARCH_SEARCH_ENDPOINT | Search service URL |
KUNGFU_RESEARCH_SEARCH_API_KEY | Search service credential |
KUNGFU_RESEARCH_SEARCH_TIMEOUT_MS | Search request timeout (default: 15000) |
When search is enabled, requests are POSTed as JSON to KUNGFU_RESEARCH_SEARCH_ENDPOINT with KUNGFU_RESEARCH_SEARCH_API_KEY as Bearer token.
KUNGFU_OPENKEY is never reused for search requests.
If search is enabled but misconfigured, the result returns misconfigured status instead of silently failing.
| Env Var | Purpose |
|---|---|
KUNGFU_ENABLE_EXPERIMENTAL_PRODUCTS | Set to 1 to enable unreleased products |
KUNGFU_RESEARCH_DEFAULT_TARGET_DATE | Override default research date (YYYYMMDD format, for testing) |
stock-research / sector-research use public EastMoney/Tencent APIs for market data — no backend dependency for these flowsKUNGFU_ENABLE_EXPERIMENTAL_PRODUCTS=1stock-research / sector-research produce markdown_svg_preview with explicit degradation reportingKUNGFU_OPENKEY is sent only to tianshan-api.kungfu-trader.com — never to EastMoney, Tencent, or any other hostRoute the user into the currently enabled intent families below. Do not expose internal product names unless needed for implementation.
Use when the user wants one A-share stock's current state, recent走势, K-line window, holders,筹码分布,支撑压力位, or other narrow deterministic data.
Default behavior:
instrument_nameexchange_id must be SSE or SZEUse when the user wants one A-share stock's基础财务指标或基础财务上下文。
Default behavior:
finance_basic_indicators for narrow factual questionsfinance_context for lightweight finance contextUse when the user asks about one A-share industry or sector.
Default behavior:
sector_namesector-research resolves theme words by matching against the full EastMoney concept sector listsector-research accepts sector_name or sector_id directly; when the local resolver cannot disambiguate, it returns needs_input for the user to provide a BK codeUse when the user wants one A-share sector's deep research, hype-cycle view, thematic thesis, dragon-head observation, committee-style bull/bear review, or a longer structured report.
Default behavior:
sector_name or sector_id; target_date is optional and defaults to the current market date in Asia/Shanghaimarkdown_svg_preview and returns explicit degradations for remaining search / adapter gapssector-analysis skillreport_svg and quality_gateneeds_input for the user to provide a BK codeweb_search runtime is enabled and configured, macro / policy / catalyst / industry-trend / competition / money-flow evidence may be attached as external search evidence (7 search buckets)Use when the user wants one A-share stock's deep research, investment thesis, catalyst map, committee-style bull/bear review, or a longer structured report.
Default behavior:
target_date and defaults it to the current market date in Asia/Shanghaimarkdown_svg_preview and returns explicit degradations for remaining search / adapter gapsstock-analysis-v2 skillreport_svg and quality_gateweb_search runtime is enabled and configured, these evidence buckets are populated; otherwise the report surfaces explicit degradationsUse when the user wants to:
Default behavior:
needs_input response so the host can continue the dialogueneeds_input for corrected instruments instead of calling the write APIUse when the user wants to:
Default behavior:
lago_planmarket-select supports InstrumentSelect, TemplateInstrumentSelect, BuySell, and TemplateBuySellmarket-select is used on BuySell or TemplateBuySell, whole-market results only return buy pointsmarket-select accepts either target_date, or strategy_start_date + strategy_end_datemarket-select mixes the two date modes, or only provides half of a range, return a structured needs_input responseneeds_input response so the host can continue the dialogueblocked response instead of pretending the scan succeededUse when the user wants to:
Default behavior:
Journeyman membership or abovestock-reports is a composed flow built from researcher score plus researcher report listauthor-reports prefers researcher-author-idresearcher-name, resolve it conservatively; if not unique, return needs_inputUse when the user wants to:
Default behavior:
list returns task summaries only and must not expose full original_reportreports supports bayesian-task-id and conservative bayesian-topic resolutionneeds_input response so the host can continue the dialogueblocked response instead of pretending the task existsUse when the user wants to see one A-share stock's technical indicator chart. The script automatically renders SVG, converts to PNG via inkscape, and returns file paths (no SVG text in stdout). Supported chart types:
kline — K线图 (candlestick chart with optional chip distribution overlay, price level lines, and custom annotations)lushan_shadow — 庐山照影图 (CM mountain + FC shadow dual-bar chart)lushan_4season — 庐山四季图 (GG/HY/DP lines + RS bars + bottom resonance/strong markers)shuanglun — 双轮驱动图 (K-wheel + R-wheel stacked bars with trend coloring)liumai — 六脉神剑图 (6-signal heatmap matrix with buy/sell signal row)smart_money — 聪明钱图 (smart money vs follow money dual-line chart)finance_score — 个股综合得分 (radar chart with 行业统治力/财务健康度/发展前景 three-dimensional scoring)K-line chart additional options:
--with-chip-peak true — overlay chip distribution (筹码峰) on the right side--with-price-levels true — draw support/resistance/concentration price level lines (阻力位/支撑位)--annotations '[{"date":"20260328","price":15.5,"type":"buy","label":"买入点","color":"#ef4444"}]' — mark custom points on the chartUse when the user wants one A-share stock's comprehensive scoring across three dimensions:
Available as both a data product (finance_score) and a rendered SVG chart (indicator-chart --chart-type finance_score).
Use when the user wants to:
Default behavior:
list groups subscriptions by instrument and shows instrument name, code, auto-update statusanomaly returns unusual movements sorted by date descending, plus signals count and analysissummary returns aggregate UM_ct (异动数量) and UM_SG_ct (异动信号) countsneeds_input responseThe following capabilities are still under route-contract cleanup and should not be used in the current public rollout:
sector-researchPick one default route from the list below.
Stock SnapshotFinance AnalysisSector AnalysisStock Deep ResearchBucket FlowStrategy FlowIndicator ChartFinance ScoreResearcher FlowBayesian Monitor FlowHealth CheckConfig OpenKeySubscription Flow (action: list)Subscription Flow (action: add)Subscription Flow (action: delete)Subscription Flow (action: anomaly)Subscription Flow (action: summary)Check UpdateIf the user asks for arbitrary whole-market screening or market-news bundles, do not use this skill in the current release build.
For single-stock requests, use exactly one:
--instrument-name--instrument-id and --exchange-idNever mix both modes.
If the stock code is unknown, prefer --instrument-name.
When using code mode, --exchange-id must be SSE or SZE.
For stock products and flows, use:
--target-date--visual-days-lenFor strategy actions, use:
signal and count: --target-date with optional --visual-days-lenbatch-scan: --target-datemarket-select: either --target-date, or --strategy-start-date plus --strategy-end-dateNever mix single-day mode and range mode in the same market-select request.
--sector-name--sector-idPrefer --sector-name.
Only reuse --sector-id after the backend has already returned it.
The current release build does not expose fuzzy sector resolution as a standalone public data product, but sector-research can resolve theme words via the EastMoney concept sector list.
Do not generate or expose these from the model side:
start_dateend_dateis_realtimelimitdaysperiodsThe internal deterministic product contract lives here:
Use that file only when you need exact internal product names, allowed parameter shapes, or output keys. Do not dump that whole catalog into the user-facing reasoning path by default.
Bucket flow contract lives here:
Strategy flow contract lives here:
Researcher flow contract lives here:
Bayesian monitor flow contract lives here:
Documented research methods live here:
Use them as methodology references and migration inputs for deep research.
The repo build currently has preview CLI/runtime entrypoints via stock-research and sector-research.
The sector preview accepts sector_name first and uses best-effort EastMoney concept list resolution before falling back to needs_input.
Read runtime_parity.md before treating any research wrapper or asset as implementation-ready truth.
Prompt assets are flow-specific. Do not mix finance-analysis formatting requirements into movement-analysis outputs, or vice versa.
node scripts/flows/run_data_request.mjs --product price_snapshot --instrument-name 贵州茅台 --target-date 20260301
node scripts/flows/run_data_request.mjs --product sector_performance --sector-name 白酒 --target-date 20260301
node scripts/router/run_router.mjs bucket --bucket-action list
node scripts/router/run_router.mjs bucket --bucket-action add --bucket-name 观察池 --bucket-instrument 贵州茅台 --bucket-instrument 平安银行
node scripts/router/run_router.mjs strategy --strategy-action list
node scripts/router/run_router.mjs strategy --strategy-action signal --strategy-name 三分归元 --instrument-name 贵州茅台 --target-date 20260331 --visual-days-len 22
node scripts/router/run_router.mjs strategy --strategy-action batch-scan --strategy-id 900 --strategy-instrument 600519.SSE --strategy-instrument 000001.SZE --target-date 20260331
node scripts/router/run_router.mjs strategy --strategy-action market-select --strategy-name 庐山升龙 --target-date 20260331
node scripts/router/run_router.mjs stock-research --instrument-name 贵州茅台 --target-date 20260331 --visual-days-len 120
node scripts/router/run_router.mjs sector-research --sector-name 机器人 --target-date 20260331 --visual-days-len 780
node scripts/router/run_router.mjs indicator-chart --chart-type kline --instrument-name 贵州茅台 --target-date 20260331 --visual-days-len 120
node scripts/router/run_router.mjs indicator-chart --chart-type kline --instrument-name 贵州茅台 --target-date 20260331 --visual-days-len 120 --with-chip-peak true --with-price-levels true
node scripts/router/run_router.mjs indicator-chart --chart-type kline --instrument-name 贵州茅台 --target-date 20260331 --visual-days-len 60 --annotations '[{"date":"20260310","type":"buy","label":"买入"},{"date":"20260325","type":"sell","label":"卖出"}]'
node scripts/router/run_router.mjs indicator-chart --chart-type lushan_shadow --instrument-name 贵州茅台 --target-date 20260331 --visual-days-len 120
node scripts/router/run_router.mjs indicator-chart --chart-type lushan_4season --instrument-name 贵州茅台 --target-date 20260331 --visual-days-len 120
node scripts/router/run_router.mjs indicator-chart --chart-type shuanglun --instrument-name 贵州茅台 --target-date 20260331 --visual-days-len 120
node scripts/router/run_router.mjs indicator-chart --chart-type liumai --instrument-name 贵州茅台 --target-date 20260331 --visual-days-len 120
node scripts/router/run_router.mjs indicator-chart --chart-type smart_money --instrument-name 贵州茅台 --target-date 20260331 --visual-days-len 120
node scripts/flows/run_data_request.mjs --product finance_score --instrument-name 贵州茅台 --target-date 20260331
node scripts/router/run_router.mjs indicator-chart --chart-type finance_score --instrument-name 贵州茅台 --target-date 20260331
node scripts/router/run_router.mjs researcher --researcher-action rank --researcher-rank-by 1m --researcher-limit 10
node scripts/router/run_router.mjs researcher --researcher-action stock-reports --instrument-name 贵州茅台
node scripts/router/run_router.mjs researcher --researcher-action author-reports --researcher-author-id author-1
node scripts/router/run_router.mjs health
Returns { healthy: true/false, checks: { openkey, api_test } }. Verifies KUNGFU_OPENKEY is set and authenticates against the backend.
node scripts/router/run_router.mjs config-openkey --openkey kf_ok_live_xxxxx
Validates the key against the backend, then writes it to ~/.openclaw/.env. Returns user_id and plan_code on success.
node scripts/router/run_router.mjs subscription --subscription-action list
node scripts/router/run_router.mjs subscription --subscription-action add --subscription-instrument 贵州茅台 --subscription-instrument 平安银行
node scripts/router/run_router.mjs subscription --subscription-action delete --subscription-instrument 贵州茅台
node scripts/router/run_router.mjs subscription --subscription-action anomaly --instrument-name 贵州茅台 --target-date 20260401
node scripts/router/run_router.mjs subscription --subscription-action summary
node scripts/router/run_router.mjs check-update
Checks ClawHub registry for a newer version. Returns { update_available, local_version, remote_version, update_command }. When an update is available, the agent should run the returned update_command (clawhub update kungfu-finance) in a shell to apply it.