agentsclimarketplace

Codex imagegen

Skill Syo-M/fable-frontend-skills/plugin/skills/codex-imagegen

Generate or AI-edit images by delegating to the Codex CLI ($imagegen / gpt-image) — sample banners, hero visuals, demo assets, image-to-image edits. Use whenever a task needs image GENERATION or AI photo editing (Claude Code cannot generate images itself). 日本語の依頼例:「画像を生成して」「サンプル画像を作って」「この写真を加工して」「バナー/ヒーロー画像が必要」。NOT for resizing/compressing existing assets (use `images-media`).From its SKILL.md

Install
npx -y skills add Syo-M/fable-frontend-skills --skill codex-imagegen

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

3 things to look at

  • reads credentialsReads from 1 credential source: `$CODEX_BIN`.
  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
  • runs commandsInstructs the agent to run 4 commands, including `codex exec -C <workdir> -s workspace-write --skip-git-repo-check "<instruction>"` and 3 more.

SKILL.md

4.5 KB, 962 tokens by cl100k_base, as published. Nobody here has run it

Codex imagegen — delegate image generation, keep the code here

Claude Code cannot generate images. When a task needs generated or AI-edited images, delegate to the Codex CLI's built-in $imagegen tool (gpt-image): it runs on the operator's ChatGPT subscription — no API key, no per-call billing, i2i editing included. Division of labor: code and prompts are authored here; pixels come from Codex.

Invocation

  • Scriptable default: codex exec -C <workdir> -s workspace-write --skip-git-repo-check "<instruction>" via execFileSync (array args, never shell strings). Timeout ~15 min per call; run batches sequentially (rate limits), support --slug re-runs and skip-existing + --force.
  • Resolve the binary: $CODEX_BIN env → codex on PATH → /Applications/Codex.app/Contents/Resources/codex (macOS app bundles the CLI). Verify with --version before batching.
  • MCP registration (claude mcp add --transport stdio codex -- codex mcp-server) is the interactive alternative; codex exec stays the default for reproducible pipelines.

Sandbox isolation — non-negotiable

Point -C at a scratch dir (os.tmpdir() subdir), NEVER the repo. The instruction embeds content-derived text (templates, user-editable YAML), so prompt injection through content must not reach a repo-writable agent — with -C repoRoot an injected instruction could rewrite package.json and land RCE on the next npm run dev. The wrapper script alone copies finished artifacts from the scratch dir into the repo.

Instruction anatomy (what actually controls quality)

  1. Verbatim prompt block: wrap the exact prompt in --- delimiters with "Use EXACTLY this prompt, verbatim, without rewriting it" — otherwise Codex paraphrases and the published prompt no longer matches the sample it claims to produce.
  2. Native sizes only: gpt-image emits 1024x1024 / 1536x1024 / 1024x1536. Other ratios: generate the nearest orientation → center-crop → resize (sips on macOS, sharp elsewhere).
  3. Bleed instruction whenever cropping: "the image will be center-cropped to WxH; treat the outer Npx as expendable bleed — background only; ALL text and critical elements inside the surviving central region." Without it, edge-anchored text gets cut (bottom ribbons are the classic casualty).
  4. i2i is two steps: generate the source image first, then EDIT mode referencing the input path ("treat 'the attached photo' as the input image at <path>"). Keep the source artifact — before/after is the proof the edit works.
  5. Close with "Save the final image to <path> (PNG). Do not edit any other files."

Quality gate — generation is not done at exit 0

  • Review every image visually before publishing. For Japanese text: character-by-character — models garble kanji, and a wrong glyph on a shipped banner is worse than none.
  • Check the crop actually preserved all text, and (i2i) that the source subject/label survived the edit.
  • Retakes are normal (budget 2–3 per image); re-run per slug, never the whole batch. Trial ONE image before any batch — composition bugs (missing bleed, wrong ratio) waste a full batch otherwise.
  • Quota is the operator's ChatGPT plan: dozens of images per session is fine, plan accordingly.

Pipeline sketch

const work = path.join(os.tmpdir(), 'imagegen-work');           // sandbox, not the repo
execFileSync(codex, ['exec', '-C', work, '-s', 'workspace-write',
  '--skip-git-repo-check', instruction(prompt, workFile)], { timeout: 900_000 });
if (!existsSync(workFile)) throw new Error('not saved');
execFileSync('sips', ['-c', cropH, cropW, workFile]);            // center-crop to target ratio
execFileSync('sips', ['-z', finalH, finalW, workFile]);          // resize to target px
copyFileSync(workFile, repoTarget);                              // script does the repo write

Derive the filled prompt from the same single source the app renders (shared data + one fill function, parity-tested) — a stored copy of the prompt WILL drift from the template that generated it.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Gives 0 of the 12 instructions most context ai engineering skills give in 962 tokens

Counted across 1,328 of the 2,349 authors here whose files we hold, read 2026-09-06

  • Dispatch a fresh subagent for each taskin 76 of 1328, across 59 files
  • Perform spec compliance review before code quality reviewin 44 of 1328, across 34 files
  • Dispatch a final code reviewer after all tasksin 38 of 1328, across 26 files
  • Answer subagent questions before allowing implementationin 36 of 1328, across 26 files
  • Use the least powerful model capable of the taskin 33 of 1328, across 26 files
  • Create a TodoWrite list for all tasksin 32 of 1328, across 22 files
  • Perform a task review after each implementationin 31 of 1328, across 24 files
  • Extract all tasks and context from the planin 29 of 1328, across 20 files
  • Provide full task text to subagentsin 28 of 1328, across 20 files
  • Use git worktrees for isolated workspacesin 25 of 1328, across 20 files
  • Specify the model explicitly when dispatching a subagentin 23 of 1328, across 18 files
  • Execute all tasks from the plan without stoppingin 21 of 1328, across 16 files

Said here and by no other author read

  • Use a scratch directory for all image generation
  • Wrap prompts in delimiters to prevent rewriting
  • Include bleed instructions for center-cropped images
  • Perform image-to-image edits in two steps
  • Review every image visually before publishing
  • Verify Japanese text character by character

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.