SuperAPI AI Directory

ljg-card

Frontend & websites

View repository

Updated 10-16 00:00

About this skill

ljg-card: Cast

Content goes in, PNG comes out. Generated images are responsible for turning thought into visible action; HTML is responsible for stating things accurately;-f it only designs the presentation of the original text, does not alter the original text, and does not generate new images.

-l、-w When undertaking knowledge explanation, it must also connect "specific situation → basis for judgment → conditional relationship → specific result." Readers should be able to see from the actions or states in the main text why an object belongs to a certain concept, and then use the relationship to derive the result at hand; merely placing examples next to terminology still leaves the connection missing. First determine what judgment the target reader needs to complete, then decide the materials and visuals; the lower-upper structure does not prescribe the layout's top and bottom, nor does it require every card to start from the beginning of the story. Literature, narrative, and aesthetic expression are organized according to their own purposes, and exercises are not imposed.

The finished product ends at the conclusion, question, or lingering resonance of the content itself, after which only the signature and source remain. Do not append "reading boundaries," disclaimers, production notes, or acceptance notes, and do not retain such endnotes under a different heading. Original conditions, disagreements, and limitations that would change understanding are integrated nearby into the corresponding argument; the scope of distillation, material gaps, and verification status are placed in the delivery reply.-f Paragraphs already present in the manuscript are still retained under the full-text fidelity contract.

Parameters

Parameter Mold Size Image role
-l(default) Long image · quiet-line narrative 1080 × auto 0–3 images; when there is comprehension gain, use 1 quiet main scene, and add continuous visual beats when necessary
-f Full text · original typography 1080 × auto Generated images fixed at 0; only faithfully present images already in the manuscript
-c Comic 1080 × auto Gap-driven comic panels rerun on the same case
-w Whiteboard · vertical argumentation 1080 × auto Local hand-drawn actions embedded in load-bearing reasoning nodes; no top main visual

When no parameters are given, use -l。

Required reading order

-l、-c、-w Every execution must Read in sequence:

  1. references/taste.md
  2. references/image-generation.md
  3. Current mode file
  4. Current HTML template

Do not skip the shared image protocol and write prompts directly, and do not apply the image grammar of one mode to another.

-l、-w When used for knowledge explanation, after step 3 and before reading the template, additionally read references/learning-design.md: it contains reader tasks, lower-upper connections, source boundaries, case-change testing, and four sets of failure-and-repair comparisons.-f does not enter this route.

-f Read in sequence:

  1. references/taste.md
  2. references/mode-full.md
  3. assets/full_template.html

-f Do not generate new images; only when the manuscript already contains images, additionally read references/image-generation.md 's asset identity, source fidelity, and local persistence contract.

-f Font priority

-f All editorial text in KingHwa_OldSong, including title, headline, section headings, body text, emphasis, captions, table headers, and signature, thereby maintaining a unified font character across the entire long card. When the browser cannot detect it, body text falls back to Songti SC、STSong、Noto Serif CJK SC and serif, and title-type text falls back to PingFang SC、Hiragino Sans GB、Microsoft YaHei and system sans. Do not download, temporarily install, or remotely reference this font over the network for card production.code、pre and the source line retain a monospaced font, because character alignment carries semantics in these positions.

-f Long-form reading surface

-f typically produces an extremely long card, so use a surface independent of -l white background with black text reading surface: the canvas is fixed to pure white #FFFFFF, regular body text uses a deep neutral black #171717, and auxiliary information uses only restrained neutral gray. For a 1080px final product, regular body text is no smaller than 40px, line height stays at 1.9, and the effective body text width is about 896px; paragraph spacing defaults to 36px, and section spacing is noticeably larger than paragraph spacing. Lists and quotes are also 40px/1.9, tables 34px, footnotes and code blocks 32px, and captions 30px. Recheck at a phone display width of about 390px, where the body text is roughly equivalent to 14.4px; long images are allowed to grow taller, and text is not shrunk to compress height. Do not bring warm paper backgrounds, small web body text, overly tight line spacing, or large areas of colored modules into -f。

Global temporary directory constraint

No matter which directory it is started from, before making cards a temporary directory exclusive to this task must be created under /tmp . All intermediate products, including generated image candidate drafts, source images used for layout, HTML, CSS, vector drafts, rendering inputs, screenshot drafts, QA slices, caches, and logs, may only be written to that directory.

Only the final files the user explicitly requests for delivery may be written outside /tmp . Candidate PNGs and rendering results that have not passed acceptance are still intermediate products. Before completion, check that the current directory and repository have no leftover intermediate files, and after the final deliverables pass acceptance, clean up this task's temporary directory.

Shared production line

  1. Read the URL, paste text, or local file, and confirm the title, author, source, and factual boundaries.
  2. -f lock the source, establish an ordered original-text block ledger, and go directly to references/mode-full.md; do not go through distillation, visual motifs, or image generation.
  3. -l、-w knowledge explanations first follow references/learning-design.md to clarify the reader's task, and organize the specific situations, criteria for judgment, relationships, results, and applicable conditions. Before entering layout, the actual draft should write out how the object, action or state, and conditions lead to the result; materials missing from the source text are recorded in the production log and briefed at delivery.-l、-c then establish the visual motif table;-w first save this input as an exact source snapshot, then run assets/prepare-whiteboard-source.ts to establish a paragraph-by-paragraph source list, make the argument ledger cover this independent list, and simultaneously check argumentative load-bearing and learning load-bearing before deciding which steps need visualization. Do not go directly from a one-sentence summary into layout.-w has a generated image budget of 0–4 images.
  4. -c call the current environment's image generation tool, and first generate a representative image to calibrate semantics and series style;-l、-w only do the same calibration when the asset budget is greater than 0; 0 images is a valid result.
  5. Save images as local PNG/JPG, and verify each file, dimensions, composition, absence of text, and source attributes one by one.
  6. Put all readable text, numbers, formulas, labels, arrows, and sources into HTML/CSS; images carry specific scenes, mechanism actions, condition comparisons, or clearly marked analogies. If the image has specific objects, that does not automatically mean it provides lower-level material usable for judgment.
  7. Read the corresponding template and replace all placeholders.-l、-c when the top image slot has no image, it must be explicitly set to data-state="empty"; when there is an image, a local path and semantic alt。-w has no top image slot: write the final argument ledger into {{LOGIC_LEDGER_JSON}}, and each generated image appears only inside its corresponding step, with data-source-claim referring back to that step ID.
  8. Before screenshotting, wait for fonts and all images to load successfully; if any image is corrupted, stop.
  9. Check the entire image before delivery; for long images, use overlapping slices to cover the full height.
  10. Content review is also done separately for knowledge explanations: key concepts have usable criteria for discrimination, relations correspond to examples, and changing the case can expose differences in conditions. Source and rendering checks, content review, and reader testing are reported separately in the delivery reply and are not placed into the card; providing a trial question cannot prove that the reader has already learned it.

-l、-c、-w When a key generated image that has been judged necessary fails, do at most two targeted regenerations. If it still fails, state the blocking reason, and do not quietly fall back to a remote placeholder image, a fake icon, or a vector graphic; do not quietly rewrite a failed image as "the image was not needed in the first place."

Input and naming

  • URL: Use the currently available web reading tool to obtain the body text, and save an explicit source.
  • Pasted text: Use it directly; do not add facts that are not in the original text.
  • File path: Read the local file.
  • {name}: Extract from the title or the core judgment; Chinese may be retained; remove punctuation; at most 20 characters.

Screenshot tool

Run from the skill root directory:

bun assets/capture.ts <html> <png> <width> <height> [fullpage]

-w Before taking screenshots, an independent checklist must first be generated from the exact source snapshot, and the two must be handed to the screenshot gate together:

bun assets/prepare-whiteboard-source.ts /tmp/<task>/source.txt /tmp/<task>/whiteboard-source-inventory.json
bun assets/capture.ts <html> <png> 1080 1600 fullpage /tmp/<task>/whiteboard-source-inventory.json /tmp/<task>/source.txt

The source checklist must be generated directly from this input, and must not be reverse-inferred from the argument ledger; otherwise, paragraphs missed by the ledger will also disappear, and the completeness check loses its meaning.

When dependencies are missing:

bun install
bunx playwright install chromium

The screenshot script waits for fonts and local images. Do not bypass its loading gate.

Footer

  • -l、-f、-c、-w: Keep logo + Li Jigang on the left; on the right use {{SOURCE_LINE}} to write the explicit source; if there is no source, replace it with an empty string.
  • The logo is an existing brand bitmap; it is not a generated image, and it cannot be used as a content illustration outside the test.

mode routing

Parameter mode file Template
-l references/mode-long.md assets/long_template.html
-f references/mode-full.md assets/full_template.html
-c references/mode-comic.md assets/comic_template.html
-w references/mode-whiteboard.md assets/whiteboard_template.html

Gotchas

  • "Concrete example + abstract conclusion" may still be hard to read. For conceptual connection, check whether the body text writes out the classification basis and the resulting change for the same situation; the appearance of examples, terminology, or acceptance fields cannot substitute for content review. When user feedback says it is hard to understand, rebuild this connection, then adjust the wording; for comparison, see references/learning-design.md。
  • -l recognizability comes from "extremely simple single-line temperament + comic-style visible change + editorial-style evidence structure." Making only one beautiful single panel loses the explanation, while making only a continuous comic overwhelms the long text; for the specific route, refer to references/mode-long.md .
  • -f emphasis can only enhance wording that already exists in the manuscript: font size, weight, color, whitespace, and semantic labels may be changed, but a sentence cannot be extracted and copied into a pull quote, and titles, lead-ins, summaries, or transitional sentences cannot be added.
  • -f full-text acceptance is based on the ordered text block ledger, not on visual impression. Changing a single character, reordering, missing a block, or duplicating a block must all make assets/verify-full-text.ts fail.
  • -f must not be blocked because KingHwa_OldSong is missing, nor may it quietly switch to a remote font; when missing, the local default font stack takes over naturally. During installation, before screenshots, separately confirm that normal body text, title, and headline actually resolve to KingHwa_OldSong; do not just look at the CSS declarations. The monospace font for code and source lines is the only exception.
  • -f black text on a white background is the readability contract for long text, not a temporary color scheme: the background must be #FFFFFF, normal body text must be a deep neutral black, and the body text size/line height must not be lower than 40px/1.9. Dark vermilion only marks a small number of separators and emphases, and must not compete with the black text for dominance.
  • Sparse line art is clear in a local cropped image, but may disappear completely when put back into the full long card.-l representative image must pass both the local pixel check and the full-card thumbnail check; when necessary, only bold the outline, and do not change the metaphor, camera, or composition along with it.
  • -c number of panels is determined by the cognitive causal beats, with no fixed range. Short content is not padded into panels, and long content does not have load-bearing relationships deleted because of a template.
  • The main comic panels are responsible for making actions and results visible; concept names, dialogue, narration, and the calibration of evidence must still be written accurately in HTML/CSS, and the image model must not be allowed to write explanations on their behalf.
  • The same round of explanation or a rerun of the same case requires continuity of characters, props, and space; a different-case test may change the objects while preserving the relationships to be tested. Changing the metaphor at each explanatory beat severs before-and-after comparison.
  • object-fit: cover may crop only one panel badly. After checking each asset, still scan the faces, hands, key props, and action points in all panels, then check the final DOM, the full image, and the overlapping slices.
  • -w mother structure is not a five-choice topology, but a .reasoning-spinethat unfolds from the question along the reasoning. chain, branch, timeline, matrix, and radial are local structures that can be embedded in the trunk; a real article may first progress, then branch, then converge, and one must not delete reasoning in order to choose a single graphic, nor create extra boundary nodes just for the ending.
  • -w establishes an argument ledger before any visual decision: every source section must map to a step, or a specific reason for omission must be registered; every step and relationship is bound to a ledger ID. Even if an example does not participate in the proof, it may still do the work of identifying a concept. Source reconciliation and consistency among the ledger and the DOM are structural gates, and cannot prove that the basis for discrimination is sufficient.
  • -w trunk being unbroken does not mean every layer must speak. Ordinary continuation, explanation, and progression use silent relationships; only when a contradiction, question rewrite, branch, recovery, or boundary truly changes the direction of reading should a complete transitional sentence be shown. Do not replace the specific unresolved pressure in the original text with narration such as "continue to ask" or "take another step forward."
  • -w generated images must not become a hero before the main text. Images are embedded only in the step they explain; if deleting the image leaves the argument, object discrimination, and understanding of the result all unimpaired, 0 images is the correct result. Text can also provide complete lower-layer material.
  • -w silent relationships retain endpoints only in the ledger and the real .logic-relation DOM, without displaying arrows or copy; arrows for visible transitions cannot use ::before/::after, and must use .relation-stem and .relation-arrowhead real elements, with a unique .transition-sentence carrying the entire transitional sentence.
  • -w does not fetch fonts online. Latin handwriting fonts do not provide Chinese glyphs, and Chinese will ultimately fall back silently; the template uses a local Kai/Chinese Sans font stack, and font differences must not change node hierarchy or geometric acceptance.

Examples

Example 1: Cast a paper or book into a long image

User: 「把这篇论文做成卡片 -l」
→ 用一个稳定人物或物件承载可见变化:论文走「问题→机制→证据→边界→决策」,书走「原状→压力→变化→余波」
→ 知识讲解先明确读者任务,展示对象凭什么归入概念、关系怎样落回结果;生成图画可见动作,准确文字由 HTML/CSS 承担
→ 交付一张具有暖纸、稀疏黑线、单一暗红与完整阅读层级的 1080px PNG

Example 2: Cast a technical concept into a comic

User: 「把这篇技术解释做成漫画 -c」
→ 固定一个最小案例,让零号模型先运行并暴露失败
→ 每次只用一格引入当前缺口需要的概念,再回到同案重跑
→ 最后从头运行完整模型,并留一个边界拍点

Example 3: Cast a complete long article into a comic

User: 「把这份已验收的完整笔记做成漫画 -c,不限格数」
→ 先锁定 Org 路径与 SHA-256,再从全文因果主线选择认知拍点
→ 格数服从承重关系与删除测试,不继承旧五格或固定页数
→ 生成分格、组装 HTML,完成逐图、整图与重叠切片 QA

Example 4: Lay out the original text as a long image without changing a single word

User: 「这篇文稿用 -f 铸成全文卡片,原文不要动」
→ 锁定来源与 SHA-256,把标题、段落、列表、引用、强调和脚注登记为有序原文块
→ 不摘要、不补标题、不抽取重复金句;只用白底、深黑、KingHwa_OldSong、克制灰阶、字体层级与留白做编辑设计
→ 全文校验器通过后截图,交付一张生成图数量为 0 的 1080px 原文长 PNG

Delivery contract

The final reply must report at least: the absolute PNG path, pixel dimensions, content source, the mode used, the number of generated images, and the full-image/segmented visual QA results. If the input comes from an already accepted Org, first record its path and SHA-256, and after card creation confirm that the source file hash has not changed.-f must also report the number of ordered original-text blocks and the full-text verification result; the number of generated images is fixed at 0.

In the delivery reply, the knowledge explanation should additionally briefly report the review results of the content connected above, the material gaps not yet filled, and whether a reader case-swap field test has been done. If no field test has been done, write "no reader field test done"; do not substitute self-review or program pass for learning effectiveness. These are delivery information, not finished body text or endnotes.

Maintenance self-check

After upgrading the template or mode, run:

bun run audit
bun test
bun run fixtures

The first checks the shared protocol, four-way references, bitmap slots, whiteboard source reconciliation, full-text fidelity contract, and prohibited items; the second runs pure functions and counterexample tests; the third, in /tmp/ljg-card-v7-fixtures/ generates representative HTML, runs full-text and whiteboard source validation, then uses capture.ts to actually take screenshots and read back the PNG.

Use an exclusive directory for each maintenance run:LJG_CARD_FIXTURE_DIR=/tmp/<task>/fixtures bun run fixtures. Existing fixtures verify rendering and structure; when changing the learning design, additionally use references/learning-design.md comparison materials for trial writing, check the actual expression, and do not substitute text rule hits for content review.