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

ljg-classic

Generator for classical Chinese character-by-character annotations, composite typesetting, chapter motif illustrations, and full-chapter interpretations. Arranges the original text, word/phrase notes, clause notes, textless header artwork, and chapter interpretation into a single readable long PNG. USE WHEN the user invokes ljg-classic OR requests character-by-character annotations, color-coded inline glosses, chapter interpretations, classical Chinese lecture-note graphics, or chapter illustrations for classical Chinese (wenyanwen), classical poetry, or traditional canonical literature (Classics, Histories, Masters, Collections). NOT FOR single-sentence translations, purely modern articles, or generic content cards.

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedExecute CommandWrite 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

Input must establish the original text, book title, and chapter; when the edition is ambiguous, preserve textual variant boundaries rather than deciding the base text for the user.

skills/ljg-classic/SKILL.md
输入必须能确定原文、书名、章节;版本不明时保留异文边界。
What is being done here: Treating 'base text uncertainty' as an explicit boundary rather than silently picking one reading.

Three tiers of color-coded inline notes serve distinct semantic roles and answer specific questions: cyan word notes for word/character meanings, vermilion clause notes for sentence actions, and ochre variant notes for textual variants and uncertainties.

skills/ljg-classic/References/AnnotationMethod.md
| `word` | 青色 | 这个字词在此处是什么意思 | 古今义、虚词功能、语法、读音 |
What is being done here: Using color to carry grammatical roles, allowing readers to distinguish word meanings, clause meanings, and variant notes at a glance.

'Character-by-character' is fulfilled via coverage rate: all non-punctuation tokens must have a note; compounds, function words, and phonetic loan characters are annotated by minimal meaningful unit without mechanically splitting them into isolated characters.

skills/ljg-classic/References/AnnotationMethod.md
“逐字注解”通过覆盖率兑现:所有非标点 token 都有 note。
What is being done here: Defining 'character-by-character' as 100% coverage rather than tearing fixed words into meaningless single characters.

The renderer consumes UTF-8 JSON; concatenating text in token order must match original verbatim; non-punctuation tokens require note and tone.

skills/ljg-classic/References/InputSchema.md
按 token 顺序拼接 `text`,必须与 `original` 逐字一致。
What is being done here: Using a concatenation invariant to turn the 'original text backbone' into a machine-verifiable contract.

Typesetting does only one thing: the eye first reads along the black original text, checks adjacent colored glosses when meeting friction, and naturally lands on the blue chapter interpretation upon finishing the whole chapter.

skills/ljg-classic/References/LayoutGrammar.md
页面只做一件事:让眼睛先沿黑色原文读,再在遇到阻力时看身边的彩色注,读完整章后自然落到蓝色解读。
What is being done here: Establishing the reading eye-flow and three visual zones across the entire long graphic.

Defaults to invoking built-in image_gen to produce a textless, low-distraction chapter motif illustration placed between chapter title and original text; if image generation is unavailable, falls back to an image-free version with an explanation.

skills/ljg-classic/SKILL.md
默认调用内置 `image_gen` 生成一幅无字、低干扰的章节意旨图,放在章节标题与原文之间;图像不可用时继续生成无图版本并说明。
What is being done here: The header graphic compresses the central motif; failure degrades gracefully without blocking the pipeline.

Each run creates an exclusive /tmp/ljg-classic-* workspace where JSON, HTML, manifest, motif illustration, candidate PNG, and QA slices reside; files are copied to $HOME/Downloads/ only after acceptance.

skills/ljg-classic/SKILL.md
候选 PNG 完成硬验收后,才复制到 `$HOME/Downloads/` 作为最终卡片;用户显式指定另一最终路径时以本次指令为准。
What is being done here: Separating intermediate artifacts from final deliverables, verifying SHA-256 consistency between both.

The chapter interpretation retains only one primary relationship, prioritizing directness over polish: intra-chapter components, condition-triggered actions, outcomes, and migration or failure boundaries.

skills/ljg-classic/References/AnnotationMethod.md
章节解读只保留一个主关系。
What is being done here: Preventing sentence-by-sentence translations from being re-stitched into a generic paragraph or a quote compilation.

Annotations must not alter the original text: suspected typos, phonetic loans, or edition variants in the base text are marked using variant rather than silently replaced.

skills/ljg-classic/SKILL.md
注解不能改写原文。底本疑似错字、通假或版本差异用 `variant` 标出,不能静默替换。
What is being done here: Guarding the boundary between original text and commentary; variants are marked without unauthorized edits.

The toolchain relies on local Bun/Playwright: RenderClassic.ts for rendering and ValidateClassic.ts for validation, both exposed via package.json scripts.

skills/ljg-classic/package.json
"render": "bun Tools/RenderClassic.ts",
What is being done here: Rendering and validation are local commands independent of remote typesetting services.

2Core Capabilities

01Character-by-character classical Chinese annotation: all non-punctuation tokens carry corresponding annotations, achieving 100% coverage
02Three-tier color-coded inline gloss system: word in cyan (word/character meaning), clause in vermilion (clause action), variant in ochre (textual variants and uncertainties)
03Composite typesetting: original text tokens and annotations form unbreakable units; punctuation follows adjacent tokens to prevent orphaned lines
04Chapter motif illustration: horizontal 3:2 aspect ratio, textless, low distraction, embedded between chapter title and original text with safe margins
05Chapter interpretation zone: warm paper background with dark ink, single primary relationship, titled strictly '章节解读' without marketing subtitles
06Input JSON schema and rendering contract: original concatenation must match verbatim, non-punctuation tokens require note/tone, no HTML allowed in JSON
07Self-contained render/validate/test toolchain driven entirely by local Bun commands
08Delivery discipline: PNG existence does not imply completion; dimensions, title/chapter, annotation coverage, page footer, and full image/slices must be verified
09Pinyin is annotated only for rare readings, polyphonic characters, or archaic pronunciations that alter comprehension; if uncertain, annotate with variant instead of guessing

3External Dependencies

KindDependency / Endpoint
packageplaywright
host-tool内置 image_gen(章节意旨图)

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 scripts or commands: bun Tools/RenderClassic.ts: Local Playwright rendering that reads UTF-8 JSON and outputs PNG.
  • 本地工作目录: File read/write and artifact output: Exclusive /tmp/ljg-classic-* workspace: JSON, HTML, manifest, motif image, candidate PNG, and overlapping QA slices.
Audit Notes: Risk assessment: Blue; uses only local scripts and local file read/write, fully compliant for execution. Target of evaluation = this skill directory (skills/ljg-classic/: SKILL.md + References/ + Workflows/ + Tools/ + package.json). Detailed verification: Execution surface is strictly local Bun + Playwright (RenderClassic/ValidateClassic/test); disk writes are confined to the exclusive /tmp workspace and final PNG delivery to $HOME/Downloads/; zero credential reading, zero network request logic. Flagged URLs during risk scanning are solely mock data in RenderClassic.test.ts (example.com placeholder images and Wikisource provenance strings), serving as metadata without generating network traffic. The flagged 'execute external program' finding is merely a prohibitive instruction in Workflows documentation stating 'do not switch to npm/npx/Python typesetting scripts'. Hence rated blue.

5Second-Pass Verification

  • [ok] 文件名与类型一致性 — SKILL.md、三份 References、Workflows/AnnotateAndRender.md、Tools/RenderClassic.ts、Tools/ValidateClassic.ts、package.json 均在 §1 清单中可见。
  • [ok] 逐字注解覆盖率口径 — AnnotationMethod.md 与 InputSchema.md 均要求非标点 token 有 note,SKILL.md Gotchas 亦重申 100% 覆盖。
  • [ok] original 拼接不变量 — InputSchema.md 第 1 条与 SKILL.md 合同一致:token 顺序拼接必须与 original 逐字一致。
  • [ok] 交付路径与临时工作区 — SKILL.md 要求 /tmp 验收后复制到 $HOME/Downloads/ 并读回 SHA-256,与 gotchas 一致。
  • [ok] 网络与凭证面 — 扫描命中的 URL 均为测试数据字符串;目录内无 fetch/curl、无 env/API key 读取。
  • [ok] 判级口径 — 仅本地脚本与本地读写、零凭证零网络,符合 blue。

6Verdict & Scenarios

  • Turns classical Chinese annotation into an executable contract: 100% token coverage, verbatim original concatenation, and zero HTML in JSON, making it machine-verifiable.
  • Three-tier color glosses and a warm-paper dark-ink interpretation block establish a clear reading eye-flow, letting color serve grammatical rather than decorative roles.
  • Solid delivery discipline: candidate acceptance in /tmp, final delivery in Downloads, and SHA-256 verification—a generated PNG alone does not equal completion.
  • Best for: Users who need character-by-character annotations, color-coded inline glosses, chapter motif artwork, and comprehensive chapter interpretations for classical Chinese (wenyanwen), classical poetry, or traditional canonical literature, delivered as a readable long PNG; also ideal for turning entire chapters of works like the Daodejing or the Analects into lecture graphics.
    Not for: Translating only a single sentence of classical Chinese, authoring purely modern articles, or generating generic content cards; not a general-purpose 'content-to-image' tool (that belongs to ljg-card), nor suitable for workflows requiring real-time interaction or branching across extensive text variants.
    Install Agent-Ready
    ① Verified Mirror 2026-10-10
    Option A · Direct DownloadDownload ljg-classic.tar.gz
    sha256: 5821f03373434196…
    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.