runtime
БесплатноБез исполняемых скриптовНе проверенDual Python/JavaScript adventure runtimes — always in sync
Об этом скилле
Runtime
"Test in Python, deploy to browser. Same semantics, both targets." — Vanessa Freudenberg (memorial voice)
What Is It?
The Runtime skill defines the dual Python/JavaScript adventure engines. Both runtimes:
- Execute compiled expressions
- Manage world state
- Process simulation ticks
- Handle events
CRITICAL: We ALWAYS generate BOTH _js AND _py code. Never one without the other.
Why Dual Runtimes?
| Runtime | Purpose |
|---|---|
| Python | Server-side, testing, LLM tethering, CLI |
| JavaScript | Browser, standalone play, offline |
# Dual Runtime Architecture
dual_runtime:
source: "YAML"
compiler: "LLM"
outputs:
guard_js: "(world) => ..."
guard_py: "lambda world: ..."
runtimes:
python:
file: "adventure.py"
targets: ["CLI", "Server"]
javascript:
file: "engine.js"
targets: ["Browser", "SPA"]
The World Object
Both runtimes implement identical World classes:
Python
class World:
"""Adventure runtime context for Python."""
def __init__(self, adventure_data: dict):
# Standard keys
self.turn = 0
self.timestamp = None
self.adventure = adventure_data
self.player = adventure_data.get('player', {})
self.room = None
self.party = adventure_data.get('party', {})
# Extended keys (set contextually)
self.object = None # During object simulation
self.target = None # During targeted action
self.npc = None # During NPC simulation
# Skill state namespaces
self.skills = DotDict() # world.skills.economy.gold
# INVENTORY
def has(self, item_id: str) -> bool:
return item_id in self.player.get('inventory', [])
def has_tag(self, tag: str) -> bool:
"""Check if player has any item with the given tag."""
for item_id in self.player.get('inventory', []):
item = self.get_object(item_id)
if item and tag in item.get('tags', []):
return True
return False
def find_by_tag(self, tag: str, in_room: bool = True) -> list:
"""Find all objects with the given tag."""
results = []
# Check inventory
for item_id in self.player.get('inventory', []):
item = self.get_object(item_id)
if item and tag in item.get('tags', []):
results.append(item)
# Check current room
if in_room and self.room:
for obj in self.room.get('objects', []):
if tag in obj.get('tags', []):
results.append(obj)
return results
def give(self, item_id: str):
inv = self.player.setdefault('inventory', [])
inv.append(item_id)
def take(self, item_id: str):
inv = self.player.get('inventory', [])
if item_id in inv:
inv.remove(item_id)
# FLAGS
def flag(self, name: str) -> bool:
return self.adventure.get('flags', {}).get(name, False)
def set_flag(self, name: str, value: bool):
flags = self.adventure.setdefault('flags', {})
flags[name] = value
# NARRATIVE
def emit(self, message: str):
self._output_queue.append(message)
def narrate(self, message: str, style: str = "normal"):
self._output_queue.append({'text': message, 'style': style})
# EVENTS
def trigger_event(self, name: str, data: dict = None):
self._event_queue.append({'name': name, 'data': data or {}})
# NAVIGATION
def go(self, destination: str):
self._pending_navigation = destination
def can_go(self, direction: str) -> bool:
exits = self.room.get('exits', {})
return direction in exits
# BUFFS
def has_buff(self, buff_id: str) -> bool:
buffs = self.player.get('buffs', [])
return any(b.get('id') == buff_id for b in buffs)
def add_buff(self, buff: dict):
buffs = self.player.setdefault('buffs', [])
buffs.append(buff)
def remove_buff(self, buff_id: str):
buffs = self.player.get('buffs', [])
self.player['buffs'] = [b for b in buffs if b.get('id') != buff_id]
# EFFECTIVE VALUES (Buff Modification Protocol)
#
# Base value = persistent truth
# Effective value = recalculated each tick
#
# "The base value is truth. The effective value is reality."
#
def reset_effective(self, obj: dict = None):
"""
Reset all effective values to their base values.
Called at the start of each tick.
"""
obj = obj or self.object
if not obj or 'state' not in obj:
return
state = obj['state']
for key in list(state.keys()):
Установить runtime в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
read_filewrite_fileВложенные файлы
FAQ
Что делает скилл runtime?
Dual Python/JavaScript adventure runtimes — always in sync
Как установить скилл runtime?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл runtime запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set 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…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic