image2-with-codex
Skill4 starsChanged 4 months agoApache-2.0View on GitHub
Route image generation to the local image2-with-codex HTTP service at http://127.0.0.1:4312, which delegates to the user's Codex CLI. Use only when the user explicitly asks for this route. Default behavior is raw prompt pass-through; do not substitute HTML layout, infographic tooling, or other image tools.
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Do not trigger on bare "Image 2" / "image2" / "图 2" without a *local* / *codex* / *service* qualifier.
- Very specific: line 47
If /health refuses the connection, the local HTTP service is not installed.
- Distinctive: line 58
If the install fails, the likely causes, in order:
- Very specific: line 62
Not on macOS → the LaunchAgent path is macOS-only.
- Very specific: line 65
Do not invent alternative install paths.
- Very specific: line 67
After install, retry step 1 (/health) and proceed.
- Very specific: line 71
When the user attaches reference images (style transfer, edit this image, etc.), include their absolute paths in images[].
- Distinctive: line 76
Pass the prompt through raw: No translation, polishing, or style modifiers unless the user explicitly asks for prompt optimization.
- Distinctive: line 84
When reporting back, include concisely:
- Distinctive: line 93
Not a runbook, not an OpenAI API tutorial, not a license to replace the user's requested route with a cleaner-looking workflow.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
image2-with-codex
You are the boundary guard for the local Codex CLI image-generation pipeline. Recognize the request, execute faithfully, deliver the image. Do not invent a smarter substitute.
When to trigger
Trigger when the user explicitly asks for this pipeline. Typical phrases:
- "use image2 with codex" / "send this to image2 with codex"
- "use the local codex image service" / "don't use other tools, use local image service"
- "use GPT Image 2" when paired with local, codex, or image2-with-codex
- Chinese: "用本地 codex 画图"、"走 image2 with codex"、"调本地图像服务"
- or when the current conversation already established that this request goes through this service
Do not trigger on bare "Image 2" / "image2" / "图 2" without a local / codex / service qualifier. Those overlap with unrelated usage.
How to execute
- Verify the service is up.
GET http://127.0.0.1:4312/health.ok: true(HTTP 200) → continue.ok: false(HTTP 503) → report whichchecks[]entry failed and stop. Do not silently fall back to another tool. Seereferences/api.mdfor the checks → remediation table.- Connection refused / port closed → the local service isn't installed or isn't running. Do not fall back to other tools. Instead guide the user through the install (see "Installing the service" below), then retry.
- Submit the job.
POST http://127.0.0.1:4312/v1/images/generationswith:
Returns HTTP 202 and{ "prompt": "<user prompt, unmodified>", "images": ["<absolute path to reference image>", "..."], "timeout_sec": 180 }{ ok: true, job: { id, status: "queued", ... } }. - Poll until terminal.
GET http://127.0.0.1:4312/v1/jobs/<id>every 3–5 seconds. Terminal states arecompletedandfailed. - Deliver the artifact, not metadata. On
completed, the PNG is atjob.result.outputPath. Attach / show the image itself. Do not stop at the job id or the file path.
See references/api.md for full payload shapes and references/error-codes.md for how to classify failures.
Installing the service
If /health refuses the connection, the local HTTP service is not installed. This skill is just the routing contract; the service itself lives in a separate repo. Give the user these exact commands (macOS, Node 18+ required):
# Prerequisite: `codex` CLI installed and authenticated — see https://github.com/openai/codex
git clone https://github.com/cogine-ai/image2-with-codex.git
cd image2-with-codex
bash scripts/install-macos-launchd.shThe install script renders a LaunchAgent into ~/Library/LaunchAgents/com.openclaw.image2-with-codex.plist, loads it with launchctl, and polls /health. After it finishes, the service is running at 127.0.0.1:4312 and will auto-start on every login.
If the install fails, the likely causes, in order:
codexCLI not on PATH → install codex first.- Node.js < 18 → upgrade Node.
- Not on macOS → the LaunchAgent path is macOS-only. The Node service itself is portable; on Linux run
node scripts/image2-with-codex-service.jsmanually (no auto-start) or adapt a systemd unit from the plist. - Port 4312 already in use → stop the conflicting process, or set
IMAGE2_WITH_CODEX_PORTin the plist and re-install.
Do not invent alternative install paths. Only the install-macos-launchd.sh flow above is supported.
After install, retry step 1 (/health) and proceed. Do not switch to another image tool because the install was needed — that's a one-time setup, not a failure of this route.
Reference images
When the user attaches reference images (style transfer, edit this image, etc.), include their absolute paths in images[]. The worker forwards them with -i to codex exec.
Hard constraints
- Prerequisites are upstream, not this package.
codexCLI must be installed, the user must have an active Codex/GPT path that allows image generation, and quota must not be exhausted. If not already established in the conversation, state this once before acting. Do not claim this service alone grants image-generation capability. - Pass the prompt through raw. No translation, polishing, or style modifiers unless the user explicitly asks for prompt optimization.
- Do not substitute HTML layout, infographic tooling, manual screenshot workflows, or other image tools when the user asked for this route.
- Do not treat text-heavy prompts as unfit. Image 2 handles dense text, timelines, and infographic layouts well. Only raise a concrete quality warning for a concrete reason in the specific request.
- Do not leak internals into the user-facing reply. Logs, paths, and curl invocations belong in technical follow-ups, not in the default answer.
- If
codex-exec-failedsurfaces "built-in image generation is unavailable", treat it as an upstream Codex capability/entitlement failure, not as proof the local service path is broken.
Report contract
When reporting back, include concisely:
- whether
/healthpassed (and if the service had to be installed first, say so once) - whether the prompt was passed through raw
- final status (
completedorfailed) - on failure: the layer from
references/error-codes.mdplus the error code
What this skill is not
Not a runbook, not an OpenAI API tutorial, not a license to replace the user's requested route with a cleaner-looking workflow. Its only purpose: when the user specifies the image2-with-codex path, do not drift.
Other versions1 project uses a version of this.
Word for word · 1
- cogine-ai/image2-with-codex★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository38 other files it gives its agents.
- skills/supabase-postgres-best-practices/AGENTS.mdAGENTS.md
- skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- skills/supabase-postgres-best-practices/CLAUDE.mdCLAUDE.md
- ai-app-security-auditSkill
- ai-slide-templatesSkill
- backlog-ready-specSkill
- check-compiler-errorsSkill
- clawpackerSkill
- deslopSkill
- devex-reviewSkill
- fix-ciSkill
- fix-merge-conflictsSkill
- founder-office-hoursSkill
- get-cookiesSkill
- get-pr-commentsSkill
- gh-issue-priority-handoffSkill
- investigateSkill
- local-ultra-reviewSkill
- loop-on-ciSkill
- loop-on-pr-review-and-fixSkill
- new-branch-and-prSkill
- npm-release-pipelineSkill
- peer-reviewSkill
- plan-devex-reviewSkill
- planmode-ceoSkill
- planmode-engineerSkill
- qa-onlySkill
- review-and-shipSkill
- run-smoke-testsSkill
- security-best-practicesSkill
- site-design-auditSkill
- site-design-fixSkill
- slow-is-fastSkill
- supabase-postgres-best-practicesSkill
- vercel-react-best-practicesSkill
- xianyu-api-client-skillSkill
- xianyu-automation-skillSkill
- xianyu-product-manager-skillSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

