draft-images
Skill0 starsChanged 3 months agoMITView on GitHub
Generates AI images for draft formats (video, carousel, article) using Google Imagen. Finds image slots, builds brand-aware prompts, generates images, and updates source files so images flow into rendering automatically. Use when the user asks to generate images for a story's video, carousel, or article, or says "make the images", "generate images", or "add images to this".
- Reads credentials
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- remotion-best-practicesSkill
- add-inspirationSkill
- brandSkill
- craft-contentSkill
- draft-articleSkill
- draft-carouselSkill
- draft-diagramSkill
- draft-videoSkill
- heygen-avatarSkill
- heygen-videoSkill
- humanizerSkill
- ingestSkill
- initSkill
- linkedin-postSkill
- lintSkill
- listenSkill
- meetingSkill
- voiceSkill
- wikiSkill
- youtube-descriptionSkill
- youtube-shortSkill
- youtube-uploadSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 12 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
When the user runs /draft-images, optionally followed by a story slug:
- Distinctive: line 19
Read the config and resolve the vault path.
- Very specific: line 21
Verify GOOGLE_API_KEY is available (via .amplifyrc studio.googleApiKey or GOOGLE_API_KEY env var).
- Very specific: line 23
Read {vaultPath}/{paths.brand}/Brand.md if it exists.
- Very specific: line 33
If the user provided a slug (e.g., /draft-images why-we-rebuilt-onboarding), use it directly.
- Very specific: line 35
If no slug, scan {vaultPath}/{paths.stories}/ for story folders.
- Very specific: line 44
If only one format exists, use it.
- Distinctive: line 46
Read the selected file and parse its frontmatter.
- Distinctive: line 65
If no image slots are found, tell the user: "All slots in this file already have assets.
- Distinctive: line 119
Call the Imagen API with the approved prompt and appropriate aspect ratio:
- Distinctive: line 129
After each image, report and ask:
- Distinctive: line 137
Regenerate with tweaks: ask what to change, update the prompt, regenerate
- Distinctive: line 138
Skip: leave this slot without an image, move to next
- Distinctive: line 142
After all images are generated (or skipped), update the source file's frontmatter:
- Very specific: line 147
Leave screen-capture shots that already had that type unchanged
- Distinctive: line 149
Write the updated frontmatter back to the file using gray-matter serialization.
- Distinctive: line 154
Write the updated frontmatter back to the file.
- Very specific: line 157
Add an images array to the frontmatter listing all generated image paths
- Distinctive: line 209
When building image prompts:
- Distinctive: line 213
Specify what you don't want: Always end with "No text, watermarks, or logos."
- Very specific: line 227
Default to 16:9 for video, 1:1 for carousel, 16:9 for article hero images.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Draft Images
Instructions
When the user runs /draft-images, optionally followed by a story slug:
Step 0: Load Context
Find the .amplifyrc config file. Check these locations in order:
.amplifyrcin the current working directory.amplifyrcat the path specified byVAULT_PATHenvironment variable
Read the config and resolve the vault path.
Verify GOOGLE_API_KEY is available (via .amplifyrc studio.googleApiKey or GOOGLE_API_KEY env var). If missing, tell the user: "Google API key not found. Add googleApiKey to the studio section of .amplifyrc or set GOOGLE_API_KEY in your environment."
Read {vaultPath}/{paths.brand}/Brand.md if it exists. Read the brand config from .amplifyrc (brand section). Build a brand context string:
Brand: {name}. Colors: {primary} (primary), {secondary} (secondary), {accent} (accent), {background} (background). Font feel: {body}. {visual style notes from Brand.md if available}This brand context string gets prepended to every image prompt.
Step 1: Find the Story
If the user provided a slug (e.g., /draft-images why-we-rebuilt-onboarding), use it directly.
If no slug, scan {vaultPath}/{paths.stories}/ for story folders. List stories that have any director output (video-.md, carousel-.md, or article-*.md). Present the list and let the user pick.
Step 2: Detect Format
Scan the story folder {stories}/{slug}/ for:
video-*.mdfiles (video timelines)carousel-*.mdfiles (carousel cards)article-*.mdfiles (blog posts)
If only one format exists, use it. If multiple formats exist, present the list and let the user pick. If none exist, tell the user: "No drafts found for this story. Run /draft-video, /draft-carousel, or /draft-article first."
Read the selected file and parse its frontmatter.
Step 3: Extract Image Slots
Based on the format, find slots that need images:
Video timeline:
- Shots where
shotType === "b-roll-placeholder"(these are dark cards waiting for visual content) - Shots where
shotType === "screen-capture"and noassetfield is set - For each slot, use the shot's
directionfield as the content direction
Carousel:
- Cards with an
imageDirectionfield and noassetfield - For each slot, use the card's
imageDirectionas the content direction
Article:
- Articles have no existing image spec. Ask the user: "Which sections need images?" Present the sections list from frontmatter and let them pick.
- For each selected section, ask for a brief image direction or offer to generate one from the section's beat and heading.
If no image slots are found, tell the user: "All slots in this file already have assets. Nothing to generate."
Present the found slots:
Found {N} image slots in {format} "{title}":
1. Shot 4 [b-roll-placeholder] — "Overhead shot of laptop with code editor open"
2. Shot 7 [b-roll-placeholder] — "Person looking at phone, notification visible"
3. Shot 9 [screen-capture] — "Dashboard showing metrics graph"Step 4: Build and Confirm Prompts
For each slot, build an image prompt by combining:
- Brand context (from Step 0) — visual style and color palette
- Format framing — aspect ratio and composition rules for the format:
- Video: 16:9, cinematic framing, shallow depth of field
- Carousel: 1:1, bold composition, clean background for text overlay
- Article: 16:9 for hero images, 4:3 for inline images
- Content direction — the
directionorimageDirectionfrom the source file - Safety suffix — "No text, watermarks, or logos in the image. Photorealistic style."
Example prompt:
Professional photograph with teal (#2e4a6e) and warm gold (#e0a53c) color accents.
Overhead shot of a laptop with a code editor open, soft natural lighting, shallow depth of field.
Modern workspace setting. No text, watermarks, or logos in the image. Photorealistic style.Present all prompts in a numbered list:
## Image Prompts
1. **Shot 4** (b-roll-placeholder, 16:9)
"Professional photograph with teal and warm gold accents. Overhead shot of laptop..."
2. **Shot 7** (b-roll-placeholder, 16:9)
"Professional photograph with teal and warm gold accents. Person looking at phone..."
3. **Shot 9** (screen-capture, 16:9)
"Professional photograph with teal and warm gold accents. Dashboard showing metrics..."
Want to refine any prompts before generating? Give me a number to edit, or "go" to generate all.Let the user refine prompts by number. Loop until they say "go" or approve.
Step 5: Generate Images
Generate images one at a time using the Imagen API. For each slot:
- Call the Imagen API with the approved prompt and appropriate aspect ratio:
- Video:
16:9 - Carousel:
1:1 - Article hero:
16:9, inline:4:3
- Video:
- Save the image to
{stories}/{slug}/assets/with a descriptive filename:- Video:
shot-{id}-{beat}.png(e.g.,shot-04-tension.png) - Carousel:
card-{id}-{beat}.png(e.g.,card-03-tension.png) - Article:
section-{id}-{beat}.png(e.g.,section-02-setup.png)
- Video:
After each image, report and ask:
Generated: assets/shot-04-tension.png [Keep] [Regenerate with tweaks] [Skip]- Keep: move to next slot
- Regenerate with tweaks: ask what to change, update the prompt, regenerate
- Skip: leave this slot without an image, move to next
Step 6: Update Source Files
After all images are generated (or skipped), update the source file's frontmatter:
Video timeline:
- For each generated image, set
asseton the corresponding shot to the relative path (e.g.,assets/shot-04-tension.png) - Change
shotTypefromb-roll-placeholdertoscreen-capture(since it now has a real image asset that the ScreenCapture component can render) - Leave
screen-captureshots that already had that type unchanged
Write the updated frontmatter back to the file using gray-matter serialization.
Carousel:
- For each generated image, set
asseton the corresponding card to the relative path (e.g.,assets/card-03-tension.png)
Write the updated frontmatter back to the file.
Article:
- Add an
imagesarray to the frontmatter listing all generated image paths - Each entry:
{ sectionId: N, path: "assets/section-02-setup.png" }
Write the updated frontmatter back to the file.
Step 7: Signal and Report
Emit an images_generated signal to {vaultPath}/{paths.signals}/signals.json:
{
"id": "sig-[timestamp]-[random6hex]",
"type": "images_generated",
"timestamp": "[ISO timestamp]",
"data": {
"slug": "[story-slug]",
"format": "[video|carousel|article]",
"sourceFile": "[filename of the director cut]",
"imageCount": 3,
"imagePaths": ["assets/shot-04-tension.png", "assets/shot-07-tension.png", "assets/shot-09-transformation.png"]
}
}Log to session memory at {vaultPath}/{paths.memory}/sessions/YYYY-MM-DD.md:
- **HH:MM** — images_generated: Generated {N} images for "{title}" ({format})Report what was done:
Images generated for "{title}" ({format}):
Generated: {N} images
Skipped: {N} slots
Saved to: {stories}/{slug}/assets/
Updated: {source-filename}
- Shot 4: b-roll-placeholder -> screen-capture (assets/shot-04-tension.png)
- Shot 7: b-roll-placeholder -> screen-capture (assets/shot-07-tension.png)
- Shot 9: screen-capture (assets/shot-09-transformation.png)
Next steps:
- Video: run `amplify studio render {slug}` — generated images render via ScreenCapture
- Carousel: take to Canva/Figma with the asset files
- Article: embed images at the marked sections when publishingPrompt Engineering Guidelines
When building image prompts:
- Lead with style, not subject. "Professional photograph with warm lighting" before "of a laptop."
- Reference brand colors by hex, not just name. The model interprets hex values as color guidance.
- Specify what you don't want. Always end with "No text, watermarks, or logos."
- Match the story's tone. A vulnerable moment gets soft lighting and close framing. A bold claim gets high contrast and wide composition.
- Be specific about composition. "Overhead shot" not "picture of." "Close-up of hands on keyboard" not "person using computer."
- Avoid abstract concepts. Imagen handles concrete visuals well. Instead of "innovation," say "lightbulb sketch on whiteboard, natural lighting."
Aspect Ratios
The Imagen API supports these aspect ratios:
1:1— square (carousel cards, social posts)16:9— widescreen (video b-roll, article heroes, YouTube thumbnails)9:16— vertical (stories, reels, shorts)4:3— standard (article inline images)3:4— portrait
Default to 16:9 for video, 1:1 for carousel, 16:9 for article hero images.
Story Folder Structure
{stories}/{slug}/
raw.md <- free write + interview (craft-content)
story.md <- pure narrative (craft-content)
video-{hook}-{slug}-{date}.md <- video timeline (draft-video)
carousel-{hook}-{slug}-{date}.md <- carousel cards (draft-carousel)
article-{hook}-{slug}-{date}.md <- blog post (draft-article)
assets/ <- generated images (draft-images)
shot-04-tension.png
card-03-tension.png
section-02-setup.pngDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

