From 1574bbe9731f611186dd13166a92912978aaae6d Mon Sep 17 00:00:00 2001 From: NimaChu <210636628+NimaChu@users.noreply.github.com> Date: Sat, 11 Jul 2026 17:12:15 +0800 Subject: [PATCH] Improve infographic prompt guidance --- SKILL.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/SKILL.md b/SKILL.md index 595ebb1..972796b 100644 --- a/SKILL.md +++ b/SKILL.md @@ -96,8 +96,8 @@ Generate images after the Markdown is ready, so prompts come from the title, art - Match the article's overall visual tone. - Constraints: no text unless explicitly requested, no logos, no watermark, central-safe visual focus. - Ordinary inline illustrations: - - Default count: 3 - - Use 2 for short articles and 4 for long or highly structured articles. + - There is no default image count. Choose zero or more images from the article's actual structure. + - Decide section by section whether the content needs a supporting art image, an infographic, or no image. - Paths: `imgs/illustration-1.png`, `imgs/illustration-2.png`, etc. - Place each image after the most relevant major section. - Match the meaning and emotional style of the nearby paragraphs. @@ -107,6 +107,24 @@ Generate images after the Markdown is ready, so prompts come from the title, art - An infographic's purpose is to replace the corresponding text, not repeat it. - Remove only the text whose complete meaning is accurately represented by the infographic. Preserve surrounding analysis, caveats, and transitions. - Treat this as an allowed image-backed structural edit, while preserving the article's meaning. + - Prefer an infographic for dense comparisons, model-selection matrices, timelines, or decision trees when exact values can be represented clearly. + - Do not force every table into an image: retain an HTML-rendered table when exact numbers, multiple columns, or mobile readability make it safer than generated artwork. + - When generating an infographic, paste the complete source block being visualized directly into the image-generation prompt, including its original headings, labels, values, caveats, and explanatory text. Then describe the visual tone, readability, audience, and output format. + - Do not pre-impose a card grid, table, node layout, column structure, or other composition unless the user requests one. Let the image model choose the information architecture from the source content. + - Ask the model to make the source text part of the visual composition, not an afterthought. Inspect every generated label, number, unit, and line break; regenerate with a targeted correction if any content is wrong or unreadable. + - Only use local text overlay as a fallback when the generated text remains unreliable after a targeted regeneration or when the user explicitly asks for deterministic typesetting. + +### Image and infographic selection gate + +Before generating any inline image, make a short section map: + +| Content shape | Preferred treatment | +| --- | --- | +| Atmosphere, concept, narrative transition | Ordinary editorial art | +| Exact comparison, pricing, benchmark, timeline, process, or decision tree | Infographic or HTML table | +| Short list with no visual relationship | No image unless it materially improves comprehension | + +The final image count must be justified by the section map. Never add images merely to reach a quota. Keep all final images under the article's `imgs/` directory. Inspect generated images before use and regenerate any image that does not match the content or shared visual style. @@ -125,6 +143,26 @@ After generating images: - Do not insert the cover image into the body unless the user asks for it. - For an infographic, replace the corresponding information block with the image link instead of leaving duplicate text. +## Table Rendering Quality Gate + +Markdown tables are fragile in the WeChat pipeline. Before rendering: + +1. Keep every table row adjacent. Do not leave blank lines between the header, separator, and body rows. +2. Use a valid separator row with the same column count as the header. +3. Do not generate a table by joining every Markdown line with a blank-line separator. +4. Preserve exact numeric values; if a table is converted to an infographic, remove only the fully represented table text. + +After preparing the Markdown, run `md-to-wechat.ts` or the API dry-run and inspect the generated HTML: + +```bash +$BUN_X "{skillDir}/scripts/md-to-wechat.ts" "post-to-wechat/yyyy-MM-dd/slug/slug.md" \ + --theme default --color blue > /tmp/mp-render.json +HTML_PATH=$(node -e 'process.stdout.write(JSON.parse(require("fs").readFileSync("/tmp/mp-render.json","utf8")).htmlPath)') +test "$(rg -o '