jimliu/decode-codex · Archived

codex-app-ref-refresh

Refresh the local ChatGPT app reference source from the installed macOS ChatGPT.app asar.

First seen Jun 26, 2026

Installation

$ npx skills add jimliu/decode-codex --skill codex-app-ref-refresh

Summary

  • Refresh the local ChatGPT app reference source from the installed macOS ChatGPT.app asar.
  • Use when Codex needs to get the latest installed ChatGPT app code, recreate ./ref from /Applications/ChatGPT.app/Contents/Resources/app.asar, or format extracted JavaScript and CSS while excluding ref/node_modules.

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from jimliu/decode-codex.

npx skills add jimliu/decode-codex

Browse all from jimliu/decode-codex

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 115
Default branch main
Open issues 0
Status Archived

Skill metadata

Parsed from SKILL.md frontmatter.

Declared agents codex

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,506 B
  • docs SUMMARY.md 333 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 2 installs

SKILL.md

ChatGPT App Ref Refresh

Workflow

Use this skill from the repository root that should receive ./ref.

  1. Verify the current working directory is the intended workspace.
  2. Run the bundled script:
node .agents/skills/codex-app-ref-refresh/scripts/refresh-codex-ref.mjs

The script runs three steps in order:

  1. Sync — deletes only <cwd>/ref, then extracts /Applications/ChatGPT.app/Contents/Resources/app.asar into a fresh ref directory.
  2. Format — runs Prettier (--write --ignore-path /dev/null) over every extracted .js and .css file, skipping any node_modules directory under ref. This intentionally bypasses .gitignore and .prettierignore so an ignored ref/ directory is still formatted. After writing, the script verifies JavaScript files with --list-different --ignore-path /dev/null and 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.
  3. 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 then ChatGPT 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 by Prettier verification complete.
  • If formatting was skipped, the script logs Skipping Prettier formatting. instead — treat that as an incomplete refresh unless --skip-format was intentional.
  • Spot-check that a known JS or CSS file under ref is 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 because ref/ is git-ignored. Prefer strict manual checks for JS files only.

Options

  • Set CHATGPTAPPASAR=/path/to/app.asar before running when the ChatGPT app bundle lives somewhere else. The legacy CODEXAPPASAR variable remains supported for compatibility.
  • Pass --skip-format only when the user explicitly wants extraction without Prettier formatting.
  • Pass --dry-run to 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, and prettier, because the script guards the target path and consistently excludes ref/node_modules.
  • After running, report the extracted ref path and whether formatting completed.