Creating Slides Skill
Provides complete HTML slide creation capabilities, including project creation, content design, technical specifications, workflows, and best practices.
Core Capabilities
- Project Creation - Create complete slide project structure
- Page Creation - Create slide pages conforming to specifications
- Content Research - Obtain reference materials and data
- Image Search - Batch search high-quality image materials
- Data Analysis - Support Python scripts for data analysis and processing
- Project Management - Support editing, refactoring, moving, and renaming slide projects
Code Execution Method (Critical)
All Python code examples in this skill must be executed via the run_sdk_snippet tool in Agent environment.
Correct example:
# Correct! Must use run_sdk_snippet to execute
run_sdk_snippet(
python_code="""
from sdk.tool import tool
result = tool.call('create_slide_project', {
"project_path": "my-project",
"slides_array": []
})
"""
)
All code blocks in this document starting with from sdk.tool import tool follow this rule: pass them via the python_code parameter of run_sdk_snippet for execution.
Default Requirements
When user has no explicit requirements, follow these defaults:
- Page count: Determine appropriate page count based on content, each page ≤100 lines of code
- Content density: One key point per page, text ≤150 words, images ≤1
- Slide mindset: 1920×1080 fixed canvas, prioritize horizontal layout, avoid vertical overflow
- Business minimalist style, follow font size specifications, Tailwind mandatory priority
Technical Specifications
Size and Implementation
- Fixed size: 1920px×1080px, strictly no overflow, width and height must be explicitly set in html and body tags
- Implementation: HTML + CSS + JavaScript
- Static fixed page: Same effect on any device size, no adaptation, responsive design prohibited
- Must include
<script src="slide-bridge.js"></script> at bottom of page for inter-page communication
CSS Frameworks and Resources
Technical Constraints
- File generation: Only generate static HTML files
- Responsive design prohibited: Strictly no media queries, pages don't change with screen size
- Content overload prohibited: Avoid excessively long text, too many list items, oversized images; split into multiple pages when single page has too much content
- Dynamic effects prohibited: Page switching controlled by outer system, single pages focus on static display; disable transition, keyframes, dynamic data display animations; disable sound effects, only keep static visuals (CSS hover, shadows, gradients, borders and other style effects can be used normally)
- Don't use server-side code, local file resources, complex interactive features
- Unless user requests, don't use unverified external images
- JavaScript code inline at
<body> bottom, CSS inline in <head>, SVG graphics inline directly
- Chart implementation: Charts, dashboards and any ECharts-supported content must use ECharts implementation, prohibited to write HTML, CSS, SVG code yourself
Tailwind Mandatory Specification
- Maximize use of Tailwind classes: Layout flex/grid, spacing p-/m-, font size text-, colors text-/bg-, decoration rounded-/shadow-*, etc.
- Minimize custom CSS: Limited to complex gradients, pseudo-elements and other scenarios Tailwind cannot implement
Font Size Specification (1920×1080 canvas requires large fonts)
- Page main title: 64-72px (text-6xl/7xl) - Prefer 64px and above
- Section title/Card main title: 40-52px (text-5xl) - Don't go below 40px
- Subtitle/Card subtitle: 30-36px (text-3xl/4xl) - Prefer 32px and above
- Body text/List item: 22-26px (text-2xl) - Minimum 22px, prefer 24px
- Auxiliary label: 20px (text-xl) - Only for tiny labels
- Strictly prohibit 18px (text-lg) and below, unless user explicitly requires
- Principle: Prefer large fonts with less content split into more pages, not small fonts cramming into one page
Visual Hierarchy
Font size contrast (main title differs from body by 3-4 levels) + weight contrast (title font-bold/black) + color contrast (title text-gray-900, body text-gray-600/700) + spatial contrast (important elements mb-8/10/12) + decorative elements (number labels, color blocks, vertical bars)
Design Principles
Content Design Mindset
- One key point per page: Each slide conveys only one core message, maintain focused attention
- Information hierarchy: Establish clear information hierarchy through font size, color depth, spatial position, create depth through shadows and transforms
- Visual expression: Use FontAwesome or Emoji icons to enhance visual expression
Image Requirements
- Image ratio: 70% of slides must contain high-quality images, e.g., 7 out of 10 slides must contain images
- When an image is the main visual anchor, make it part of the layout rather than a tiny corner illustration. It should usually occupy about one third to one half of the main content area.
- Slides without images still need a strong visual anchor, such as a chart, matrix, color block, large number, geometric decoration, card grid, or flow diagram. Avoid pages with only a title and sparse body text.
- Search keywords: Must contain at least one subject keyword, prohibited to use abstract, general, non-specific keywords
- Search format:
[Subject keyword] [Specific scene description]
- Extract at least 1-3 subject keywords related to slide content
- Keyword examples:
- Correct: "IShowSpeed China tour Beijing Great Wall" Wrong: "Beijing Great Wall"
- Correct: "Elon Musk portrait" Wrong: "Tech giant portrait"
- Correct: "Zuckerberg astronomical talent poaching" (specific event) Wrong: "AI talent competition" (abstract, general, non-specific)
- Prohibited to use placeholder images, must use high-quality images returned by image_search tool
Design Style
Default style: Minimalist business style
- Primary colors: Black/white/gray (text-gray-*)
- Accent colors: Orange/red/green/blue (max 1-2 per page)
- Background: Mainly white/light gray, dark background for contrast
- Prohibited: Excessive use of blue, purple, gradients
Style selection: Based on content theme and target audience, derive from minimalist business style, imitate popular PPT design styles including but not limited to:
- Tech: Apple Keynote, Google Material Design, Microsoft Fluent Design
- Business: McKinsey Consulting, Huawei Enterprise, Alibaba Enterprise
- Consumer brands: Xiaomi, Netflix, Nike
- Design-driven: Minimalism, Flat Design
- Media publishing: TED Talks, National Geographic
- Education academia: Stanford University, MIT
Layout Design Core Principles
- Precise zoning planning: Precise zoning planning based on 1920×1080 canvas
- Priority layout modes: Single column centered, left-right split, three-point grid, standard three-section, card-style, timeline (only horizontal timeline allowed), comparison split-screen and dashboard classic PPT layout modes
- Especially recommend left-right split layout (like 60/40 or 50/50), fully utilize horizontal space, avoid vertical stacking causing height overflow
- Zoning planning:
- Header area: Fixed height about 10% (like h-24)
- Middle content area: Occupies main space, can flexibly divide into 2×2, 3×3 grid, max 9-grid
- Footer area: Fixed height about 5% (below h-16), images not allowed
- Horizontal division: Max 6 columns per row, avoid overly fragmented division causing content crowding
- Vertical infinite extension prohibited: Maximize horizontal space use, e.g., horizontal timeline not vertical timeline
Use predefined grid (grid-cols-2/3, grid-rows-2) with gap-4/6/8 unified spacing, flexibly control element space occupation through col-span-2, row-span-2, avoid pixel values defining grid size, use fr units or percentages; Flex layout uses TailwindCSS proportional width classes (w-1/2, w-1/3, w-2/3) prohibited hardcoded pixels, leverage flex-1, justify-between, items-center to achieve responsive layout and balanced content distribution.
Height Control Technique (Critical)
[Hard Requirement] Page height must strictly not exceed 1080px, this is a non-negotiable specification!
If content is too much for a single page, must split into multiple pages, absolutely not allowed to let single page exceed 1080px height.
Reasonable slide height control is extremely important. A simple effective approach is using Grid horizontal card layout, maximize horizontal space use, control similar left-right content amounts, aligned arrangement, overall neat typography.
During conception, page preceding elements should choose height-sensitive elements (usually need sufficient space), subsequent elements/content use height-insensitive elements (usually can adapt to remaining space, like charts), so only need to consider preceding element heights, set subsequent element/content heights to fill remaining height.
While ensuring page is visually full, absolutely don't cram too much readable substantive content in one page.
Please think through above points step by step during design, ensure perfect page layout and height control. Unless user has conflicting requirements, must default to this approach for page layout and height control.
Image Usage Technique
Images are very dangerous, hard-to-control elements in slide creation. Need to plan space with similar aspect ratio to place images, carry images through container elements, let images fill container. Container width and height should use relative units (like percentages, fr units) or Grid layout's automatic allocation mechanism, not fixed, often miscalculated pixel values, otherwise images often overflow canvas causing layout chaos.
Content-related images may also be used as local section backgrounds to add depth. Put an independent overlay layer above the background image and keep text/cards in a separate foreground layer. Do not apply opacity to a container that also holds text.
<div
class="relative"
style="background-image:url('images/xxx.jpg');
background-size:cover;background-position:center;"
>
<div class="absolute inset-0" style="background:rgba(14,20,32,0.60);"></div>
<div class="relative z-10"><!-- content --></div>
</div>
Use background images selectively. Avoid repeating the same full-image treatment on most consecutive slides; alternate with charts, cards, diagrams, or clean graphic pages.
Default Design Mindset
Slides overall have premium feel, use rich decorative elements, conform to industry mainstream aesthetic practices, but don't introduce too much complexity. Note slide height control and neat typography, don't cram too much content in one page, this is key.
ECharts Configuration Requirements
- All ECharts charts must ensure echarts.init() only after HTML content and CSS styles are fully parsed (window.onload). Note: window.onload, not DOMContentLoaded.
- When page contains ECharts charts, must listen to window.resize event. When resize triggers, call resize() method on all charts.
- Chart containers should fully utilize available space, reserve margins to ensure complete text display.
Multi-axis alignment:
- Ensure same-direction axes have consistent tick counts to avoid grid line misalignment.
- Use min, max, interval parameters to achieve tick alignment.
Visual requirements:
- Keep axes, grid lines, labels aligned.
- Avoid text overlap and dense data display issues.
- Harmonious and unified color scheme, reasonable layout not obscuring key data.
Data Analysis Processing
When scenarios involve data analysis, write Python scripts for analysis:
- Python scripts are solely for data analysis processing, not data visualization. Use ECharts for visualization. Strictly prohibited to write chart rendering code in Python scripts.
- For data files like Excel, CSV, use read_files to read first 10 lines to understand structure, then use Python scripts for data analysis.
- For Excel files with multiple sheets or large size, always use Python scripts for analysis. First use script to view data structure and sheet structure, then perform analysis.
- Python script processing results should be refined. Script's role is to calculate and distill core data, not return large amounts of process data, typically hundreds to thousands of characters, max 5000 characters.
- Follow latest mainstream Python programming practices. Ensure code robustness, aim for one-time successful execution.
Slide HTML Template
Reference the following template to create slide pages. Each page is an independent HTML file, style should be consistent but can have appropriate variations, comments are for your understanding only, omit in actual development.
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<title>Slide Title</title>
<script src="https://cdn.tailwindcss.com/3.4.17"></script>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap"
rel="stylesheet"
/>
<style>
html,
body {
width: 1920px;
height: 1080px; /* DO NOT set height or max-height, allow extreme cases to exceed */
font-family:
"Noto Sans SC",
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
"PingFang SC",
"Hiragino Sans GB",
"Microsoft YaHei",
sans-serif;
/* more styles can be added here... */
}
.slide-container {
width: 1920px;
height: 1080px;
/* padding: Adjust according to design needs */
/* more styles can be added here... */
}
</style>
</head>
<body>
<div class="slide-container">
<!-- Page content goes here -->
</div>
<!--
IMPORTANT: This script must be included in every generated slide page.
Simply copy this line as-is - no need to read or understand the script content.
It enables keyboard navigation and title synchronization with the parent page.
-->
<script src="slide-bridge.js"></script>
</body>
</html>
Quick Start
Reminder: All code examples below must be executed via run_sdk_snippet(python_code="..."). Refer to the "Code Execution Method" section at the top of this document.
Create Slide Project
from sdk.tool import tool
# Create empty project (add pages later)
result = tool.call('create_slide_project', {
"project_path": "ChatGPT-Evolution-Report",
"slides_array": [],
"slide_images_content": "",
"todo_list": ""
})
# Create complete project (with images and outline)
result = tool.call('create_slide_project', {
"project_path": "Product-Launch",
"slides_array": ["cover.html", "product-intro.html", "key-features.html"],
"slide_images_content": """# Slide Image Library
## Project Info
- Search topic: Product Launch
- Collected at: 2025-01-22 10:30:00
- Total images: 5
## Image Categories
### Cover / Hero

- Index: 1
- Size: 1920x1080px (16:9, horizontal)
- Visual Analysis: Modern tech product close-up, white background, professional lighting
- Use Case: Cover hero image
- Search Keywords: product hero image modern technology
""",
"todo_list": """# Slide Production Plan
## Project Info
- Project name: Product Launch
- Theme: New product release and feature showcase
- Pages: 3
- Keywords: product, technology, innovation
## Content Outline
### Cover (cover.html)
Display product name and hero visual
### Product Introduction (product-intro.html)
Introduce product background and core value
### Key Features (key-features.html)
Showcase the three core product features
"""
})
Create Single Slide Page
from sdk.tool import tool
result = tool.call('create_slide', {
"file_path": "ChatGPT-Evolution-Report/OpenAI-Milestones.html",
"content": """<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>OpenAI Milestones</title>
<script src="https://cdn.tailwindcss.com/3.4.17"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet"/>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap" rel="stylesheet"/>
<style>
html, body {
width: 1920px;
height: 1080px;
font-family: 'Noto Sans SC', sans-serif;
}
.slide-container {
width: 1920px;
height: 1080px;
}
</style>
</head>
<body>
<div class="slide-container bg-gradient-to-br from-blue-50 to-white flex items-center justify-center">
<div class="text-center">
<h1 class="text-7xl font-bold text-gray-900 mb-8">OpenAI Milestones</h1>
<p class="text-3xl text-gray-600">Key moments in AI development</p>
</div>
</div>
<script src="slide-bridge.js"></script>
</body>
</html>""",
"max_width": 1920,
"max_height": 1080,
"analysis_js": """
const issues = [];
const container = document.querySelector('.slide-container');
if (container) {
const {x, y, width, height} = container.getBoundingClientRect();
if (y + height > maxHeight) {
issues.push(`Container bottom overflow: ${Math.round(y+height)} > ${maxHeight}`);
}
}
return issues.length > 0 ? issues.join(', ') : 'Layout check passed';
""",
"insert_after_slide": ""
})
# Second page
result = tool.call('create_slide', {
"file_path": "ChatGPT-Evolution-Report/Development-Timeline.html",
"content": """...""",
"max_width": 1920,
"max_height": 1080,
"analysis_js": """...""",
"insert_after_slide": "OpenAI-Milestones.html"
})
# Third page
result = tool.call('create_slide', {
"file_path": "ChatGPT-Evolution-Report/Technical-Breakthroughs.html",
"content": """...""",
"max_width": 1920,
"max_height": 1080,
"analysis_js": """...""",
"insert_after_slide": "Development-Timeline.html"
})
Search Image Materials
from sdk.tool import tool
result = tool.call('image_search', {
"topic_id": "ChatGPT-Evolution-Report",
"requirements_xml": """<requirements>
<requirement>
<name>Musk Portrait</name>
<query>Elon Musk portrait professional</query>
<visual_understanding_prompt>Verify this is a clear portrait of Elon Musk</visual_understanding_prompt>
<requirement_explanation>Need a professional portrait photo of Musk for the person introduction page</requirement_explanation>
<expected_aspect_ratio>3:4</expected_aspect_ratio>
<count>3</count>
</requirement>
<requirement>
<name>ChatGPT Interface</name>
<query>ChatGPT interface screenshot 2025</query>
<visual_understanding_prompt>Confirm this is a real ChatGPT interface screenshot</visual_understanding_prompt>
<requirement_explanation>Need a real ChatGPT interface screenshot to showcase product features</requirement_explanation>
<expected_aspect_ratio>16:9</expected_aspect_ratio>
<count>5</count>
</requirement>
<requirement>
<name>Tech Background</name>
<query>AI technology abstract background</query>
<visual_understanding_prompt>Assess whether this is suitable as a technology-themed background</visual_understanding_prompt>
<requirement_explanation>Need an abstract tech-style background image for slide backgrounds</requirement_explanation>
<expected_aspect_ratio>16:9</expected_aspect_ratio>
<count>3</count>
</requirement>
</requirements>"""
})
Web Content Retrieval
from sdk.tool import tool
# Search web pages
search_result = tool.call('web_search', {
"topic_id": "ChatGPT-Research",
"requirements_xml": """<requirements>
<requirement>
<name>ChatGPT History</name>
<query>ChatGPT development history 2025</query>
<limit>10</limit>
</requirement>
<requirement>
<name>GPT-4 Breakthroughs</name>
<query>OpenAI GPT-4 technical breakthroughs</query>
<limit>10</limit>
<time_period>month</time_period>
</requirement>
<requirement>
<name>Commercialization</name>
<query>ChatGPT commercialization progress</query>
<limit>10</limit>
</requirement>
</requirements>"""
})
# Read high-value webpages (refer to separate documentation for this tool)
# read_result = tool.call('read_webpages_as_markdown', {...})
Core Tools and Parameters
create_slide_project - Create Slide Project
| Parameter |
Required |
Type |
Description |
project_path |
Yes |
string |
Project relative path (folder name), e.g., "ChatGPT-Development-Report" |
slide_count |
No |
number |
Slide page count, default 0 (empty project or determined by slides_array) |
slides_array |
Yes |
array |
List of slide filenames, can be empty array [] |
slide_images_content |
No |
string |
Image material library content (Markdown format), empty means not creating file |
todo_list |
No |
string |
Task planning content (Markdown format), empty means not creating file |
Tool Functions:
- Create project folder structure
- Auto-generate
index.html (presentation controller)
- Auto-generate
magic.project.js (project config)
- Auto-generate
slide-bridge.js (inter-page communication script)
- Create
images/ folder
- If
slide_images_content is provided, automatically download images to images/ folder
create_slide - Create Slide Page
| Parameter |
Required |
Type |
Description |
file_path |
Yes |
string |
Slide file path (relative to working directory), e.g., "project-name/page.html" |
content |
Yes |
string |
Complete HTML content |
max_width |
Yes |
number |
Expected max width (usually 1920) |
max_height |
Yes |
number |
Expected max height (usually 1080) |
analysis_js |
Yes |
string |
Layout analysis JavaScript function body (without function declaration) |
insert_after_slide |
Yes |
string |
Insert position: "" for first page, filename to insert after that file |
Tool Functions:
- Write HTML file
- Load via browser and execute
analysis_js for quality check
- Detect layout issues, height overflow, image stretch, small fonts
- Auto-update slides array based on
insert_after_slide
analysis_js Instructions:
- Function body content (without
function() declaration)
- Can access
maxWidth, maxHeight
- Use
return for result
- Focus on detecting element overflow
insert_after_slide Instructions:
"" for first page, filename to insert after
- Auto-updates slides array
image_search - Batch Search Images
| Parameter |
Required |
Type |
Description |
topic_id |
Yes |
string |
Search topic identifier for deduplication |
requirements_xml |
Yes |
string |
XML format search requirements configuration |
requirements_xml Format:
Each <requirement> contains:
name - Requirement name (required)
query - Search keywords (required)
visual_understanding_prompt - Visual analysis prompt (required)
requirement_explanation - Requirement explanation (required)
expected_aspect_ratio - Expected aspect ratio, e.g., 16:9, 9:16, 1:1 (required)
count - Image count (optional, default 20, max 50)
Key Principles:
- Each requirement must provide clear search keywords
- Keywords must include subject words, prohibit pure generic terms
- Choose language based on search intent (Chinese/English/mixed)
- Visual analysis cannot assess clarity, only content
web_search - Web Search
| Parameter |
Required |
Type |
Description |
topic_id |
Yes |
string |
Search topic identifier for deduplication |
requirements_xml |
Yes |
string |
XML format search requirements configuration |
requirements_xml Format:
Each <requirement> contains:
name - Requirement name (required)
query - Search keywords (required)
limit - Result count (optional, default 10, max 20)
offset - Pagination offset (optional, default 0)
language - Search language (optional, default zh-CN)
region - Search region (optional, default CN)
time_period - Time range (optional): day/week/month/year
Project Architecture
Slide projects use separated architecture design:
Project Name/
├── index.html # Presentation controller - handles page navigation, keyboard control, scaling adaptation
├── magic.project.js # Project config - stores slides array and other config info
├── slide-bridge.js # Inter-slide communication script
├── images/ # Image resource folder
├── Slide Page 1.html # Specific slide page
├── Slide Page 2.html # Specific slide page
└── ...
Architecture Working Principles:
index.html is the core controller of presentation system, containing:
- Navigation logic: handles keyboard events, page switching
- Display engine: iframe loading, 16:9 scaling adaptation
create_slide_project tool auto-generates index.html and magic.project.js files, no need to read these files
magic.project.js stores project config, including slides array defining slide page path list
slide-bridge.js is inter-slide communication script, auto-generated by create_slide_project tool, no need to read
- Each HTML file in project root is a completely independent slide page:
- Self-contained design: independent styles, content, scripts
- Standard size: based on 1920×1080 design
- Each slide project must be a complete self-contained project, therefore:
- Slide pages prohibited from referencing images or resources outside project folder. All images must be stored in images folder, otherwise cannot render correctly
- User-uploaded images need to be copied to images folder via shell_exec(command="cp src_path dst_path") command to be correctly referenced
Tool Usage Principles
Tool Restrictions for Slide Creation
Primary Tools (use when creating slides):
web_search - Internet content retrieval
read_webpages_as_markdown - Read high-value webpage content
create_slide_project - Create slide project
create_slide - Create individual slide page
image_search - Batch search image materials
Prohibited Tools (don't use when creating slides):
- File writing tools - No quality checks
- File editing tools - Only when user explicitly requests partial edits
shell_exec with mkdir - create_slide_project auto-creates
Exceptions:
- Non-slide tasks (e.g., "write Python script"), can use other file tools
- User explicitly requests partial edits, can use file editing tools
Tool Selection Principles
Creating Pages: Always use create_slide
create_slide = file writing + quality check + auto-registration
- Don't use file writing tools (no quality checks)
Editing Pages:
- Small-scale (≤100 chars): Use file editing tools
- Large-scale (>100 chars): Use
create_slide to recreate
Project Initialization: Use create_slide_project
- Don't manually
mkdir directories
- Don't manually create
magic.project.js and slide-bridge.js
create_slide_project completes all initialization in one go
Magic Project Mechanism
Core Concept: Folder containing magic.project.js = Frontend recognizes as Magic Project
magic.project.js Operation Constraints:
- Format is JSONP (not JSON), generated by dedicated tools (e.g., setup_audio_project)
- Never create this file directly
- Allowed to edit and modify parameters inside (e.g., metadata.speakers)
Frontend Rendering Differentiation:
- Regular folder: Shows folder icon, click to expand file list
- Magic Project: Shows project icon, click to open dedicated panel (loads index.html visualization interface)
User Operations:
- Click project icon: Open project panel (not entering folder, not opening index.html file)
- Click arrow next to project name: Expand to see internal raw files (like expanding regular folder)
Project Types: type options include audio, slide, etc. Entire folder called "super deliverable".
Tool Parameter Format Specifications
create_slide_project Parameter Formats
slide_images_content Format Requirements
The slide_images_content parameter should contain complete slide-images.md file content, formatted as follows:
# Slide Image Material Library
## Project Information
- Search Topic: ChatGPT Evolution and Technological Breakthroughs
- Collection Time: 2025-01-22 10:30:00
- Total Images: 15
## Image Categories
### Cover/Hero Images

- Index: 1
- Size: {width}x{height}px ({ratio}, {horizontal/vertical/square})
- Visual Analysis: {AI analysis result, excluding size info, describe in detail with minimum words, at least 50 characters}
- Use Case: {recommended usage scenario}
- Search Keywords: {keywords used}

- Index: 2
- Size: {width}x{height}px ({ratio}, {horizontal/vertical/square})
- Visual Analysis: {AI analysis result, excluding size info, describe in detail with minimum words, at least 50 characters}
- Use Case: {recommended usage scenario}
- Search Keywords: {keywords used}
### Background Images

- Index: 3
[Each image follows same format, use standard Markdown image syntax with sequential numbering...]
### Product/Content Display Images

- Index: N
[Continue with same format, ensure index increments sequentially...]
### Icon/Decorative Images

- Index: N+1
[Continue with same format, ensure index increments sequentially...]
Important Notes:
- Use standard Markdown image format:

- filename serves as image alt text and also as filename when downloading
- filename must include file extension, e.g., .jpg, .png, .webp, etc.
- filename should prioritize user's preferred language, be concise and clear, e.g., "trump-assassination-attempt.jpg", "chatgpt-viral-phenomenon.png", "tesla-q4-earnings.jpg"
todo_list Format Requirements
The todo_list parameter should contain complete slide-todo.md file content for recording slide content planning and task breakdown.
Recommended format:
# Slide Production Task Planning
## Project Information
- Project Name: ChatGPT Development Report
- Theme: ChatGPT Evolution and Impact Analysis
- Pages: 10
- Key Keywords: ChatGPT, OpenAI, GPT-4, Artificial Intelligence
## Content Outline
### Cover (OpenAI Milestones.html)
Introduce OpenAI's important development nodes and breakthrough achievements
### Table of Contents (AI Revolution Timeline.html)
Display key time points and milestone events in artificial intelligence development
### GPT Series Evolution (GPT-4 Technological Breakthrough.html)
Detail GPT-4's technical innovations and performance improvements compared to previous generations
### Commercialization Process (ChatGPT Business Miracle.html)
Analyze how ChatGPT reached billion-level user scale in short time
...
magic.project.js Format Description (slide type)
magic.project.js is a JSONP format project configuration file that defines slide project structure and page list.
File Structure:
window.magicProjectConfig = {
version: "1.0.0",
type: "slide",
name: "Project Name",
slides: ["cover.html", "contents.html", "content-page.html"],
};
window.magicProjectConfigure(window.magicProjectConfig);
Field Descriptions:
- version: Configuration file version number, fixed as "1.0.0"
- type: Project type, fixed as "slide" (slide type)
- name: Project name, usually folder name
- slides: Slide page path array, relative to project root, defines page order
slides Array Characteristics:
- Array elements are strings, each string is a relative path to an HTML file
- Array order is the slide playback order
- Can be empty array
[] (empty project), add page paths later via edit_file
- Frontend loads and navigates slide pages based on this array
Modification Examples:
Use edit_file tool to modify slides array content:
- Add page: Append new file path to end of array
- Remove page: Remove specified path from array
- Adjust order: Rearrange array element order
Note: Ensure valid JSONP syntax after modification (valid JavaScript code)
image_search Keyword Strategy
Basic Principles
When using image_search tool, query keywords must be diversified, try 2-3 different keyword combinations for each requirement.
Keyword Language Selection Principles
Judge language based on search intent and information source, try multilingual combinations:
- Search foreign websites/international reports → Use English or original language
- Search local websites → Use local language
- Uncertain about source → Mix multiple languages for comprehensive results
- Same topic can use different languages to get different perspectives
Search Strategy Framework
- Core word: Most direct topic word
- Qualifier: Core word + attribute/function/scenario
- Combination: Multiple related elements combined
- Variant: Synonym/abbreviation/colloquialism/multilingual variant
Search Examples
Search iPhone official images:
- "iPhone", "iPhone 17 Pro Max", "iPhone official"
Search Chinese netizens' comments about Musk (screenshots):
- "Musk Weibo", "Musk comments Chinese", "Musk social media China"
Search international news images about Musk:
- "Elon Musk", "Musk Tesla", "Musk 2025"
Search WeChat function interface:
- "WeChat app", "WeChat interface", "WeChat Pay"
Search international reports about WeChat:
- "WeChat", "WeChat China", "WeChat report"
Search Tesla Shanghai factory (mixed):
- "Tesla Shanghai", "Tesla Shanghai Gigafactory", "Tesla China factory"
Wrong Examples (Avoid)
- Use "collaboration software" → Too generic, should use "Figma", "Figma collaboration" etc.
- Use "database tool" → No subject, should use "Notion database", "Airtable" etc.
- Prohibit generic searches: No using only generic industry terms (software/platform/tool), pure function terms (payment/chat), pure adjectives (modern/advanced)
Keyword Diversification Principles
- From core to specific: Subject name → Subject+attribute → Subject+scenario+time
- Try different expressions: Choose language based on source/abbreviation/full name/multilingual variants
- Combine different elements: Subject/action/time/location
- At least 2-3 different angles per requirement
Create Specific Slide Workflow
If user requests creating specific slides or requests imitating/referencing to generate slides, reference partial workflow of complete creation workflow to flexibly complete user's creation needs.
Best Practices
1. Use create_slide_project to Create Project
- When user has no image requirements: slide_images_content can be empty
- When user already provided images: No need to use image_search tool to search images, instead use visual_understanding tool to analyze image info, write image info into slide_images_content per format requirements
- When user already provided outline or specific text: No need to use web_search tool to search webpages, directly extract todo_list content
2. Directly Use create_slide to Create Slides
- Create slides based on user-provided information
- Insist on using create_slide tool, use analysis_js to analyze layout
- Don't use file writing tools
3. Special Handling for Imitate/Reference Scenarios
- Remember to copy original images: Copy original images to new project's images folder, ensure complete slide project architecture
- Use shell_exec(command="cp src_path dst_path") command to copy images
Complete Creation Workflow
If user has no special requirements, follow this workflow step by step to complete slide creation task:
1. Internet Search
- Understand task description and user needs
- Round 1 search (required): Generate 3 keyword sets for web_search tool, search relevant pages
- Round 2 search (optional): If search results differ from expectations (common in current events scenarios), generate 3+ keyword sets again, conduct second round search with web_search
- Select high-value pages, eliminate duplicates and irrelevant pages. If user doesn't specify count, default to 5 high-value pages, use read_webpages_as_markdown to get high-value page content
2. Image Search and Content Planning
- Batch image search: Use image_search tool to batch search image materials, default minimum batch search 5+ requirements at once, all different, covering large, medium, small, horizontal, vertical various sizes or different scenarios for later use, set topic_id to project name (ensure deduplication)
- One-time batch search: Speculate various types of image needs potentially needed later, initiate batch search in one go, common examples: search background large images, character portraits, product close-ups, icons in different sizes and scenarios
- Avoid duplicates: Don't repeatedly use visual analysis on similar content images, ensure similar content images only used once
- Content planning: Based on user needs and reference materials, analyze and plan slide content:
- Analyze user specific needs and background
- Extract core content points from reference files
- Determine slide page count (determine appropriate page count based on content)
- Identify target audience and usage scenarios
- Choose appropriate design style: Select most suitable style direction from design style list based on content theme
- Prepare content: Prepare complete slide_images_content and todo_list content
…(truncated)
1---
2name: creating-slides
3description: Slide/PPT creation skill that provides complete slide creation, editing, and management capabilities. Use when users need to create slides, make presentations, edit slide content, or manage slide projects. CRITICAL - When user message contains [@slide_project:...] mention, you MUST load this skill first before any operations.
4
5---
6
7# Creating Slides Skill
8
9Provides complete HTML slide creation capabilities, including project creation, content design, technical specifications, workflows, and best practices.
10
11## Core Capabilities
12
13- **Project Creation** - Create complete slide project structure
14- **Page Creation** - Create slide pages conforming to specifications
15- **Content Research** - Obtain reference materials and data
16- **Image Search** - Batch search high-quality image materials
17- **Data Analysis** - Support Python scripts for data analysis and processing
18- **Project Management** - Support editing, refactoring, moving, and renaming slide projects
19
20---
21
22## Code Execution Method (Critical)
23
24All Python code examples in this skill **must be executed via the `run_sdk_snippet` tool** in Agent environment.
25
26**Correct example**:
27
28```python
29# Correct! Must use run_sdk_snippet to execute
30run_sdk_snippet(
31 python_code="""
32from sdk.tool import tool
33result = tool.call('create_slide_project', {
34 "project_path": "my-project",
35 "slides_array": []
36})
37"""
38)
39```
40
41All code blocks in this document starting with `from sdk.tool import tool` follow this rule: pass them via the `python_code` parameter of `run_sdk_snippet` for execution.
42
43---
44
45## Default Requirements
46
47When user has no explicit requirements, follow these defaults:
48
49- **Page count**: Determine appropriate page count based on content, each page ≤100 lines of code
50- **Content density**: One key point per page, text ≤150 words, images ≤1
51- **Slide mindset**: 1920×1080 fixed canvas, prioritize horizontal layout, avoid vertical overflow
52- **Business minimalist style**, follow font size specifications, Tailwind mandatory priority
53
54---
55
56## Technical Specifications
57
58### Size and Implementation
59
60- **Fixed size**: 1920px×1080px, strictly no overflow, width and height must be explicitly set in html and body tags
61- **Implementation**: HTML + CSS + JavaScript
62- **Static fixed page**: Same effect on any device size, no adaptation, responsive design prohibited
63- **Must include** `<script src="slide-bridge.js"></script>` at bottom of page for inter-page communication
64
65### CSS Frameworks and Resources
66
67- **TailwindCSS**: https://cdn.tailwindcss.com/3.4.17 (required, note: this CDN uses JIT browser compilation mode, returns JS code, use `<script>` tag)
68- **FontAwesome**: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css (required)
69- **Google Fonts**: https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap (required)
70- **ECharts**: https://cdnjs.cloudflare.com/ajax/libs/echarts/5.6.0/echarts.min.js (use when necessary)
71
72### Technical Constraints
73
74- **File generation**: Only generate static HTML files
75- **Responsive design prohibited**: Strictly no media queries, pages don't change with screen size
76- **Content overload prohibited**: Avoid excessively long text, too many list items, oversized images; split into multiple pages when single page has too much content
77- **Dynamic effects prohibited**: Page switching controlled by outer system, single pages focus on static display; disable transition, keyframes, dynamic data display animations; disable sound effects, only keep static visuals (CSS hover, shadows, gradients, borders and other style effects can be used normally)
78- **Don't use server-side code, local file resources, complex interactive features**
79- **Unless user requests, don't use unverified external images**
80- **JavaScript code inline at `<body>` bottom, CSS inline in `<head>`, SVG graphics inline directly**
81- **Chart implementation**: Charts, dashboards and any ECharts-supported content must use ECharts implementation, prohibited to write HTML, CSS, SVG code yourself
82
83### Tailwind Mandatory Specification
84
85- **Maximize use of Tailwind classes**: Layout flex/grid, spacing p-_/m-_, font size text-_, colors text-_/bg-_, decoration rounded-_/shadow-\*, etc.
86- **Minimize custom CSS**: Limited to complex gradients, pseudo-elements and other scenarios Tailwind cannot implement
87
88### Font Size Specification (1920×1080 canvas requires large fonts)
89
90- **Page main title**: 64-72px (text-6xl/7xl) - Prefer 64px and above
91- **Section title/Card main title**: 40-52px (text-5xl) - Don't go below 40px
92- **Subtitle/Card subtitle**: 30-36px (text-3xl/4xl) - Prefer 32px and above
93- **Body text/List item**: 22-26px (text-2xl) - Minimum 22px, prefer 24px
94- **Auxiliary label**: 20px (text-xl) - Only for tiny labels
95- **Strictly prohibit 18px (text-lg) and below**, unless user explicitly requires
96- **Principle**: Prefer large fonts with less content split into more pages, not small fonts cramming into one page
97
98### Visual Hierarchy
99
100Font size contrast (main title differs from body by 3-4 levels) + weight contrast (title font-bold/black) + color contrast (title text-gray-900, body text-gray-600/700) + spatial contrast (important elements mb-8/10/12) + decorative elements (number labels, color blocks, vertical bars)
101
102---
103
104## Design Principles
105
106### Content Design Mindset
107
108- **One key point per page**: Each slide conveys only one core message, maintain focused attention
109- **Information hierarchy**: Establish clear information hierarchy through font size, color depth, spatial position, create depth through shadows and transforms
110- **Visual expression**: Use FontAwesome or Emoji icons to enhance visual expression
111
112### Image Requirements
113
114- **Image ratio**: 70% of slides must contain high-quality images, e.g., 7 out of 10 slides must contain images
115- When an image is the main visual anchor, make it part of the layout rather than a tiny corner illustration. It should usually occupy about one third to one half of the main content area.
116- Slides without images still need a strong visual anchor, such as a chart, matrix, color block, large number, geometric decoration, card grid, or flow diagram. Avoid pages with only a title and sparse body text.
117- **Search keywords**: Must contain at least one subject keyword, prohibited to use abstract, general, non-specific keywords
118 - Search format: `[Subject keyword] [Specific scene description]`
119 - Extract at least 1-3 subject keywords related to slide content
120 - Keyword examples:
121 - Correct: "IShowSpeed China tour Beijing Great Wall" Wrong: "Beijing Great Wall"
122 - Correct: "Elon Musk portrait" Wrong: "Tech giant portrait"
123 - Correct: "Zuckerberg astronomical talent poaching" (specific event) Wrong: "AI talent competition" (abstract, general, non-specific)
124- **Prohibited to use placeholder images**, must use high-quality images returned by image_search tool
125
126### Design Style
127
128**Default style**: Minimalist business style
129
130- **Primary colors**: Black/white/gray (text-gray-\*)
131- **Accent colors**: Orange/red/green/blue (max 1-2 per page)
132- **Background**: Mainly white/light gray, dark background for contrast
133- **Prohibited**: Excessive use of blue, purple, gradients
134
135**Style selection**: Based on content theme and target audience, derive from minimalist business style, imitate popular PPT design styles including but not limited to:
136
137- **Tech**: Apple Keynote, Google Material Design, Microsoft Fluent Design
138- **Business**: McKinsey Consulting, Huawei Enterprise, Alibaba Enterprise
139- **Consumer brands**: Xiaomi, Netflix, Nike
140- **Design-driven**: Minimalism, Flat Design
141- **Media publishing**: TED Talks, National Geographic
142- **Education academia**: Stanford University, MIT
143
144### Layout Design Core Principles
145
146- **Precise zoning planning**: Precise zoning planning based on 1920×1080 canvas
147- **Priority layout modes**: Single column centered, left-right split, three-point grid, standard three-section, card-style, timeline (only horizontal timeline allowed), comparison split-screen and dashboard classic PPT layout modes
148- **Especially recommend left-right split layout** (like 60/40 or 50/50), fully utilize horizontal space, avoid vertical stacking causing height overflow
149- **Zoning planning**:
150 - Header area: Fixed height about 10% (like h-24)
151 - Middle content area: Occupies main space, can flexibly divide into 2×2, 3×3 grid, max 9-grid
152 - Footer area: Fixed height about 5% (below h-16), images not allowed
153- **Horizontal division**: Max 6 columns per row, avoid overly fragmented division causing content crowding
154- **Vertical infinite extension prohibited**: Maximize horizontal space use, e.g., horizontal timeline not vertical timeline
155
156Use predefined grid (grid-cols-2/3, grid-rows-2) with gap-4/6/8 unified spacing, flexibly control element space occupation through col-span-2, row-span-2, avoid pixel values defining grid size, use fr units or percentages; Flex layout uses TailwindCSS proportional width classes (w-1/2, w-1/3, w-2/3) prohibited hardcoded pixels, leverage flex-1, justify-between, items-center to achieve responsive layout and balanced content distribution.
157
158### Height Control Technique (Critical)
159
160**[Hard Requirement] Page height must strictly not exceed 1080px, this is a non-negotiable specification!**
161
162If content is too much for a single page, **must split into multiple pages**, absolutely not allowed to let single page exceed 1080px height.
163
164**Reasonable slide height control is extremely important**. A simple effective approach is using Grid horizontal card layout, maximize horizontal space use, control similar left-right content amounts, aligned arrangement, overall neat typography.
165
166During conception, **page preceding elements should choose height-sensitive elements (usually need sufficient space), subsequent elements/content use height-insensitive elements (usually can adapt to remaining space, like charts)**, so only need to consider preceding element heights, set subsequent element/content heights to fill remaining height.
167
168While ensuring page is visually full, **absolutely don't cram too much readable substantive content in one page**.
169
170Please think through above points step by step during design, ensure perfect page layout and height control. Unless user has conflicting requirements, must default to this approach for page layout and height control.
171
172### Image Usage Technique
173
174Images are very dangerous, hard-to-control elements in slide creation. Need to plan space with similar aspect ratio to place images, carry images through container elements, let images fill container. Container width and height should use relative units (like percentages, fr units) or Grid layout's automatic allocation mechanism, not fixed, often miscalculated pixel values, otherwise images often overflow canvas causing layout chaos.
175
176Content-related images may also be used as local section backgrounds to add depth. Put an independent overlay layer above the background image and keep text/cards in a separate foreground layer. Do not apply `opacity` to a container that also holds text.
177
178```html
179<div
180 class="relative"
181 style="background-image:url('images/xxx.jpg');
182 background-size:cover;background-position:center;"
183>
184 <div class="absolute inset-0" style="background:rgba(14,20,32,0.60);"></div>
185 <div class="relative z-10"><!-- content --></div>
186</div>
187```
188
189Use background images selectively. Avoid repeating the same full-image treatment on most consecutive slides; alternate with charts, cards, diagrams, or clean graphic pages.
190
191### Default Design Mindset
192
193Slides overall have premium feel, use rich decorative elements, conform to industry mainstream aesthetic practices, but don't introduce too much complexity. Note slide height control and neat typography, don't cram too much content in one page, this is key.
194
195---
196
197## ECharts Configuration Requirements
198
199- All ECharts charts must ensure echarts.init() only after HTML content and CSS styles are fully parsed (window.onload). Note: window.onload, not DOMContentLoaded.
200- When page contains ECharts charts, must listen to window.resize event. When resize triggers, call resize() method on all charts.
201- Chart containers should fully utilize available space, reserve margins to ensure complete text display.
202
203**Multi-axis alignment:**
204
205- Ensure same-direction axes have consistent tick counts to avoid grid line misalignment.
206- Use min, max, interval parameters to achieve tick alignment.
207
208**Visual requirements:**
209
210- Keep axes, grid lines, labels aligned.
211- Avoid text overlap and dense data display issues.
212- Harmonious and unified color scheme, reasonable layout not obscuring key data.
213
214---
215
216## Data Analysis Processing
217
218When scenarios involve data analysis, write Python scripts for analysis:
219
220- **Python scripts are solely for data analysis processing, not data visualization**. Use ECharts for visualization. Strictly prohibited to write chart rendering code in Python scripts.
221- For data files like Excel, CSV, use read_files to read first 10 lines to understand structure, then use Python scripts for data analysis.
222- For Excel files with multiple sheets or large size, always use Python scripts for analysis. First use script to view data structure and sheet structure, then perform analysis.
223- Python script processing results should be refined. Script's role is to calculate and distill core data, not return large amounts of process data, typically hundreds to thousands of characters, max 5000 characters.
224- Follow latest mainstream Python programming practices. Ensure code robustness, aim for one-time successful execution.
225
226---
227
228## Slide HTML Template
229
230Reference the following template to create slide pages. Each page is an independent HTML file, style should be consistent but can have appropriate variations, comments are for your understanding only, omit in actual development.
231
232```html
233<!DOCTYPE html>
234<html lang="zh">
235 <head>
236 <meta charset="utf-8" />
237 <meta content="width=device-width, initial-scale=1.0" name="viewport" />
238 <title>Slide Title</title>
239 <script src="https://cdn.tailwindcss.com/3.4.17"></script>
240 <link
241 href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"
242 rel="stylesheet"
243 />
244 <link
245 href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap"
246 rel="stylesheet"
247 />
248 <style>
249 html,
250 body {
251 width: 1920px;
252 height: 1080px; /* DO NOT set height or max-height, allow extreme cases to exceed */
253 font-family:
254 "Noto Sans SC",
255 -apple-system,
256 BlinkMacSystemFont,
257 "Segoe UI",
258 "PingFang SC",
259 "Hiragino Sans GB",
260 "Microsoft YaHei",
261 sans-serif;
262 /* more styles can be added here... */
263 }
264
265 .slide-container {
266 width: 1920px;
267 height: 1080px;
268 /* padding: Adjust according to design needs */
269 /* more styles can be added here... */
270 }
271 </style>
272 </head>
273 <body>
274 <div class="slide-container">
275 <!-- Page content goes here -->
276 </div>
277 <!--
278 IMPORTANT: This script must be included in every generated slide page.
279 Simply copy this line as-is - no need to read or understand the script content.
280 It enables keyboard navigation and title synchronization with the parent page.
281 -->
282 <script src="slide-bridge.js"></script>
283 </body>
284</html>
285```
286
287---
288
289## Quick Start
290
291> **Reminder**: All code examples below must be executed via `run_sdk_snippet(python_code="...")`. Refer to the "Code Execution Method" section at the top of this document.
292
293### Create Slide Project
294
295```python
296from sdk.tool import tool
297
298# Create empty project (add pages later)
299result = tool.call('create_slide_project', {
300 "project_path": "ChatGPT-Evolution-Report",
301 "slides_array": [],
302 "slide_images_content": "",
303 "todo_list": ""
304})
305
306# Create complete project (with images and outline)
307result = tool.call('create_slide_project', {
308 "project_path": "Product-Launch",
309 "slides_array": ["cover.html", "product-intro.html", "key-features.html"],
310 "slide_images_content": """# Slide Image Library
311
312## Project Info
313- Search topic: Product Launch
314- Collected at: 2025-01-22 10:30:00
315- Total images: 5
316
317## Image Categories
318
319### Cover / Hero
320
321
322- Index: 1
323- Size: 1920x1080px (16:9, horizontal)
324- Visual Analysis: Modern tech product close-up, white background, professional lighting
325- Use Case: Cover hero image
326- Search Keywords: product hero image modern technology
327""",
328 "todo_list": """# Slide Production Plan
329
330## Project Info
331- Project name: Product Launch
332- Theme: New product release and feature showcase
333- Pages: 3
334- Keywords: product, technology, innovation
335
336## Content Outline
337### Cover (cover.html)
338Display product name and hero visual
339
340### Product Introduction (product-intro.html)
341Introduce product background and core value
342
343### Key Features (key-features.html)
344Showcase the three core product features
345"""
346})
347```
348
349### Create Single Slide Page
350
351```python
352from sdk.tool import tool
353
354result = tool.call('create_slide', {
355 "file_path": "ChatGPT-Evolution-Report/OpenAI-Milestones.html",
356 "content": """<!DOCTYPE html>
357<html lang="en">
358<head>
359 <meta charset="utf-8"/>
360 <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
361 <title>OpenAI Milestones</title>
362 <script src="https://cdn.tailwindcss.com/3.4.17"></script>
363 <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet"/>
364 <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap" rel="stylesheet"/>
365 <style>
366 html, body {
367 width: 1920px;
368 height: 1080px;
369 font-family: 'Noto Sans SC', sans-serif;
370 }
371 .slide-container {
372 width: 1920px;
373 height: 1080px;
374 }
375 </style>
376</head>
377<body>
378 <div class="slide-container bg-gradient-to-br from-blue-50 to-white flex items-center justify-center">
379 <div class="text-center">
380 <h1 class="text-7xl font-bold text-gray-900 mb-8">OpenAI Milestones</h1>
381 <p class="text-3xl text-gray-600">Key moments in AI development</p>
382 </div>
383 </div>
384 <script src="slide-bridge.js"></script>
385</body>
386</html>""",
387 "max_width": 1920,
388 "max_height": 1080,
389 "analysis_js": """
390const issues = [];
391const container = document.querySelector('.slide-container');
392if (container) {
393 const {x, y, width, height} = container.getBoundingClientRect();
394 if (y + height > maxHeight) {
395 issues.push(`Container bottom overflow: ${Math.round(y+height)} > ${maxHeight}`);
396 }
397}
398return issues.length > 0 ? issues.join(', ') : 'Layout check passed';
399""",
400 "insert_after_slide": ""
401})
402
403# Second page
404result = tool.call('create_slide', {
405 "file_path": "ChatGPT-Evolution-Report/Development-Timeline.html",
406 "content": """...""",
407 "max_width": 1920,
408 "max_height": 1080,
409 "analysis_js": """...""",
410 "insert_after_slide": "OpenAI-Milestones.html"
411})
412
413# Third page
414result = tool.call('create_slide', {
415 "file_path": "ChatGPT-Evolution-Report/Technical-Breakthroughs.html",
416 "content": """...""",
417 "max_width": 1920,
418 "max_height": 1080,
419 "analysis_js": """...""",
420 "insert_after_slide": "Development-Timeline.html"
421})
422```
423
424### Search Image Materials
425
426```python
427from sdk.tool import tool
428
429result = tool.call('image_search', {
430 "topic_id": "ChatGPT-Evolution-Report",
431 "requirements_xml": """<requirements>
432 <requirement>
433 <name>Musk Portrait</name>
434 <query>Elon Musk portrait professional</query>
435 <visual_understanding_prompt>Verify this is a clear portrait of Elon Musk</visual_understanding_prompt>
436 <requirement_explanation>Need a professional portrait photo of Musk for the person introduction page</requirement_explanation>
437 <expected_aspect_ratio>3:4</expected_aspect_ratio>
438 <count>3</count>
439 </requirement>
440 <requirement>
441 <name>ChatGPT Interface</name>
442 <query>ChatGPT interface screenshot 2025</query>
443 <visual_understanding_prompt>Confirm this is a real ChatGPT interface screenshot</visual_understanding_prompt>
444 <requirement_explanation>Need a real ChatGPT interface screenshot to showcase product features</requirement_explanation>
445 <expected_aspect_ratio>16:9</expected_aspect_ratio>
446 <count>5</count>
447 </requirement>
448 <requirement>
449 <name>Tech Background</name>
450 <query>AI technology abstract background</query>
451 <visual_understanding_prompt>Assess whether this is suitable as a technology-themed background</visual_understanding_prompt>
452 <requirement_explanation>Need an abstract tech-style background image for slide backgrounds</requirement_explanation>
453 <expected_aspect_ratio>16:9</expected_aspect_ratio>
454 <count>3</count>
455 </requirement>
456</requirements>"""
457})
458```
459
460### Web Content Retrieval
461
462```python
463from sdk.tool import tool
464
465# Search web pages
466search_result = tool.call('web_search', {
467 "topic_id": "ChatGPT-Research",
468 "requirements_xml": """<requirements>
469 <requirement>
470 <name>ChatGPT History</name>
471 <query>ChatGPT development history 2025</query>
472 <limit>10</limit>
473 </requirement>
474 <requirement>
475 <name>GPT-4 Breakthroughs</name>
476 <query>OpenAI GPT-4 technical breakthroughs</query>
477 <limit>10</limit>
478 <time_period>month</time_period>
479 </requirement>
480 <requirement>
481 <name>Commercialization</name>
482 <query>ChatGPT commercialization progress</query>
483 <limit>10</limit>
484 </requirement>
485</requirements>"""
486})
487
488# Read high-value webpages (refer to separate documentation for this tool)
489# read_result = tool.call('read_webpages_as_markdown', {...})
490```
491
492---
493
494## Core Tools and Parameters
495
496### create_slide_project - Create Slide Project
497
498| Parameter | Required | Type | Description |
499| ---------------------- | -------- | ------ | ------------------------------------------------------------------------------- |
500| `project_path` | Yes | string | Project relative path (folder name), e.g., `"ChatGPT-Development-Report"` |
501| `slide_count` | No | number | Slide page count, default 0 (empty project or determined by slides_array) |
502| `slides_array` | Yes | array | List of slide filenames, can be empty array `[]` |
503| `slide_images_content` | No | string | Image material library content (Markdown format), empty means not creating file |
504| `todo_list` | No | string | Task planning content (Markdown format), empty means not creating file |
505
506**Tool Functions:**
507
508- Create project folder structure
509- Auto-generate `index.html` (presentation controller)
510- Auto-generate `magic.project.js` (project config)
511- Auto-generate `slide-bridge.js` (inter-page communication script)
512- Create `images/` folder
513- If `slide_images_content` is provided, automatically download images to `images/` folder
514
515### create_slide - Create Slide Page
516
517| Parameter | Required | Type | Description |
518| -------------------- | -------- | ------ | --------------------------------------------------------------------------------- |
519| `file_path` | Yes | string | Slide file path (relative to working directory), e.g., `"project-name/page.html"` |
520| `content` | Yes | string | Complete HTML content |
521| `max_width` | Yes | number | Expected max width (usually 1920) |
522| `max_height` | Yes | number | Expected max height (usually 1080) |
523| `analysis_js` | Yes | string | Layout analysis JavaScript function body (without function declaration) |
524| `insert_after_slide` | Yes | string | Insert position: `""` for first page, filename to insert after that file |
525
526**Tool Functions:**
527
528- Write HTML file
529- Load via browser and execute `analysis_js` for quality check
530- Detect layout issues, height overflow, image stretch, small fonts
531- Auto-update slides array based on `insert_after_slide`
532
533**analysis_js Instructions:**
534
535- Function body content (without `function()` declaration)
536- Can access `maxWidth`, `maxHeight`
537- Use `return` for result
538- Focus on detecting element overflow
539
540**insert_after_slide Instructions:**
541
542- `""` for first page, filename to insert after
543- Auto-updates slides array
544
545### image_search - Batch Search Images
546
547| Parameter | Required | Type | Description |
548| ------------------ | -------- | ------ | -------------------------------------------- |
549| `topic_id` | Yes | string | Search topic identifier for deduplication |
550| `requirements_xml` | Yes | string | XML format search requirements configuration |
551
552**requirements_xml Format:**
553Each `<requirement>` contains:
554
555- `name` - Requirement name (required)
556- `query` - Search keywords (required)
557- `visual_understanding_prompt` - Visual analysis prompt (required)
558- `requirement_explanation` - Requirement explanation (required)
559- `expected_aspect_ratio` - Expected aspect ratio, e.g., `16:9`, `9:16`, `1:1` (required)
560- `count` - Image count (optional, default 20, max 50)
561
562**Key Principles:**
563
564- Each requirement must provide clear search keywords
565- Keywords must include subject words, prohibit pure generic terms
566- Choose language based on search intent (Chinese/English/mixed)
567- Visual analysis cannot assess clarity, only content
568
569### web_search - Web Search
570
571| Parameter | Required | Type | Description |
572| ------------------ | -------- | ------ | -------------------------------------------- |
573| `topic_id` | Yes | string | Search topic identifier for deduplication |
574| `requirements_xml` | Yes | string | XML format search requirements configuration |
575
576**requirements_xml Format:**
577Each `<requirement>` contains:
578
579- `name` - Requirement name (required)
580- `query` - Search keywords (required)
581- `limit` - Result count (optional, default 10, max 20)
582- `offset` - Pagination offset (optional, default 0)
583- `language` - Search language (optional, default zh-CN)
584- `region` - Search region (optional, default CN)
585- `time_period` - Time range (optional): day/week/month/year
586
587---
588
589## Project Architecture
590
591Slide projects use separated architecture design:
592
593```
594Project Name/
595├── index.html # Presentation controller - handles page navigation, keyboard control, scaling adaptation
596├── magic.project.js # Project config - stores slides array and other config info
597├── slide-bridge.js # Inter-slide communication script
598├── images/ # Image resource folder
599├── Slide Page 1.html # Specific slide page
600├── Slide Page 2.html # Specific slide page
601└── ...
602```
603
604**Architecture Working Principles:**
605
6061. `index.html` is the core controller of presentation system, containing:
607 - Navigation logic: handles keyboard events, page switching
608 - Display engine: iframe loading, 16:9 scaling adaptation
609 - `create_slide_project` tool auto-generates index.html and magic.project.js files, no need to read these files
6102. `magic.project.js` stores project config, including slides array defining slide page path list
6113. `slide-bridge.js` is inter-slide communication script, auto-generated by `create_slide_project` tool, no need to read
6124. Each HTML file in project root is a completely independent slide page:
613 - Self-contained design: independent styles, content, scripts
614 - Standard size: based on 1920×1080 design
6155. Each slide project must be a complete self-contained project, therefore:
616 - Slide pages prohibited from referencing images or resources outside project folder. All images must be stored in images folder, otherwise cannot render correctly
617 - User-uploaded images need to be copied to images folder via shell_exec(command="cp src_path dst_path") command to be correctly referenced
618
619---
620
621## Tool Usage Principles
622
623### Tool Restrictions for Slide Creation
624
625**Primary Tools** (use when creating slides):
626
627- `web_search` - Internet content retrieval
628- `read_webpages_as_markdown` - Read high-value webpage content
629- `create_slide_project` - Create slide project
630- `create_slide` - Create individual slide page
631- `image_search` - Batch search image materials
632
633**Prohibited Tools** (don't use when creating slides):
634
635- File writing tools - No quality checks
636- File editing tools - Only when user explicitly requests partial edits
637- `shell_exec` with `mkdir` - `create_slide_project` auto-creates
638
639**Exceptions**:
640
641- Non-slide tasks (e.g., "write Python script"), can use other file tools
642- User explicitly requests partial edits, can use file editing tools
643
644### Tool Selection Principles
645
646**Creating Pages:** Always use `create_slide`
647
648- `create_slide` = file writing + quality check + auto-registration
649- Don't use file writing tools (no quality checks)
650
651**Editing Pages:**
652
653- Small-scale (≤100 chars): Use file editing tools
654- Large-scale (>100 chars): Use `create_slide` to recreate
655
656**Project Initialization:** Use `create_slide_project`
657
658- Don't manually `mkdir` directories
659- Don't manually create `magic.project.js` and `slide-bridge.js`
660- `create_slide_project` completes all initialization in one go
661
662---
663
664## Magic Project Mechanism
665
666**Core Concept**: Folder containing magic.project.js = Frontend recognizes as Magic Project
667
668**magic.project.js Operation Constraints**:
669
670- Format is JSONP (not JSON), generated by dedicated tools (e.g., setup_audio_project)
671- Never create this file directly
672- Allowed to edit and modify parameters inside (e.g., metadata.speakers)
673
674**Frontend Rendering Differentiation**:
675
676- Regular folder: Shows folder icon, click to expand file list
677- Magic Project: Shows project icon, click to open dedicated panel (loads index.html visualization interface)
678
679**User Operations**:
680
681- Click project icon: Open project panel (not entering folder, not opening index.html file)
682- Click arrow next to project name: Expand to see internal raw files (like expanding regular folder)
683
684**Project Types**: type options include audio, slide, etc. Entire folder called "super deliverable".
685
686---
687
688## Tool Parameter Format Specifications
689
690### create_slide_project Parameter Formats
691
692#### slide_images_content Format Requirements
693
694The `slide_images_content` parameter should contain complete slide-images.md file content, formatted as follows:
695
696```markdown
697# Slide Image Material Library
698
699## Project Information
700
701- Search Topic: ChatGPT Evolution and Technological Breakthroughs
702- Collection Time: 2025-01-22 10:30:00
703- Total Images: 15
704
705## Image Categories
706
707### Cover/Hero Images
708
709
710
711- Index: 1
712- Size: {width}x{height}px ({ratio}, {horizontal/vertical/square})
713- Visual Analysis: {AI analysis result, excluding size info, describe in detail with minimum words, at least 50 characters}
714- Use Case: {recommended usage scenario}
715- Search Keywords: {keywords used}
716
717
718
719- Index: 2
720- Size: {width}x{height}px ({ratio}, {horizontal/vertical/square})
721- Visual Analysis: {AI analysis result, excluding size info, describe in detail with minimum words, at least 50 characters}
722- Use Case: {recommended usage scenario}
723- Search Keywords: {keywords used}
724
725### Background Images
726
727
728
729- Index: 3
730 [Each image follows same format, use standard Markdown image syntax with sequential numbering...]
731
732### Product/Content Display Images
733
734
735
736- Index: N
737 [Continue with same format, ensure index increments sequentially...]
738
739### Icon/Decorative Images
740
741
742
743- Index: N+1
744 [Continue with same format, ensure index increments sequentially...]
745```
746
747**Important Notes**:
748
7491. Use standard Markdown image format: ``
7502. filename serves as image alt text and also as filename when downloading
7513. filename must include file extension, e.g., .jpg, .png, .webp, etc.
7524. filename should prioritize user's preferred language, be concise and clear, e.g., "trump-assassination-attempt.jpg", "chatgpt-viral-phenomenon.png", "tesla-q4-earnings.jpg"
753
754#### todo_list Format Requirements
755
756The `todo_list` parameter should contain complete slide-todo.md file content for recording slide content planning and task breakdown.
757
758Recommended format:
759
760```markdown
761# Slide Production Task Planning
762
763## Project Information
764
765- Project Name: ChatGPT Development Report
766- Theme: ChatGPT Evolution and Impact Analysis
767- Pages: 10
768- Key Keywords: ChatGPT, OpenAI, GPT-4, Artificial Intelligence
769
770## Content Outline
771
772### Cover (OpenAI Milestones.html)
773
774Introduce OpenAI's important development nodes and breakthrough achievements
775
776### Table of Contents (AI Revolution Timeline.html)
777
778Display key time points and milestone events in artificial intelligence development
779
780### GPT Series Evolution (GPT-4 Technological Breakthrough.html)
781
782Detail GPT-4's technical innovations and performance improvements compared to previous generations
783
784### Commercialization Process (ChatGPT Business Miracle.html)
785
786Analyze how ChatGPT reached billion-level user scale in short time
787...
788```
789
790#### magic.project.js Format Description (slide type)
791
792magic.project.js is a JSONP format project configuration file that defines slide project structure and page list.
793
794**File Structure**:
795
796```javascript
797window.magicProjectConfig = {
798 version: "1.0.0",
799 type: "slide",
800 name: "Project Name",
801 slides: ["cover.html", "contents.html", "content-page.html"],
802};
803window.magicProjectConfigure(window.magicProjectConfig);
804```
805
806**Field Descriptions**:
807
808- **version**: Configuration file version number, fixed as "1.0.0"
809- **type**: Project type, fixed as "slide" (slide type)
810- **name**: Project name, usually folder name
811- **slides**: Slide page path array, relative to project root, defines page order
812
813**slides Array Characteristics**:
814
815- Array elements are strings, each string is a relative path to an HTML file
816- Array order is the slide playback order
817- Can be empty array `[]` (empty project), add page paths later via edit_file
818- Frontend loads and navigates slide pages based on this array
819
820**Modification Examples**:
821Use edit_file tool to modify slides array content:
822
823- Add page: Append new file path to end of array
824- Remove page: Remove specified path from array
825- Adjust order: Rearrange array element order
826
827Note: Ensure valid JSONP syntax after modification (valid JavaScript code)
828
829---
830
831## image_search Keyword Strategy
832
833### Basic Principles
834
835When using image_search tool, query keywords must be diversified, try 2-3 different keyword combinations for each requirement.
836
837### Keyword Language Selection Principles
838
839Judge language based on search intent and information source, try multilingual combinations:
840
841- Search foreign websites/international reports → Use English or original language
842- Search local websites → Use local language
843- Uncertain about source → Mix multiple languages for comprehensive results
844- Same topic can use different languages to get different perspectives
845
846### Search Strategy Framework
847
8481. **Core word**: Most direct topic word
8492. **Qualifier**: Core word + attribute/function/scenario
8503. **Combination**: Multiple related elements combined
8514. **Variant**: Synonym/abbreviation/colloquialism/multilingual variant
852
853### Search Examples
854
855**Search iPhone official images**:
856
857- "iPhone", "iPhone 17 Pro Max", "iPhone official"
858
859**Search Chinese netizens' comments about Musk (screenshots)**:
860
861- "Musk Weibo", "Musk comments Chinese", "Musk social media China"
862
863**Search international news images about Musk**:
864
865- "Elon Musk", "Musk Tesla", "Musk 2025"
866
867**Search WeChat function interface**:
868
869- "WeChat app", "WeChat interface", "WeChat Pay"
870
871**Search international reports about WeChat**:
872
873- "WeChat", "WeChat China", "WeChat report"
874
875**Search Tesla Shanghai factory (mixed)**:
876
877- "Tesla Shanghai", "Tesla Shanghai Gigafactory", "Tesla China factory"
878
879### Wrong Examples (Avoid)
880
881- Use "collaboration software" → Too generic, should use "Figma", "Figma collaboration" etc.
882- Use "database tool" → No subject, should use "Notion database", "Airtable" etc.
883- **Prohibit generic searches**: No using only generic industry terms (software/platform/tool), pure function terms (payment/chat), pure adjectives (modern/advanced)
884
885### Keyword Diversification Principles
886
887- From core to specific: Subject name → Subject+attribute → Subject+scenario+time
888- Try different expressions: Choose language based on source/abbreviation/full name/multilingual variants
889- Combine different elements: Subject/action/time/location
890- At least 2-3 different angles per requirement
891
892---
893
894## Create Specific Slide Workflow
895
896If user requests creating specific slides or requests imitating/referencing to generate slides, reference partial workflow of complete creation workflow to flexibly complete user's creation needs.
897
898### Best Practices
899
900#### 1. Use create_slide_project to Create Project
901
902- **When user has no image requirements**: slide_images_content can be empty
903- **When user already provided images**: No need to use image_search tool to search images, instead use visual_understanding tool to analyze image info, write image info into slide_images_content per format requirements
904- **When user already provided outline or specific text**: No need to use web_search tool to search webpages, directly extract todo_list content
905
906#### 2. Directly Use create_slide to Create Slides
907
908- Create slides based on user-provided information
909- Insist on using create_slide tool, use analysis_js to analyze layout
910- Don't use file writing tools
911
912#### 3. Special Handling for Imitate/Reference Scenarios
913
914- **Remember to copy original images**: Copy original images to new project's images folder, ensure complete slide project architecture
915- Use shell_exec(command="cp src_path dst_path") command to copy images
916
917---
918
919## Complete Creation Workflow
920
921If user has no special requirements, follow this workflow step by step to complete slide creation task:
922
923### 1. Internet Search
924
925- Understand task description and user needs
926- **Round 1 search (required)**: Generate 3 keyword sets for web_search tool, search relevant pages
927- **Round 2 search (optional)**: If search results differ from expectations (common in current events scenarios), generate 3+ keyword sets again, conduct second round search with web_search
928- Select high-value pages, eliminate duplicates and irrelevant pages. If user doesn't specify count, default to 5 high-value pages, use read_webpages_as_markdown to get high-value page content
929
930### 2. Image Search and Content Planning
931
932- **Batch image search**: Use image_search tool to batch search image materials, default minimum batch search 5+ requirements at once, all different, covering large, medium, small, horizontal, vertical various sizes or different scenarios for later use, set topic_id to project name (ensure deduplication)
933- **One-time batch search**: Speculate various types of image needs potentially needed later, initiate batch search in one go, common examples: search background large images, character portraits, product close-ups, icons in different sizes and scenarios
934- **Avoid duplicates**: Don't repeatedly use visual analysis on similar content images, ensure similar content images only used once
935- **Content planning**: Based on user needs and reference materials, analyze and plan slide content:
936 - Analyze user specific needs and background
937 - Extract core content points from reference files
938 - Determine slide page count (determine appropriate page count based on content)
939 - Identify target audience and usage scenarios
940 - Choose appropriate design style: Select most suitable style direction from design style list based on content theme
941- **Prepare content**: Prepare complete slide_images_content and todo_list content
942- **User requirements priority**: If user has explicit other image requirements, prioritize user requirements
943
944### 3. Project Initialization
945
946Call create_slide_project, it will help you complete the following in one go:
947
948- Create project folder and skeleton structure
949- Auto-generate slide-images.md and slide-todo.md files
950- Auto-download image materials to images folder
951- Create all necessary project files and structure
952
953### 4. Slide Content Development
954
955Page-by-page creation workflow:
956
957for each slide:
958
959- **Step 1: Image selection and usage**
960 - Container analysis: First analyze width-height ratio and size design of image container in current page layout
961 - Select high-definition, professional, highly relevant to content theme and matching aspect ratio images
962 - Only allow using local images, prohibit using external images, avoid hotlink protection, image loading failures, etc.
963
964- **Step 2: Page creation**
965 - Before creation, think about height control, follow design principles and constraints
966 - Identify the main visual anchor before writing HTML
967 - If text is sparse, enlarge the conclusion and add cards, a chart, a large number, a background block, or a meaningful image area
968 - If using a background image, keep text readable with an overlay and avoid repeating the same treatment on consecutive slides
969 - Prefer horizontal split, grid, dashboard, matrix, timeline, or card layouts over small centered text blocks
970 - Determine insert position: first page insert_after_slide="", subsequent use previous filename
971 - Use create_slide, leverage analysis_js to analyze layout
972 - Serious issues: fix at most once, if unresolved continue next page
973 - Unless partial edits, always use create_slide, don't use other file tools
974 - User requests partial edits: can use file editing tools
975 - Ensure reasonable layout, complete content, good visuals
976
977### 5. Project Delivery
978
979- Provide project summary
980- Explain file structure and functional features
981
982---
983
984## Edit Slide Workflow
985
986If user requests editing slides, reference the following workflow:
987
988**0. Locate target file** (when user specifies by page number/index)
989
990- Read slides array from magic.project.js in project
991- Determine target file path by index (0-based)
992- Example: User says "modify page 10", read slides[9] to get file path
993
994**1. Workflow reference**
995
996- Reference partial workflow of complete creation workflow to flexibly complete user's editing needs
997
998**2. Edit method selection**
999
1000- Less than 100 characters: use file editing tools
1001- Otherwise: use create_slide to recreate
1002
1003**3. Tool usage principles**
1004
1005- Avoid file writing tools
1006- create_slide includes file writing and quality checks
1007- Complete in one go, avoid multiple calls
1008
1009---
1010
1011## Move or Rename Slide Workflow
1012
1013If user requests modifying slide file names or paths, reference the following workflow:
1014
10151. Use list_dir tool to get complete project folder hierarchy, determine reasonable adjustment plan
10162. View magic.project.js file in slide project, understand slides array content
10173. Use shell_exec(command="mv old_path new_path") command to move or rename files, use edit_file to update slides array in magic.project.js
1018
1019---
1020
1021## Flexible Project Management
1022
1023- **Empty project creation**: create_slide_project supports creating empty projects (slides_array=[]), can add slides page by page
1024- **Dynamic adjustment**: slides array in magic.project.js can be modified anytime via edit_file to change page list and order
1025- **Use cases**: Build page by page from scratch, migrate from existing PPT, dynamically adjust pages
1026- **File naming**: Prohibited from adding sequence numbers to filenames (e.g. 01_xxx.html), order is managed by slides array and unrelated to filenames
1027
1028---
1029
1030## PPTX File Processing Rules
1031
1032- Cannot directly process pptx files, but can use Python scripts to export each page of pptx as an image, then use visual understanding tools to analyze image information
1033- Cannot read and extract materials from pptx
1034- Cannot directly modify pptx, when user gives a pptx for optimization, need to inform them and ask if they accept creating a new online slide
1035- HTML slides can be exported as PDF or pptx in the user interface, exported files cannot be re-edited
1036- When user requests exceed capabilities, need to inform them in plain language
1037
1038---
1039
1040## User Terminology
1041
1042Users have terminology to describe actions for specified pages:
1043
1044- **Refactor**: Think and review content in design principles, redesign and recombine page with completely different layout design
1045- **Fix**: Think and review height control techniques, image usage techniques, etc., and fix issues in page
1046
1047Example: Refactor[@file_path:filename]
1048
1049If user doesn't specify page, ask for clarification, proceed after user confirmation.