Dependencies
This Skill depends on linyuebanzi-image-gen as the image-generation execution layer. Make sure it is installed:
npx skills add lqshow/linyuebanzi-skills -s linyuebanzi-image-gen
The corresponding environment variables need to be set:MULERUN_API_KEY、APIMART_API_KEY or ATLASCLOUD_API_KEY。
Workflow
Step 1: Parse user input
Example user inputs:
"声现象"→ Automatically inferred: Grade 8 Physics · Chapter 2"初二物理 光现象"→ Directly extracted: Grade 8 Physics · Chapter 4"帮我做一张关于杠杆原理的知识卡片"→ Inferred: Grade 8 Physics · Simple Machines"勾股定理"→ Inferred: Grade 8 Math"光合作用"→ Inferred: Grade 7 Biology
Extracted fields:
topic: Knowledge point namesubject: Subjectgrade: Grade (automatically inferred if not provided)edition: Textbook edition (defaults to PEP edition; different editions have different chapter arrangements, so if the user specifies an edition, follow the user's)chapter: Chapter number (if not provided, infer fromedition; when uncertain, it is better to omit the chapter number than to print a wrong one on the image)key_concepts: 3-5 core sub-concepts (automatically broken down)
Step 2: Determine the visual theme color
Use low-saturation (Morandi) tones throughout—do not give the image-generation model a coarse-grained color name like "blue series" (it will default to outputting the high-saturation "AI infographic blue"); instead givespecific color cards: primary color + background color + neutral color, each with a hex anchor. For different chapters in the same subject, rotate the primary color among the available color cards, with no repeats within the same batch.
| Color card | Primary color (accent) | Background color (bg tint) | Neutral (neutral) | Applicable to |
|---|---|---|---|---|
| Terracotta orange | terracotta #C97E4E |
cream #F7F1E6 |
slate blue-grey #3A506B |
Physics (sound/heat), Chemistry (organic) |
| Deep gray-blue | slate blue #3A506B |
misty blue-white #EDF3F8 |
warm grey #8A7D6B |
Physics (electricity/mechanics), English |
| Soft teal green | muted teal #4A9E9B |
pale green-white #EAF1E3 |
grey olive #8E9678 |
Physics (light/lenses), Chemistry |
| Misty purple | misty purple #7A6296 |
ivory #F7F3ED |
grey blue #6B7889 |
Math (same source as the math theme of teaching videos) |
| Deep tea green | deep tea green #5F6B4F |
pale green-white #EAF1E3 |
light khaki #D9C9A3 |
Biology |
| Caramel brown | caramel brown #8A624A |
cream beige #F4E6C8 |
grey coffee #6F5F4A |
Chinese, History |
| Sage green | sage green #8FA08A |
oat #F2EAD9 |
grey olive #8E9678 |
Biology (plants), English |
Rules:
- Use the primary color only ontitles, numbering badges, keywords, formula highlights(about 10% of the image); card backgrounds and the background use light variants of the background color
- Use neutral colors for secondary text, structural lines, and explanatory annotations
- High-saturation candy colors, neon colors, and pure
#FFhues are prohibited - When working on the same knowledge point as
linyuebanzi-teaching-animation, choose a color card from the same source (e.g., Pythagorean theorem → misty purple), so that the infographic, animated image, and video styles are unified
Step 3: Build the prompt
Read references/prompt_template.md to get the prompt skeleton, and fill in the following variables:
{topic}→ Knowledge point name{grade}→ Grade{subject}→ Subject{chapter}→ Chapter{theme_color}→ Primary color (English name + hex, taken from the Step 2 color card, e.g.misty purple #7A6296){bg_tint}→ Background color (English name + hex){neutral_color}→ Neutral color (English name + hex){num_sections}→ Number of sub-concepts{sections_content}→ Title, illustration description, and explanatory text for each sub-concept (fromreferences/illustration_guide.mdmatch; if no match, generate automatically)
Step 4: Subject accuracy self-check (prompt layer)
Before calling image generation, check the constructed prompt. This is the first line of defense, blocking "the prompt itself is written wrong."
Data sources: Read the following three files at the same time and cross-check them against the current prompt:
references/accuracy_checklist.md: General checklist + subject-specific checklistsreferences/illustration_guide.md: The "must include" and "common errors" columns for each knowledge point, checked item by itemreferences/errata.md: Historical errata records, to confirm no repeated pitfalls
Check order:
- General check(all subjects): typos, formula variable notation, grade-level matching (out-of-syllabus check), chapter number consistent with textbook version, numerical reasonableness
- Subject-specific check: Go through the checklist for the corresponding subject in accuracy_checklist.md item by item. Different subjects have different error patterns—for physics check controlled variable conditions/circuit conventions/scalars and vectors, for math check theorem applicability conditions/consistency of figure labels, for chemistry check balancing/reaction conditions/↑↓ symbols, for biology check the four elements of processes/arrow directions, for Chinese check original famous quotations/correspondence between authors and dynasties, for history check correspondence between years and figures/events, for English check spelling/part of speech/example sentence grammar
If problems are found, fix the prompt first before calling image generation.
Step 5: Call linyuebanzi-image-gen to generate images
Pass the constructed prompt to linyuebanzi-image-gen to execute image generation:
# 单张生成(提示词较长,建议写入文件用 --prompt-file 传入)
python scripts/generate.py --mode generation \
--prompt-file "<提示词文件路径>" \
--aspect-ratio "9:16" \
--output-dir "output" \
--name-tag "{topic}"
# 批量生成(多个知识点)
# 逐张调用,每张使用不同主题色和 --name-tag
CLI required
--mode generation; output uses--output-dir(directory) +--name-tag(filename prefix), the script automatically adds a timestamp, not a--outputsingle-file path.
Output specifications:
- Ratio: 9:16 vertical
- Format: PNG
- Output path:
output/directory
Step 6: Generated image visual review (image layer)
This is the second line of defense, blocking "the prompt is right but the image is drawn wrong"—the image generation model may render garbled text, typos, messed-up formula superscripts and subscripts, reversed arrows, or mixed-up circuits.After each image is generated, it must be reviewed; no review, no delivery.
- Use the Read tool to read the generated PNG
- Compare against
references/accuracy_checklist.mdthe "generated image visual review points" at the bottom, and check item by item what isactually renderedin the image:- All Chinese text: no garbled characters, no typos, no pseudo-Chinese characters with missing strokes
- Formulas/equations/numbers: completely consistent with the prompt, superscripts and subscripts correct, units not lost
- Diagram logic: arrow directions, label positions, and structural relationships consistent with the prompt description
- Then go through the image content once more according to the subject-specific checklist for that subject
- Judgment and handling:
- Pass → Deliver
- Fail → Add emphasis instructions in the prompt for the error points (e.g.
The formula must read exactly "a² + b² = c²" with correct superscripts), and regenerate. Retry at most 2 times - If it still fails after 2 retries → deliver the best one among them, butThe user must be clearly told where the errors are in the image, and an erroneous image must never be silently delivered to the student
- Errata feedback loop: Knowledge errors found during review (those missed at the prompt layer, excluding pure rendering garbled text) are appended in the format to
references/errata.md, so that the next generation automatically avoids the pitfall
Step 7: Batch generation
When the user requests multiple knowledge points (such as "all chapters of the first semester of eighth-grade physics"):
- Automatically break them down into a list of independent knowledge points
- Assign a different theme color to each image (no repeats within the same batch)
- Call
linyuebanzi-image-genone by one, keeping the style consistent but the colors varied - Each image independently goes through the Step 4 self-check and Step 6 visual review, without skipping due to batching; the review results are reported image by image in the final summary (passed / passed after retry / delivered with flaws)
Usage examples
# 单个知识点
"声现象,做张信息图"
"帮我做一张物态变化的知识卡片"
# 指定学科和年级
"初二物理 光现象"
# 跨学科
"勾股定理"
"光合作用"
# 批量
"帮我把初二物理上学期的知识点全部做成信息图"
"初二物理 声现象、物态变化、光现象、透镜,分别做一张"
Notes
- All text must be in Chinese
- Illustrations should mainly be concise diagrams; do not use real photos
- Keep the sub-concepts of each infographic to 3-5
- Formulas must clearly label the meaning of variables
- Choose one of three for the bottom summary area: key term badges / study tip box / real-life example bar
- Multiple images generated in the same batch must use different color schemes
- The audience is students, and accuracy takes priority over aesthetics: Each image must complete the Step 4 prompt self-check + Step 6 visual review of the finished image before delivery; if an unfixable knowledge error is found, the user must be informed, and it must not be silently delivered
- Chapter numbers are marked according to the People's Education Press edition by default; if the user uses textbooks from other editions, please specify in the input
- This Skill only generates static infographics; for dynamic interactive demonstrations, please use the corresponding Skill