Install
openclaw skills install tonghuashun-ifindUse when the user needs Tonghuashun iFinD market, report, factor, screening, calendar, or other financial data, and all data must come from iFinD after successful authentication.
openclaw skills install tonghuashun-ifind当 OpenClaw、Hermes、Codex 或其他 Agent 需要给同花顺 iFinD 用户做金融数据查询时,优先使用这个 skill。
这个 skill 的产品定位只有一句话:给已经有同花顺 iFinD 账号的用户,一个能听懂自然语言的查询入口。
如果你是负责安装这个 skill 的 Agent,照下面做,不要发明其它路径:
bash scripts/install_skill.sh
安装结果必须是:
~/.openclaw/workspace/skills/tonghuashun-ifind-skill
安装后先按同花顺 iFinD 官方方式完成鉴权:用户登录 iFinD 超级命令客户端或网页版账号详情,复制 refresh_token,再让 skill 换取并缓存 access_token。
Agent 必须这样引导用户取 token:
请先打开同花顺 iFinD 超级命令客户端,进入账号详情,复制 refresh_token。
如果你用网页端,可以打开:
https://quantapi.10jqka.com.cn/gwstatic/static/ds_web/super-command-web/index.html#/AccountDetails
登录后在账号详情里复制 refresh_token。复制后发给我,我会只用它换取 access_token 并缓存,不会要求你的同花顺用户名或密码。
python3 tonghuashun-ifind-skill/scripts/ifind_cli.py auth-set-refresh-token \
--refresh-token "$IFIND_REFRESH_TOKEN"
如果用户已经给了双 token,才直接注入:
python3 tonghuashun-ifind-skill/scripts/ifind_cli.py auth-set-tokens \
--access-token "$IFIND_ACCESS_TOKEN" \
--refresh-token "$IFIND_REFRESH_TOKEN"
查询时永远先用自然语言入口:
python3 tonghuashun-ifind-skill/scripts/ifind_cli.py smart-query \
--query "查一下贵州茅台近三年营收和毛利率"
access_token,或可用 refresh_token 能续期。smart-query,由 skill 负责把用户原话路由到 iFinD。quote-realtime、quote-history、market-snapshot、fundamental-basic 是明确场景下的稳定命令。/smart_stock_picking 查询股票代码和简称,再用解析出的代码调用行情/历史等稳定接口;不要维护全量本地股票表。/smart_stock_picking 走 iFinD;交易日 / 休市日走 /date_sequence。/smart_stock_picking,不要让 Agent 先手写 endpoint。api-call 只用于高级兜底:smart-query、iFinD 自然语言透传和 endpoint-list / endpoint-call 都不够时再用。refresh_token -> /get_access_token -> access_token;不要替用户完成浏览器登录。access_token 或 refresh_token。refresh_token,再执行 auth-set-refresh-token。~/.openclaw/tonghuashun-ifind-skill/token_state.json 里的缓存 token。access_token 过期,自动使用 refresh_token 调用 /get_access_token 续期。refresh_token。refresh_token 后执行 auth-set-refresh-token,skill 会调用 /get_access_token 并保存双 token。access_token 和 refresh_token 时,才执行 auth-set-tokens。用户问“token 在哪拿”时,直接回答:
refresh_token。https://quantapi.10jqka.com.cn/gwstatic/static/ds_web/super-command-web/index.html#/AccountDetails。refresh_token,只把这个 token 提供给 Agent。auth-set-refresh-token --refresh-token "$IFIND_REFRESH_TOKEN"。官方文档入口:
https://quantapi.51ifind.com/gwstatic/static/ds_web/quantapi-web/help-center/deploy.htmlhttps://quantapi.51ifind.com/gwstatic/static/ds_web/quantapi-web/example.htmlhttps://quantapi.10jqka.com.cn/gwstatic/static/ds_web/super-command-web/index.html#/AccountDetailsauth-set-refresh-tokenauth-set-tokenssmart-queryquote-realtimequote-historymarket-snapshotfundamental-basicendpoint-listendpoint-callapi-callbasic-datasmart-pickreport-querydate-sequencesmart-query。smart-query 会用 iFinD 自身能力解析证券代码;用户输入常见口语简称或昵称时,smart-query 会先做小型别名纠偏,再把请求发到 iFinD;如果名称仍有歧义,就让用户补充完整简称或 6 位代码。quote-realtime、quote-history、market-snapshot、fundamental-basic。refresh_token 鉴权,不要尝试其它数据源。smart-query 会把用户原话交给 iFinD /smart_stock_picking;只有 iFinD 也无法处理时,才看 endpoint-list。api-call。smart-query 返回需要手动查接口,就先读本地路由文档和 use cases;如果文档里仍找不到合适接口,就明确告诉用户当前 skill 未覆盖该 iFinD 能力,不要乱猜 endpoint。默认使用本地确定性路由。需要强化复杂自然语言解析时,可以启用 OpenAI-compatible Chat Completions 路由器:
export IFIND_ROUTE_LLM_ENABLED=1
export IFIND_ROUTE_LLM_API_KEY="$OPENAI_API_KEY"
export IFIND_ROUTE_LLM_MODEL="gpt-4o-mini"
可选变量:
IFIND_ROUTE_LLM_BASE_URLIFIND_ROUTE_LLM_TIMEOUTIFIND_ROUTE_LLM_MIN_CONFIDENCE大模型只允许输出 iFinD 路由计划。低置信度、无效返回或模型调用失败时,skill 会回到本地确定性路由。
https://clawhub.ai/etherstrings/tonghuashun-ifindhttps://github.com/Etherstrings/tonghuashun-ifind-skill/tree/main/tonghuashun-ifind-skill详细示例见 references/usage.md,能力边界先看 references/capability-matrix.md,路由规则见 references/routing.md,常见用户问法示例见 references/use-cases.md。如果要查看当前已封装的命名接口,直接运行 endpoint-list。