Friendly Battle
Tokenmon friendly battle. Real PvP turn loop against another player on the same network. Korean: 친선전, 친선 배틀, 배틀, 대전, friendly battle
от ThunderConch★ 26 звёзд на GitHub
Установить Friendly Battle в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Open a friendly battle session and fight another player in real-time turn-based combat. One player opens a room (open), shares the session code + host:port with their opponent, who then joins (join). Switch, surrender, and leave are now supported (PR45, PR46).
Execute
Step 0 — Parse $ARGUMENTS
Read the first token of $ARGUMENTS:
open→ go to Step 1a (open flow). Default is LAN mode — bind0.0.0.0and advertise the machine's detected LAN IP. If the second token islocal, run in loopback mode instead — bind127.0.0.1(same-machine only).join→ go to Step 1b (join flow); the second token must be<code>@<host>:<port>resume→ go to Step 1c (resume flow — picks up the turn loop afteropendetaches while waiting for the guest)status→ go to Step 7 (status flow)leave→ go to Step 9 (leave flow)helpor empty → go to Step 8 (help flow)- anything else → print
알 수 없는 명령어: <token>and go to Step 8
Step 1a — Open flow (host)
Pick listen mode from the second $ARGUMENTS token:
- Default (no second token, or anything besides
local): LAN mode — bind0.0.0.0, advertise the machine's detected LAN IP. Works for two players on the same local network (e.g. same WiFi). The host's firewall must allow inbound TCP on the chosen port. - Second token
local: loopback mode — bind127.0.0.1, advertise127.0.0.1:<port>. Only works when host and guest are on the same machine.
Resolve plugin root, generation, and — in LAN mode — the machine's LAN IP first:
P="${CLAUDE_PLUGIN_ROOT:-$(ls -d ~/.claude/plugins/marketplaces/tkm 2>/dev/null || ls -d ~/.claude/plugins/cache/tkm/tkm/*/ 2>/dev/null | sort -V | tail -1)}"
GEN=$(node -e "try{const g=JSON.parse(require('fs').readFileSync(require('path').join(require('os').homedir(),'.claude/tokenmon/global-config.json'),'utf-8'));console.log(g.active_generation||'gen1')}catch{console.log('gen1')}")
SESSION_CODE=$(node -e "process.stdout.write(require('crypto').randomBytes(3).toString('hex'))")
LAN_IP=$(node -e "const i=require('os').networkInterfaces();for(const k of Object.keys(i))for(const a of i[k]||[])if(a.family==='IPv4'&&!a.internal){process.stdout.write(a.address);process.exit(0)}process.stdout.write('127.0.0.1')")
Initialize the host daemon. In LAN mode (default) bind 0.0.0.0 and advertise the detected LAN_IP via --join-host so guests learn the concrete address to connect to. In loopback mode (local) bind 127.0.0.1 and omit --join-host.
# LAN mode (default):
"$P/bin/run-friendly-battle-turn.sh" --init-host --session-code "$SESSION_CODE" --generation "$GEN" --listen-host 0.0.0.0 --join-host "$LAN_IP" --port 0 --timeout-ms 300000 --player-name Host
# Loopback mode (second $ARGUMENTS token == local):
# "$P/bin/run-friendly-battle-turn.sh" --init-host --session-code "$SESSION_CODE" --generation "$GEN" --listen-host 127.0.0.1 --port 0 --timeout-ms 300000 --player-name Host
Parse the JSON envelope on stdout. Store sessionId — you MUST remember this for /tkm:friendly-battle resume and other subcommands later. Also read the PORT: line from stderr to get the bound port.
Set ADVERTISED_HOST=$LAN_IP in LAN mode, ADVERTISED_HOST=127.0.0.1 in loopback mode.
Tell the user:
- "세션 코드:
<SESSION_CODE>" - "호스트 주소:
<ADVERTISED_HOST>:<PORT>" - "상대방에게 위 코드와 주소를 공유하고, 상대방이
/tkm:friendly-battle join <code>@<ADVERTISED_HOST>:<port>를 실행하도록 안내하세요." - In LAN mode (default) only, add: "⚠️ LAN 모드는 호스트 머신의 방화벽이 해당 TCP 포트(
<PORT>)의 인바운드 연결을 허용해야 합니다. WSL2 호스트의 경우 Windows 방화벽도 확인하세요. 같은 WiFi/LAN 에 있는 상대방만 접속 가능합니다 (인터넷 경유 X). 같은 머신에서 두 터미널로 테스트하려면/tkm:friendly-battle open local을 사용하세요." - "💡 친선전 턴 진행은 거의 mechanical 한 작업이니 Opus 대신 Sonnet 을 쓰면 훨씬 빠릅니다. 배틀 속도가 답답하면
/model sonnet으로 전환하세요. (배틀 끝난 뒤/model로 원래 모델 복구. Haiku는 UI 입력 파싱이 불안정해서 비추천.)" - "💤 게스트 접속 대기는 백그라운드 데몬이 알아서 처리합니다. (핸드셰이크 제한 시간은 5분이며, 그 전에 resume 하지 않으면 세션이 만료됩니다.)"
Then immediately probe with --status once (non-blocking, never fails) so that if the opponent has already connected we skip straight to the turn loop:
"$P/bin/run-friendly-battle-turn.sh" --status --session "$SESSION_ID" --generation "$GEN"
Dispatch on the returned envelope's phase:
phase === 'battle'→ transition to Step 2 (turn loop) now.phase === 'aborted'→ showquestionContext(or REASON from stderr) and stop.- anything else (
waiting_for_guest/handshake/connecting/ready) → tell the user "아직 상대가 접속하지 않았습니다. 상대방이 붙었다 싶으면/tkm:friendly-battle resume을 실행하거나 저에게 '확인' / 'check' / 'resume' 이라고 말씀하세요. 그때 제가 다시 확인해서 배틀을 시작하겠습니다." and end your turn.
Stand-by rule (follow-up turns in the same conversation): while the session is in a pre-battle phase (sessionId still in scope but Step 2 not yet entered), treat any subsequent free-form user message that looks like a check request — exact matches or fuzzy Korean/English equivalent
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Friendly Battle?
Tokenmon friendly battle. Real PvP turn loop against another player on the same network. Korean: 친선전, 친선 배틀, 배틀, 대전, friendly battle
Как установить скилл Friendly Battle?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Friendly Battle запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…