Skip to content

About

An adaptation of the Codex plugin for ModRetro Chromatic

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

claude-code-chromatic-plugin

A Claude Code plugin for making Game Boy Color games for the ModRetro Chromatic and writing them to its rewritable cartridge. It is an adaptation of the "ModRetro Chromatic Plugin" for Codex, rebuilt as a single Claude Code skill with plain scripts.

Unofficial. Not affiliated with ModRetro, OpenAI or Anthropic.

Claude Album title screen: three figures under a street lamp in the snow Noelle in the practice room: She's lying! You were perfect.

Iris on the station platform at night: I was first. Two people holding each other on the platform as the last train leaves

What it does

Ask Claude for a game and it will:

  1. Set up the toolchain: GB Studio 4.3.2's headless compiler, GBDK-2020 4.5.0, PyBoy 2.7.0 and ModRetro's chromatic-cli 1.2.1, all under ~/.chromatic-dev.
  2. Write the game as a native GB Studio project, generated from one Python file (make_game.py) that draws the pixel art and declares scenes, actors, triggers and scripts. The project opens unchanged in the GB Studio editor.
  3. Build the ROM and playtest it in a headless emulator: scripted input, screenshots, and assertions on the game's variables, the player's position and the current scene.
  4. Put it on the handheld: stream the ROM to the Chromatic's screen without writing anything, or write it to the cartridge and verify it.

Install

In Claude Code (2.1.275 or later):

/plugin install chromatic --marketplace coreyschulz/claude-code-chromatic-plugin

On older versions:

/plugin marketplace add coreyschulz/claude-code-chromatic-plugin
/plugin install chromatic@chromatic-plugin

Or, without the plugin system, copy skills/chromatic into ~/.claude/skills/.

Requirements: macOS or Linux, Node 22+, git, Python 3.10 to 3.13. Developed and tested on macOS on Apple Silicon; the Linux paths in setup.sh are untested. The handheld is optional: everything up to the playtest runs without one.

Use

Set up the Chromatic plugin so I can create games, build ROMs, and run
automated playtests. Check what's already installed and prepare what's missing.
Make a visual novel called Claude Album at ~/games/ClaudeAlbum. A forlorn,
tragic love story with a couple of choices: Claude has to choose between two
heroines. Draw original sprites and write a soundtrack.
Flash it to the cartridge.

The first setup builds the GB Studio CLI from source and takes a few minutes.

The example

skills/chromatic/examples/ClaudeAlbum is the game a prompt like the second one produced: a short visual novel about one winter, three people and a band with one song. Three choices, four endings, 10-15 minutes a route. Everything in it is written in Python:

  • two 48x96 portraits with five expressions each, and seven painted backgrounds, drawn in code and fitted to the console's palette limits;
  • a five-piece soundtrack, composed as note data and written out as hUGETracker files;
  • a variable-width dialogue font, with each heroine's name in her own colour;
  • playthrough.py, which plays all four routes in the emulator and checks the scenes visited, the choices recorded and the ending reached.

Scenes from the playthrough

To build it yourself, with S=skills/chromatic/scripts:

$S/setup.sh apply                          # once
$S/generate.sh skills/chromatic/examples/ClaudeAlbum
$S/build.sh    skills/chromatic/examples/ClaudeAlbum
~/.chromatic-dev/venv/bin/python skills/chromatic/examples/ClaudeAlbum/playthrough.py

examples/MoonGarden is a smaller game in one file: a top-down garden with seeds to collect, beds to plant and a gate to open. It is the one to read first for the usual kind of game, with a player who walks around, actors, triggers and collisions.

Scripts

All in skills/chromatic/scripts. Claude runs them; they also work by hand.

Script Purpose
setup.sh doctor / apply [parts] Report or install the toolchain
gbs.py Python library that writes a GB Studio project
generate.sh [project] Run a project's make_game.py
build.sh <project> [out.gbc] Compile the project to a ROM
playtest.py <rom> STEP... Scripted headless playtest with screenshots
chromatic.mjs info/devices/detect/play/flash/reset ROM facts and handheld actions
updater_flash.py check/probe/write Second way to write the cartridge (below)

The skill's own instructions are in SKILL.md, with the authoring rules, the full GB Studio event list and the hardware notes under references/.

Writing the cartridge

Writing needs Developer Mode, which you activate yourself, once per computer, in ModRetro's Chromatic Firmware Updater app with the code that came with the handheld. The plugin never asks for or handles that code.

chromatic.mjs flash <rom> --confirm-erase has two routes:

  • cli: ModRetro's chromatic-cli write-homebrew.
  • updater: updater_flash.py, which drives the Python library inside the installed Chromatic Firmware Updater app, in the same order the app does when you pick a homebrew ROM in its Cart Clinic. It checks Developer Mode with ModRetro's service, refuses ROMs on ModRetro's list of released games, writes, then reads the whole game back and compares it with the ROM.

The default tries the CLI first. On at least one setup (an Anduril edition Chromatic on macOS 27) the CLI stops before erasing anything, with flash.write_failed in its drawing phase. flash then switches to the updater route and remembers the choice. The updater route is optional, macOS on Apple Silicon only, and set up with setup.sh apply updater; it needs the Firmware Updater app installed and closed. It was built against app v1.7.5 and depends on that app's internals, so an app update can break it. references/hardware.md has the details.

Flashing replaces whatever is on the cartridge, and nothing can be backed up first. Only flash games you made.

What gets downloaded

Nothing third-party is stored in this repository. setup.sh downloads, into ~/.chromatic-dev:

  • GBDK-2020 4.5.0 from its GitHub release (checksum verified);
  • GB Studio at the v4.3.2 commit, built locally into its headless CLI;
  • PyBoy 2.7.0 and Pillow from PyPI;
  • @modretro/chromatic-cli 1.2.1 from npm (ModRetro's closed-source tool);
  • for the optional updater route, a standalone Python 3.10 from python-build-standalone (checksum verified) and pyinstxtractor-ng, used to unpack the library from your own installed copy of the Firmware Updater app.

Each of those has its own licence.

Credits

The Codex plugin this adapts is by ModRetro and OpenAI.

Licence

MIT. See LICENSE.

About

An adaptation of the Codex plugin for ModRetro Chromatic

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages