game_of_life
Skill34 starsChanged 6 months agoMITView on GitHub
Use this skill when the user wants to play Conway's Game of Life, Rainbow Life, a Mosaico life demo, paint living tiles on the LCD, or launch an interactive mosaic / cellular automata game. Requires a display. Tuned for Mosaico QSPI AMOLED (command-mode GRAM): each frame uses begin_frame, draw, present, end_frame; avoid present_full and clear=false partial paths on current firmware. Chrome-less full-screen ink canvas — no HUD buttons and no generation/status text. Uses LCD touch gestures when available; otherwise falls…
In this repository42 other files it gives its agents.
- air_mouseSkill
- balance_ballSkill
- bilibili_up_fansSkill
- camera_previewSkill
- china_a_share_quoteSkill
- clock_dial_demoSkill
- cloudmusicSkill
- codex_usage_dashboardSkill
- current_ip_infoSkill
- current_weatherSkill
- dfrobot_matrix_lidar_8x8_i2cSkill
- dfrobot_stcc4_i2cSkill
- dinoSkill
- example_skillSkill
- flappybirdSkill
- flashbackSkill
- game_2048Skill
- gimbal_color_detectSkill
- gimbal_motion_detectSkill
- github_repo_starSkill
- jump_prince_gameSkill
- lcd_touch_paintSkill
- mazeSkill
- mosaico-musicalSkill
- movement_detectionSkill
- network_radioSkill
- number_puzzleSkill
- reaction_gameSkill
- servo_dogSkill
- snake_gameSkill
- snakeSkill
- stock_quotes_displaySkill
- tetris_clockSkill
- token_usageSkill
- unihiker_buttonSkill
- unihiker_expansion_batterySkill
- unihiker_expansion_irSkill
- unihiker_expansion_motor_controlSkill
- unihiker_expansion_servo_controlSkill
- unihiker_expansion_WS2812Skill
- weather_clockSkill
- whack_mole_gameSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
Use this skill when the user wants to play Conway's Game of Life, Rainbow Life, a Mosaico life demo, paint living tiles on the LCD, or …
- Very specific: line 53
Run exactly one script with lua_run_script unless the user explicitly asks to run another application.
- Very specific: line 55
If lua_run_script returns an error, report that error directly to the user.
- Very specific: line 78
Use lua_run_script_async for the async form when available.
- Very specific: line 97
Run {CUR_SKILL_DIR}/scripts/mosaico_life.lua with an empty args object unless a non-default IMU device name is required.
- Distinctive: line 104
If the display is missing, say so and do not run the script.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Game of Life
Use this skill when the user wants to play Conway's Game of Life, Rainbow Life, a Mosaico life demo, paint living tiles on the LCD, or launch an interactive mosaic / cellular automata game.
Requires a display. Tuned for Mosaico QSPI AMOLED (command-mode GRAM): each frame uses begin_frame, draw, present, end_frame; avoid present_full and clear=false partial paths on current firmware. Chrome-less full-screen ink canvas — no HUD buttons and no generation/status text. Uses LCD touch gestures when available; otherwise falls back to a button. IMU shake is optional and soft-required via pcall(require, "imu"). On current Mosaico firmware the Lua imu module is not registered, so shake-to-scatter is temporarily unavailable even though the board has a hardware IMU. When imu is present and the board declares imu_sensor (or args.imu_device is set), shaking still scatters life. Audio is not required.
Run exactly one script with lua_run_script unless the user explicitly asks to run another application.
If lua_run_script returns an error, report that error directly to the user. Do not retry with changed arguments unless the user asks.
Launch
Tool call:
{"path":"{CUR_SKILL_DIR}/scripts/mosaico_life.lua","args":{}}Mosaico / QSPI notes
- Target panel: 480x480 QSPI AMOLED (CO5300-class GRAM). A full RGB565 frame is about 450 KB, so refresh uses paced full-frame present rather than RGB-style continuous scanout.
- Safe Lua display path on current Mosaico image: begin_frame({ clear = true }) then draw then present() then end_frame().
- Shake/IMU: code keeps optional IMU support, but without the Lua imu module shake does nothing until firmware enables it.
Optional long-running launch (preferred for interactive play so the agent stays responsive):
{"path":"{CUR_SKILL_DIR}/scripts/mosaico_life.lua","args":{},"exclusive":"display","replace":true,"name":"game_of_life"}Use lua_run_script_async for the async form when available.
Optional args:
{"path":"{CUR_SKILL_DIR}/scripts/mosaico_life.lua","args":{"imu_device":"imu_sensor","shake_sensitivity":1.0,"touch_ms":4,"display_ms":36,"step_ms":110,"target_cells":240,"cell_px":16}}imu_device: board_manager device name for the IMU (defaultimu_sensor). Use this only when the board YAML uses a non-default device id — never hard-code a board product name.shake_sensitivity: number > 0 (default1.0). Higher = easier to trigger physical shake.touch_ms: touch/button poll interval in ms (default4, ~250 Hz). Lower = snappier strokes.display_ms: visual refresh interval in ms (default25on RGB framebuffer panels,80on SPI/QSPI panels).step_ms: Life generation interval (default90on RGB framebuffer panels,150on SPI/QSPI panels).target_cells: soft budget for grid tiles (default900on RGB framebuffer panels,240on SPI/QSPI panels). Larger panels grow cell pixels instead of denser grids.cell_px: force tile pixel size (overridestarget_cellssizing). Use only for manual tuning.
Recommended flow
- Activate the
board_hardware_infoskill and confirm a display is declared. LCD touch is preferred; a button is enough for pause / reset / shake. If an IMU is declared (commonlyimu_sensor), physical shake is available automatically. - Run
{CUR_SKILL_DIR}/scripts/mosaico_life.luawith an emptyargsobject unless a non-default IMU device name is required. - Tell the user the chrome-less controls:
- Drag: paint living cells (drag over a live cell to erase).
- Tap: place the next seed pattern.
- Long-press ≈ 700 ms: reset and reseed.
- Physically shake the board when IMU is present.
- Button-only boards: hold ≈ 700 ms to reset and reseed; physical shake requires an IMU.
- If the display is missing, say so and do not run the script. Missing IMU is not fatal — shake still works via button hold on button-only boards.
- On script error, report the error text and stop.
Gameplay notes
- Rule: classic B3/S23 Conway Life with Rainbow hue inheritance.
- Shake moves life in 3×3 blocks (1–3 steps) and plants viable sparks so the board does not die instantly.
- Physical shake detection is relative to resting acceleration (scale-free), so it works across IMU backends without per-chip thresholds.
- A restrained colored background and edge feedback add atmosphere without particle halos or on-screen chrome.
- Tile density is panel-aware: about 900 cells on RGB framebuffer panels and about 240 on SPI/QSPI panels.
- SPI/QSPI panels automatically use horizontal dirty-band presents, final-state transitions, and a lower default cadence; RGB framebuffer panels retain the richer high-frame-rate path.
- Single-device port of the original web demo; multi-tile linking is out of scope for this Lua skill.
References
- Play and control details:
read_file("{CUR_SKILL_DIR}/references/gameplay.md")
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

