with one click
background-generator
// Generate 20 background images per brand for Reel video production. Run manually or schedule externally.
// Generate 20 background images per brand for Reel video production. Run manually or schedule externally.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | background-generator |
| description | Generate 20 background images per brand for Reel video production. Run manually or schedule externally. |
| allowed-tools | Read, Grep, Glob, Bash |
| Agent | Version | Last Changed |
|---|---|---|
| Link | v2.4.0 | May 07, 2026 |
Description: Generate 20 background images per brand for Reel video production. Run manually or schedule externally.
v2.4.0 ā May 07, 2026
mcp__notion__API-query-data-source and mcp__notion__API-get-block-children calls (not exposed by current Notion connector) with the canonical notion-fetch + notion-search (with data_source_url filter) pattern used by social-calendarmcp__notion__* ā mcp__claude_ai_Notion__*v2.2.15 ā May 05, 2026
v2.2.5 ā April 26, 2026
v2.2.2 ā April 10, 2026
Read agents/link.md before starting. It defines the active brand, personality, quality checklist, and available tools. Determine the active brand from $DEFAULT_BRAND env var ā if not set, ask the user.
You generate 20 pre-stored background images per brand for use in Ken Burns Reel videos. These backgrounds are stored at brands/{brand}/backgrounds/ and used as raw material for video production. Run manually when the library needs refreshing.
Relationship to Claude Design shell collections ā brands/{brand}/social-carousel-template/ and brands/{brand}/social-story-template/ (when present) hold pre-rendered branded background shells for static social posts (Carousel + Story / Reel static frames). Those shells are populated by brand-setup Step 4c and consumed by content-generator and creative-designer via their shell-path. The backgrounds/ library this skill produces is a separate, more general-purpose set used by Reel video production and as the Gemini fallback library. The two systems are independent ā this skill does not need to read or write the shell folders.
Do NOT use for:
Read the next 2 weeks of social calendar entries for the brand to get fresh ImageBrief values.
Use Notion MCP to query the calendar:
data_source_url first, then search inside it for the latest SocialCalendar_ pages:Use mcp__claude_ai_Notion__notion-fetch:
- id: "${BRAND}_NOTION_DB"
Inspect the response and extract the collection:// URL (typically data_sources[0].url). Save as data_source_url.
Use mcp__claude_ai_Notion__notion-search:
- query: "SocialCalendar_"
- data_source_url: <data_source_url from above>
- query_type: "internal"
- page_size: 5
For each page whose date range covers the next 2 weeks, use mcp__claude_ai_Notion__notion-fetch with the page ID to retrieve the page content (returns full markdown including the calendar table). Parse the table rows from the returned markdown directly.
Parse each row ā column order: Date, Platform, Format, Topic, Persona, ContentAngle, CTA, Hashtags, ImageBrief, Status. Filter for rows with Status = "Planned" and dates within the next 14 days.
Extract all unique ImageBrief values (column index 8). These are the prompts.
Take up to 20 unique ImageBriefs from Step 1. If fewer than 20, create variations of existing briefs by changing:
Prompt rules:
ImageBrief exactly as written in the calendarCreate the backgrounds folder if it doesn't exist: brands/{brand}/backgrounds/
For each image:
Use gateway MCP tool `gemini_generate_image`:
- fiveagents_api_key: ${FIVEAGENTS_API_KEY}
- prompt: "{ImageBrief}"
- aspect_ratio: "1:1" (default for background library; content-generator crops to target canvas at overlay time)
- model: "gemini-3.1-flash-image-preview"
Result is auto-saved to a temp file. Use Python to locate, decode, and save to disk:
```python
import glob, json, base64, os
result_file = max(glob.glob('/sessions/*/mnt/.claude/projects/*/tool-results/mcp-*gemini_generate_image*.txt'), key=os.path.getmtime)
with open(result_file) as f:
parsed = json.loads(json.load(f)[0]['text'])
with open('brands/{brand}/backgrounds/{descriptive_filename}.png', 'wb') as f:
f.write(base64.b64decode(parsed['image_base64']))
If user has selected a folder, save directly to brands/{brand}/backgrounds/ ā not a temp path.
Wait 6 seconds between calls (rate limit: ~10 requests per minute).
Filename convention: Use a descriptive slug based on the Topic or ImageBrief content. Examples:
finance_dashboard_laptop.pngsingapore_skyline_timelapse.pngabstract_purple_silk.pngcafe_laptop_notepad.pngFilenames must be descriptive enough that the content-generator can pick the right background based on the post's Topic.
Rate limit: 6 seconds between image generation calls.
Count the PNG files in brands/{brand}/backgrounds/. Must have at least 20 NEW images generated. Skip filenames that already exist ā the library grows each month. If any failed, retry.
DM the user via Slack MCP (channel_id: "$SLACK_NOTIFY_USER"):
š¼ļø [{brand}] Monthly backgrounds refreshed
New images: 20
Total library: [count] images
Location: brands/{brand}/backgrounds/
See docs/new_agent_onboarding/metrics-spec.md for the full JSONB contract.
Use gateway MCP tool `fiveagents_log_run`:
- fiveagents_api_key: ${FIVEAGENTS_API_KEY}
- skill: "background-generator"
- brand: "<active-brand>"
- status: "<success|failed>"
- summary: "<1 line, <200 chars>"
- started_at: "<ISO timestamp>"
- completed_at: "<ISO timestamp>"
- metrics: { "date": "YYYY-MM-DD", "images_generated": 0, "total_library": 0 }