| name | request-api-key |
| description | Requests Upstage API key via Channel.io when the key is not configured. Sends a message to Pete, waits for his reply, then writes the key to .env automatically. |
Request API Key via Channel.io
Overview
When UPSTAGE_API_KEY is missing from .env, this skill:
- Sends a request message to Pete's Channel.io group
- Waits for the user to confirm Pete replied
- Reads the key from the thread and writes it to
.env
Language: Detect the language from the user's first message and respond in that language throughout. Support Korean (ํ๊ตญ์ด) and Japanese (ๆฅๆฌ่ช). Default to Korean if language is unclear.
Steps
1. Check Current API Key Status
Constraints:
- You MUST run:
grep -s "UPSTAGE_API_KEY" .env
- If the key exists, starts with
up_, and is NOT the placeholder up_YOUR_API_KEY_HERE โ STOP and tell the user the key is already configured
- You MUST get requester info:
hostname and whoami
2. Send Request to Pete via Channel.io
Constraints:
- You MUST call
mcp__team-chat-mcp__send_team_chat_message with groupId: "531940"
- You MUST set
userName to {username} ({hostname})
- You MUST save the returned
messageId for thread lookup in Step 3
Message template:
๐ Upstage API ํค ์์ฒญ
์๋
ํ์ธ์, ํผํธ๋!
{username} ({hostname})์์ SOP ํ์ดํ๋ผ์ธ์ ์คํํ๋ ค๊ณ ํฉ๋๋ค.
Upstage API ํค๊ฐ ํ์ํฉ๋๋ค. ํค๋ฅผ ์ด ์ค๋ ๋์ ๋ต์ฅํด ์ฃผ์ธ์ ๐
Expected Output:
โ
ํผํธ๋๊ป ์์ฒญ์ ๋ณด๋์ต๋๋ค!
Channel.io์์ ๋ต์ฅ์ด ์ค๋ฉด ์๋ ๋ฒํผ์ ๋๋ฌ์ฃผ์ธ์.
3. Wait for Pete's Reply
Constraints:
- You MUST use AskUserQuestion with two options:
- "๋ต์ฅ ์์ด์" โ Pete replied, check the thread now
- "์ ๊น ๊ธฐ๋ค๋ฆด๊ฒ์" โ not yet, will notify later
- If user selects "์ ๊น ๊ธฐ๋ค๋ฆด๊ฒ์", tell them to re-run
/request-api-key when Pete replies and STOP
- If user selects "๋ต์ฅ ์์ด์", proceed to get the thread
4. Find Pete's Key and Save to .env
Pete may reply in the thread or directly in the group โ check both.
Constraints:
- First, call
mcp__team-chat-mcp__get_team_chat_thread with the messageId from Step 2, and scan replies for a message from personId 592317 containing up_[a-zA-Z0-9_]+
- If not found in thread, call
mcp__team-chat-mcp__get_team_chat_messages with groupId: "531940", limit: 10, sortOrder: "desc" and scan for a message from personId 592317 containing up_[a-zA-Z0-9_]+
- You MUST extract the key value from whichever location it's found
- You MUST verify the key starts with
up_ and is at least 20 characters
- If still not found, ask user to copy-paste Pete's message directly via AskUserQuestion
- If
.env does not exist, create it: cp .env.example .env
- You MUST replace the UPSTAGE_API_KEY line using the Edit tool
- You MUST verify:
grep UPSTAGE_API_KEY .env
- You MUST NOT display the full key โ show only first 8 chars +
...
5. Verify and Continue
Constraints:
- You MUST run:
python3 -c "import sys; sys.path.insert(0, '.'); from scripts.config import UPSTAGE_API_KEY; print('OK')"
- If OK โ inform the user setup is complete, suggest
/stage1-clustering or /userchat-to-sop-pipeline
- If fails โ tell user to restart Claude Code
Expected Output:
๐ API ํค ์ค์ ์๋ฃ! (up_xxxxx...)
์ด์ ํ์ดํ๋ผ์ธ์ ์คํํ ์ ์์ต๋๋ค.
๐ /stage1-clustering ๋๋ /userchat-to-sop-pipeline
Troubleshooting
Key not found in thread
- Ask user to copy-paste Pete's message directly via AskUserQuestion
- Validate it starts with
up_
Python verification fails
- Check
.env is in project root: cat .env
- Ask user to restart Claude Code and retry