Lov Document Illustrator logo

Lov Document Illustrator

Organization
lovstudio
lov-document-illustrator

为文档原地插入 AI 配图。读取文档后全局规划插入点,并行生成所有图片, 异步插回原文。支持封面图、自定义比例和三种风格。 Use when: 用户要求为文档/文章/笔记生成配图、插图。 Also trigger when user mentions: 配图、插图、illustration、 generate images、document images、为文章加图。

Overview

Publisherlovstudio
Repositoryskills
Skill namelov-document-illustrator
Stars
67
Forks
17
Bundled files
7
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by lovstudio on GitHub. Read the source before you install it.

Installation

Install the Lov Document Illustrator AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lovstudio/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/document-illustrator .claude/skills/lov-document-illustrator
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Lov Document Illustrator in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Lov Document Illustrator on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Lov Document Illustrator is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

文档插画师 · Document Illustrator

基于 AI 智能分析的文档配图生成工具。全局规划、并行生成、异步插入,高效为文档添加配图。

核心流程(5 步)

备份 → 全局规划插入点 → 并行生成图片 → 异步插入原文 → 清理备份

Step 0: 备份原文件

在修改前先创建备份,确保安全回滚:

python
import shutil
backup_path = f"{doc_path}.illustrator-backup"
shutil.copy2(doc_path, backup_path)

所有后续操作直接在原文件上进行。

Step 1: 全局确定所有插入位置

读取完整文档,一次性规划所有图片的插入位置:

  1. 使用 Read 工具读取完整文档
  2. AI 分析内容结构,识别核心主题
  3. 为每个主题确定精确的插入锚点(行号 + 上下文文本)
  4. 输出一份插入计划表:
插入计划:
  [1] 行 15 后 | 锚点: "## Rules 的诞生" | 主题: Rules 演化历程
  [2] 行 42 后 | 锚点: "## Commands 打包" | 主题: 工作流打包
  [3] 行 78 后 | 锚点: "## MCP 动态能力" | 主题: 第三方集成
  ...
  [cover] 行 1 前 | 封面图 | 主题: 全文概要

关键:插入锚点使用上下文文本(而非纯行号),这样即使前面的插入导致行号偏移,后续插入仍可通过锚点定位。

Step 2: 并行生成所有图片

用 Agent 工具并行启动所有图片生成子任务:

对每个插入计划项,同时启动一个 Agent:
  Agent 1: generate_single_image.py --title "..." --content "..." --output images/illustration-01.png
  Agent 2: generate_single_image.py --title "..." --content "..." --output images/illustration-02.png
  Agent 3: generate_single_image.py --title "..." --content "..." --output images/illustration-03.png
  ...
  • 所有 Agent 并发执行,不互相等待
  • 每个 Agent 完成后返回图片路径或错误信息
  • 预期总耗时 = 单张耗时(10-20s),而非 N * 单张耗时

Step 3: 异步插入原文

每个 Agent 完成后立即插入,不等待其他 Agent:

  1. Agent 完成 → 获得图片路径
  2. 在原文档中通过锚点文本定位插入位置(不依赖行号)
  3. 使用 Edit 工具在锚点后插入 Markdown 图片引用:
    markdown
    ![主题描述](images/illustration-01.png)
  4. 插入使用锚点文本匹配,所以前面的插入不影响后面的定位

位置偏移处理

  • 每次插入会增加文档行数
  • 使用锚点文本(如 ## Rules 的诞生)而非行号来定位
  • 从文档末尾向开头方向插入也可避免偏移问题

Step 4: 验证与清理

所有图片插入完成后:

  1. 验证:检查原文档中所有计划的 ![...]() 引用都已插入
  2. 验证:检查所有图片文件都存在于 images/ 目录
  3. 成功 → 删除备份文件 {doc_path}.illustrator-backup
  4. 失败 → 保留备份文件,报告哪些图片未能生成/插入,用户可用备份恢复
完成: 6/6 张配图已插入原文档
已清理备份文件

配置选项

执行前 Claude 会询问(或从用户消息中推断):

选项默认
图片比例16:9 / 3:416:9
是否封面图是/否
内容配图数量3-10根据文档长度推荐
风格gradient-glass / ticket / vector-illustrationgradient-glass

如果用户在请求中已指定(如"竖屏、票据风格、8张"),直接使用,不再询问。

风格速查

风格关键词适合
gradient-glass玻璃拟态、极光渐变、科技感技术文档、产品介绍
ticket黑白对比、票券结构、极简数据报告、信息图表
vector-illustration扁平插画、复古配色、几何化教程、故事、品牌

风格文件位于 styles/ 目录。

技术细节

项目
API 模型Gemini 2.0 Flash Image Preview
16:9 分辨率2560x1440 (2K) / 3840x2160 (4K)
3:4 分辨率1920x2560 (2K) / 2880x3840 (4K)
单张耗时~10-20s
并行耗时~10-20s(总,不乘 N)
依赖pip install google-genai pillow python-dotenv
API Key.envGEMINI_API_KEY 或环境变量

脚本

  • scripts/generate_single_image.py — 单张图片生成(供 Agent 并行调用)
  • scripts/generate_illustrations.py — 旧版批量顺序生成(保留兼容)

Runtime context (shared)

运行前读取本 Skill 包的 skill.yaml,由宿主提供 skill-runtime/v1 上下文。字段解析顺序为:当前请求、项目上下文、个人 Preferences、品牌 Profile、通用默认值。

  • 只使用 Manifest 声明的字段;Profile 保存公开品牌事实,Preferences 保存个人工作偏好。
  • required: true 字段缺失时,按 Manifest 的问题配置向用户提出一个聚焦问题;用户明确同意后再保存回答。
  • 报错提供可复制的 context_id、字段路径与来源,诊断内容避开秘密、完整私人路径和原始配置。

通用反馈闭环

用户在 Skill 驱动任务中提出修改意见时,继续当前产物前必须执行:

  1. 先判断意见是 task-specific(仅本次)还是 reusable(可跨任务复用)。
  2. task-specific 只修改当前任务,不改 Skill。
  3. reusable 先确定作用域:领域规则先更新对应 canonical Skill;适用于所有 Skill 的规则先更新共享规范。
  4. 完成规则更新、版本、lint 与分发核验后,再把修改应用到当前任务。
  5. reusable 修改会使此前的“确认”“继续”“发吧”失效;完成当前产物修改和回读后必须停下,等待用户下一步指示,不自动进入发布、提交或其他外部写入。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Lov Document Illustrator AI skill do?

为文档原地插入 AI 配图。读取文档后全局规划插入点,并行生成所有图片, 异步插回原文。支持封面图、自定义比例和三种风格。 Use when: 用户要求为文档/文章/笔记生成配图、插图。 Also trigger when user mentions: 配图、插图、illustration、 generate images、document images、为文章加图。

Why use Lov Document Illustrator on TypingMind?

Because you install it once and use it with any model. Lov Document Illustrator is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Lov Document Illustrator in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/lovstudio/skills/tree/main/skills/document-illustrator. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Lov Document Illustrator?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Lov Document Illustrator?

As many as you like. As long as a model supports skills, you can use Lov Document Illustrator with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Lov Document Illustrator AI skill free?

Yes. It is published on GitHub by lovstudio under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇