ljg-card
"Content caster (铸). Transforms text into PNG through precise HTML typography and, when the mold needs it, generated raster imagery. Four molds: -l (default) long reading card, -f source-faithful full text, -c comic, -w whiteboard. USE WHEN user says '铸', 'cast', '做成图', '做成卡片', '做成海报', '原文排版', '全文卡片', '漫画', or '白板'."
1How It Works & Mechanism
Arguments determine the four molds: -l long card (default) / -f full text / -c comic / -w whiteboard, each with its own dimensions and image roles; -l is used when no arguments are provided.
| `-l`(默认) | 长图 · 静线叙事 | 1080 × auto | 0–3 幅;有理解增益时用 1 个安静主场景,必要时追加连续视觉拍点 |
Ten-step shared production pipeline: Read input → Lock source and factual boundaries → (Define reader tasks first for knowledge explanations) → Generate calibration images → Persist and inspect images → Assign text to HTML → Read template and replace placeholders → Wait for fonts and images → Full image and slice inspection → Content review.
6. 将所有可读文字、数字、公式、标签、箭头和来源放入 HTML/CSS;图片承担具体场景、机制动作、条件对比或明确标明的类比。
Temporary directory constraint: Regardless of the invocation directory, a dedicated directory for the current task must be created under /tmp prior to card generation, and all intermediate artifacts must be written exclusively to this directory.
无论从哪个目录启动,制卡前都必须在 `/tmp` 下建立本任务独占的临时目录。…全部只能写入该目录。
Screenshots are taken using the bundled capture.ts (Playwright), which waits for fonts and local images to load; its loading gate must not be bypassed.
截图脚本会等待字体与本地图片。不要绕过它的加载门禁。
The -f full-text mode follows an ordered raw text block ledger and verify-full-text.ts: the verification tool must exit with a non-zero code for all four types of counterexamples: modified single characters, reordering, missing blocks, or duplicated blocks.
验收反例固定为四类:改单字、调序、漏块、重复块。四类中的任意一种都必须让校验工具退出非 0。
The -f mode prioritizes local KingHwa_OldSong font; network downloads, temporary installations, or remote references during card generation are strictly prohibited; missing fonts fall back to the local default font stack.
不得为了制卡联网下载、临时安装或远程引用该字体。
Generated images start by establishing a visual motif table and a series bible, accompanied by unified negative prompts (prohibiting legible in-image text/logos/watermarks) to maintain character, medium, and color continuity across the series.
写提示词前先完成表格;一行对应一个候选资产:
The -w whiteboard mode builds an argument ledger first: every source section must map to a step or have a specific omission reason recorded; the source_sections of the ledger must match the ID and order of the independent source list exactly.
每个源章节必须二选一,不能静默消失。
Knowledge explanations (-l/-w) adopt the bottom-up learning-design structure: readers must be able to identify targets, actions or state transitions, classification features, relational conditions, and outcomes from the explanation.
读者应能从同一段解释中指出:眼前是什么对象,发生了什么动作或状态变化,哪个特征支持归类,关系靠什么条件成立,最后得到什么结果。
Three maintenance self-check commands: audit checks shared protocols, four-way references, whiteboard source reconciliation, full-text fidelity, and prohibited items; test runs pure functions and counterexamples; fixtures generates representative HTML and takes actual screenshot captures back to PNG.
第一条检查共享协议、四路引用、位图槽、白板来源对账、全文忠实度合同与禁用项;第二条运行纯函数与反例测试;第三条在 `/tmp/ljg-card-v7-fixtures/` 生成代表 HTML,运行全文与白板来源校验,随后用 `capture.ts` 实际截图并读回 PNG。
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| package | playwright |
| host-tool | 运行时 image generation 工具 |
| network | Google Fonts(comic_template.html 的 @import,产物期远程字体) |
4Recommended Governance & Evidence
- scripts/: Execute local script or command: bun assets/capture.ts <html> <png> <width> <height> [fullpage]: Playwright headless execution
- 网络端点: Declare external network access: comic_template.html contains @import Google Fonts (output-stage remote fonts; the browser may fetch fonts.goog during -c rendering)
- 本地工作目录: File I/O and artifact output: Dedicated /tmp/<task> workspace: all intermediate artifacts including candidate images, source images, HTML/CSS, vector drafts, render inputs, draft captures, QA slices, cache, and logs.
5Second-Pass Verification
- [ok] 四模具与 mode/模板路由表 — SKILL.md 参数表与 mode 路由表一致(-l/-f/-c/-w 分别对应 long/full/comic/whiteboard 模板)。
- [ok] -f 全文保真与校验器合同 — mode-full.md 规定四类反例必须让 verify-full-text.ts 退出非 0,与 SKILL.md Gotchas 互相印证。
- [ok] -w 来源清单先于账本生成 — mode-whiteboard.md 明确 prepare-whiteboard-source.ts 由本次输入生成,账本 source_sections 必须与其 ID/顺序一致。
- [ok] 网络面核实 — 无 fetch/requests 类代码;扫描命中的 URL 均为 lockfile registry、模板 @import 与测试数据,属产物期或安装期。
- [ok] 判级口径 — 目录内零凭证读取、写盘限于 /tmp 与最终交付物,符合 blue(仅本地脚本/CLI 与本地读写)。
- [ok] meta 核定值未改动 — license/stars/last_push/official_desc 与骨架一致,installs 保持 null(无可定位到本 skill 的安装量)。
6Verdict & Scenarios
a574935eb0666759…