framework_eng/skills/tool-usage/content-generation/codex-image-gen/SKILL.md
Use for generating and editing raster images (UI mockup, wireframe, illustration, diagram, icon, test fixture). Helps delegate image creation to Codex/GPT through `codex exec image_generation`, placing the result in `tasks/<id>/assets/`.
npx skillsauth add steelmorgan/1c-agent-based-dev-framework codex-image-genInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A thin wrapper around the Codex CLI for generating and editing raster images. Claude/Opus as the primary agent cannot draw images, so when such a task appears you must explicitly delegate it to Codex through the wrapper described below. This is not a review scenario: image_gen really creates a file on disk, so Codex is launched with --sandbox workspace-write, unlike cross-provider-review.
| Situation | Action |
|----------|--------|
| A UI mockup / wireframe of a 1С form is needed for UX discussion before implementation | Apply the "UI / app mockup" template from references/prompt-guide.md |
| An illustration is needed for a spec, ADR, article, or presentation | Apply the "Office / business illustration" or "Lifestyle scene" template |
| A diagram is needed as a raster image (not a vector mermaid/PlantUML diagram) | Apply the "Diagram / explainer visual" template |
| A test fixture is needed: icon, avatar, placeholder for a Picture/AttachedFile field | Apply the "Icon / sticker" or "Product photo" template |
| An existing PNG needs editing (change color, remove an object, replace the background) | Pass the original through --reference-image, apply the editing template |
| The user asks, "can you draw N images and compare them" | Make N independent wrapper calls - Codex keeps image state only within one session |
web-test-1c / playwright / gui-control, not generation.codex_review.py - --sandbox read-only is hard-coded there, so no file will appear on disk. Use codex_image_gen.py specifically.tasks/<id>/assets/, so the artifact lives next to the task. If there is no task, discuss with the user whether one needs to be created.The wrapper is located next to SKILL.md:
.claude/skills/codex-image-gen/scripts/codex_image_gen.py \
--task-id <id> \
--filename <name>.png \
--prompt-file path/to/prompt.txt
or as a short one-liner:
.claude/skills/codex-image-gen/scripts/codex_image_gen.py \
--task-id <id> \
--filename <name>.png \
--prompt "High-fidelity UI mockup for ..."
For editing an existing image:
.claude/skills/codex-image-gen/scripts/codex_image_gen.py \
--task-id <id> \
--filename <name>-v2.png \
--reference-image tasks/<id>/assets/<name>.png \
--prompt "Keep the original composition. Change the background to ..."
Wrapper options:
| Flag | Purpose |
|------|---------|
| --task-id | Required. Output goes to tasks/<task-id>/assets/. The directory is created automatically. |
| --filename | Required. Name of the final file (*.png/*.jpg/*.webp). |
| --prompt or --prompt-file | Prompt content. One of the two is required. |
| --reference-image | Path to the source image for editing mode. Can be repeated. |
| --model | Codex model. Default is gpt-5. |
| --reasoning-effort | low/medium/high. Default is medium. |
| --timeout-sec | Timeout for one call. Default is 600. |
| --dry-run | Shows the final codex exec command without running it. Useful for debugging. |
The wrapper prints a JSON block to stdout: {"status": "ok", "files": ["abs/path/...png", ...]} or {"status": "error", "reason": "..."}. Consume the result programmatically from this JSON.
references/prompt-guide.md is a working guide with 8 sections: general principle, prompt axes (story/style/light/background/constraints), a generation constructor template, an editing constructor template, 10 ready-made templates for common generation scenarios, 10 templates for editing, common mistakes, and an iterative protocol. You MUST read the section relevant to your task before composing the prompt - image_gen is nonlinearly sensitive to structure.
Hard prompt requirements specific to this wrapper, not to the general image_gen:
Save the resulting image as <filename> in the current working directory. - the wrapper appends it automatically to the end of the prompt, but if you are writing a prompt file, do not add anything extra about saving.--sandbox workspace-write -C <output_dir>, and any attempt to write outside tasks/<id>/assets/ will be blocked by the kernel sandbox.--filename). For a series, make several separate wrapper calls.status: ok plus a list of files -> check ls tasks/<id>/assets/<filename> (stat is enough). If the file is missing, it is status: error regardless of what Codex said.image_generation tool depends on the Codex CLI model and settings. If the wrapper fails with a message like "model does not support image_generation", tell the user and suggest switching the model via --model (for example, gpt-5/gpt-5-codex) or opening a ticket to update the Codex CLI.status: error with a hint to retry, explicitly requiring the file to be saved.Use 1024x1024 unless the user explicitly asked for another size. in the prompt - override it with an explicit instruction in your own prompt.cross-provider-review creates a sandbox in .review-sandboxes/, hard-codes --sandbox read-only, and is intended for a second opinion on artifacts - with no writes to disk and no side effects. Image generation, by contrast, is a target write to the project's result folder. The semantics and security modes are different, so codex_image_gen.py is a standalone wrapper, not a flag in codex_review.py.
depends_on:
testing
MUST use BEFORE making a judgment about the cause of a conflict, a test failure, or an artifact dispute. Defines the end-to-end verification method L1→L6 and the classification of the first broken link.
development
MUST use AFTER a work cycle with ≥2 iterations (wrote → error → fixed → success). Provides the retrospective procedure and the format for recording practice/anti-patterns in references/learned-patterns.md or {project}/.context/learned-patterns.md.
tools
MUST use WHEN you are writing reusable knowledge into RLM (pattern / architectural decision / stable domain fact) OR reading it before a non-trivial task/solution in the domain. Provides the breakdown of native-push vs RLM-pull, tools for writing and reading RLM, H-MEM levels, and hygiene.
testing
MUST use WHEN the task is classified as simple (< 20 lines, 1 file, no new metadata objects, no architectural decisions). Provides a short cycle of 3 steps with a guard on the self path and mandatory verify.