wewrite-visual

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

wewrite-visual — 封面与配图

wewrite-visual — Covers and Illustrations

前置

Prerequisites

用户指定文章时使用该文件;否则
wewrite run show
,读取当前任务的
artifacts.article
、
artifacts.illustrated_article
、
artifacts.image_prompts
、
artifacts.images_manifest
、
visual
、
flags
和任务目录。已完成的文章也可以直接配图,不要恢复或新建写作任务。
有任务时运行
wewrite run step visual in_progress
。用户直接给了任务外文章时独立执行, 不写任务状态;提示词和图片放进文章同目录的
<文件名>-assets/
,带图副本写成
<文件名>-illustrated.md
。
根据本轮原话确定模式并用
wewrite run update
记录:只要封面用
cover
,封面和必要内文图 用
full
,只要提示词用
prompts
。不要沿用写作模式猜测用户想生图。
prompts
或
skip_image_gen=true
时仍要完成提示词,但不调用付费图片服务。
完整读取:
text
读取: {skill_dir}/references/visual-guide.md
Use this file when the user specifies an article; otherwise run
wewrite run show
to read the current task's
artifacts.article
,
artifacts.illustrated_article
,
artifacts.image_prompts
,
artifacts.images_manifest
,
visual
,
flags
, and the task directory. Completed articles can also be directly illustrated — do not resume or create a new writing task.
When there is an existing task, run
wewrite run step visual in_progress
. If the user provides an article outside of an existing task, execute independently without writing task status; place prompts and images in the
<filename>-assets/
directory under the same folder as the article, and save the illustrated copy as
<filename>-illustrated.md
.
Determine the mode based on the user's latest message and record it with
wewrite run update
: use
cover
for cover-only requests,
full
for cover plus necessary in-article illustrations,
prompts
for prompt-only requests. Do not assume the user wants image generation based on the writing mode. When using
prompts
mode or if
skip_image_gen=true
, still complete the prompt creation process but do not call paid image generation services.
Full read:
text
读取: {skill_dir}/references/visual-guide.md

执行

Execution

  1. 从终稿提取 3-5 个具体实体和文章主情绪,形成统一色板、构图与质感。
  2. 写一个封面提示词。
    cover
    模式到此为止;
    full
    模式只为确实需要解释或缓冲阅读的 段落补图,不按固定数量凑图。
  3. 将提示词和目标路径写到
    artifacts.image_prompts
    ;批量清单写到
    artifacts.images_manifest
    。
  4. 数量必须不超过任务的
    visual.max_images
    。调用时同时传入数量和费用上限:
bash
wewrite image-gen --manifest {run_dir}/images.json --max-images {max_images} --max-cost {max_cost}
max_cost
为空时省略该参数。预算预检不通过就减少内文图,不能绕过上限。图片服务失败时 保留完整提示词并继续流程。
  1. 一次性检查所有实际文件:能打开、格式与扩展名一致、核心实体可辨、风格连贯。只重试 明显失败的单张一次。
    full
    模式先复制原始正文到
    artifacts.illustrated_article
    ,再把 采用的内文图插到副本相应段落;封面不插入正文。任何模式都不得覆盖原始正文。
完成后更新
images.cover
、
images.figures
,再执行:
bash
wewrite run step visual completed
只有提示词时同样标 completed,并明确说明未产生费用、没有实际图片。
  1. Extract 3-5 specific entities and the main emotion of the article from the final draft to form a unified color palette, composition, and texture.
  2. Write a cover prompt. Stop here for
    cover
    mode; in
    full
    mode, only add illustrations to paragraphs that genuinely need explanation or reading pacing, do not add images to meet a fixed count.
  3. Write the prompts and target paths to
    artifacts.image_prompts
    ; write the batch manifest to
    artifacts.images_manifest
    .
  4. The number of images must not exceed the task's
    visual.max_images
    limit. Pass both the count and cost limit when calling:
bash
wewrite image-gen --manifest {run_dir}/images.json --max-images {max_images} --max-cost {max_cost}
Omit the
--max-cost
parameter if
max_cost
is empty. If the budget pre-check fails, reduce in-article illustrations — do not bypass the upper limit. If the image service fails, retain the full prompts and continue the workflow.
  1. Check all actual files at once: verify they can be opened, format matches the extension, core entities are recognizable, and style is consistent. Retry only obviously failed single images once. In
    full
    mode, first copy the original article text to
    artifacts.illustrated_article
    , then insert the adopted in-article illustrations into the corresponding paragraphs of the copy; do not insert the cover image into the article body. Never overwrite the original article text in any mode.
After completion, update
images.cover
and
images.figures
, then execute:
bash
wewrite run step visual completed
Mark as completed even for prompt-only requests, and clearly state that no fees were incurred and no actual images were generated.