Document Illustrator Skill 基于 AI 智能分析的文档配图生成工具。无需依赖特定格式,自动理解内容并生成专业配图。 🎯 核心特点 - ✨ AI 智能归纳 :自动理解文档内容,智能提取核心主题 - 🎨 格式无关 :支持任何格式的文档(Markdown、纯文本、PDF 等) - 📐 灵活比例 :支持 16:9(横屏)和 3:4(竖屏) - 🖼️ 封面图可选 :可生成概括全文的封面图 - 🎭 三种风格 :渐变玻璃卡片、票据风格、矢量插画 🚀 使用方法 直接告诉 Claude 或者: 📝 完整工作流程 第 1 步:Claude 读取和理解文档 当你请求生成配图时,Claude 会: 1. 使用 Read 工具读取完整文档 2. AI 分析理解文档内容和结构 3. 识别核心主题和要点 无需担心文档格式 : - ✅ 标准 Markdown(##、###) - ✅ 分隔线格式(======、------) - ✅ 纯文本段落 - ✅ 任何其他格式 第 2 步:配置选项(3 个问题) Claude 会询问你的偏好: 问题 1:图片比例 问题 2:封面图 问题 3:内容配图数量 第 3 步:Claude 归纳内容并展示 根据你指定的数量,Claude 会智能归纳文档,然后展示给你确认: 关键保证 : - ✅ 内容完整:所有重要信息都会被归入某张图片 - ✅…

, re.MULTILINE)\n headings = heading_pattern.findall(content)\n\n if not headings:\n print(\"错误: 文档中没有找到标题(##、###、####)\", file=sys.stderr)\n print(\"请确保文档使用 Markdown 格式并包含标题\", file=sys.stderr)\n sys.exit(1)\n\n # 统计各级标题\n h2_titles = []\n h3_titles = []\n h4_titles = []\n\n for level, title in headings:\n if level == '##':\n h2_titles.append(title)\n elif level == '###':\n h3_titles.append(title)\n elif level == '####':\n h4_titles.append(title)\n\n # 提取每个小节的内容\n sections = []\n\n # 将文档按标题分割\n lines = content.split('\\n')\n current_section = None\n\n for i, line in enumerate(lines):\n # 检查是否是标题行\n match = re.match(r'^(#{2,4})\\s+(.+)

Document Illustrator Skill 基于 AI 智能分析的文档配图生成工具。无需依赖特定格式,自动理解内容并生成专业配图。 🎯 核心特点 - ✨ AI 智能归纳 :自动理解文档内容,智能提取核心主题 - 🎨 格式无关 :支持任何格式的文档(Markdown、纯文本、PDF 等) - 📐 灵活比例 :支持 16:9(横屏)和 3:4(竖屏) - 🖼️ 封面图可选 :可生成概括全文的封面图 - 🎭 三种风格 :渐变玻璃卡片、票据风格、矢量插画 🚀 使用方法 直接告诉 Claude 或者: 📝 完整工作流程 第 1 步:Claude 读取和理解文档 当你请求生成配图时,Claude 会: 1. 使用 Read 工具读取完整文档 2. AI 分析理解文档内容和结构 3. 识别核心主题和要点 无需担心文档格式 : - ✅ 标准 Markdown(##、###) - ✅ 分隔线格式(======、------) - ✅ 纯文本段落 - ✅ 任何其他格式 第 2 步:配置选项(3 个问题) Claude 会询问你的偏好: 问题 1:图片比例 问题 2:封面图 问题 3:内容配图数量 第 3 步:Claude 归纳内容并展示 根据你指定的数量,Claude 会智能归纳文档,然后展示给你确认: 关键保证 : - ✅ 内容完整:所有重要信息都会被归入某张图片 - ✅…

, line)\n\n if match:\n # 保存上一个小节\n if current_section:\n sections.append(current_section)\n\n # 开始新小节\n level_marks, title = match.groups()\n level = 'h' + str(len(level_marks))\n\n current_section = {\n 'level': level,\n 'title': title,\n 'content': '',\n 'line_start': i\n }\n elif current_section:\n # 累积当前小节的内容\n current_section['content'] += line + '\\n'\n\n # 添加最后一个小节\n if current_section:\n sections.append(current_section)\n\n # 清理每个小节的内容(移除首尾空白)\n for section in sections:\n section['content'] = section['content'].strip()\n\n return {\n 'h2': h2_titles,\n 'h3': h3_titles,\n 'h4': h4_titles,\n 'sections': sections\n }\n\n\ndef merge_sections_by_level(sections, target_level):\n \"\"\"\n 根据目标层级智能合并章节,确保不丢失内容\n\n 规则:\n - 如果选择 h2:将所有 h3、h4 内容合并到对应的 h2 父章节下\n - 如果选择 h3:将所有 h4 内容合并到对应的 h3 父章节下\n - 如果选择 h4:保持原样\n\n 返回:合并后的章节列表\n \"\"\"\n level_hierarchy = {'h2': 2, 'h3': 3, 'h4': 4}\n target_level_num = level_hierarchy[target_level]\n\n merged_sections = []\n current_parent = None\n\n for section in sections:\n section_level_num = level_hierarchy[section['level']]\n\n if section_level_num == target_level_num:\n # 找到目标层级的章节\n if current_parent:\n # 保存上一个父章节\n merged_sections.append(current_parent)\n\n # 创建新的父章节\n current_parent = {\n 'level': section['level'],\n 'title': section['title'],\n 'content': section['content'],\n 'merged_from': [section['title']] # 记录合并来源\n }\n\n elif section_level_num > target_level_num:\n # 子章节,需要合并到当前父章节\n if current_parent:\n # 添加子章节的内容\n if current_parent['content']:\n current_parent['content'] += '\\n\\n'\n\n # 添加子章节标题和内容\n current_parent['content'] += f\"【{section['title']}】\\n{section['content']}\"\n current_parent['merged_from'].append(section['title'])\n else:\n # 没有父章节,说明文档结构有问题,作为独立章节处理\n merged_sections.append({\n 'level': section['level'],\n 'title': section['title'],\n 'content': section['content'],\n 'merged_from': [section['title']]\n })\n\n elif section_level_num \u003c target_level_num:\n # 比目标层级更高的章节(比如选了 h3 但遇到 h2)\n # 保存当前父章节\n if current_parent:\n merged_sections.append(current_parent)\n\n # 这个高层级章节作为独立章节\n merged_sections.append({\n 'level': section['level'],\n 'title': section['title'],\n 'content': section['content'],\n 'merged_from': [section['title']]\n })\n current_parent = None\n\n # 保存最后一个父章节\n if current_parent:\n merged_sections.append(current_parent)\n\n return merged_sections\n\n\ndef verify_content_coverage(original_sections, merged_sections):\n \"\"\"\n 验证内容覆盖度,确保没有章节被遗漏\n\n 返回:{\n 'all_covered': True/False,\n 'original_count': 原始章节数,\n 'merged_count': 合并后章节数,\n 'coverage_report': [\n {'title': '...', 'status': 'included/merged', 'merged_into': '...'},\n ...\n ]\n }\n \"\"\"\n # 收集所有原始章节标题\n original_titles = {s['title'] for s in original_sections}\n\n # 收集合并后覆盖的所有标题\n covered_titles = set()\n coverage_report = []\n\n for merged in merged_sections:\n covered_titles.update(merged['merged_from'])\n\n if len(merged['merged_from']) == 1:\n # 未合并的章节\n coverage_report.append({\n 'title': merged['title'],\n 'status': 'independent',\n 'merged_into': None\n })\n else:\n # 合并的章节\n main_title = merged['merged_from'][0]\n sub_titles = merged['merged_from'][1:]\n\n coverage_report.append({\n 'title': main_title,\n 'status': 'parent',\n 'merged_into': None\n })\n\n for sub_title in sub_titles:\n coverage_report.append({\n 'title': sub_title,\n 'status': 'merged',\n 'merged_into': main_title\n })\n\n # 检查是否有遗漏\n missing_titles = original_titles - covered_titles\n\n for missing in missing_titles:\n coverage_report.append({\n 'title': missing,\n 'status': 'MISSING',\n 'merged_into': None\n })\n\n return {\n 'all_covered': len(missing_titles) == 0,\n 'original_count': len(original_sections),\n 'merged_count': len(merged_sections),\n 'missing_count': len(missing_titles),\n 'coverage_report': coverage_report\n }\n\n\ndef prompt_user_for_granularity(structure):\n \"\"\"\n 根据文档结构,让用户选择生成粒度\n\n 返回:选中的标题级别('h2', 'h3', 或 'h4')\n \"\"\"\n print(f\"\\n检测到文档结构:\")\n print(f\"- {len(structure['h2'])} 个二级标题 (##)\")\n print(f\"- {len(structure['h3'])} 个三级标题 (###)\")\n print(f\"- {len(structure['h4'])} 个四级标题 (####)\")\n\n print(f\"\\n请选择生成粒度:\")\n\n options = []\n if len(structure['h2']) > 0:\n print(f\"1. 粗粒度 - 按二级标题生成 ({len(structure['h2'])} 张图片)\")\n options.append(('1', 'h2'))\n\n if len(structure['h3']) > 0:\n print(f\"2. 中等粒度 - 按三级标题生成 ({len(structure['h3'])} 张图片)\")\n options.append(('2', 'h3'))\n\n if len(structure['h4']) > 0:\n print(f\"3. 细粒度 - 按四级标题生成 ({len(structure['h4'])} 张图片)\")\n options.append(('3', 'h4'))\n\n if not options:\n print(\"错误: 文档中没有找到任何标题\", file=sys.stderr)\n sys.exit(1)\n\n while True:\n valid_choices = [opt[0] for opt in options]\n choice = input(f\"\\n请输入选择 ({'/'.join(valid_choices)}): \").strip()\n\n for opt_choice, opt_level in options:\n if choice == opt_choice:\n return opt_level\n\n print(f\"无效选择,请输入 {' 或 '.join(valid_choices)}\")\n\n\ndef prompt_user_for_style():\n \"\"\"\n 让用户选择风格\n\n 返回:风格文件路径\n \"\"\"\n # 获取 styles 目录路径\n skill_root = Path(__file__).parent.parent\n styles_dir = skill_root / \"styles\"\n\n # 定义风格选项\n styles = [\n {\n 'number': '1',\n 'name': '渐变玻璃卡片风格',\n 'description': '现代科技感,毛玻璃效果,未来感强',\n 'file': 'gradient-glass.md'\n },\n {\n 'number': '2',\n 'name': '票据风格',\n 'description': '黑白对比,极简设计,高级感',\n 'file': 'ticket.md'\n },\n {\n 'number': '3',\n 'name': '矢量插画风格',\n 'description': '扁平化插画,色彩柔和,温馨可爱',\n 'file': 'vector-illustration.md'\n }\n ]\n\n print(\"\\n请选择配图风格:\")\n for style in styles:\n print(f\"{style['number']}. {style['name']} - {style['description']}\")\n\n while True:\n choice = input(\"\\n请输入选择 (1/2/3): \").strip()\n\n for style in styles:\n if choice == style['number']:\n style_path = styles_dir / style['file']\n if not style_path.exists():\n print(f\"错误: 风格文件不存在: {style_path}\", file=sys.stderr)\n sys.exit(1)\n return str(style_path)\n\n print(\"无效选择,请输入 1、2 或 3\")\n\n\ndef extract_core_prompt(style_file_path):\n \"\"\"\n 从风格文件中智能提取核心提示词部分\n\n 规则:\n 1. 对于\"渐变玻璃卡片风格\":提取\"### 提示词\"之后的内容\n 2. 对于\"票据风格\":提取整个文件内容(因为整个文件就是提示词模板)\n 3. 对于\"矢量插画风格\":提取\"### 提示词\"之后的内容\n\n 通用策略:\n - 查找\"提示词\"、\"prompt\"等关键词\n - 排除\"概述\"、\"适配模型\"、\"适用模型\"等说明性章节\n - 保留核心的风格描述和要求\n \"\"\"\n with open(style_file_path, 'r', encoding='utf-8') as f:\n content = f.read()\n\n # 尝试匹配 \"### 提示词\" 或 \"## 提示词\"\n prompt_section_pattern = re.compile(r'###?\\s+提示词(.+)', re.DOTALL)\n match = prompt_section_pattern.search(content)\n\n if match:\n # 提取提示词之后的内容\n extracted = match.group(1).strip()\n\n # 移除可能的尾部章节(如\"需要生成 PPT 的内容:\")\n # 查找\"需要生成\"、\"文本信息\"等标记\n end_markers = [\n '需要生成 PPT 的内容:',\n '需要生成 PPT 的内容:',\n '文本信息:',\n '文本信息:',\n '内容:',\n '内容:'\n ]\n\n for marker in end_markers:\n if marker in extracted:\n extracted = extracted.split(marker)[0].strip()\n break\n\n return extracted\n\n # 如果没有找到\"提示词\"章节,尝试更智能的提取\n # 查找\"帮我\"、\"基于\"等开头的段落\n if content.startswith('帮我') or content.startswith('基于'):\n # 票据风格的情况:整个文件就是提示词\n # 但要移除\"文本信息:\"之后的部分\n for marker in ['文本信息:', '文本信息:']:\n if marker in content:\n content = content.split(marker)[0].strip()\n break\n return content\n\n # 如果以上都不匹配,排除说明性章节\n # 移除\"## 概述\"、\"### 适配模型\"等章节\n lines = content.split('\\n')\n filtered_lines = []\n skip = False\n\n for line in lines:\n # 检查是否是需要跳过的章节\n if re.match(r'##?\\s+(概述|适配模型|适用模型及软件)', line):\n skip = True\n continue\n elif re.match(r'##?\\s+', line):\n # 遇到其他章节,停止跳过\n skip = False\n\n if not skip:\n filtered_lines.append(line)\n\n return '\\n'.join(filtered_lines).strip()\n\n\ndef generate_illustration(section_title, section_content, style_prompt, output_dir, index, resolution='2K'):\n \"\"\"\n 调用 Gemini API 生成单张配图\n\n 参数:\n - section_title: 小节标题\n - section_content: 小节内容\n - style_prompt: 风格提示词\n - output_dir: 输出目录\n - index: 图片序号\n - resolution: 图片分辨率('2K' 或 '4K')\n\n 返回:生成的图片路径\n \"\"\"\n try:\n from google import genai\n from google.genai import types\n except ImportError:\n print(\"错误: 未安装 google-genai 库\", file=sys.stderr)\n print(\"请运行: pip install google-genai\", file=sys.stderr)\n sys.exit(1)\n\n # 获取 API 密钥\n api_key = os.environ.get(\"GEMINI_API_KEY\")\n if not api_key:\n print(\"错误: 未设置 GEMINI_API_KEY 环境变量\", file=sys.stderr)\n print(\"请在 .env 文件中设置: GEMINI_API_KEY=your-api-key\", file=sys.stderr)\n sys.exit(1)\n\n # 组合提示词\n full_prompt = f\"{style_prompt}\\n\\n根据以下内容生成配图:\\n\\n标题:{section_title}\\n\\n内容:{section_content}\"\n\n try:\n # 调用 API\n client = genai.Client(api_key=api_key)\n\n response = client.models.generate_content(\n model=\"gemini-3-pro-image-preview\", # Nano Banana Pro\n contents=full_prompt,\n config=types.GenerateContentConfig(\n response_modalities=['IMAGE'],\n image_config=types.ImageConfig(\n aspect_ratio=\"16:9\",\n image_size=resolution\n )\n )\n )\n\n # 保存图片\n for part in response.parts:\n if part.inline_data is not None:\n image = part.as_image()\n image_path = os.path.join(output_dir, f\"illustration-{index:02d}.png\")\n image.save(image_path)\n return image_path\n\n print(f\"警告: 第 {index} 张图片生成失败 - 未收到图片数据\", file=sys.stderr)\n return None\n\n except Exception as e:\n print(f\"错误: 第 {index} 张图片生成失败 - {e}\", file=sys.stderr)\n return None\n\n\ndef main():\n \"\"\"主流程\"\"\"\n parser = argparse.ArgumentParser(\n description='Document Illustrator - 为文档生成配图',\n formatter_class=argparse.RawDescriptionHelpFormatter,\n epilog=\"\"\"\n示例用法:\n python generate_illustrations.py document.md\n python generate_illustrations.py document.md --resolution 4K\n python generate_illustrations.py document.md --output /custom/output\n\n环境变量:\n GEMINI_API_KEY: Google AI API 密钥(必需)\n\"\"\"\n )\n\n parser.add_argument('document', help='文档路径')\n parser.add_argument(\n '--output',\n default=None,\n help='输出目录(默认:文档所在目录下的 images/ 文件夹)'\n )\n parser.add_argument(\n '--resolution',\n choices=['2K', '4K'],\n default='2K',\n help='图片分辨率(默认: 2K)'\n )\n parser.add_argument(\n '--style',\n choices=['gradient-glass', 'ticket', 'vector-illustration'],\n help='配图风格(gradient-glass: 渐变玻璃卡片, ticket: 票据风格, vector-illustration: 矢量插画)'\n )\n parser.add_argument(\n '--level',\n choices=['h2', 'h3', 'h4'],\n help='标题层级(h2: 二级标题, h3: 三级标题, h4: 四级标题)'\n )\n\n args = parser.parse_args()\n\n print(\"=\" * 60)\n print(\"Document Illustrator - 文档配图生成器\")\n print(\"=\" * 60)\n print()\n\n # 1. 分析文档结构\n print(\"📖 分析文档结构...\")\n structure = analyze_document_structure(args.document)\n\n # 2. 用户选择生成粒度\n if args.level:\n # 非交互模式:使用命令行参数\n selected_level = args.level\n level_counts = {\n 'h2': len(structure['h2']),\n 'h3': len(structure['h3']),\n 'h4': len(structure['h4'])\n }\n print(f\"\\n🎯 使用指定粒度: {selected_level} ({level_counts[selected_level]} 张图片)\")\n else:\n # 交互模式:提示用户选择\n print(\"\\n🎯 选择生成粒度...\")\n selected_level = prompt_user_for_granularity(structure)\n\n # 3. 用户选择风格\n if args.style:\n # 非交互模式:使用命令行参数\n skill_root = Path(__file__).parent.parent\n styles_dir = skill_root / \"styles\"\n style_file = str(styles_dir / f\"{args.style}.md\")\n\n if not Path(style_file).exists():\n print(f\"错误: 风格文件不存在: {style_file}\", file=sys.stderr)\n sys.exit(1)\n\n style_names = {\n 'gradient-glass': '渐变玻璃卡片风格',\n 'ticket': '票据风格',\n 'vector-illustration': '矢量插画风格'\n }\n print(f\"\\n🎨 使用指定风格: {style_names[args.style]}\")\n else:\n # 交互模式:提示用户选择\n print(\"\\n🎨 选择配图风格...\")\n style_file = prompt_user_for_style()\n\n style_prompt = extract_core_prompt(style_file)\n\n # 显示提取的风格提示词预览(前 200 个字符)\n print(f\"\\n✓ 已加载风格提示词\")\n print(f\" 预览: {style_prompt[:200]}...\")\n\n # 4. 创建输出目录(在文档所在目录下)\n doc_dir = os.path.dirname(os.path.abspath(args.document))\n\n if args.output:\n output_dir = os.path.join(args.output, \"images\")\n else:\n # 默认:文档所在目录下的 images/ 文件夹\n output_dir = os.path.join(doc_dir, \"images\")\n\n os.makedirs(output_dir, exist_ok=True)\n\n print(f\"\\n📁 输出目录: {output_dir}\")\n\n # 4.5. 智能合并章节并验证内容覆盖\n print(f\"\\n📋 合并子章节内容...\")\n merged_sections = merge_sections_by_level(structure['sections'], selected_level)\n\n print(f\"\\n✓ 已合并章节\")\n print(f\" 原始章节数: {len(structure['sections'])}\")\n print(f\" 合并后章节数: {len(merged_sections)}\")\n\n # 验证内容覆盖度\n print(f\"\\n🔍 验证内容覆盖...\")\n verification = verify_content_coverage(structure['sections'], merged_sections)\n\n if verification['all_covered']:\n print(f\"✓ 所有内容已覆盖,无遗漏\")\n else:\n print(f\"⚠️ 警告: 发现 {verification['missing_count']} 个章节可能遗漏\")\n\n # 显示详细的覆盖报告\n print(f\"\\n📊 内容覆盖报告:\")\n for item in verification['coverage_report']:\n if item['status'] == 'MISSING':\n print(f\" ⚠️ 遗漏: {item['title']}\")\n elif item['status'] == 'merged':\n print(f\" ✓ 已整合: {item['title']} → 合并到「{item['merged_into']}」\")\n elif item['status'] == 'parent':\n # 统计该父章节合并了多少子章节\n merged_count = sum(1 for x in verification['coverage_report']\n if x.get('merged_into') == item['title'])\n if merged_count > 0:\n print(f\" ✓ 父章节: {item['title']} (包含 {merged_count} 个子章节)\")\n else:\n print(f\" ✓ 独立章节: {item['title']}\")\n\n if not verification['all_covered']:\n print(f\"\\n❌ 错误: 有内容遗漏,请检查文档结构\")\n print(f\"建议: 尝试不同的粒度,或检查文档标题层级是否规范\")\n sys.exit(1)\n\n # 5. 生成配图\n sections = merged_sections\n\n if not sections:\n print(f\"错误: 没有找到级别为 {selected_level} 的小节\", file=sys.stderr)\n sys.exit(1)\n\n print(f\"\\n🖼️ 开始生成 {len(sections)} 张配图...\")\n print(f\"分辨率: {args.resolution}\")\n print(\"=\" * 60)\n print()\n\n successful = 0\n failed = 0\n\n for i, section in enumerate(sections, 1):\n print(f\"正在生成第 {i}/{len(sections)} 张...\")\n print(f\" 标题: {section['title']}\")\n\n # 限制内容长度(避免超过 API 限制)\n content = section['content']\n if len(content) > 1000:\n content = content[:1000] + \"...\"\n print(f\" 提示: 内容较长,已截取前 1000 字符\")\n\n image_path = generate_illustration(\n section['title'],\n content,\n style_prompt,\n output_dir,\n i,\n args.resolution\n )\n\n if image_path:\n print(f\" ✓ 已保存: {image_path}\")\n successful += 1\n else:\n print(f\" ✗ 生成失败\")\n failed += 1\n\n print()\n\n # 6. 完成\n print(\"=\" * 60)\n print(\"✨ 生成完成!\")\n print(\"=\" * 60)\n print(f\"成功: {successful} 张\")\n if failed > 0:\n print(f\"失败: {failed} 张\")\n print(f\"\\n所有配图已保存到: {output_dir}\")\n print()\n\n\nif __name__ == \"__main__\":\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":23225,"content_sha256":"caa6028fcb33184caed9052b41cb12e37ba60e2f512615f5bf4896cbe875132f"},{"filename":"scripts/generate_single_image.py","content":"#!/usr/bin/env python3\n\"\"\"\nDocument Illustrator - 单图片生成工具\n由 Claude 负责文档分析和内容归纳,此脚本只负责调用 Gemini API 生成图片\n\"\"\"\n\nimport os\nimport sys\nimport argparse\nfrom pathlib import Path\nfrom dotenv import load_dotenv\n\n\ndef find_and_load_env():\n \"\"\"\n 智能查找并加载 .env 文件\n 优先级:\n 1. 当前脚本所在目录的上一级(Skill 根目录)\n 2. 当前工作目录\n 3. 用户主目录下的 .claude/skills/document-illustrator/\n \"\"\"\n # 获取脚本所在目录的上一级(Skill 根目录)\n skill_root = Path(__file__).parent.parent\n env_path = skill_root / \".env\"\n\n if env_path.exists():\n load_dotenv(env_path, override=True)\n return True\n\n # 尝试当前工作目录\n if Path(\".env\").exists():\n load_dotenv(\".env\", override=True)\n return True\n\n # 尝试 Claude Code Skill 标准位置\n claude_skill_env = Path.home() / \".claude\" / \"skills\" / \"document-illustrator\" / \".env\"\n if claude_skill_env.exists():\n load_dotenv(claude_skill_env, override=True)\n return True\n\n # 如果都没找到,尝试默认加载\n load_dotenv(override=True)\n return False\n\n\n# 智能加载环境变量\nfind_and_load_env()\n\n\ndef get_image_dimensions(aspect_ratio, resolution):\n \"\"\"\n 根据比例和分辨率返回图片尺寸\n\n 参数:\n - aspect_ratio: \"16:9\" 或 \"3:4\"\n - resolution: \"2K\" 或 \"4K\"\n\n 返回:(width, height)\n \"\"\"\n dimensions = {\n \"16:9\": {\n \"2K\": (2560, 1440),\n \"4K\": (3840, 2160)\n },\n \"3:4\": {\n \"2K\": (1920, 2560),\n \"4K\": (2880, 3840)\n }\n }\n\n if aspect_ratio not in dimensions:\n raise ValueError(f\"不支持的比例: {aspect_ratio},请使用 '16:9' 或 '3:4'\")\n\n if resolution not in dimensions[aspect_ratio]:\n raise ValueError(f\"不支持的分辨率: {resolution},请使用 '2K' 或 '4K'\")\n\n return dimensions[aspect_ratio][resolution]\n\n\ndef generate_image(title, content, style_prompt, output_path, aspect_ratio=\"16:9\", resolution=\"2K\", is_cover=False):\n \"\"\"\n 调用 Gemini API 生成单张配图\n\n 参数:\n - title: 图片标题\n - content: 图片内容文本\n - style_prompt: 风格提示词\n - output_path: 输出文件路径(包含文件名)\n - aspect_ratio: 宽高比 \"16:9\" 或 \"3:4\"\n - resolution: 分辨率 \"2K\" 或 \"4K\"\n - is_cover: 是否为封面图\n\n 返回:成功返回图片路径,失败返回 None\n \"\"\"\n try:\n from google import genai\n from google.genai import types\n except ImportError:\n print(\"错误: 未安装 google-genai 库\", file=sys.stderr)\n print(\"请运行: pip install google-genai\", file=sys.stderr)\n sys.exit(1)\n\n # 获取 API 密钥\n api_key = os.environ.get(\"GEMINI_API_KEY\")\n if not api_key:\n print(\"错误: 未设置 GEMINI_API_KEY 环境变量\", file=sys.stderr)\n print(\"请在 .env 文件中设置: GEMINI_API_KEY=your-api-key\", file=sys.stderr)\n sys.exit(1)\n\n # 组合提示词\n if is_cover:\n # 封面图的提示词,强调概括性和引导性\n full_prompt = f\"\"\"{style_prompt}\n\n这是一张封面图,需要概括整个文档的核心信息。\n\n标题:{title}\n\n核心内容(需要在一张图中体现):\n{content}\n\n要求:\n- 封面图需要突出主题,具有引导性\n- 信息要精炼但完整,能代表整个系列\n- 视觉冲击力强,吸引读者注意\n\"\"\"\n else:\n # 普通内容配图\n full_prompt = f\"\"\"{style_prompt}\n\n根据以下内容生成配图:\n\n标题:{title}\n\n内容:\n{content}\n\"\"\"\n\n try:\n # 调用 API\n client = genai.Client(api_key=api_key)\n\n response = client.models.generate_content(\n model=\"gemini-3-pro-image-preview\", # Nano Banana Pro\n contents=full_prompt,\n config=types.GenerateContentConfig(\n response_modalities=['IMAGE'],\n image_config=types.ImageConfig(\n aspect_ratio=aspect_ratio,\n image_size=resolution\n )\n )\n )\n\n # 检查响应是否有效\n if response is None:\n print(f\"错误: API 返回空响应\", file=sys.stderr)\n return None\n\n if not hasattr(response, 'parts') or response.parts is None:\n print(f\"错误: API 响应中没有 parts 属性\", file=sys.stderr)\n print(f\"响应内容: {response}\", file=sys.stderr)\n return None\n\n # 保存图片\n for part in response.parts:\n if part.inline_data is not None:\n image = part.as_image()\n\n # 确保输出目录存在\n output_dir = os.path.dirname(output_path)\n if output_dir:\n os.makedirs(output_dir, exist_ok=True)\n\n image.save(output_path)\n return output_path\n\n print(f\"警告: 图片生成失败 - 未收到图片数据\", file=sys.stderr)\n return None\n\n except Exception as e:\n import traceback\n print(f\"错误: 图片生成失败 - {e}\", file=sys.stderr)\n print(f\"详细错误信息:\", file=sys.stderr)\n traceback.print_exc(file=sys.stderr)\n return None\n\n\ndef main():\n \"\"\"主流程\"\"\"\n parser = argparse.ArgumentParser(\n description='Document Illustrator - 单图片生成工具',\n formatter_class=argparse.RawDescriptionHelpFormatter,\n epilog=\"\"\"\n示例用法:\n # 生成普通内容配图\n python generate_single_image.py \\\\\n --title \"AI 工具演化\" \\\\\n --content \"从 Rules 到 Skills 的演化历程...\" \\\\\n --style-file ../styles/ticket.md \\\\\n --output /path/to/output/image-01.png \\\\\n --ratio 16:9 \\\\\n --resolution 2K\n\n # 生成封面图\n python generate_single_image.py \\\\\n --title \"AI 编程工具完全指南\" \\\\\n --content \"本文介绍...\" \\\\\n --style-file ../styles/gradient-glass.md \\\\\n --output /path/to/output/cover.png \\\\\n --ratio 3:4 \\\\\n --resolution 2K \\\\\n --cover\n\n环境变量:\n GEMINI_API_KEY: Google AI API 密钥(必需)\n\"\"\"\n )\n\n parser.add_argument('--title', required=True, help='图片标题')\n parser.add_argument('--content', required=True, help='图片内容文本')\n parser.add_argument('--style-file', required=True, help='风格提示词文件路径')\n parser.add_argument('--output', required=True, help='输出文件路径(包含文件名)')\n parser.add_argument(\n '--ratio',\n choices=['16:9', '3:4'],\n default='16:9',\n help='宽高比(默认: 16:9)'\n )\n parser.add_argument(\n '--resolution',\n choices=['2K', '4K'],\n default='2K',\n help='分辨率(默认: 2K)'\n )\n parser.add_argument(\n '--cover',\n action='store_true',\n help='标记为封面图(会使用不同的提示词策略)'\n )\n\n args = parser.parse_args()\n\n # 读取风格提示词\n style_file_path = Path(args.style_file)\n if not style_file_path.exists():\n print(f\"错误: 风格文件不存在: {args.style_file}\", file=sys.stderr)\n sys.exit(1)\n\n with open(style_file_path, 'r', encoding='utf-8') as f:\n style_prompt = f.read()\n\n # 显示生成信息\n image_type = \"封面图\" if args.cover else \"内容配图\"\n print(f\"正在生成{image_type}...\")\n print(f\" 标题: {args.title}\")\n print(f\" 比例: {args.ratio}\")\n print(f\" 分辨率: {args.resolution}\")\n\n width, height = get_image_dimensions(args.ratio, args.resolution)\n print(f\" 尺寸: {width}x{height}\")\n\n # 生成图片\n result_path = generate_image(\n title=args.title,\n content=args.content,\n style_prompt=style_prompt,\n output_path=args.output,\n aspect_ratio=args.ratio,\n resolution=args.resolution,\n is_cover=args.cover\n )\n\n if result_path:\n print(f\"✓ 已保存: {result_path}\")\n sys.exit(0)\n else:\n print(f\"✗ 生成失败\", file=sys.stderr)\n sys.exit(1)\n\n\nif __name__ == \"__main__\":\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":8232,"content_sha256":"e10cb7f276e5d516d2920f6d1bd3fe7ea3a31f7e4769d166e5192654493b86c7"},{"filename":"styles/gradient-glass.md","content":"## 渐变拟物玻璃卡片风格 PPT\n\n### 概述\n整了一套非常漂亮的渐变拟物玻璃卡片风格 PPT 提示词,可以在 NotebookLM、Youmind、Listenhub、Lovart等支持 Nano Banana Pro 生成 PPT 的位置使用\n\n### 适配模型\n\n- Nano Banana Pro\n- Seedream\n\n### 提示词\n你是一位专家级UI UX演示设计师,请生成高保真、未来科技感的16比9演示文稿幻灯片。请根据视觉平衡美学,自动在封面、网格布局或数据可视化中选择一种最完美的构图。\n\n全局视觉语言方面,风格要无缝融合Apple Keynote的极简主义、现代SaaS产品设计和玻璃拟态风格。整体氛围需要高端、沉浸、洁净且有呼吸感。光照采用电影级体积光、柔和的光线追踪反射和环境光遮蔽。配色方案选择深邃的虚空黑或纯净的陶瓷白作为基底,并以流动的极光渐变色即霓虹紫、电光蓝、柔和珊瑚橙、青色作为背景和UI高光点缀。\n\n关于画面内容模块,请智能整合以下元素:\n\n1. 排版引擎采用Bento便当盒网格系统,将内容组织在模块化的圆角矩形容器中。容器材质必须是带有模糊效果的磨砂玻璃,具有精致的白色边缘和柔和的投影,并强制保留巨大的内部留白,避免拥挤。\n\n2. 插入礼物质感的3D物体,渲染独特的高端抽象3D制品作为视觉锚点。它们的外观应像实体的昂贵礼物或收藏品,材质为抛光金属、幻彩亚克力、透明玻璃或软硅胶,形状可是悬浮胶囊、球体、盾牌、莫比乌斯环或流体波浪。\n\n3. 字体与数据方面,使用干净的无衬线字体,建立高对比度。如果有图表,请使用发光的3D甜甜圈图、胶囊状进度条或悬浮数字,图表应看起来像发光的霓虹灯玩具。\n\n构图逻辑参考: 如果生成封面,请在中心放置一个巨大的复杂3D玻璃物体,并覆盖粗体大字,背景有延伸的极光波浪。 如果生成内容页,请使用Bento网格布局,将3D图标放在小卡片中,文本放在大卡片中。 如果生成数据页,请使用分屏设计,左侧排版文字,右侧悬浮巨大的发光3D数据可视化图表。\n\n渲染质量要求:虚幻引擎5渲染,8k分辨率,超细节纹理,UI设计感,UX界面,Dribbble热门趋势,设计奖获奖作品。\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":2356,"content_sha256":"6289415a11e5c9a8d766f00506d87c81d6d0ff8b036f47e717eaa1ad12d428f9"},{"filename":"styles/ticket.md","content":"帮我根据下面的设计风格要求和内容要求,生成一张中文的信息图片: \n设计风格要求: \n运用3-4种不同字号创造层次感,关键词使用最大字号 \n主标题字号需要比副标题和介绍大三倍以上,采用网格排版,类似高级杂志 \n文字与装饰元素间保持和谐的比例关系 \n确保视觉流向清晰,引导读者目光移动 \n数字极简票券风设计风格 \n黑白对比主导:高度对比的黑白配色方案,形成强烈视觉冲击 \n票券化布局:类似登机牌、门票或电子凭证的结构设计 \n几何分区明确:画面被精确划分为信息区块,井然有序 \n留白艺术运用:大量有效留白提升整体通透感和优雅度 \n东西方美学融合:结合中文传统排版与西方现代设计语言 \n工业设计感:注册商标符号、条形码等商业元素的精致运用 \n数字界面映射:模拟电子屏幕或应用界面的信息呈现方式 \n文字排版风格 \n中英混排对比:中英文字体混合使用,创造文化融合感 \n尺寸层级分明:主标题大号处理,副文本精致小巧 \n多向排列组合:包含横排、竖排、斜排等多方向文字布局 \n间距精确控制:字符间距和行距经过精心计算,保持呼吸感 \n符号化装饰:括号、下划线、箭头融入文字设计 \n衬线与非衬线混搭:不同字体家族交替使用,增强层次感 \n时间信息格式化:日期标注采用统一格式,搭配方向指示符 \n视觉元素风格 \n功能性指示符:各类箭头、星号作为视觉引导和强调 \nUI元素借鉴:\"CHECK IN\"、\"@\"等数字界面元素的平面化应用 \n边框与分割线:简洁线条用于区隔不同信息区域 \n简约图形符号:最小化的设计符号传达核心信息 \n手写风点缀:如\"Romantic\"的手写体为机械排版增添人文温度 \n方向性视觉流动:通过元素排布创造从左到右、从上到下的阅读节奏 \n负空间利用:将空白区域视为积极设计元素的一部分 \n文本信息:","content_type":"text/markdown; charset=utf-8","language":"markdown","size":2092,"content_sha256":"3dc539f465ecf40b4e957d58880b29a2176cd12a8ae49fa49cdfd3dab3027656"},{"filename":"styles/vector-illustration.md","content":"## 矢量插画风格PPT生成\n\n### 适用模型及软件\n\n- Nano Banana Pro\n- Notebookml\n- Youmind\n- Listenhub\n- Lovart\n\n### 提示词\n\n帮我基于这个风格要求和内容生成 PPT:\n\n视觉风格与美术指导 (Visual Style & Art Direction)\n\n插画风格: 扁平化矢量插画(Flat Vector Illustration)。必须包含清晰、统一粗细的黑色轮廓线(Monoline/Stroke)。色彩填涂需简洁,仅使用少量阴影,严禁使用渐变色或3D渲染效果。\n构图形式: 横向全景式构图(Panoramic),占据版面顶部 1/3 的空间。\n线条风格 (Line Work): 必须使用统一粗细的黑色单线描边(Monoline/Uniform Stroke)。所有物体(建筑、植物、云朵)都必须有封闭的黑色轮廓,类似填色书的线稿风格。线条末端圆润,避免尖锐的棱角。\n几何化处理 (Geometric Simplification): 将复杂的物体简化为基本几何形状。例如,树木简化为棒棒糖形状或三角形,建筑物简化为简单的矩形块面,窗户简化为整齐的小方格网格。不要追求写实细节,要追求“玩具模型”般的可爱感。\n空间与透视: 采用平视或稍微俯视的 2.5D 视角(类似等轴测,但更自由)。通过图层的前后遮挡来表现纵深,不要使用大气透视(即远景不要变模糊或变淡),所有图层清晰度一致。\n装饰元素: 在空白处添加装饰性的几何元素,如放射状的线条(代表阳光或能量)、药丸形状的云朵、或者是简单的小圆点和星星,以平衡画面的视觉密度。\n配色方案: 复古且柔和的色调。\n背景: 米色/奶油色(Cream/Off-white)纸张纹理感底色。\n强调色: 珊瑚红、薄荷绿、芥末黄、赭石色(Burnt Orange)和岩石蓝。\n字体排版:\n主标题: 巨大的、加粗的复古衬线体(Retro Serif),体现权威感与优雅感。\n副标题: 位于矩形色块内的全大写无衬线体。\n正文: 清晰易读的几何感无衬线体。\n\n需要生成 PPT 的内容:","content_type":"text/markdown; charset=utf-8","language":"markdown","size":2061,"content_sha256":"155993b0ed7c6be894aa7914cd259e1efeed25cd75828f192a1e1db6dd5c28b3"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Document Illustrator Skill","type":"text"}]},{"type":"paragraph","content":[{"text":"基于 AI 智能分析的文档配图生成工具。无需依赖特定格式,自动理解内容并生成专业配图。","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"🎯 核心特点","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✨ ","type":"text"},{"text":"AI 智能归纳","type":"text","marks":[{"type":"strong"}]},{"text":":自动理解文档内容,智能提取核心主题","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"🎨 ","type":"text"},{"text":"格式无关","type":"text","marks":[{"type":"strong"}]},{"text":":支持任何格式的文档(Markdown、纯文本、PDF 等)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"📐 ","type":"text"},{"text":"灵活比例","type":"text","marks":[{"type":"strong"}]},{"text":":支持 16:9(横屏)和 3:4(竖屏)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"🖼️ ","type":"text"},{"text":"封面图可选","type":"text","marks":[{"type":"strong"}]},{"text":":可生成概括全文的封面图","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"🎭 ","type":"text"},{"text":"三种风格","type":"text","marks":[{"type":"strong"}]},{"text":":渐变玻璃卡片、票据风格、矢量插画","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"🚀 使用方法","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"直接告诉 Claude","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"帮我为这个文档生成配图:/path/to/document.md","type":"text"}]},{"type":"paragraph","content":[{"text":"或者:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"我想为这篇文章生成一些配图","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"📝 完整工作流程","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"第 1 步:Claude 读取和理解文档","type":"text"}]},{"type":"paragraph","content":[{"text":"当你请求生成配图时,Claude 会:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"使用 Read 工具读取完整文档","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"AI 分析理解文档内容和结构","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"识别核心主题和要点","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"无需担心文档格式","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✅ 标准 Markdown(##、###)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✅ 分隔线格式(======、------)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✅ 纯文本段落","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✅ 任何其他格式","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"第 2 步:配置选项(3 个问题)","type":"text"}]},{"type":"paragraph","content":[{"text":"Claude 会询问你的偏好:","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"问题 1:图片比例","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"请选择图片比例:\n1. 16:9 (横屏) - 适合演示文稿、幻灯片、横屏展示\n2. 3:4 (竖屏) - 适合社交媒体、手机查看、海报\n\n请选择 (1/2):","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"问题 2:封面图","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"是否生成封面图?\n封面图将概括文档的所有核心信息,作为系列配图的引导。\n\n1. 是 - 生成封面图 + 内容配图\n2. 否 - 仅生成内容配图\n\n请选择 (1/2):","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"问题 3:内容配图数量","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"期望生成多少张内容配图?\n建议范围:3-10 张\n根据文档内容,推荐生成 6 张\n\n请输入数字:","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"第 3 步:Claude 归纳内容并展示","type":"text"}]},{"type":"paragraph","content":[{"text":"根据你指定的数量,Claude 会智能归纳文档,然后展示给你确认:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"📋 内容归纳完成\n\n📄 封面图内容:(如果选择生成)\n\"AI 编程工具概念演化:从 Rules 到 Skills\"\n- 核心概念:静态上下文 vs 动态上下文\n- 演化路径:Rules → Commands → MCP → Modes → Skills\n- 最佳实践:简化为两个核心工具\n\n📚 内容配图(共 6 张):\n\n1. Rules 的诞生与演化\n 包含:早期模型幻觉问题、rules 文件的作用、静态上下文概念\n\n2. Commands 和工作流打包\n 包含:固定工作流的出现、slash command、团队分享\n\n3. MCP Servers 带来动态能力\n 包含:第三方工具集成、OAuth 认证、上下文膨胀问题\n\n4. Modes 和 Subagents 的登场\n 包含:人设提示词、系统提示词修改、可靠性设计、Hooks 确定性\n\n5. Skills 统一动态上下文\n 包含:Skills 概念、动态加载、编程工具优化\n\n6. 最佳实践与未来展望\n 包含:Rules 使用建议、Skills 探索、核心理念总结\n\n✓ 所有内容已覆盖,无遗漏\n\n确认开始生成配图吗?(Y/N)","type":"text"}]},{"type":"paragraph","content":[{"text":"关键保证","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✅ 内容完整:所有重要信息都会被归入某张图片","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✅ 逻辑清晰:按照内容的自然逻辑分段","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✅ 用户可控:展示归纳结果,等待用户确认","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"第 4 步:生成配图","type":"text"}]},{"type":"paragraph","content":[{"text":"确认后,Claude 调用 Python 脚本生成图片:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"🖼️ 开始生成配图...\n\n正在生成封面图...\n ✓ 已保存: /path/to/document/images/cover.png\n\n正在生成第 1/6 张...\n 标题: Rules 的诞生与演化\n ✓ 已保存: /path/to/document/images/illustration-01.png\n\n正在生成第 2/6 张...\n 标题: Commands 和工作流打包\n ✓ 已保存: /path/to/document/images/illustration-02.png\n\n...\n\n✨ 完成!共生成 7 张配图(1 张封面 + 6 张内容)","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"第 5 步:输出结果","type":"text"}]},{"type":"paragraph","content":[{"text":"输出位置","type":"text","marks":[{"type":"strong"}]},{"text":":文档所在目录下的 ","type":"text"},{"text":"images/","type":"text","marks":[{"type":"code_inline"}]},{"text":" 文件夹","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"/path/to/your/document/\n└── images/\n ├── cover.png # 封面图(如果选择生成)\n ├── illustration-01.png # 第 1 张内容配图\n ├── illustration-02.png # 第 2 张内容配图\n ├── illustration-03.png\n ├── illustration-04.png\n ├── illustration-05.png\n └── illustration-06.png","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"🎨 三种风格说明","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1. 渐变玻璃卡片风格 (gradient-glass)","type":"text"}]},{"type":"paragraph","content":[{"text":"特点","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Apple Keynote 风格的极简主义","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"玻璃拟态(Glassmorphism)设计","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"深邃虚空黑或纯净陶瓷白基底","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"流动的极光渐变色","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"3D 玻璃物体和发光效果","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"适用场景","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"科技产品介绍","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"数据分析报告","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"未来趋势展望","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"产品功能演示","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"2. 票据风格 (ticket)","type":"text"}]},{"type":"paragraph","content":[{"text":"特点","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"数字极简票券设计","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"高度对比的黑白配色","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"类似登机牌、门票的结构","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"精确的几何分区","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"中英混排,多向文字布局","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"适用场景","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"信息图表","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"统计数据展示","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"时间线和流程图","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"要点总结","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"3. 矢量插画风格 (vector-illustration)","type":"text"}]},{"type":"paragraph","content":[{"text":"特点","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"扁平化矢量插画","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"统一粗细的黑色轮廓线","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"复古柔和的配色","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"几何化处理","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"横向全景式构图","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"适用场景","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"故事叙述","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"概念解释","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"教育内容","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"品牌宣传","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"💡 使用示例","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"示例 1:完整流程","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"用户: 帮我为 ~/blog/ai-tools.md 生成配图,用票据风格\n\nClaude: 好的,让我先读取这个文档...\n [读取文档,分析内容]\n\n 检测到文档长度约 3000 字,内容涉及 AI 工具演化。\n\n 请选择图片比例:\n 1. 16:9 (横屏)\n 2. 3:4 (竖屏)\n\n用户: 1\n\nClaude: 是否生成封面图?\n 1. 是\n 2. 否\n\n用户: 是\n\nClaude: 期望生成多少张内容配图?\n 建议范围:3-10 张\n 根据文档内容,推荐生成 5 张\n\n用户: 5\n\nClaude: [展示归纳的 5 个主题]\n 确认开始生成配图吗?\n\n用户: Y\n\nClaude: [调用 Python 脚本生成 6 张图片]\n ✨ 完成!配图已保存到 ~/blog/images/","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"示例 2:纯文本文档","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"用户: 为这个纯文本笔记生成配图\n\nClaude: [读取笔记,即使没有任何标题也能理解内容]\n [智能识别 3 个核心主题]\n [询问配置、展示归纳、生成配图]","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"示例 3:自定义数量","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"用户: 我想要 8 张图,竖屏的,不要封面\n\nClaude: 好的,16:9 竖屏,不生成封面,8 张内容配图。\n [将文档归纳为 8 个主题]\n [展示归纳结果,用户确认后生成]","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"🔧 技术细节","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"图片规格","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"比例","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"分辨率","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"适用场景","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"16:9","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"2560x1440 (2K)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"演示文稿、横屏展示","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"3:4","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"1920x2560","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"社交媒体、竖屏查看","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"可选 4K 分辨率:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"16:9 → 3840x2160","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"3:4 → 2880x3840","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"API 调用","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"模型","type":"text","marks":[{"type":"strong"}]},{"text":":Gemini 2.0 Flash Image Preview (Nano Banana Pro)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"成本","type":"text","marks":[{"type":"strong"}]},{"text":":每张图片 = 1 次 API 调用","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"速度","type":"text","marks":[{"type":"strong"}]},{"text":":平均 10-20 秒/张","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"环境要求","type":"text"}]},{"type":"paragraph","content":[{"text":"必需","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"pip install google-genai pillow python-dotenv","type":"text"}]},{"type":"paragraph","content":[{"text":"API 密钥","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"在 ","type":"text"},{"text":"~/.claude/skills/document-illustrator/.env","type":"text","marks":[{"type":"code_inline"}]},{"text":" 中配置","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"或设置环境变量 ","type":"text"},{"text":"GEMINI_API_KEY","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"📊 内容归纳原则","type":"text"}]},{"type":"paragraph","content":[{"text":"Claude 归纳内容时遵循以下原则:","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1. 完整性优先","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✅ 所有重要信息都会被包含","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✅ 不会遗漏关键概念","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✅ 保留原文的核心观点","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"2. 逻辑清晰","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"按照内容的自然逻辑分段","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"相关内容归为一组","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"保持叙事的连贯性","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"3. 平衡分配","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"每张图片包含相似的信息量","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"避免某张过于拥挤或空洞","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"根据内容重要性调整","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"4. 用户可控","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"展示归纳结果给用户确认","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"用户可以要求调整","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"确认后才开始生成","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"🐛 故障排除","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"问题 1:API 密钥错误","type":"text"}]},{"type":"paragraph","content":[{"text":"错误信息","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"Error: Invalid API key","type":"text"}]},{"type":"paragraph","content":[{"text":"解决方案","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"检查 ","type":"text"},{"text":".env","type":"text","marks":[{"type":"code_inline"}]},{"text":" 文件中的 ","type":"text"},{"text":"GEMINI_API_KEY","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"确保 API 密钥有效且未过期","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"获取新密钥:https://makersuite.google.com/app/apikey","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"问题 2:内容归纳不理想","type":"text"}]},{"type":"paragraph","content":[{"text":"问题","type":"text","marks":[{"type":"strong"}]},{"text":":归纳的主题不符合预期","type":"text"}]},{"type":"paragraph","content":[{"text":"解决方案","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"在归纳展示阶段,告诉 Claude 你的期望","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Claude 会重新归纳并调整","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"确认满意后再开始生成","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"问题 3:图片生成失败","type":"text"}]},{"type":"paragraph","content":[{"text":"可能原因","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"网络连接问题","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"API 配额用尽","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"内容过长超过限制","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"解决方案","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"检查网络连接","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"检查 API 配额","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"尝试增加图片数量(分散内容)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"💰 成本估算","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"图片数量","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"API 调用次数","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"预估成本","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"无封面 + 3 张","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"3 次","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"低","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"有封面 + 5 张","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"6 次","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"中","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"有封面 + 10 张","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"11 次","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"较高","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"建议","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"短文档(\u003c1000字):3-5 张","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"中等文档(1000-3000字):5-7 张","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"长文档(>3000字):8-10 张","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"📚 最佳实践","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1. 合理选择图片数量","type":"text"}]},{"type":"paragraph","content":[{"text":"太少","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"每张图片信息量过大","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"不容易理解和记忆","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"太多","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"内容分散","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"增加成本和生成时间","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"推荐","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"根据文档长度选择","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"每张图片涵盖 1-2 个核心观点","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"2. 根据用途选择比例","type":"text"}]},{"type":"paragraph","content":[{"text":"16:9 适合","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"PPT 演示","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"网站横幅","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"视频封面","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"博客配图(桌面端)","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"3:4 适合","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"社交媒体(Instagram、小红书)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"移动端文章","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"海报设计","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"竖屏视频","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"3. 封面图的使用","type":"text"}]},{"type":"paragraph","content":[{"text":"建议生成封面图的场景","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"系列文章(作为统一引导)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"社交分享(作为预览图)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"文档首页(概括全文)","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"可以不生成的场景","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"仅内部使用","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"图片数量已足够","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"希望降低成本","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"4. 风格选择建议","type":"text"}]},{"type":"paragraph","content":[{"text":"技术文档","type":"text","marks":[{"type":"strong"}]},{"text":" → 渐变玻璃卡片风格 ","type":"text"},{"text":"数据报告","type":"text","marks":[{"type":"strong"}]},{"text":" → 票据风格 ","type":"text"},{"text":"教程故事","type":"text","marks":[{"type":"strong"}]},{"text":" → 矢量插画风格 ","type":"text"},{"text":"产品介绍","type":"text","marks":[{"type":"strong"}]},{"text":" → 渐变玻璃卡片风格","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"🔄 工作原理","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"传统方式(已废弃)","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"[代码] 读取文档 → 识别 ## ### 标题 → 机械切分\n ↓\n 依赖特定格式\n 容易遗漏内容\n 不够智能","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"新方式(当前实现)","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"[Claude] 读取文档 → AI 理解内容 → 智能归纳主题\n ↓\n 格式无关\n 内容完整\n 用户可控","type":"text"}]},{"type":"paragraph","content":[{"text":"核心区别","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"❌ 旧方式:依赖代码解析,只能处理标准格式","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✅ 新方式:AI 理解内容,任何格式都能处理","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"🎯 与其他工具的对比","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"功能","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Document Illustrator","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"传统 PPT 工具","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"AI 图片生成器","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"理解文档内容","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ AI 智能理解","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"❌ 需要手动","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"❌ 需要手动输入","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"格式依赖","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ 格式无关","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"❌ 依赖特定格式","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ 无依赖","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"内容完整性","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ 自动验证","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"⚠️ 手动确保","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"❌ 无法保证","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"批量生成","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ 一次生成多张","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"❌ 逐张制作","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"⚠️ 需要多次输入","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"风格一致性","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ 自动保持","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"⚠️ 手动调整","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"⚠️ 需要重复提示词","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"📞 获取帮助","type":"text"}]},{"type":"paragraph","content":[{"text":"如有问题或建议:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"直接在 Claude Code 中询问 Claude","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"查看计划文件:","type":"text"},{"text":"~/.claude/plans/shimmering-tickling-seahorse.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"检查 Skill 目录:","type":"text"},{"text":"~/.claude/skills/document-illustrator/","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"让 AI 帮你理解和归纳内容,生成专业配图!","type":"text","marks":[{"type":"strong"}]},{"text":" ✨","type":"text"}]}]},"metadata":{"date":"2026-06-05","name":"document-illustrator","model":"claude-sonnet-4-5-20250514","author":"@skillopedia","source":{"stars":546,"repo_name":"document-illustrator-skill","origin_url":"https://github.com/op7418/document-illustrator-skill/blob/HEAD/SKILL.md","repo_owner":"op7418","body_sha256":"d2c9a8c614a702ca94ad49b56d25b63364164e2ed9d2d00862ae7e9ff13adf8e","cluster_key":"749a91e35936cdb1095d8df3ce4484c30fc3c1fab2aee9deccf198642e407ab8","clean_bundle":{"format":"clean-skill-bundle-v1","source":"op7418/document-illustrator-skill/SKILL.md","attachments":[{"id":"01fb101d-155b-518e-93e9-f8802d2339e6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/01fb101d-155b-518e-93e9-f8802d2339e6/attachment","path":".gitignore","size":514,"sha256":"48604e6c7e72204d48f36992c9c2f895fbb798196f56d453658f4aeadd584791","contentType":"text/plain; charset=utf-8"},{"id":"43c299ca-3215-5804-86f7-409f0f830793","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/43c299ca-3215-5804-86f7-409f0f830793/attachment.md","path":"README.md","size":15105,"sha256":"53d2d8881a4bf5188b9a84442dedb577a31a1bb504a63ef9a5b73c008df8cadd","contentType":"text/markdown; charset=utf-8"},{"id":"c91f52a4-7b31-57fa-ab63-9ade64a28396","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c91f52a4-7b31-57fa-ab63-9ade64a28396/attachment.md","path":"examples/README.md","size":2221,"sha256":"b50cd8d6e36937c073ec8cbfdeea653e20da6b84995e88f78482c9716f2f14e3","contentType":"text/markdown; charset=utf-8"},{"id":"af096e3e-950c-5ebe-83bc-32b2e8edb7f5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/af096e3e-950c-5ebe-83bc-32b2e8edb7f5/attachment.py","path":"scripts/generate_illustrations.py","size":23225,"sha256":"caa6028fcb33184caed9052b41cb12e37ba60e2f512615f5bf4896cbe875132f","contentType":"text/x-python; charset=utf-8"},{"id":"d8a59933-b013-5874-b2e2-d9179bc82440","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/d8a59933-b013-5874-b2e2-d9179bc82440/attachment.py","path":"scripts/generate_single_image.py","size":8232,"sha256":"e10cb7f276e5d516d2920f6d1bd3fe7ea3a31f7e4769d166e5192654493b86c7","contentType":"text/x-python; charset=utf-8"},{"id":"c8d5b701-ce82-5f71-ab17-404a292e4abe","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c8d5b701-ce82-5f71-ab17-404a292e4abe/attachment.md","path":"styles/gradient-glass.md","size":2356,"sha256":"6289415a11e5c9a8d766f00506d87c81d6d0ff8b036f47e717eaa1ad12d428f9","contentType":"text/markdown; charset=utf-8"},{"id":"acca5bca-2d82-5026-a6cc-9e9bb58262e0","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/acca5bca-2d82-5026-a6cc-9e9bb58262e0/attachment.md","path":"styles/ticket.md","size":2092,"sha256":"3dc539f465ecf40b4e957d58880b29a2176cd12a8ae49fa49cdfd3dab3027656","contentType":"text/markdown; charset=utf-8"},{"id":"8ba52851-7a4e-584c-bffa-2da56f6e055d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8ba52851-7a4e-584c-bffa-2da56f6e055d/attachment.md","path":"styles/vector-illustration.md","size":2061,"sha256":"155993b0ed7c6be894aa7914cd259e1efeed25cd75828f192a1e1db6dd5c28b3","contentType":"text/markdown; charset=utf-8"}],"bundle_sha256":"9233160165bb9a8857df4d331669aaf28e74b541ec5f1335aac3ab0f2692de41","attachment_count":8,"text_attachments":8,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"documents-office","category_label":"Documents"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"documents-office","import_tag":"clean-skills-v1","description":"基于文档内容自动生成配图。AI 智能分析文档结构,归纳核心要点, 为每个主题生成符合特定风格的配图。支持封面图生成和自定义图片比例。 使用场景:当用户需要为文档、文章、笔记生成配图时。 关键词:配图、插图、illustration、generate images、document images\n","allowed-tools":["Read","Write","Bash(python:*)","Glob","AskUserQuestion"]}},"renderedAt":1782979513228}

Document Illustrator Skill 基于 AI 智能分析的文档配图生成工具。无需依赖特定格式,自动理解内容并生成专业配图。 🎯 核心特点 - ✨ AI 智能归纳 :自动理解文档内容,智能提取核心主题 - 🎨 格式无关 :支持任何格式的文档(Markdown、纯文本、PDF 等) - 📐 灵活比例 :支持 16:9(横屏)和 3:4(竖屏) - 🖼️ 封面图可选 :可生成概括全文的封面图 - 🎭 三种风格 :渐变玻璃卡片、票据风格、矢量插画 🚀 使用方法 直接告诉 Claude 或者: 📝 完整工作流程 第 1 步:Claude 读取和理解文档 当你请求生成配图时,Claude 会: 1. 使用 Read 工具读取完整文档 2. AI 分析理解文档内容和结构 3. 识别核心主题和要点 无需担心文档格式 : - ✅ 标准 Markdown(##、###) - ✅ 分隔线格式(======、------) - ✅ 纯文本段落 - ✅ 任何其他格式 第 2 步:配置选项(3 个问题) Claude 会询问你的偏好: 问题 1:图片比例 问题 2:封面图 问题 3:内容配图数量 第 3 步:Claude 归纳内容并展示 根据你指定的数量,Claude 会智能归纳文档,然后展示给你确认: 关键保证 : - ✅ 内容完整:所有重要信息都会被归入某张图片 - ✅…