← Back to Skills Marketplace
ctg-travel

Ctg Travel

by ctg-travel · GitHub ↗ · v1.0.5 · MIT-0
cross-platform ✓ Security Clean
195
Downloads
0
Stars
0
Active Installs
6
Versions
Install in OpenClaw
/install ctg-travel
Description
中旅旅行开放平台一站式预订助手。整合机票、酒店、火车票、门票四大资源,支持查询、预订、退款全流程。下载中旅旅行APP获取 API Key。当用户表达出行住宿需求时(如"买火车票""订酒店""查询航班""购买景区门票"),提供智能引导和便捷预订服务。
README (SKILL.md)

旅游项目 Skill

一、前置条件(首要步骤,必须先完成)

  • 运行环境:Python 环境,支持 HTTP 调用
  • 接入指南Skill 接入指南
  • CTG_API_KEY:中旅旅行 API Key,用于调用接口

在任何预订/查询流程开始之前,必须先确保 API Key 可用。 获取流程如下:

  1. 检查配置文件:检查 config/ctgConfig.json 中是否存在 apiKey 字段。
  2. 索取并持久化:若配置文件中无 API Key,立即向用户索要,并阻塞后续流程直到用户提供。获取后通过命令持久化:python scripts/apiexe.py set-key --api-key \x3C用户提供的Key>,将 Key 写入 config/ctgConfig.json,后续调用自动读取。
  3. 禁止访问:当没有获取到 CTG_API_KEY 时不要进行需求识别与分流

话术示例:「为了为您办理预订服务,请提供您的中旅旅行 API Key。您可以在中旅旅行 APP 中获取后提供给我。」

二、需求识别与分流(按需加载指南)

根据用户输入识别意图,仅加载匹配的资源 guide,不预加载全部。

资源线 触发示例 操作指南 接口文档
火车 买火车票、订火车票、买高铁票、动车票、预定武汉-北京火车票、查询火车票/高铁票、去上海有什么车次、坐 G101 去北京 guide/train.md api/train.json
火车票退订 火车票退票、我要退票、申请退款、确认退票 guide/train-refund.md api/train-refund.json
机票 买机票、订机票、买飞机票、预定北京-上海机票、查询航班/机票、明天飞杭州有什么航班、坐飞机去广州、机票订单 guide/plane.md api/plane.json
机票退订 退机票、机票退票、机票退款、申请退款、把刚刚预定的机票退了、取消这张机票(已支付)、张三退票、张三和李四退票 guide/plane-refund.md api/plane-refund.json
酒店 预订酒店、订酒店、订房、酒店订单、我的酒店订单、取消订单(未支付) guide/hotel.md api/hotel.json
酒店退订 退订酒店、酒店退款、申请退款、我要退订 guide/hotel-refund.md api/hotel-refund.json
门票 购买门票、订门票、景区门票、查询门票、门票订单 guide/ticket.md api/ticket.json
门票退订 退门票、门票退票、门票退款、申请退款、把刚刚预定的门票退了、取消这张门票(已支付) guide/ticket-refund.md api/ticket-refund.json
  • 模糊推荐:用户说「想去XX旅游」「推荐去哪玩」→ 先推荐目的地,再引导明确资源类型
  • 多资源:逐个引导、依次下单

三、整体交互流程

用户输入 → 确认 API Key 已配置(无则索要并通过 set-key 持久化) → 匹配资源线 → 加载对应 guide + api → 收集必填参数 → 调用接口 → 话术反馈

四、接口调用

  • 执行scripts/apiexe.py call --method \x3Cmethod> --arg '\x3Cparams_json>'
  • 请求超时:「当前系统响应较慢,请稍后再试。」
  • 后台报错:转化为通俗话术,禁止暴露接口名、method、技术报错原文
  • 多次失败:「抱歉,当前服务暂时繁忙。您可以前往「中旅旅行」App 完成操作,体验更流畅。」

五、入参引导与结果反馈

  • 以 api/*.json 为准:查阅对应 method 的 parameters.requiredproperties
  • 缺则提示:每次只问一项缺项(如「从哪个城市出发?」),逐步收集
  • 完整后再请求:所有必填字段齐备后再调用
  • 结果反馈:使用通俗语言,禁止返回原始技术字段。如「您的火车票订单已创建成功,请注意查收通知。」
Usage Guidance
This skill appears to do what it says: it needs your CTG API Key to call the CTG booking APIs and will store that key in config/ctgConfig.json (or use CTG_API_KEY env var). Before installing, consider: 1) Only provide an API Key obtained from the official CTG app; do not reuse broader credentials. 2) The key is stored as plaintext JSON in the skill directory if you use the set-key command — if you prefer not to persist it, supply it via the CTG_API_KEY environment variable at runtime and avoid running set-key. 3) The skill will send booking-related PII (names, identity numbers, phone numbers) to pro-api.ourtour.com as part of normal booking flows — review and accept that data flow. 4) Review the included scripts (scripts/apiexe.py, scripts/json_arg_escape.py) and the CALL_URL to be comfortable with the endpoint and signing design; revoke the key if you later suspect compromise. 5) The package has no external installers or opaque downloads, but provenance is minimal (no homepage) — if you require stronger assurance, ask the publisher for an official homepage or documentation and limit the API Key's permissions.
Capability Assessment
Purpose & Capability
Name/description (CTG travel booking) match the requested environment variable (CTG_API_KEY), the included API JSON schemas, and the two helper scripts. The skill needs an API key to call CTG APIs and the code implements that. Owner/source metadata is sparse (no homepage) but that is a provenance note, not an incoherence.
Instruction Scope
SKILL.md explicitly requires the API key before doing any intent matching and instructs saving it to config/ctgConfig.json via scripts/apiexe.py set-key. The instructions do not ask the agent to read unrelated system files or exfiltrate data. Note: the skill will collect and transmit user booking/identity data (names, identityNo, phoneNumber, etc.) to the CTG API as part of booking flows — this is expected but privacy-relevant and worth telling users.
Install Mechanism
No install spec or external downloads are present; the skill is instruction + Python scripts included in the bundle. No network install or third-party package pulls were found in the provided files.
Credentials
Only CTG_API_KEY is required, which is proportionate for a gateway-authenticated API. Implementation stores the key in config/ctgConfig.json and also accepts CTG_API_KEY from environment. Important to note: the key is effectively used as an HMAC secret (compute_signature), so it must be protected; the key is persisted in plaintext JSON under the skill directory unless the user supplies it only via environment.
Persistence & Privilege
always:false (no forced global presence). The skill writes its own config file (config/ctgConfig.json) and may create a cache directory; this is limited to the skill's folder and is consistent with its stated behavior. It does not modify other skills or system-wide settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ctg-travel
  3. After installation, invoke the skill by name or use /ctg-travel
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.5
- 新增 metadata 字段,明确声明需要 CTG_API_KEY 环境变量用于接口调用。 - 其他功能和流程保持不变。
v1.0.4
- Bumped version number to 1.0.4. - Update Hotel json.
v1.0.3
No user-facing changes in this version. - Version bumped from 1.0.2 to 1.0.3. - No file or documentation changes detected.
v1.0.2
ctg-travel 1.0.2 introduces improved API Key管理和配置方式: - 统一 API Key 获取流程,优先从配置文件读取,无则主动索取,并持久化保存 - 禁止在未获取到 API Key 时进行任何资源识别或业务处理,增强安全性和用户体验 - 调用接口时不再需要每次显式传递 API Key,简化调用流程 - 日志及用户引导话术均有细节优化 - 版本号与技能名正式归一为 ctg-travel 1.0.2
v1.0.1
ctg-travel 1.0.1 - 新增在所有操作前强制获取并保存用户 API Key,流程会在未获取时阻塞,保障数据安全与操作顺畅 - 更新整体流程为:优先校验 API Key → 才进行资源匹配与后续操作 - 细化 API Key 获取的话术,明确示例引导 - 完善接口调用方式,要求每次请求携带用户 API Key - 补充/优化相关话术与异常反馈策略,避免技术细节暴露
v1.0.0
- 首次发布:提供一站式旅行预订助手,整合机票、酒店、火车票、门票全流程查询、订购与退款能力 - 支持按用户需求识别自动分流,仅加载所需操作指南与接口,提升响应效率 - 针对模糊旅游需求进行推荐引导,再精细化收集并处理订购需求 - 明确多资源订单处理机制,避免流程冲突 - 所有对用户输出均为通俗话术,无技术术语,完善异常处理与友好引导
Metadata
Slug ctg-travel
Version 1.0.5
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 6
Frequently Asked Questions

What is Ctg Travel?

中旅旅行开放平台一站式预订助手。整合机票、酒店、火车票、门票四大资源,支持查询、预订、退款全流程。下载中旅旅行APP获取 API Key。当用户表达出行住宿需求时(如"买火车票""订酒店""查询航班""购买景区门票"),提供智能引导和便捷预订服务。 It is an AI Agent Skill for Claude Code / OpenClaw, with 195 downloads so far.

How do I install Ctg Travel?

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

Is Ctg Travel free?

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

Which platforms does Ctg Travel support?

Ctg Travel is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Ctg Travel?

It is built and maintained by ctg-travel (@ctg-travel); the current version is v1.0.5.

💬 Comments