asnnetworks/floh-skills/image-gen
Claude Code and agent skill by asnnetworks/floh-skills
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Generate and edit raster images by driving a local coding-agent CLI that has an image tool — Codex (ChatGPT/OpenAI images) or Antigravity (Google Gemini images). Use whenever the user asks for an image to be generated, drawn, rendered, or made — 'generate an image of X', 'make me a picture', 'ask codex to draw Y', 'use gemini to generate Z', 'have codex picture what W looks like'. Also use when the user asks for an EXISTING image to be edited, changed, re-posed or given a variant, or for a new image matching a reference image they already have — 'make her point instead of thumbs-up', 'same character but waving', 'one more pose for this set', 'make one in this style'. Images default to <repo-root>/claude-image-gen/<name>-<provider>.png; also use this skill when the user names a different export folder or filename, such as the Desktop. Honour an explicitly named provider (codex / chatgpt / openai vs antigravity / gemini / google); default to Codex when none is named. Do NOT use for SVG/vector or code-native graphics, or for charts and data visualization (use dataviz).
Install
npx vskill@latest install asnnetworks/floh-skills/image-genSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as asnnetworks/floh-skills/image-gen.
Generating images through a local agent CLI
Claude has no image-generation tool. Two locally installed agent CLIs do. This skill drives them headlessly so an image request costs one command, not an investigation.
First run on a new machine
gen-image.sh runs scripts/preflight.sh before it does anything else, so a machine that cannot generate an image says so in a second rather than after a two-minute run that was never going to work.
| Exit | Means | What you do | |
|---|---|---|---|
| 0 | at least one provider is installed and usable | proceed | |
| 1 | installed but something is off (not signed in, untrusted workspace, no python3) | relay the warning, then proceed; it may still work | |
| 2 | neither provider installed | stop. Give the user the install instructions it printed |
On exit 2, do not fall back to an SVG or a CSS drawing. That is a different deliverable and the user did not ask for it. Say which providers you looked for and where.
How "first run" is detected. State lives at ~/.cache/floh-image-gen/preflight.json. No file means this skill has never run here, which is exactly when to check everything and walk the user through setup. When the file is there, preflight compares a fingerprint of the environment (each binary's path, size and mtime, plus the mtime of the Antigravity settings and of the Codex auth file) against the stored one. Unchanged means every probe is skipped, so the steady-state cost is a few stat calls. Changed means a re-check, because an upgrade, a reinstall or an edited settings file is precisely when a cached "it worked once" becomes a lie.
Set GEN_IMAGE_SKIP_PREFLIGHT=1 to bypass it, and GEN_IMAGE_STATE_DIR to move the state.
Provider selection
- The user named one — obey it. "codex" / "chatgpt" / "openai" →
codex.
"antigravity" / "agy" / "gemini" / "google" / "nano banana" → antigravity.
- No provider named → Codex.
- Codex missing → Antigravity, and say plainly which one you used.
- Neither installed → do not improvise an SVG. Report it and give the install
instructions at the bottom of this file. The script prints them too.
Do not silently switch providers after a failure — a failed Codex run is worth reporting, and the user may want a retry rather than a different model's aesthetic.
Verified environment (tested end-to-end, same brief through both)
Measured twice on different platforms. Use the row for the machine you are on; do not quote the other one's timings at the user.
| Platform | Antigravity | Codex | |
|---|---|---|---|
| macOS (2026-07-29) | 17 s, 1024×1024 JPEG | 2 m 21 s / 1 m 41 s, 1254×1254 PNG | |
| Linux / Ubuntu (2026-07-31) | ~20 s, 1024×1024 JPEG, 864 KB | ~2 m 30 s, 1254×1254 PNG, 2.7 MB |
The Linux run used the same brief as the macOS run (an open brass compass on oak, top-down, "no text or lettering anywhere") and reproduced the difference below independently: Codex obeyed the no-text instruction completely, Antigravity still engraved N/E/S/W and degree numbers on the dial.
Detail (macOS reference machine)
| Codex | Antigravity | ||
|---|---|---|---|
| Binary | codex — ~/.npm-global/bin/codex, v0.145.0 | agy — ~/.local/bin/agy (not on `PATH`; call the absolute path) | |
| Model | gpt-5.6-sol, effort xhigh (~/.codex/config.toml) | Gemini 3.6 Flash (High) (~/.gemini/antigravity-cli/settings.json) | |
| Image tool | built-in image_gen (via its own imagegen skill) | built-in generate_image | |
| Auth | ChatGPT sign-in. No `OPENAI_API_KEY` needed | Google sign-in, already done | |
| Headless flag | codex exec | agy --print / -p | |
| Writes result to | $CODEX_HOME/generated_images/<uuid>/ | ~/.gemini/antigravity-cli/brain/<conv-uuid>/<slug>_<ts>.jpg | |
| Output observed | PNG, 1254×1254 from "square, high quality" | JPEG, 1024×1024 | |
| Measured runs | 2 min 21 s, 1 min 41 s | 17 s |
Both got identical briefs (a persimmon still life, then a brass compass) and both followed them faithfully. Codex is slower and more literal — tighter studio crops, closer to the words. Antigravity is dramatically faster and invents more scene around the subject (it added a window, a desk lamp, a leather wallet unprompted), and it read "no text or lettering" as no overlay text while still engraving N/E/S/W on the compass dial.
Reach for Antigravity when speed matters or you want an atmospheric photograph; Codex when the brief is exacting and extra props would be wrong.
Where the image goes
Unless the user says otherwise, every generated image lands at:
<repo-root>is the git root of the working directory, falling back to the working
directory itself when it isn't a repo. The folder is created if absent.
<descriptive-name>is a real name for the subject —brass-compass-desk,
claude-portrait, hero-banner-dark — not image1 or output. Pass it with --name; the script otherwise slugs the brief's first line, which is a fallback, not a good name.
<provider>iscodexorantigravity, so the file says which model drew it.
It is the provider, deliberately, not the raw image-model id: Codex does not expose which image model its built-in tool used (its log mentions both gpt-image-1.5 and gpt-image-2 only because its own skill doc names both), and agy self-reports imagen-3.0-generate-002, which is an unverified self-claim. Don't bake a guess into a filename.
A user-specified folder or filename always wins — pass --dest. Only then does the image go somewhere else, and never overwrite: existing names get -v2, -v3.
The original always lands here, even when the deliverable doesn't. Often the generated image is raw material rather than the finished asset: it gets cropped, rescaled, converted, and dropped into the project somewhere specific. When that happens the derived asset goes to its project path and the untouched generator output still goes to claude-image-gen/. Do not leave it in a scratch directory — that is gone at the end of the session, and the generation is not reproducible.
Keep both halves when post-processing happened:
| File | What | |
|---|---|---|
<name>-<provider>.png | the output as the generator delivered it | |
<name>-<provider>-chroma.png | the pre-chroma-key version, when a green screen was used | |
<name>-vN-rejected-<provider>.png | earlier attempts, when it took more than one round |
The full-resolution original is typically 3–5× the size the project ends up using. Without it, a later re-crop, a different scale, or a different matte setting means re-generating — and the model will not draw the same image twice.
The fast path
--edit changes one thing about an existing image and carries the rest over. --ref supplies style/character references for a fresh generation and repeats. Both stage their inputs inside the agent's workspace, flattening alpha onto white on the way in — hand a model a transparent cutout and it may composite it on black and faithfully match the silhouette. In edit mode the default slug becomes <source-name>-edit.
--file stages a project file the agent reads for itself — a component, a token sheet, a copy deck. Repeatable. See Generating from your project below for when to reach for it.
Defaults to auto (Codex, else Antigravity) and to the destination above. The script picks the provider, runs it in a throwaway workspace, converts the format if the destination extension disagrees with what the provider emits, and copies the result out. It prints the final path, dimensions, and the agent's closing message; the 60 KB event stream goes to a log file instead of your context.
Write the brief with the Write tool. Never inline a long prompt in a shell string — an apostrophe in "Anthropic's" will break the quoting.
Then always `Read` the resulting image. You cannot describe or vouch for a picture you have not looked at, and both agents occasionally return something other than what was asked.
Driving them by hand
When the script doesn't fit — edits, variants, reference images:
Codex. Sandbox it and feed the prompt on stdin.
--skip-git-repo-check is required (a scratch dir is not a repo). -o captures only the final message. Tell Codex to copy its chosen output into its working directory under a fixed name, or you are left guessing at a session UUID.
Antigravity. Three constraints that are easy to trip over:
- Headless mode auto-denies permission-gated tools unless an allow-rule covers them —
otherwise run_command / write_to_file abort the run with a "headless mode cannot prompt" error. generate_image needs no permission at all, so the image path works with zero config: tell agy explicitly not to run shell commands or write files, and to print the absolute image path instead. Claude copies the file afterwards.
--dangerously-skip-permissionswould lift everything, but Claude Code's own classifier
blocks the flag and it auto-approves every tool. Don't reach for it.
- Run agy with a cwd inside one of its `trustedWorkspaces`. An untrusted workspace can
stall it at start. Do not hardcode a path for this: on macOS /private/tmp is trusted and $TMPDIR (/var/folders/...) may not be, while on a Linux box trustedWorkspaces was ["/root"] only, which makes /tmp untrusted and /private/tmp non-existent. The script's scratch_base() reads ~/.gemini/antigravity-cli/settings.json and picks a covered, writable directory (preferring ~/.cache/gen-image); GEN_IMAGE_TMPDIR overrides it.
Scrub the environment before you spawn
Agent-harness variables leak into the child process and get read as instructions. Measured: with ARGUS_BOARD_CMD exported, a Codex run spent six turns doing task-board diagnostics before it drew anything, then reported on the board rather than on the image.
Strip ARGUS_*, CLAUDE_* and ANTHROPIC_* from the child environment before invoking either CLI. Anything your own harness exports is a prompt the sub-agent did not ask for.
Portability
The script runs on macOS and Linux. Three things in the original were macOS-only and are now shimmed, with macOS behaviour unchanged:
| Was | Problem | Now | |
|---|---|---|---|
mktemp -d /private/tmp/... | that path does not exist on Linux, so mktemp fails outright | scratch_base(), driven by agy's own trustedWorkspaces | |
stat -f '%m %N' | BSD-only; GNU coreutils needs -c '%Y %n' and errors on -f | newest_image() in python3 | |
sips | macOS-only, and magick/convert are not guaranteed either | img_convert() / img_dims(), sips first then Pillow |
The stat one matters more than it looks: it sits in both fallback paths, so on Linux a run that needed the fallback reported "no image produced" while the image sat on disk. A failure that presents as absence is the expensive kind.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/image-gen/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/asnnetworks/floh-skills/image-gen)