一键导入
generate-slides
Generate a slide deck from a topic or context, then convert it into a Google Slides presentation after user confirmation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate a slide deck from a topic or context, then convert it into a Google Slides presentation after user confirmation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | generate-slides |
| description | Generate a slide deck from a topic or context, then convert it into a Google Slides presentation after user confirmation. |
Generate a slide deck in markdown from the user's topic or context, then convert it into a Google Slides presentation using the Google Slides API.
$ARGUMENTS: the topic, context, or description for the presentation$HOME/my-skills/.env:
GOOGLE_CREDENTIALS_FILE — path to a Google OAuth2 Desktop or Service Account JSON key fileGOOGLE_SLIDES_SHARE_EMAIL — email address to share the presentation with (optional, for new presentations)$HOME/my-skills/.venv/bin/python3google-api-python-client, google-auth, google-auth-oauthlibd2 — D2 diagram CLI for generating flowcharts and sequence diagramsfreeze — Code screenshot tool for syntax-highlighted code imagesRead $ARGUMENTS as the topic or context for the presentation.
Generate a markdown slide deck following this format for each slide:
## Slide Title
Description content here (bullet points or paragraphs)
> Speaker notes content here
> Can span multiple lines
---
## headings for slide titles.-) or paragraphs for the slide body.> ) for speaker notes.--- on its own line.# as the presentation title.Output the full markdown to the user and ask them to review and confirm before proceeding to Phase 2.
Only proceed after the user confirms the markdown is ready.
Pipe the confirmed markdown content to the script via stdin:
echo "$MARKDOWN_CONTENT" | $HOME/my-skills/.venv/bin/python3 "$HOME/my-skills/scripts/create_google_slides.py"
To update an existing presentation instead of creating a new one:
echo "$MARKDOWN_CONTENT" | $HOME/my-skills/.venv/bin/python3 "$HOME/my-skills/scripts/create_google_slides.py" --update PRESENTATION_ID
The script outputs JSON to stdout: {"url": "...", "title": "...", "slide_count": N}
For presentations requiring tables, diagrams, code images, or custom layouts, write a Python script that uses the helpers module:
import sys
sys.path.insert(0, '$HOME/my-skills/scripts')
from google_slides_helpers import *
slides_service, drive_service = build_services()
PRES_ID = 'your_presentation_id'
Then use the helper functions described in the Advanced Capabilities section below.
The helper module $HOME/my-skills/scripts/google_slides_helpers.py provides reusable functions for all Google Slides API operations.
from google_slides_helpers import build_services
slides_service, drive_service = build_services()
# Handles Service Account and OAuth2 Desktop credentials automatically
from google_slides_helpers import (
delete_objects_requests, create_blank_slide_request,
get_presentation, execute_batch, uid
)
prefix = uid() # e.g. 'a1b2c3d4'
# Delete old slides
reqs = delete_objects_requests(['slide_id_1', 'slide_id_2'])
execute_batch(slides_service, PRES_ID, reqs, 'Delete old slides')
# Create new blank slides
reqs = [
create_blank_slide_request(f'new_{prefix}_0', insertion_index=5),
create_blank_slide_request(f'new_{prefix}_1', insertion_index=6),
]
execute_batch(slides_service, PRES_ID, reqs, 'Create new slides')
Standard 24pt bold centered title at the top of a slide:
from google_slides_helpers import create_title_requests
reqs = create_title_requests('slide_id', 'My Title', uid_prefix='s1')
# Returns: [createShape, insertText, updateTextStyle, updateParagraphStyle]
Cards with colored background, border, bold title, and description:
from google_slides_helpers import create_card_requests
reqs = create_card_requests(
slide_id='slide_id',
card_id='card_1',
title='Card Title',
description='Line 1\nLine 2\nLine 3',
x=500000, y=700000, width=2600000, height=1700000,
bg_hex='#EBF5FB', # light background
border_hex='#2471A3', # colored border
title_color_hex='#2471A3' # title text color
)
Decorative colored bars (top/bottom of slide, or left-side card accents):
from google_slides_helpers import create_accent_bar_requests
# Top bar
reqs = create_accent_bar_requests('slide_id', 'bar_top',
x=0, y=0, width=9144000, height=200000, color_hex='#2471A3')
# Left-side card accent
reqs = create_accent_bar_requests('slide_id', 'accent_1',
x=900000, y=750000, width=60000, height=440000, color_hex='#E74C3C')
from google_slides_helpers import create_bullet_textbox_requests
reqs = create_bullet_textbox_requests(
'slide_id', 'bullets_1',
lines=['First point', 'Second point', 'Third point'],
x=500000, y=800000, width=4000000, height=2000000
)
Tables with blue header, alternating row colors, and safe empty-cell handling:
from google_slides_helpers import create_styled_table_on_slide
data = [
['Header 1', 'Header 2', 'Header 3'], # row 0 = header
['Cell 1-1', 'Cell 1-2', 'Cell 1-3'],
['Cell 2-1', 'Cell 2-2', 'Cell 2-3'],
]
# High-level: creates, populates, and styles in one call
create_styled_table_on_slide(
slides_service, drive_service, PRES_ID,
slide_id='slide_id', table_id='table_1',
data=data,
x=311700, y=800000, width=8520600, height=2400000
)
For more control, use the lower-level functions:
from google_slides_helpers import (
create_table_request, populate_table_requests,
style_table_requests, cell_has_text
)
IMPORTANT: Always use cell_has_text() before applying updateTextStyle to table cells. Styling empty cells causes API errors.
# White background, suitable for slides
d2 --theme 0 input.d2 output.png
D2 diagram tips:
--theme 0 (white background) — dark themes look bad on slidesstyle.font-color: "#333333" on nodes for readabilitystyle.fill: "#CCE5FF"echo 'code here' | freeze -l go --theme dracula --window=false \
--padding 20,30,20,30 --font.size 14 -o output.png
Freeze tips:
--theme dracula for consistent dark code blocksfrom google_slides_helpers import upload_image_to_drive, create_image_request
# Upload to Google Drive (sets public read permission)
url = upload_image_to_drive(drive_service, '/path/to/image.png', 'display_name.png')
# Insert into slide
req = create_image_request('slide_id', 'img_1', url,
x=571500, y=800000, width=8001000, height=4000000)
from google_slides_helpers import get_notes_placeholder_id, create_speaker_notes_request
pres = get_presentation(slides_service, PRES_ID)
notes_id = get_notes_placeholder_id(pres, 'slide_id')
reqs = create_speaker_notes_request(notes_id, 'Speaker notes text here')
Update individual slides without affecting the rest of the presentation:
from google_slides_helpers import (
get_presentation, get_slide_by_index, get_slide_index_by_id,
clear_slide_requests, replace_slide,
update_slide_title, update_slide_notes,
execute_batch
)
pres = get_presentation(slides_service, PRES_ID)
# Inspect a slide by page number (0-based)
info = get_slide_by_index(pres, 5) # page 6
print(info['objectId'], info['elements'])
# Find slide index by objectId
idx = get_slide_index_by_id(pres, 'slide_5')
# Clear all elements on a slide (optionally keep images)
reqs = clear_slide_requests(pres, 'slide_5', keep_types={'IMAGE'})
execute_batch(slides_service, PRES_ID, reqs, 'Clear slide')
# Replace a slide with a new blank one at the same position
new_id = replace_slide(slides_service, PRES_ID, 'slide_5', slide_index=5)
# Update only the title text
update_slide_title(slides_service, PRES_ID, pres, 'slide_5', 'New Title')
# Update only the speaker notes
update_slide_notes(slides_service, PRES_ID, pres, 'slide_5', 'New speaker notes here')
from google_slides_helpers import parse_inline_formatting
segments = parse_inline_formatting('This is **bold** and *italic*')
# [{'text': 'This is ', 'bold': False, 'italic': False},
# {'text': 'bold', 'bold': True, 'italic': False},
# {'text': ' and ', 'bold': False, 'italic': False},
# {'text': 'italic', 'bold': False, 'italic': True}]
When creating visually rich slides, follow these conventions:
| Usage | Hex | Description |
|---|---|---|
| Primary accent | #2471A3 | Blue — links, headers, accent bars |
| Success | #27AE60 | Green — completed, positive |
| Error/Failure | #E74C3C | Red — failed, negative |
| Warning | #E67E22 | Orange — compensation, caution |
| Pending | #F39C12 | Yellow/Orange — in-progress |
| Purple | #8E44AD | Purple — state machines, special |
| Teal | #1ABC9C | Teal — techniques, tips |
| Table header | #4A86C8 | Blue — table header background |
| Element | Value |
|---|---|
| Slide width | 9,144,000 |
| Slide height | 5,143,500 |
| Title position | (311700, 152400) |
| Content start Y | 800,000 |
| 1 PT in EMU | 12,700 |
Common errors and solutions:
| Error | Cause | Solution |
|---|---|---|
GOOGLE_CREDENTIALS_FILE not set | Missing env var | Set in $HOME/my-skills/.env |
The object has no text (400) | updateTextStyle on empty table cell | Use cell_has_text() check |
| CJK characters as boxes | freeze doesn't support CJK fonts | Use English-only text in freeze |
| Dark diagram background | D2 theme 200 | Use --theme 0 for white bg |
| OAuth token expired | Cached token stale | Delete $HOME/my-skills/.cache/google_slides_token.pickle |
Query and manage WooCommerce orders on flowers.fenny-studio.com. (1) Look up orders by product ID or Chinese keyword — e.g. "哪些訂單買了鬱金香材料包"、"4182 被誰訂了"、"查一下 DIY 材料包的訂單". (2) Look up orders by shipping tracking number (運送編號) — e.g. "P93479717606 是哪張單"、"查物流單 R53049771167". (3) Filter orders by 希望送達時間 (desired delivery date) — e.g. "明天要出哪些貨"、"4/15 要送的訂單"、"本週出貨清單". (4) Reissue ECPay C2C tracking number for expired logistics — e.g. "4372 重打綠界"、"物流單過期了重新產生"、"reissue tracking". (5) Query ECPay logistics status — e.g. "誰到店了"、"查物流狀態"、"列到店待取的訂單"、"已寄出的訂單目前狀況"、"4345 現在物流狀態".
Trigger a Bitbucket Cloud pipeline on the current branch, with interactive pipeline selection and variable support. Polls for completion and reports results.
Create or update a Bitbucket Cloud pull request with auto-generated title and description from git diff.
Query an Asana task by ID or title keyword via the Asana API, retrieve its title and description, then analyze and process it.
Fetch Bitbucket PR review comments, analyze whether code changes are needed, and reply after user confirmation.
Generate a D2 diagram (sequence diagram or flowchart) by tracing an API endpoint or method's execution flow in the current repository. Use when the user wants to visualize code flow.