Gym
Tokenmon gym battle. Challenge gym leaders with your party in turn-based combat. Korean: 체육관, 배틀, 도전, gym, 관장
by ThunderConch★ 26 GitHub stars
Install Gym in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
Challenge a Tokenmon gym leader in turn-based battle. The battle runs inside Claude Code — status bar shows sprites and HP, conversation handles turns.
Execute
If $ARGUMENTS is list: show gym status
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)}"
"$P/bin/tsx-resolve.sh" "$P/src/cli/gym-list.ts"
Show the output to the user and stop.
Otherwise: start a gym battle
Step 1 — Initialize the battle:
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')}")
GYM_ID="${ARGUMENTS:-}"
"$P/bin/tsx-resolve.sh" "$P/src/cli/battle-turn.ts" --init --gym "${GYM_ID:-auto}" --gen "$GEN"
Parse the JSON output. Read sessionId, phase, status, questionContext, moveOptions, partyOptions (fallback switchOptions only if partyOptions is absent), animationFrames, and currentFrameIndex. Do NOT parse or trust the legacy menu string.
Step 2 — Non-negotiable input rule:
During battle, ALWAYS use AskUserQuestion for action selection. Never infer actions from plain chat. If the user types 1, 공격, 교체, or anything else in free chat during battle, ignore it as a battle command and re-open the correct AskUserQuestion UI.
Step 3 — Action-select flow (status=="ongoing" and phase=="select_action"):
Build AskUserQuestion options from moveOptions only:
- Show exactly
min(moveOptions.length, 4)move-slot options. - Each label must be
{index}. {nameKo} ({pp}/{maxPp}). - Use a brief description only if type/power is actually known from the JSON/context.
- Never add switch or surrender as buttons. Never show slots 5 or 6 as buttons.
- If a move has
disabled: true, keep it visibly unavailable for that slot instead of replacing it with another action.
Then ask the user via AskUserQuestion and rely on the auto-provided Other field for non-move intents.
All battle-turn invocations below use the same launcher as Step 1:
"$P/bin/tsx-resolve.sh" "$P/src/cli/battle-turn.ts" <flags> — keep $P in scope from the initialization shell block.
Parse the AskUserQuestion answer like this:
- Button
1-4on a shown move slot: run"$P/bin/tsx-resolve.sh" "$P/src/cli/battle-turn.ts" --action <index>. Othertext: trim and lowercase it.Othermatching/^(교체|switch|change|s)$/i: enter switch flow.Othermatching/^(항복|surrender|quit|giveup|gg)$/i: enter surrender confirm flow.- Anything else: show
알아들을 수 없어. 기술 버튼을 누르거나 "교체" / "항복" 을 입력해줘.and re-ask the same AskUserQuestion.
Step 4 — Switch flow (switch_menu):
To open the switch menu, run:
"$P/bin/tsx-resolve.sh" "$P/src/cli/battle-turn.ts" --action 5
Parse the returned JSON and read partyOptions[] first, or switchOptions only as a fallback. Then make a SECOND AskUserQuestion:
- Show up to 4 party members.
- Label each live option as
{index}. {name} HP:{hp}/{maxHp}. - If a member is fainted, mark that slot unavailable or note
기절; do not offer it as a valid switch target. - If more than 4 live members exist, mention
그 외는 이름으로 입력해줘and rely onOther.
Parse the second AskUserQuestion answer like this:
- Button on a listed live member: run
"$P/bin/tsx-resolve.sh" "$P/src/cli/battle-turn.ts" --action switch:<index>. Othertext: fuzzy matchnameby lowercase exact match or substring match.- No match: re-ask the same switch AskUserQuestion.
Step 5 — Surrender flow:
AskUserQuestion:
- Question:
정말 항복할거야? 체육관 재도전 패널티가 있을 수 있어. - Options:
항복 확정,취소
If confirmed, run:
"$P/bin/tsx-resolve.sh" "$P/src/cli/battle-turn.ts" --action 6
If cancelled, return to the same action-select AskUserQuestion.
Step 6 — Forced switch flow (status=="fainted_switch"):
Use the same party AskUserQuestion as the switch flow, but do not allow cancel or return to action-select. The user must choose a live party member or type a valid name in Other, then run:
"$P/bin/tsx-resolve.sh" "$P/src/cli/battle-turn.ts" --action switch:<index>
The CLI handles this forced switch without an extra AI turn.
Step 7 — Animation pump after every --action call:
After every action command that returns JSON, inspect animationFrames[].
- If
animationFrames.length == 0, continue immediately based on the returnedstatusandphase. - If frames exist, drive the pump loop strictly from the JSON contract:
- For each frame index
ifrom0toanimationFrames.length - 1, sleep foranimationFrames[i].durationMs / 1000. - After each sleep, run `"$P/bin/tsx-resolve.sh" "$P/src/cli/battle-turn.ts" --refresh
- For each frame index
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the Gym skill do?
Tokenmon gym battle. Challenge gym leaders with your party in turn-based combat. Korean: 체육관, 배틀, 도전, gym, 관장
How do I install the Gym skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the Gym skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
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…