ChatGPT App Ref Refresh
Workflow
Use this skill from the repository root that should receive ./ref.
- Verify the current working directory is the intended workspace.
- Run the bundled script:
node .agents/skills/codex-app-ref-refresh/scripts/refresh-codex-ref.mjs
The script runs three steps in order:
- Sync — deletes only
<cwd>/ref, then extracts/Applications/ChatGPT.app/Contents/Resources/app.asarinto a freshrefdirectory. - Format — runs Prettier (
--write --ignore-path /dev/null) over every extracted.jsand.cssfile, skipping anynode_modulesdirectory underref. This intentionally bypasses.gitignoreand.prettierignoreso an ignoredref/directory is still formatted. After writing, the script verifies JavaScript files with--list-different --ignore-path /dev/nulland reruns Prettier on any remaining JS files. CSS is formatted but not used as a hard verification gate because bundled Tailwind CSS can be non-idempotent under Prettier. This step is always on by default; do not skip it unless the user explicitly asks. - Report — prints the count of formatted files and a completion line.
Formatting the synced JS and CSS with Prettier is a required part of the refresh, not an optional extra. The minified asar output is unreadable until formatted, so always let the Prettier step run. Only pass --skip-format when the user explicitly wants raw, unformatted extraction.
Verify
After the run, confirm formatting actually completed before reporting success:
- The script logs
Formatting N JS/CSS file(s) with Prettier, ignoring git/prettier ignore files...,Prettier verification complete., and thenChatGPT app ref refresh complete. - If the script logs
Prettier verification found N file(s) needing another pass; reformatting..., that is acceptable only when it is followed byPrettier verification complete. - If formatting was skipped, the script logs
Skipping Prettier formatting.instead — treat that as an incomplete refresh unless--skip-formatwas intentional. - Spot-check that a known JS or CSS file under
refis multi-line (Prettier-formatted), not a single minified line. - If running a manual Prettier verification against
ref, include--ignore-path /dev/null; otherwise Prettier may skip files becauseref/is git-ignored. Prefer strict manual checks for JS files only.
Options
- Set
CHATGPT_APP_ASAR=/path/to/app.asarbefore running when the ChatGPT app bundle lives somewhere else. The legacyCODEX_APP_ASARvariable remains supported for compatibility. - Pass
--skip-formatonly when the user explicitly wants extraction without Prettier formatting. - Pass
--dry-runto inspect the resolved paths without deleting or extracting anything.
Safety
- Do not run the script from the wrong directory; it intentionally replaces
./ref. - Prefer the script over manually chaining
rm,npx @electron/asar, andprettier, because the script guards the target path and consistently excludesref/node_modules. - After running, report the extracted
refpath and whether formatting completed.