eggs
Original:🇺🇸 English
Translated
2 scriptsChecked / no sensitive code detected
Spawn, stop, change state, or manage a standalone animated 2D desktop sprite companion. Use when the user invokes `/eggs`, asks for an animated desktop companion, wants a roaming sprite character, or asks to stop/status/restart/change the companion process.
20installs
Sourcelarchliu/eggs
Added on
NPX Install
npx skill4agent add larchliu/eggs eggsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Eggs
Quick Start
When the user asks to spawn the desktop companion, including , run the bundled runtime from this skill directory:
/eggsbash
python3 scripts/egg_desktop.py startWhen the user asks to stop it:
bash
python3 scripts/egg_desktop.py stopFor status:
bash
python3 scripts/egg_desktop.py statusFor restart:
bash
python3 scripts/egg_desktop.py restartRemote interaction is opt-in. To connect this skill to a separately deployed remote sprite server:
bash
python3 scripts/egg_desktop.py remote server http://localhost:8787
python3 scripts/egg_desktop.py remote upload dino
python3 scripts/egg_desktop.py remote
python3 scripts/egg_desktop.py remote statusremoteremote randomFor invite rooms:
bash
python3 scripts/egg_desktop.py remote room ABC123To leave:
bash
python3 scripts/egg_desktop.py remote leaveFor state changes:
bash
python3 scripts/egg_desktop.py state unborn
python3 scripts/egg_desktop.py state ready
python3 scripts/egg_desktop.py state hatching
python3 scripts/egg_desktop.py state hatched
python3 scripts/egg_desktop.py state walk
python3 scripts/egg_desktop.py state sleep
python3 scripts/egg_desktop.py state eat
python3 scripts/egg_desktop.py state drink
python3 scripts/egg_desktop.py state play
python3 scripts/egg_desktop.py state roar
python3 scripts/egg_desktop.py state attackTo install a replacement spritesheet:
bash
python3 scripts/egg_desktop.py spritesheet /path/to/dino.png dino
python3 scripts/egg_desktop.py restartSprite Tools
Use the bundled Swift tools in when asked to process, extract, validate, or merge desktop companion sprite sheets.
When tools are run with , they write and to the requested output directory and also install copies to and . If extraction is run without , use the input image stem and write .
tools/--name <sprite><sprite>.png<sprite>.json~/.codex/eggs/<sprite>.png~/.codex/eggs/<sprite>.json--name<input-name>_spritesheet.png/jsonBuild tools into a temporary location instead of committing platform-specific binaries:
bash
mkdir -p .swift-module-cache
CLANG_MODULE_CACHE_PATH="$PWD/.swift-module-cache" \
swiftc -module-cache-path "$PWD/.swift-module-cache" \
eggs/tools/extract_sprite.swift \
-o /tmp/extract_spriteExtract a bordered grid:
bash
/tmp/extract_sprite <input.png> <output-dir> --prefix <name>Extract a borderless regular grid:
bash
/tmp/extract_sprite <input.png> <output-dir> \
--grid uniform \
--columns <n> \
--rows <n> \
--prefix <name>Force multiple source sheets into a common frame canvas:
bash
/tmp/extract_sprite <input.png> <output-dir> --frame-size 251 --prefix <name>Merge extracted sheets vertically:
bash
CLANG_MODULE_CACHE_PATH="$PWD/.swift-module-cache" \
swiftc -module-cache-path "$PWD/.swift-module-cache" \
eggs/tools/merge_spritesheets.swift \
-o /tmp/merge_spritesheets
/tmp/merge_spritesheets <output-dir> [--name <sprite>] <sheet-a.json> <sheet-b.json>Validation helpers:
bash
swiftc eggs/tools/check_sprite.swift -o /tmp/check_sprite
swiftc eggs/tools/bounds_sprite.swift -o /tmp/bounds_spriteRuntime Behavior
- Use only the bundled ; it has no third-party Python dependencies.
scripts/egg_desktop.py - On macOS, the manager compiles and launches the bundled native Swift/Cocoa overlay at first run. This requires and the macOS Swift compiler, but no npm, Electron, PyPI packages, or external assets.
python3 - When remote interaction is enabled, the Swift runtime remains the display runtime. A separate Python sidecar handles remote WebSocket sync and writes for Swift to render remote peers.
~/.codex/eggs/remote-peers.json - On non-macOS, the manager falls back to its Python/Tk runtime. If Tkinter is unavailable, report that the local Python build cannot display the fallback GUI.
- The script launches a detached local GUI process and stores its PID/log under .
~/.codex/eggs/ - Re-running should not create duplicates; use
startwhen the user wants a fresh companion.restart - The runtime reads the current sprite and state from .
~/.codex/eggs/state.json - The runtime reads optional user animation names from under
~/.codex/eggs/config.json, where each animation object usesanimations.<sprite>.<name>androw.loop - The runtime first looks for a user-installed sprite at with optional
~/.codex/eggs/<sprite>.png, then bundled skill assets at~/.codex/eggs/<sprite>.jsonandassets/<sprite>.png, then falls back to a simple procedural placeholder drawing.assets/<sprite>.json - Resolve bundled assets relative to this installed skill directory; never rely on the original repo path or any absolute path.
/Users/... - Do not hardcode the frame size. The animation runtime reads and
frameWidthfromframeHeightto slice the PNG and size the desktop window. It only falls back to 251x251 if metadata is missing or invalid.<sprite>.json - The bundled spritesheet currently has 251x251 frames in a 5x11 regular grid.
- keeps
assets/dino.jsonasimage, relative to the JSON file's own directory. Generated sprite metadata should stay portable in the same way.dino.png - Without custom config, each row is a state: ,
unborn,ready,hatching,hatched,walk,sleep,eat,drink,play,roar.attack - With custom config, accept animation names from , for example
config.json,"idle": { "row": 3, "loop": true }, or"attackOnce": { "row": 10, "loop": false }."roar3": { "row": 9, "loop": 3 } - Chinese state requests are supported through aliases such as ,
睡觉,吃鸡腿,喝水,玩耍, and咆哮.攻击 - The and
statecommands writesprite; running windows poll it and switch animation rows or sprite assets without restarting.~/.codex/eggs/state.json - The desktop window can be repositioned by dragging it with the mouse.
- Remote settings are stored in , anonymous device identity in
~/.codex/eggs/remote.json, and downloaded remote peer indexes in~/.codex/eggs/client.jsonwith shared blob files under~/.codex/eggs/remote/<peer_id>/. Remote cache never overwrites local~/.codex/eggs/remote/blobs/.<sprite>.png/json - Remote upload remembers the selected sprite name, and room/random interaction uses for the live WebSocket session rather than resolving peers through the public sprite detail endpoint.
device_id + sprite name - The remote Go server is not part of the installed skill; it lives at the repository root under and should be deployed separately.
server/ - Sprite preparation tools are bundled under ; do not rely on old root-level compiled binaries.
tools/
Notes For Codex
If the user types or asks to spawn the companion, do the start action immediately and briefly report whether it launched. If the user asks to change companion state, run the command with the closest matching state name. Do not open or explain the script unless launch fails.
/eggsstate