What does HeiGe Codex Skin Studio do?
The goal is to complete theme switching quickly. Do not expand it into a design platform, do not split into multiple layers of assets, and do not modify app.asar.
First-time Installation
Run:
open "$HOME/.agents/skills/heige-codex-skin-studio/scripts/install.command"
The installation location is fixed at ~/.codex/heige-codex-skin-studio.
User Provides an Image
- Confirm the image is a non-empty PNG, JPG, JPEG, or WebP.
- Create a theme using Codex's built-in Node:
"/Applications/ChatGPT.app/Contents/Resources/cua_node/bin/node" \
"$HOME/.codex/heige-codex-skin-studio/src/cli.mjs" create \
--image "/absolute/path/hero.webp" --name "Theme Name"
- Read the
idfrom the returned JSON. - Inform the user that applying the theme will gracefully quit and reopen the current Codex.
- If the user has requested immediate application, open the apply script with the
id:
open "$HOME/.codex/heige-codex-skin-studio/scripts/apply.command" --args "theme-id"
User Only Provides a Creative Description
First, use the imagegen skill available in the current environment to generate a complete horizontal UI main image. The image must leave readable space on the left for navigation and at the bottom for the input area. Do not bake buttons, menu text, or chat content into the image. Once you have the local image path, proceed as described in "User Provides an Image."
If image generation is not available, simply ask the user to provide a local image. Do not request additional API keys.
Built-in Presets
The default preset is the high-precision miku-488137. There are also 9 lightweight presets (color scheme + background image):
genshin-dawn, genshin-night, wuthering-tide, wuthering-echo, naruto-hokage, naruto-sasuke, deepspace-dawn, deepspace-star, dalao-dianyan (Easter egg: "Big Boss · Lighting Up").
open "$HOME/.codex/heige-codex-skin-studio/scripts/apply.command" --args "miku-488137"
After applying any preset, the remaining presets are available via the 🎨 menu at the top center for one-click switching.
Critical Rules for Agents Running Inside Codex
Applying a skin will gracefully quit and restart the Codex application itself, interrupting your current task. Restart means success – this is expected behavior:
- During installation, always use the
HEIGE_SKIP_APPLY=1environment variable to skip automatic application. - Make apply the very last step of the entire task. Before executing, inform the user: "Codex will restart, and the skin will take effect after the restart."
- After the restart, absolutely do NOT retry install or apply; otherwise, it will cause an infinite restart loop. Leave verification to the user's eyes or to tools outside Codex.
- If the user wants the skin to "persist across restarts," have them run
scripts/enable-persist.command(macOS). This installs a launchd watchdog with a 10-minute cooldown that automatically restores the skin. The agent inside Codex must still NOT retry apply on its own. To disable, usescripts/disable-persist.command. - If the debug port does not open after a restart (apply reports port not ready), do not loop for debugging. There are two scenarios: the old instance hasn't fully quit and has taken over the new one (ask the user to fully quit with Cmd+Q and re-run the script); or the parameters are in the command line but the port still won't open (the current Codex version may have disabled the debug port – ask the user to open a GitHub issue with the version number). The first troubleshooting step is to run
node src/cli.mjs doctor: thediagnosisfield in the output directly gives a classification (ok / flag-present-port-closed / running-no-flag / not-running). When filing an issue, attach the entire doctor JSON. The error messages from the scripts already contain various guides; relay them to the user verbatim.
In-app Switch Menu
After applying any theme, a 🎨 button appears at the top center of Codex. Clicking it allows instant switching among all installed themes and the native interface without running commands. The "Hide this button" option at the bottom of the menu collapses the button into a small semi-transparent dot (state persists across restarts). Clicking the dot restores the full button. After creating a new theme, re-run apply.command to refresh the menu list.
The "+ Custom Image" option in the menu allows users to directly upload a local image. The page automatically compresses the image, extracts a color scheme based on the image's style, and immediately applies it. The result is stored in Codex's local storage. On restart, reapplying via the script will automatically restore the menu entry. The custom slot has a single slot; uploading a new image overwrites the previous one. When the user just wants to quickly try an image, prioritize this entry. Use the create command only when building a distributable theme.
Pause or Restore Original Interface
open "$HOME/.codex/heige-codex-skin-studio/scripts/pause.command"
This only removes the live-injected <style> and the switch menu, since the tool never modifies Codex application files.
Optional Pet
Only run this if the user explicitly requests the Miku Future pet:
open "$HOME/.codex/heige-codex-skin-studio/custom-pet/install.command"
Boundaries
- Currently only supports macOS.
- CDP is fixed to listen on
127.0.0.1, default port9341. - After a full reload of Codex's renderer, the theme must be reapplied.
- Does not modify the application bundle, does not inject ASAR, does not handle Windows or Linux.