Turn an article into a set of images with a unified style. Claude is responsible for figuring out what to draw and which text goes on the image; Codex is only responsible for handing the prompt to imagegen as-is to render; the script is responsible for checking and verification.
Below, S refers to this skill's script directory (under the directory where this file is located, the scripts/):
S=<本 SKILL.md 所在目录>/scripts
First time use
python3 $S/doctor.py: Environment self-check (whether Codex is installed, logged in, Python). If there is a ✗, follow the prompt to fix it first.- When there is no default style, open the style selection page for the user to look at images and choose (see "Default style" below).
Default style
Style = a style that has sample images, the user looks at images and chooses. Once chosen, it is saved as the default, and from then on it is used directly each time without asking again.
| User says | How to do it |
|---|---|
| (when starting work) | python3 $S/settings.py get style. Print out the number → tell the user "This time using default style X (number · name), say something if you want to change it", and proceed directly.Nothing printed = not set yet, go to "First-time selection" |
| First-time selection / "Change default style" | First give the storyboard to the user for confirmation, then python3 $S/style_picker.py <任务目录>/风格选择.html and open; if the user reports a number (or pastes back the content copied from ♡), it is considered the chosen default → python3 $S/settings.py set style <编号> |
| "This time use N42" | Only for this one time,does not change settings: write this number in the adapt filename (e.g. 1-N42.txt)。The number in the filename is what truly determines which style card is used;scenes.md writing a line "Style for this time: N42" at the top is just a memo |
| "Show me a few styles" | Exploration: choose 3–4 kinds (reference/recommend.md recommends based on content type), use the user's own same image to render one version of each for comparison; the one the user selects can be set as the new default |
| "You recommend" | Only then refer to reference/recommend.md and reference/taste.md(author's taste) |
Settings are stored in ~/.image-render/settings.json, upgrading the skill will not overwrite them; when the home directory is not writable (Codex sandbox), they are automatically stored in the current project's .image-render/, and will be read automatically when used in this project later; you can also specify with the environment variable IMAGE_RENDER_HOME .
Process
| Step | What to do | Who | Details |
|---|---|---|---|
| 1 Storyboard | Each image: aspect ratio / purpose, what it conveys, content type, must-have text (wrapped in ""). After writing, give it to the user for confirmation (if the user says "just do it", it can be skipped) | Claude → User | stages/01-scenes.md |
| 2 Determine style | Default style; if none, look at images and choose; during exploration choose 3–4 kinds | User | stages/02-pick-style.md |
| 3 Style adaptation | Core: redesign the scene, metaphor, and text carrier for each image according to the style card's narrative grammar | Claude | stages/03-adapt.md |
| 4 Image generation | Check → assemble prompt → Codex generates the image verbatim → verify the prompt character by character.First time using it or just switched the default style: generate only the 1st image for the user to see first; generate the rest only after they're satisfied | Script + Codex | stages/04-render.md |
| 5 Selecting images and iterating | Claude first reads the text on each image one by one; marks ♡ for the user on the comparison page; when dissatisfied, change only one place at a time; write the selected images back as samples | Claude → user | stages/05-review.md |
Adding a new style
The user wants a style not in the library (give a one-sentence description or a reference image):
- Find the custom style directory (
python3 $S/settings.py showsecond line, usually~/.image-render/styles/; it may not exist yet when adding a style for the first time, so firstmkdir -p), copytemplates/style-card.mdinto it, name itU01-<风格名>.md(numberU01、U02… continue in sequence, filename = number-name), and fill it in. The style block should only describe "what it looks like" — materials, lines, color scheme, how the text looks, what not to include,do not write the layout。 - Use one image the user has on hand to produce a trial image with the new card (write the adapt filename as
1-U01.txt)。 - The user says they like it →
python3 $S/add_sample.py U01 <试图路径>(to set it as default, add--default). This command will thumbnail the image, put it in the sample directory, and write it into the card.Only with a sample does it count as in the library, and only then will it show on the style selection page. - The user doesn't like it: change only one place in the style block and generate another version; if giving up, delete this card and don't leave an empty card.
Key principles (all have empirical evidence, see reference/lessons.md)
- Style cards are fixed; each image is customized. Mechanically applying the same image and just switching styles resulted in not a single one being selected.
- Paste the style block verbatim, don't rewrite it; write the layout into the image, not into the style block.
- "" is reserved only for text that is to be drawn. Before generating an image it must pass
check_prompts.py。 - Prompts are written to disk, passed in verbatim, and verified afterward: Codex only executes, it doesn't rewrite.
- Aspect ratio relies only on the first sentence: only write ones that have been empirically tested (21:9 / 16:9 / 2:1 / 1:1 / 3:4 / 9:16).
- Specify how much of the frame the subject occupies("about 60% of the width"), otherwise the image will be very empty.
- Made-up characters will be consistent across images if written in detail;real characters (your pet, IP) must have a reference image(
--ref)。 - The script only verifies the prompt received by imagegen, it does not check the text drawn on the image. Before delivery, the current assistant (Claude or Codex) must look at each image one by one and point out typos and extra characters.
Table of contents
styles/: style library (every card has a sample,README.mdis the index,samples/is the sample)templates/:scene.mdimage sheet template,style-card.mdnew style card template,adapt-example.txtadaptation example,common.txtgeneral constraints,codex-task.mdtask template for Codexscripts/:doctor.pyself-check,settings.pydefault style,style_picker.pystyle selection page,add_sample.pywrite back sample,render_codex.py(check + assemble + generate + verify, one command),check_prompts.py、build_prompts.py、verify_log.py(Codex verifies after generating the image itself),make_page.pycomparison page,update_index.pyrebuild style indexreference/:formats.mdaspect ratio,recommend.mdcontent type → style,taste.mdauthor's taste,lessons.mdMeasured rules and evidence
Task directory (one per article / per batch of images)
<项目>/images/<NN-简述>/
scenes.md 画面单(阶段 1)
adapt/<图号>-<风格>.txt 适配后的画面(阶段 3),如 2-S07.txt
prompts/ out/ logs/ 脚本生成
review.html 对比页
ref.png (可选)参考图
_v1/ 改过提示词后被替换下来的旧图
baselines/ (可选)用户认可后冻结的版本
Who is the executor
- Claude leads: Stages 1–3 and 5 are done by Claude; Stage 4 uses
render_codex.pyto invokecodex exec, and Codex is only responsible for producing images as-is. - Codex runs this skill itself: Stage 4 does not invoke
render_codex.py(otherwise it would start another Codex); follow thestages/04-render.md"Codex runs it itself" section.