rail

Original🇨🇳 Chinese
Translated

High-speed rail / train lookup workflow (China-focused). Use for timetables, ticket availability, delays, cancellations, or “today/latest” rail updates. Prefer official sources; always include source link + local update time; NEVER fabricate.

12installs
Added on

NPX Install

npx skill4agent add jinfanzheng/kode-sdk-csharp rail

SKILL.md Content (Chinese)

View Translation Comparison →

Rail Skill (High-Speed Rail/Train: Timetable, Ticket Availability, Delays)

Mental Model

  • Timetable ≠ Ticket Availability ≠ Delays: These three types of information differ in real-time nature and authoritative sources. Clearly specify which type you are querying when outputting results.
  • Ticket availability/delays are highly real-time: Must include source link + local update time; do not draw conclusions if you cannot obtain this information.
  • Station names/dates are critical: A city may have multiple stations; "today/tomorrow" must be converted to a specific local date.

Ask Only 1 Key Question (Only When Necessary)

When key information is missing, ask only one question:
  • Missing date: "Which date (local date) are you inquiring about?"
  • Unclear station names: "Which departure station and arrival station are you referring to? (e.g., Shenzhen North → Guangzhou South)"
  • Unclear query goal (timetable/ticket availability/delays): "Do you want to check the timetable, ticket availability, or delays/cancellations?"

Hard Output Requirements (Strict Constraints)

Must include:
  • Type: Timetable / Ticket Availability / Delays / Cancellations
  • Departure Station → Arrival Station + Date (local date)
  • Train number (if provided by user or available from source)
  • Source + Link
  • Local Time (update/publish time of the source page; write "Source does not indicate update time" if unavailable)
Recommended Format (Markdown):
  • Shenzhen North → Guangzhou South (YYYY-MM-DD) Ticket Availability/Timetable/Delays (Source: xxx; Local Time: YYYY-MM-DD HH:mm / Source does not indicate update time)
    • Result: 1-2 key pieces of information (avoid information overload)

Source Strategy (China-Focused)

Whitelist (For Drawing Conclusions)

  • 12306.cn
    (official ticketing/inquiry channel; used for ticket availability, on-time/cancellation information, authoritative timetables)

Priority Link for Ticket Availability Inquiry (Prefer 12306 Deep Links)

When users ask about ticket availability/fare/purchase possibility, do not just tell users to "check the link themselves". You should first retrieve the results, then provide the results along with the source; 12306 must be prioritized.
Implementation (Constrained within the skill, no custom tools required):
  • First open the 12306 deep link page (
    leftTicket/init
    or
    lcQuery/init
    ), complete the query/extract results on the page (use web reading/browser tools to extract list content if necessary).
  • Organize key results into 2-5 items (train number, departure/arrival time, duration, ticket availability) to avoid information overload.
  • Must include the corresponding 12306 deep link (for user verification) in the output, and clearly state the Beijing time of your query (if the page does not indicate update time, write "Subject to query time").
Source Links (For reference/verification, not for user to check on your behalf):
  • Direct Ticket Availability/Train List (leftTicket):
    • Template:
      https://kyfw.12306.cn/otn/leftTicket/init?linktypeid=dc&fs=<Departure Station Name>,<Departure Station Code>&ts=<Arrival Station Name>,<Arrival Station Code>&date=<YYYY-MM-DD>&flag=N,N,Y
    • Example:
      https://kyfw.12306.cn/otn/leftTicket/init?linktypeid=dc&fs=江门,JOQ&ts=深圳北,IOQ&date=2026-01-19&flag=N,N,Y
  • Transfer Inquiry (lcQuery) (Prioritize this when user explicitly requests "transfer" or direct results are unsatisfactory):
    • Template:
      https://kyfw.12306.cn/otn/lcQuery/init?linktypeid=dc&fs=<Departure Station Name>,<Departure Station Code>&ts=<Arrival Station Name>,<Arrival Station Code>&date=<YYYY-MM-DD>&flag=N,N,Y
    • Example:
      https://kyfw.12306.cn/otn/lcQuery/init?linktypeid=dc&fs=江门,JOQ&ts=深圳北,IOQ&date=2026-01-19&flag=N,N,Y
Usage Notes:
  • Station codes must be official 12306 codes (e.g.,
    Shenzhen North=IOQ
    ). If the user only provides station names, first confirm the code using the official 12306 station code list; if the station name is ambiguous (multiple stations in the same city/old name), clarify with the user before generating the deep link.
  • Update Time Format: The 12306 ticket availability list page usually does not separately indicate "update time". In this case, write in the output:
    Subject to query time (Beijing Time YYYY-MM-DD HH:mm)
    and clearly state "Page does not indicate update time".
  • Conclusion Constraint: Even if third-party pages show ticket availability/fare, they can only be used as supplementary references; the final conclusion must be based on the 12306 deep link page (or equivalent official inquiry page).
  • Exception Handling (Only in Force Majeure Cases): If 12306 triggers a captcha/risk control that prevents data retrieval, clearly state "I cannot directly obtain real-time ticket availability here at the moment", provide the 12306 deep link as an alternative verification path, and do not fabricate any ticket availability conclusions.

Entire Web (Only for Supplementary Verification/Cross-Validation)

  • Third-party sites can be used for auxiliary retrieval/guidance, but conclusions on ticket availability, cancellations, or delays must be based on official or equivalent authoritative sources.

NEVER (Absolutely Forbidden)

  • Do not fabricate ticket quantities, fares, delay minutes, or cancellation information
  • Do not use historical timetables as the current day's operation status
  • Do not output specific train numbers and times without confirming the date/station",