Home / All Skills / Workflow & Core Tools / ljg-card
Workflow & Core Tools · lijigang/ljg-skills

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 '白板'."

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedExecute CommandNetwork AccessWrite FileDual-pass Audit
Author lijigangGitHub lijigang/ljg-skills ↗License MIT(仓库根 LICENSE)Commit 9e75497a95
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

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.

skills/ljg-card/SKILL.md
| `-l`(默认) | 长图 · 静线叙事 | 1080 × auto | 0–3 幅;有理解增益时用 1 个安静主场景,必要时追加连续视觉拍点 |
What is happening here: Binding molds, dimensions, and generated image budgets into a single parameter table, serving as the branch point for all subsequent steps.

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.

skills/ljg-card/SKILL.md
6. 将所有可读文字、数字、公式、标签、箭头和来源放入 HTML/CSS;图片承担具体场景、机制动作、条件对比或明确标明的类比。
What is happening here: Defining the division of labor between images and text: any semantic text, numbers, and arrows must be precisely rendered via HTML/CSS, while images only depict visible actions.

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.

skills/ljg-card/SKILL.md
无论从哪个目录启动,制卡前都必须在 `/tmp` 下建立本任务独占的临时目录。…全部只能写入该目录。
What is happening here: Using a temporary directory to isolate candidate images, render inputs, QA slices, and logs, preventing pollution of the repository and user directories.

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.

skills/ljg-card/SKILL.md
截图脚本会等待字体与本地图片。不要绕过它的加载门禁。
What is happening here: Making "font and image readiness" a prerequisite for screenshots, halting execution if any image is corrupted.

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.

skills/ljg-card/references/mode-full.md
验收反例固定为四类:改单字、调序、漏块、重复块。四类中的任意一种都必须让校验工具退出非 0。
What is happening here: Transforming "not altering a single character of the original text" from an impressionistic visual check into an enforceable validator contract.

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.

skills/ljg-card/SKILL.md
不得为了制卡联网下载、临时安装或远程引用该字体。
What is happening here: The font policy adheres to local-first and graceful fallback upon absence, introducing no remote font dependencies.

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.

skills/ljg-card/references/image-generation.md
写提示词前先完成表格;一行对应一个候选资产:
What is happening here: Tabulating "what should be depicted in the frame" upfront to prevent the image generation model from blindly guessing based on the whole text.

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.

skills/ljg-card/references/mode-whiteboard.md
每个源章节必须二选一,不能静默消失。
What is happening here: Constraining the ledger with an independently generated source list to prevent missing original sections from being rationalized by the ledger itself.

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.

skills/ljg-card/references/learning-design.md
读者应能从同一段解释中指出:眼前是什么对象,发生了什么动作或状态变化,哪个特征支持归类,关系靠什么条件成立,最后得到什么结果。
What is happening here: Providing concrete criteria for content review instead of merely verifying whether fields are filled.

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.

skills/ljg-card/SKILL.md
第一条检查共享协议、四路引用、位图槽、白板来源对账、全文忠实度合同与禁用项;第二条运行纯函数与反例测试;第三条在 `/tmp/ljg-card-v7-fixtures/` 生成代表 HTML,运行全文与白板来源校验,随后用 `capture.ts` 实际截图并读回 PNG。
What is happening here: Solidifying regression testing into three reproducible self-check commands after template and mode upgrades.

2Core Capabilities

01Cast text into a 1080px tall PNG card (default -l warm-paper quiet-line narrative long card)
02-f source-faithful full-text typesetting: visible text blocks appear exactly once without character or sequence changes, using only font size, font weight, and whitespace for editorial design
03-c comic: panel count is determined by cognitive cause-and-effect beats; short content is not padded, and load-bearing relationships in long content are preserved
04-w whiteboard vertical argumentation: single .reasoning-spine trunk, relegating chain/branch/timeline/matrix/radial to localized sub-tools
05Shared image generation protocol: quad-fold asset identities (generated/source/brand/structural), visual motif tables, series bibles, prompt skeletons, unified negative constraints, and sample-before-batch workflow
06Bottom-up knowledge explanation structure: selecting materials based on reader tasks, covering targets & problems, discriminant criteria, relationships & conditions, examples & outcomes, and counter-cases & feedback
07Bundled Playwright capture tool capture.ts, supporting custom width/height and fullpage long images, with optional whiteboard source list gating
08Maintenance toolchain: audit.ts (protocol and fidelity audit), verify-full-text.ts (full-text verification), prepare-whiteboard-source.ts (source manifest), and build-fixtures.ts (fixture regression)
09Shared aesthetic baseline: judgment precedes decoration, every image must answer "what does the reader see", non-uniform layouts, and ending naturally on the content itself

3External Dependencies

KindDependency / Endpoint
packageplaywright
host-tool运行时 image generation 工具
networkGoogle Fonts(comic_template.html 的 @import,产物期远程字体)

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Graded/per-use authorization, sandbox recommended
For Administrators
Approval workflow, rollback support, full audit
Evidence & Triggers (File Paths & Excerpts)
  • 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.
Audit Notes: Risk Advisory: Blue. Involves only local scripts and local read/write, safe for compliant use. Evaluation target = this skill directory (skills/ljg-card/: SKILL.md + 7 references + assets scripts/templates + lockfile). Item-by-item verification: script execution is entirely local Bun/Playwright (capture/audit/verify-full-text/prepare-whiteboard-source/build-fixtures); disk writes are confined to the dedicated /tmp workspace and final delivery PNGs; zero credential access. Among the scanned URLs, npmjs registry appears solely in lockfiles, and Google Fonts @import exists only in the comic_template.html template—both are artifact-phase/installation-phase references rather than runtime skill code requests, thus not affecting the tier rating. image_gen is a runtime host capability whose handling of user materials is governed by the host; the rating only evaluates the intrinsic behavior of this directory.

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

  • Codifies text-to-image design discipline into enforceable contracts: source locking via SHA-256, ordered text block ledgers, whiteboard source manifests, and dual-scale pixel/slice inspections—failing with hard stops rather than silent fallbacks.
  • Clear division of labor between text and visuals, accompanied by three regression commands (audit/test/fixtures) to ensure re-verifiability after template upgrades.
  • All four molds share a single image generation protocol and aesthetic baseline; knowledge explanations are further calibrated via learning-design bottom-up connections, achieving broad yet disciplined coverage.
  • Best for: Users who need to cast long articles, papers, books, technical concepts, original manuscripts, or reasoning workflows into readable 1080px long images and are willing to adopt a rigorous pipeline of "source locking + validators + pixel verification"; also suitable for knowledge explanation cards (-l/-w) or verbatim full-text typesetting (-f).
    Not for: Scenarios where only a one-liner or a casual generic illustration is desired; cases lacking reliable sources and factual boundaries; environments unable to install Bun/Playwright or lacking image generation capabilities; or requests solely for translating a classical quote, drafting modern articles, or generic content cards (choose lighter-weight alternatives outside -f/-c).
    Install Agent-Ready
    ① Verified Mirror 2026-10-10
    Option A · Direct DownloadDownload ljg-card.tar.gz
    sha256: a574935eb0666759…
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 9e75497a95.