k-skill/docs/setup.md
Jeffrey (Dongkyu) Kim fbc004af9d Remove client-side Seoul subway key setup
Route Seoul subway arrival lookups through k-skill-proxy so the
hosted proxy owns the Seoul Open Data upstream key and end users
only need the proxy base URL. Add proxy route coverage, update
skill/docs guidance, and align setup materials with the hosted
proxy flow used for fine dust.

Constraint: Must keep the proxy public, read-only, and dependency-free
Constraint: Must satisfy TDD-first verification and ship on feature/#35 targeting dev
Rejected: Add a separate client helper package | unnecessary extra layer for a single proxy route
Rejected: Keep SEOUL_OPEN_API_KEY as an end-user requirement | defeats the issue goal
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep the Seoul subway proxy surface limited to station-arrival passthrough unless tests/docs expand the contract
Tested: npm run ci; local proxy runtime on 127.0.0.1:4120 for /health and /v1/seoul-subway/arrival on 2026-03-31 with an invalid upstream key
Not-tested: Live success response with a valid Seoul Open API key
Related: #35
2026-03-31 10:25:55 +09:00

2.4 KiB

공통 설정 가이드

k-skill 전체 스킬을 설치한 뒤, 인증 정보가 필요한 기능(SRT 예매, KTX 예매, self-host 프록시 운영용 서울 지하철/미세먼지 upstream key)을 사용하려면 이 절차를 진행하면 된다.

Credential resolution order

모든 credential-bearing 스킬은 아래 우선순위를 따른다.

  1. 이미 환경변수에 있으면 그대로 사용한다.
  2. 에이전트가 자체 secret vault(1Password CLI, Bitwarden CLI, macOS Keychain 등)를 사용 중이면 거기서 꺼내 환경변수로 주입해도 된다.
  3. ~/.config/k-skill/secrets.env (기본 fallback) — plain dotenv 파일, 퍼미션 0600.
  4. 아무것도 없으면 유저에게 물어서 2 또는 3에 저장한다.

에이전트가 자체 vault를 사용 중이라면 기본 경로 설정을 건너뛰어도 된다.

기본 경로로 설정하기

에이전트가 별도 vault를 쓰지 않는 경우, 기본 fallback 파일을 만든다.

mkdir -p ~/.config/k-skill
cat > ~/.config/k-skill/secrets.env <<'EOF'
KSKILL_SRT_ID=replace-me
KSKILL_SRT_PASSWORD=replace-me
KSKILL_KTX_ID=replace-me
KSKILL_KTX_PASSWORD=replace-me
AIR_KOREA_OPEN_API_KEY=replace-me
KSKILL_PROXY_BASE_URL=https://k-skill-proxy.nomadamas.org
EOF
chmod 0600 ~/.config/k-skill/secrets.env

실제 값을 채운다.

확인

bash scripts/check-setup.sh

시크릿이 없을 때의 기본 응답

인증이 필요한 스킬에서 값이 비어 있으면 credential resolution order에 따라 확보한다.

  • 어떤 값이 필요한지 정확한 변수 이름으로 알려주기
  • resolution order에 따라 유저에게 확보 방법 안내하기

기능별로 필요한 값

기능 필요한 값
SRT 예매 KSKILL_SRT_ID, KSKILL_SRT_PASSWORD
KTX 예매 KSKILL_KTX_ID, KSKILL_KTX_PASSWORD
서울 지하철 도착정보 조회 KSKILL_PROXY_BASE_URL
사용자 위치 미세먼지 조회 KSKILL_PROXY_BASE_URL 또는 AIR_KOREA_OPEN_API_KEY

다음에 볼 문서

설치 기본 흐름은 "전체 스킬 설치 → 개별 기능 사용" 이다.