qxcnm/codex-manager/cm-imagegen
- community
Checking that the SKILL.md file is still in the repository.
Generate or edit raster images through CodexManager's OpenAI-compatible Images API when Codex should use the current Codex provider base_url and auth.json API key instead of the official built-in image_gen tool. Use when the user asks for CodexManager image generation, API-key/provider-mode image generation, or image generation through CodexManager account pools, routing, logs, and billing.
Install
npx vskill@latest install qxcnm/codex-manager/cm-imagegenSKILL.md
CM Image Generation Skill
Generates or edits images for the current project (for example website assets, game assets, UI mockups, product mockups, wireframes, logo design, photorealistic images, or infographics).
This skill follows the same request semantics, prompt workflow, decision tree, and output expectations as the official imagegen skill. The only intentional difference is the execution layer: image requests are sent to CodexManager's OpenAI-compatible Images API using the current Codex provider base_url and auth.json API key.
Top-level modes and rules
This skill has one top-level mode:
- CodexManager CLI mode: bundled
scripts/cm_image_gen.pyCLI. It uses the current Codex configuration and calls CodexManager's image endpoints.
The CLI exposes two subcommands:
generateedit
Rules:
- Use this skill only when the user explicitly asks for CodexManager image generation or when the official built-in
image_gentool is unavailable in API-key/provider mode. - Do not ask the user for a separate image API key or image base URL by default.
- Do not create one-off SDK runners.
- Never modify the official system
imagegenskill.
CodexManager config policy:
- If
CODEXMANAGER_IMAGE_BASE_URLis set, use it as the image request base URL. - Otherwise, read the active
model_providerfrom$CODEX_HOME/config.toml. - Read that provider's
base_urlfrom[model_providers.<provider>]. - Read
OPENAI_API_KEYfrom$CODEX_HOME/auth.json. - Use
CODEXMANAGER_IMAGE_MODELonly for the image model override; otherwise usegpt-image-2for OpenAI-compatible Images providers, orimage-01when the provider base URL targets the image_generation API (minimax.io/minimaxi.comhosts). - When the provider base URL targets the image_generation API, the CLI calls
POST /v1/image_generationwithaspect_ratio/width/height/seed/n/prompt_optimizer/response_formatrequest fields, passes--imageinputs assubject_reference, and parsesdata.image_urls/data.image_base64+base_resp.status_code; otherwise it calls the OpenAI Images/images/generationsand/images/editsendpoints and parsesdata[].b64_json. - Use
CODEXMANAGER_IMAGE_OUTPUT_DIRonly for the output directory override; otherwise save under the current working directory'sgenerated-images/folder.
Save-path policy:
- CodexManager generated images are saved under the current working directory's
generated-images/folder by default. - If the user names a destination, use
--out-dirand/or--filename, or move/copy the selected output there. - Do not edit, create, or attach unrelated project files such as
AGENTS.md. - If the image is meant for the current project, keep the final selected image in
generated-images/unless the user named another destination. - If the image is only for preview or brainstorming, report and attach the generated PNG file from
generated-images/so Codex App shows the file card with the Open button. - Never report an unrelated file card as the generated image result.
- Do not overwrite an existing asset unless the user explicitly asked for replacement; otherwise create a sibling versioned filename such as
hero-v2.pngoritem-icon-edited.png.
Shared prompt guidance lives in references/prompting.md and references/sample-prompts.md.
CLI docs/resources:
references/cli.mdreferences/image-api.mdreferences/codex-network.mdscripts/cm_image_gen.py
When to use
- Generate a new image (concept art, product shot, cover, website hero)
- Generate a new image using one or more reference images for style, composition, or mood
- Edit an existing image (inpainting, lighting or weather transformations, background replacement, object removal, compositing, transparent background)
- Produce many assets or variants for one task
When not to use
- Extending or matching an existing SVG/vector icon set, logo system, or illustration library inside the repo
- Creating simple shapes, diagrams, wireframes, or icons that are better produced directly in SVG, HTML/CSS, or canvas
- Making a small project-local asset edit when the source file already exists in an editable native format
- Any task where the user clearly wants deterministic code-native output instead of a generated bitmap
- When the user explicitly wants the official built-in
image_genworkflow and that tool is available
Decision tree
Think about two separate questions:
- Intent: is this a new image or an edit of an existing image?
- Execution strategy: is this one asset or many assets/variants?
Intent:
- If the user wants to modify an existing image while preserving parts of it, treat the request as edit.
- If the user provides images only as references for style, composition, mood, or subject guidance, treat the request as generate.
- If the user provides no images, treat the request as generate.
Edit semantics:
- Edit mode is for images already visible in the conversation context, images generated earlier in the thread, or local image files whose paths are available.
- If a local file is the edit target, pass its absolute path with
--image. - For edits, preserve invariants aggressively and save non-destructively by default.
Execution strategy:
- For one asset, issue one CLI call.
- For many assets or variants, issue one CLI call per requested asset or variant.
Assume the user wants a new image unless they clearly ask to change an existing one.
Workflow
- Decide the intent:
generateoredit. - Decide whether the output is preview-only or meant to be consumed by the current project.
- Decide the execution strategy: single asset vs repeated calls.
- Collect inputs up front: prompt(s), exact text (verbatim), constraints/avoid list, and any input images.
- For every input image, label its role explicitly:
- reference image
- edit target
- supporting insert/style/compositing input
- If the user asked for a photo, illustration, sprite, product image, banner, or other explicitly raster-style asset, use CodexManager image generation rather than substituting SVG/HTML/CSS placeholders. If the request is for an icon, logo, or UI graphic that should match existing repo-native SVG/vector/code assets, prefer editing those directly instead.
- Augment the prompt based on specificity:
- If the user's prompt is already specific and detailed, normalize it into a clear spec without adding creative requirements.
- If the user's prompt is generic, add tasteful augmentation only when it materially improves output quality.
- Call
scripts/cm_image_gen.py. - Inspect outputs and validate: subject, style, composition, text accuracy, and invariants/avoid items.
- Iterate with a single targeted change, then re-check.
- For preview-only work, report and attach the generated PNG file from
generated-images/so Codex App shows the file card with the Open button. - For project-bound work, keep the selected artifact in
generated-images/or move/copy it only to a user-named destination, then update consuming code or references if needed. - For batches, persist only the selected finals in the workspace unless the user explicitly asked to keep discarded variants.
- Keep the final response minimal. Do not print the final prompt, validation details, file size, JSON output, model, base URL, or absolute path unless the user explicitly asks for them.
Commands
Generate:
Edit:
Useful options:
After a successful call:
- Parse the printed JSON.
- Use the first absolute
paths[]item as the final image path unless the user requested multiple outputs. - Do not call a local image viewing tool for the final answer. In Codex App this can create a broken gray preview placeholder for CLI-created local images.
- Attach/report the generated PNG file itself from
generated-images/so Codex App shows a normal image file card with the Open button. - Do not create a markdown image/link, HTML image tag, or fake preview block.
- Do not attach or report unrelated files such as
AGENTS.md. - The normal saved path should be the current working directory's
generated-images/<filename>file, but do not print the path in the final response unless the user asks. - Do not print the final prompt, prompt spec, validation result, file size, model, base URL, raw JSON, or command output in the final response unless the user asks.
- The final response should be only a short completion sentence plus the generated PNG file card.
- For edits, also keep track of the source image path.
Prompt augmentation
Reformat user prompts into a structured, production-oriented spec. Make the user's goal clearer and more actionable, but do not blindly add detail.
Treat this as prompt-shaping guidance, not a closed schema. Use only the lines that help, and add a short extra labeled line when it materially improves clarity.
Specificity policy
Use the user's prompt specificity to decide how much augmentation is appropriate:
- If the prompt is already specific and detailed, preserve that specificity and only normalize/structure it.
- If the prompt is generic, you may add tasteful augmentation when it will materially improve the result.
Allowed augmentations:
- composition or framing hints
- polish level or intended-use hints
- practical layout guidance
- reasonable scene concreteness that supports the stated request
Not allowed augmentations:
- extra characters or objects that are not implied by the request
- brand names, slogans, palettes, or narrative beats that are not implied
- arbitrary side-specific placement unless the surrounding layout supports it
Use-case taxonomy (exact slugs)
Classify each request into one of these buckets and keep the slug consistent across prompts and references.
Generate:
- photorealistic-natural — candid/editorial lifestyle scenes with real texture and natural lighting.
- product-mockup — product/packaging shots, catalog imagery, merch concepts.
- ui-mockup — app/web interface mockups and wireframes; specify the desired fidelity.
- infographic-diagram — diagrams/infographics with structured layout and text.
- logo-brand — logo/mark exploration, vector-friendly.
- illustration-story — comics, children's book art, narrative scenes.
- stylized-concept — style-driven concept art, 3D/stylized renders.
- historical-scene — period-accurate/world-knowledge scenes.
Edit:
- text-localization — translate/replace in-image text, preserve layout.
- identity-preserve — try-on, person-in-scene; lock face/body/pose.
- precise-object-edit — remove/replace a specific element (including interior swaps).
- lighting-weather — time-of-day/season/atmosphere changes only.
- background-extraction — transparent background / clean cutout.
- style-transfer — apply reference style while changing subject/scene.
- compositing — multi-image insert/merge with matched lighting/perspective.
- sketch-to-render — drawing/line art to photoreal render.
Shared prompt schema
Use the following labeled spec as shared prompt scaffolding:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcm-skills/cm-imagegen/SKILL.md
Popularity
- Repository stars
- 2,891
- Repository forks
- 389
- 7-day trend score
- 40
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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/qxcnm/codex-manager/cm-imagegen)