公众号排版 · WeChat Typesetter
把用户的 Markdown 交给 Lovpen 已验收的真实渲染链。默认生成与
LovpenReact → 微信公众号 → extractWechatClipboardHTML
相同契约的内联
HTML;只有用户明确要求独立网页时才输出带
的完整文档。
Public identifier:
intentionally matches the Lovpen product and
installed command. Do not rewrite it as
; that would break the
existing
trigger and installation paths.
Triggers
Activate when
- “/lovpen-cli 把这篇 Markdown 用 Typora 套装排版成微信公众号 HTML”。
- “列出 Lovpen 可用的主题、代码高亮和模板”。
- “检查 lovpen-cli 能不能用”“用 JSON 返回 Lovpen 渲染证据”。
- “Use /lovpen-cli to render this Markdown with Lovpen.”
- “Render this Markdown with the Typora Newsprint kit for WeChat.”
- “Render this Markdown as a self-contained Lovpen HTML file.”
Do not activate when
- 用户要创建、重构或修复 CLI 本身;交给 或目标项目开发流程。
- 用户要发布、上传或上架这个 Skill;交给 。
- 用户要直接发布到微信公众号、知乎、小红书或 Twitter;本 Skill 只生成 HTML,平台发布由对应产品能力负责。
- 用户只要润色 Markdown 文本而不需要 Lovpen 渲染;使用写作或编辑能力。
- “给 Lovpen 项目新增一个 React 组件”属于应用开发,不触发本 Skill。
User Profile (cross-session)
Every invocation reads the shared
contract declared in
. Resolve the CLI path, Lovpen project root, output directory,
default template kit, theme, and highlight in this order: current request,
project context,
skills.lovpen-cli.records
, shared preferences, workspace
Profile, then safe defaults.
Persist only a directly stated durable preference. For example, when the user
explicitly says to always use one theme:
bash
python3 "$SKILL_DIR/scripts/profile_store.py" record \
--skill-id lovpen-cli \
--path records.default_theme \
--value '"wabi-sabi"' \
--confirm
Report the saved Profile path. Never persist inferred project paths, document
contents, credentials, or tokens. Read
references/user-profile.md
for the
complete contract.
Skill Group Composition
Read
references/skill-composition.md
before invoking an adjacent Skill.
owns intent routing and verified use of the existing CLI. The CLI
is the product backend, not an embedded Skill module or copied implementation.
Workflow (MANDATORY)
Follow these steps in order.
Step 0: Resolve the Skill, Profile, and CLI
- Resolve from the active Skill context.
- Read ,
references/skill-composition.md
, and
references/cli-contract.md
completely.
- Confirm
$SKILL_DIR/scripts/run_lovpen_cli.py
exists.
- Resolve the backend through the wrapper. It accepts an explicit CLI,
, an installed on , or a ready project root
from the request, , Profile, or current directory.
- Do not store a machine-specific resolved path in this Skill source.
Manual resolution check:
bash
python3 "$SKILL_DIR/scripts/run_lovpen_cli.py" \
--project-root PROJECT_ROOT \
--resolve-only
Step 1: Map the user task to the narrowest command
- Runtime health and dependencies: .
- CLI identity and readiness: .
- Machine-readable command discovery: .
- Available themes, highlights, templates, and template kits: .
- Markdown to WeChat-copy HTML or a self-contained HTML artifact: .
For
, resolve the input Markdown, output HTML, format, template kit or
individual resources, title, and author. The safe format default is
.
If the output is omitted, use
INPUT_STEM.lovpen.wechat.html
; use
only for explicitly requested
output.
Without a named kit, safe resource defaults are theme
, highlight
, and no HTML template.
Step 2: Run doctor before a material render
Use global
before the subcommand:
bash
python3 "$SKILL_DIR/scripts/run_lovpen_cli.py" \
--project-root PROJECT_ROOT \
-- --json doctor
Continue only when the JSON envelope has
and
.
For WeChat format, confirm the
,
, and
checks are also true. On failure, return the CLI or wrapper
, failed check, and hint.
Step 3: Inspect resources when selection is unresolved
Run
before choosing an unverified theme, highlight, or template:
bash
python3 "$SKILL_DIR/scripts/run_lovpen_cli.py" \
--project-root PROJECT_ROOT \
-- --json resources
Match theme names or
exactly. Match highlight and HTML template
names exactly. Match a template kit by its exact
or
; for example,
the UI's “Typora Newsprint” selection is
--template-kit typora-newsprint
, not
. A kit atomically resolves its theme, highlight, optional
HTML layout, and theme color. Do not combine
with
,
, or
.
Step 4: Render through the real Lovpen backend
bash
python3 "$SKILL_DIR/scripts/run_lovpen_cli.py" \
--project-root PROJECT_ROOT \
-- --json render INPUT.md \
--output OUTPUT.html \
--format wechat \
--template-kit typora-newsprint
For an explicitly requested independent document, pass
and select
,
, and optionally
. Add
or
only when requested or resolved from the current document
context. Use
when the user asks to preview the planned write. Never
reconstruct a shell command from untrusted input; pass arguments as an array
through the supplied wrapper.
Step 5: Validate and report the artifact
For a successful render, verify all of the following from the JSON response and
filesystem:
- and are true, unless this was a dry run.
- identifies Lovpen's standalone renderer.
- The absolute output path exists as a regular file.
- is positive and is a 64-character digest.
- , , theme, highlight, template kit/template, and
are reported without hiding limitations.
- For , is ,
identifies
extractWechatClipboardHTML
, the output root is
<section class="lovpen-renderer">
, inline styles are present, and no
tag remains.
- For , is , the document
contains its embedded , and browser-only disabled plugins remain
explicit.
Lead with the output file, then report resource choices and verification. Do
not blur the two contracts. WeChat format runs Lovpen's shared preview-plugin
and clipboard extractors in Chromium using the same built-in defaults and
resolved kit as the UI; standalone format intentionally remains the DOM-free
document path. If the UI has additional persisted per-document settings that
were not provided to the CLI, report that scope instead of claiming those
settings were reproduced.
Dependencies
- Python 3.9+
- Node.js 20+
- Chrome or Chromium 109+ for WeChat format
- 0.2.0 on , or a Lovpen source checkout whose
agent-harness/lov-cli.json
status is
- Installed Lovpen workspace dependencies, including Vite, for source-checkout mode
No credentials are required for local rendering.
Validation
bash
python3 "$SKILL_DIR/scripts/validate_skill.py" "$SKILL_DIR"
python3 "$SKILL_DIR/scripts/run_lovpen_cli.py" \
--project-root PROJECT_ROOT \
-- --json doctor