This wraps the SRTrain Python library to search, reserve, and cancel SRT train tickets in Korea. It pulls credentials from environment variables or a local secrets file, searches available trains between stations, shows you the options with pricing and seat availability, then reserves once you pick one. The workflow is careful about side effects: it always lists candidates before booking anything. Useful if you're building a Korean travel assistant and want seat booking without touching payment. Won't help with KTX or full checkout flows, and it keeps retry logic conservative to avoid hammering the account. Clean separation between read and write operations, which matters when you're dealing with real reservations.
npx -y skills add nomadamas/k-skill --skill srt-booking --agent claude-codeInstalls into .claude/skills of the current project.
SRTrain 위에 scripts/srt_booking.py helper 를 얹어 SRT 조회와 호차별 좌석번호 확인을 처리하고, 예약과 취소는 고정된 열차/예약을 다시 식별한 뒤 SRTrain으로 진행한다.
python3 -m pip install SRTrainKSKILL_SRT_IDKSKILL_SRT_PASSWORD~/.config/k-skill/secrets.env (기본 fallback) — plain dotenv 파일, 퍼미션 0600.기본 경로에 저장하는 것은 fallback일 뿐, 강제가 아니다.
YYYYMMDDHHMMSSpython3 -c 'import SRT' 가 실패하면 다른 구현으로 우회하지 말고 전역 Python 패키지 설치를 먼저 시도한다.
python3 -m pip install SRTrain
KSKILL_SRT_ID, KSKILL_SRT_PASSWORD 환경변수가 설정되어 있는지 확인한다. 없으면 위 credential resolution order에 따라 확보한다.
시크릿이 없다는 이유로 웹사이트를 직접 긁거나 다른 비공식 경로를 찾지 않는다.
먼저 helper 로 조회해서 후보를 요약한다.
python3 scripts/srt_booking.py search 수서 부산 20260328 080000 --time-limit 120000 --limit 5
예약 전에는 항상 아래를 짧게 정리한다.
search 의 좌석 가능 여부는 열차 단위 플래그다. 사용자가 "남은 좌석 번호", "호차별 좌석", "특정 좌석", "창측/순방향 자리", "예약 전에 자리 확인"처럼 구체적인 좌석을 물으면 예약 전에 seats 를 호출한다.
python3 scripts/srt_booking.py seats 수서 부산 20260328 080000 --train-id <train_id>
특정 호차의 빈 좌석만 확인하려면 --car-no 와 --available-only 를 쓴다.
python3 scripts/srt_booking.py seats 수서 부산 20260328 080000 --train-id <train_id> --car-no 5 --available-only
특정 좌석이 비었는지 확인하려면 --seat 를 붙인다.
python3 scripts/srt_booking.py seats 수서 부산 20260328 080000 --train-id <train_id> --car-no 5 --seat 11A
특정 호차를 지정하지 않으면 가운데 호차부터 탐색한다. --car-priority center|low|high 로 호차 탐색 순서를 바꾸고, --seat-priority forward-window|window-forward|row-low 로 좌석 정렬 우선순위를 바꾼다.
상세 좌석 응답을 보여줄 때는 아래를 우선 요약한다.
available_seat_countavailable_seats)direction, positionrequested_seat_available이 기능은 좌석을 선택/선점하지 않는다. 실제 예약은 다음 단계에서만 진행한다.
예약은 부작용이 있으므로 정확한 열차를 고른 뒤에만 진행한다.
python3 - <<'PY'
import os
from SRT import Adult, SRT, SeatType
srt = SRT(os.environ["KSKILL_SRT_ID"], os.environ["KSKILL_SRT_PASSWORD"])
trains = srt.search_train("수서", "부산", "20260328", "080000", time_limit="120000")
reservation = srt.reserve(
trains[0],
passengers=[Adult(1)],
special_seat=SeatType.GENERAL_FIRST,
)
print(reservation)
PY
취소 전에는 대상 예약을 다시 식별한다.
python3 - <<'PY'
import os
from SRT import SRT
srt = SRT(os.environ["KSKILL_SRT_ID"], os.environ["KSKILL_SRT_PASSWORD"])
reservations = srt.get_reservations()
print(reservations)
PY
SRTrain은 SRT 전용 라이브러리라서 스킬 의도가 더 선명하다juliusbrussee/caveman
mattpocock/skills
shadcn/improve
obra/superpowers
forrestchang/andrej-karpathy-skills
vercel-labs/skills