# Content Illustrator

> |

- **Type:** Skill
- **Install:** `agentstack add skill-hhhh124hhhh-skillmate-content-illustrator`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [hhhh124hhhh](https://agentstack.voostack.com/s/hhhh124hhhh)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [hhhh124hhhh](https://github.com/hhhh124hhhh)
- **Source:** https://github.com/hhhh124hhhh/SkillMate/tree/main/resources/skills/content-illustrator

## Install

```sh
agentstack add skill-hhhh124hhhh-skillmate-content-illustrator
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 文章插图生成技能

## 核心功能

AI 驱动的插图规划系统，自动分析文章结构，识别需要视觉辅助的位置，并调用项目内置的豆包 Seedream 4.5 API 生成高质量插图。

## 风格系统

支持 **14 种精细风格**：

### 现有风格（5种）
- **tech** - 专业科技（AI、编程、技术文档）
- **fresh** - 清新活泼（生活分享、学习笔记）
- **minimal** - 简约极简（哲学思考、深度观点）
- **warm** - 温暖治愈（情感文章、成长感悟）
- **business** - 商务专业（数据报告、市场分析）

### 新增风格（9种，来自宝玉）
- **elegant** - 优雅精致（商业分析、领导力内容）
- **bold** - 高对比冲击（观点文章、重要提醒）
- **playful** - 活泼趣味（教程指南、轻松内容）
- **nature** - 自然有机（环保健康、自然主题）
- **sketch** - 手绘草图（头脑风暴、创意过程）
- **notion** - Notion 极简（知识分享、概念解释）**[默认]**

## 工作流程

### 步骤 1：分析内容与选择风格

1. **读取文章内容**
   - 使用 `read_file` 工具读取文章文件
   - 提取标题、章节结构和核心主题

2. **自动风格匹配**
   - 分析文章标题和内容关键词
   - 匹配最佳风格（基于风格关键词库）
   - 如未指定，默认使用 **notion** 风格

3. **内容类型识别**
   - 技术文章 → tech/elegant
   - 成长感悟 → warm/nature
   - 教程指南 → playful/fresh
   - 观点文章 → bold
   - 知识分享 → notion/minimal

### 步骤 2：识别插图位置

**插图三大目的**：
1. **信息补充**：帮助理解抽象概念
2. **概念可视化**：将抽象想法转化为具体视觉
3. **想象力引导**：创造氛围，增强阅读体验

**适合插图的内容**：
- ✅ 需要可视化的抽象概念（如"微服务架构"、"递归算法"）
- ✅ 需要图解的流程/步骤（如"部署流程"、"操作步骤"）
- ✅ 需要视觉化对比的内容（如"方案A vs 方案B"）
- ✅ 需要强化的核心论点（如"3个关键原因"）
- ❌ 已有图片或代码截图
- ❌ 纯文字段落

**插图数量原则**：
- 每个主要章节至少 1 张
- 多于少好，避免过度
- 建议：3-5张（对于中等长度文章）

### 步骤 3：生成插图计划

创建结构化的插图计划（markdown 格式）：

```markdown
# 插图计划

## 元信息
- 文章路径：`{{article_path}}`
- 风格：{{matched_style}}
- 插图数量：{{count}} 张
- 生成时间：{{timestamp}}

## 插图列表

### 插图 1：{{illustration_title}}
- **插入位置**：{{chapter_name}} 章节，第 X 段落后
- **用途**：{{purpose}}（如：解释微服务的三层架构）
- **视觉内容**：{{visual_description}}（如：从上到下依次是API网关、业务服务、数据层，箭头表示数据流向）
- **尺寸**：1792x1024（16:9横版）
- **文件名**：`assets/images/01-{{slug}}.png`
- **提示词草稿**：{{prompt_draft}}

---

### 插图 2：...
```

### 步骤 4：调用 image-generation 技能

对于每一张需要生成的图片：

**重要**：必须使用 `run_command` 工具执行命令，不能只生成脚本。

1. **构建完整的命令**：

```bash
python resources/skills/image-generation/scripts/doubao_image_gen.py \
  --prompt "{{从插图计划提取的提示词}}" \
  --size "1792x1024" \
  --quality "hd" \
  --output "assets/images/01-{{slug}}.png"
```

2. **使用 run_command 工具执行**：

调用格式：
```
使用 run_command 工具执行上述命令
```

3. **确认生成成功**：
- 检查返回信息中是否包含 "Successfully wrote to"
- 确认文件已创建到指定路径

4. **处理错误**：
- **如果提示 "DOUBAO_API_KEY environment variable is not set"**：
  - 告知用户需要在设置面板配置豆包 API Key
  - 提供配置指导：打开应用 → 设置 → API 配置 → 豆包 API Key

- **如果提示 "No such file or directory"**：
  - 使用 `run_command` 创建目录：`mkdir -p assets/images`
  - 然后重新执行生图命令

- **如果提示其他错误**：
  - 记录完整错误信息
  - 提供备选方案（使用 cover-generator 或在线工具）

**环境变量注入**：
- `DOUBAO_API_KEY`：从 ConfigStore 自动读取
- Agent 运行时会自动处理环境变量注入
- 无需手动设置

### 步骤 5：更新文章

在文章的指定位置插入图片引用：

```markdown
## 微服务架构概述

微服务是一种架构风格...

如上图所示，微服务架构分为三层...
```

### 步骤 6：输出总结

生成完成后的总结报告：

```markdown
✅ 插图生成完成

**文章**：{{article_path}}
**风格**：{{matched_style}}
**生成数量**：{{count}} 张

**生成清单**：
1. ✅ {{illustration_1}} - assets/images/01-xxx.png
2. ✅ {{illustration_2}} - assets/images/02-xxx.png
...

**插图计划**：`assets/illustration-plan.md`
**文章已更新**：图片已插入到指定位置
```

## 错误处理

### 图片生成失败
- 提供详细错误信息
- 建议使用备选方案（cover-generator、Canva等）
- 保存已成功生成的图片

### 文件写入失败
- 检查文件权限
- 提供备用路径建议

### 风格匹配失败
- 默认使用 notion 风格
- 提示用户可手动指定风格

## 最佳实践

1. **先分析后生成**：确保插图位置合理，避免盲目生成
2. **批量生成限制**：每次最多生成 5 张，避免超时
3. **文件组织**：所有图片保存在文章项目的 `assets/images/` 目录
4. **命名规范**：`{序号}-{slug}.png`，便于管理

## 示例场景

### 示例 1：技术文章自动配图

**用户输入**：
```
为我的文章《深入理解微服务架构》生成配图
```

**AI 执行流程**：
1. 读取文章内容，识别为技术文章
2. 自动匹配 **tech** 风格
3. 分析文章结构，识别需要插图的位置：
   - "微服务架构概述" → 需要架构图
   - "服务间通信" → 需要通信流程图
   - "数据一致性" → 需要对比图
4. 生成 3 张插图并插入文章
5. 输出总结报告

### 示例 2：成长感悟文章配图

**用户输入**：
```
给文章《我的2023年成长总结》配图，使用温暖治愈风格
```

**AI 执行流程**：
1. 读取文章，用户指定 **warm** 风格
2. 识别关键成长节点，需要 2 张配图：
   - "年初迷茫期" → 温暖的启程图
   - "年末收获" → 充满希望的成果图
3. 生成配图并插入
4. 完成总结

## 参考文档

- **风格系统详情**：`resources/skills/image-generation/SKILL.md`
- **豆包 API 文档**：https://www.volcengine.com/docs/82379/1541523
- **宝玉技能库**：https://github.com/JimLiu/baoyu-skills

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [hhhh124hhhh](https://github.com/hhhh124hhhh)
- **Source:** [hhhh124hhhh/SkillMate](https://github.com/hhhh124hhhh/SkillMate)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-hhhh124hhhh-skillmate-content-illustrator
- Seller: https://agentstack.voostack.com/s/hhhh124hhhh
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
