Image Generation Skill
Generate images using Gemini's image model via scripts/generate-image.js. Specializes in technical architecture diagrams, pipeline visuals, blog headers, and branded project graphics.
Usage
# Generate a new image
node scripts/generate-image.js "<prompt>" "<output-path>" [--aspect-ratio 16:9]
# Edit an existing image
node scripts/generate-image.js "<edit prompt>" "<output-path>" --input <source-image> [--aspect-ratio 16:9]
Requires GEMINI_API_KEY in .env.
Image Editing
Pass --input / -i with a path to an existing image to edit it instead of generating from scratch. The prompt should describe only the desired change — Gemini will preserve the rest of the image.
Good edit prompts:
- "Change the background color to blue"
- "Add a crown to the lobster"
- "Remove the text in the bottom right corner"
- "Make the arrows thicker and brighter"
Bad edit prompts (too vague or re-describe the whole image):
- "A diagram with boxes and arrows" — this regenerates rather than edits
- "Make it better" — too vague for targeted edits
Aspect Ratios
| Ratio |
Use Case |
16:9 |
Architecture diagrams, pipeline flows, blog banners |
1:1 |
Logos, icons, social media avatars |
4:3 |
Documentation images, screenshots |
9:16 |
Mobile/story format |
3:4 |
Portrait format |
4:1 |
Ultra-wide panoramic banners |
1:4 |
Tall vertical infographics |
8:1 |
Extreme panoramic strips |
1:8 |
Extreme vertical strips |
Default to 16:9 for technical diagrams. Ask the user if unclear.
Project Visual Style
All project diagrams use a whiteboard sketch style — hand-drawn feel with colorful markers on a white/off-white background, like a real brainstorming session.
Background
- White or off-white background like a real whiteboard
- Subtle marker texture / dry-erase feel
Color Palette (marker colors)
| Color |
Role |
| Blue |
Messaging channels, data sources, entry points |
| Orange / Red |
Orchestration, danger, warnings, attack flows |
| Purple |
AI/agent components, processing, databases |
| Green |
Containers, active processes, security, safe elements |
| Red |
Destructive operations, vulnerabilities, blocked items |
| Yellow |
API endpoints, web services, highlights |
| Cyan / Teal |
Indexes, search, semantic operations |
| Black |
Text, arrows, annotations, connections |
Drawing Style
- Hand-sketched boxes with slightly imperfect lines and rounded corners
- Hand-drawn arrows with slight curves and imperfections
- Text that looks like handwritten marker in different colors
- Small doodles, asterisks, underlines, and emphasis marks
- Exclamation marks or stars next to key features
- Lock icons near security features
- Cloud shapes around AI components
- Annotations that look like whiteboard notes with arrows
- Circled keywords and underlined important terms
Layout
- Left-to-right or top-to-bottom flow
- Clear stage/step numbering when applicable
- Annotations and callout notes in margins (like a real whiteboard)
- Title in large bold marker text at the top
Whiteboard Background
All whiteboard-style diagrams use a pre-made background image as the canvas. The background is bundled with this skill at multiple locations — use the first one that exists:
~/.claude/skills/generate-image/whiteboard-background.png (container agents)
docs/whiteboard-background.png (host/project root)
Before generating, resolve the path:
WB=$(test -f ~/.claude/skills/generate-image/whiteboard-background.png && echo ~/.claude/skills/generate-image/whiteboard-background.png || echo docs/whiteboard-background.png)
Then use --input "$WB" for all whiteboard diagrams.
Prompt Construction
When the user asks for a diagram, build the prompt by combining:
Style preamble (always include):
Draw a hand-sketched technical diagram on this whiteboard using colorful markers. Use a hand-sketched marker style with slightly imperfect lines, hand-drawn arrows with natural curves, and handwritten-looking text in colorful markers. Add small doodles, asterisks, underlines, and emphasis marks like a real whiteboard brainstorming session. Include annotations with arrows, circled keywords, and exclamation marks near key features. Keep the whiteboard background texture visible.
Color assignments — map each component type to the marker palette above based on its role
Content — the specific boxes, labels, arrows, and relationships the user wants
Layout instruction:
Keep it readable but energetic — like a whiteboard sketch from a team planning session. Use hand-drawn arrows between stages. Add small annotation notes in the margins for key insights.
Example: Architecture Diagram
node scripts/generate-image.js "Draw a hand-sketched technical diagram on this whiteboard using colorful markers. Use a hand-sketched marker style with slightly imperfect lines, hand-drawn arrows with natural curves, and handwritten-looking text in colorful markers. Add small doodles, asterisks, underlines, and emphasis marks like a real whiteboard brainstorming session.
Color markers: blue for channels, orange for orchestration, purple for AI components, green for containers.
Title at top: 'System Architecture'
[... specific boxes, connections, labels ...]
Keep it readable but energetic — like a whiteboard sketch from a team planning session. Keep the whiteboard background texture visible." "docs/system-architecture-TIMESTAMP.png" --input docs/whiteboard-background.png --aspect-ratio 16:9
Output Location
CRITICAL: Never overwrite existing images. Always append a timestamp to the filename so previous versions are preserved.
Naming format: docs/<name>-<YYYYMMDD-HHMM>.png
Examples:
docs/data-to-wisdom-pipeline-20260221-1430.png
docs/openclaw-vs-bastionclaw-security-20260221-1445.png
Architecture diagrams: docs/<name>-<timestamp>.png
Blog images: user-specified path with timestamp
Default: output-<timestamp>.png in project root
When the user picks a final version to use in docs, symlink or copy it to the clean name (e.g., docs/data-to-wisdom-pipeline.png).
Process
Generating a New Image
- Understand what the user wants to visualize
- Construct the prompt using the style guide above
- Choose appropriate aspect ratio (default
16:9 for diagrams)
- Generate output path with timestamp:
docs/<name>-$(date +%Y%m%d-%H%M).png
- For whiteboard-style diagrams, use
--input docs/whiteboard-background.png to draw on the consistent background:
node scripts/generate-image.js "<prompt>" "<path>" --input docs/whiteboard-background.png -ar <ratio>
For non-whiteboard images (thumbnails, photos, etc.), generate without --input:
node scripts/generate-image.js "<prompt>" "<path>" -ar <ratio>
- Read the generated image to verify quality
- If the user wants it linked in docs, update the relevant
.md file
Editing an Existing Image
- Identify the source image to edit (use the most recent timestamped version)
- Write a focused prompt describing only the change (not the whole image)
- Generate a new output path with timestamp (never overwrite the source)
- Run
node scripts/generate-image.js "<edit prompt>" "<path>" --input <source-image>
- Read the edited image to verify the change was applied
- If unsatisfied, iterate with a more specific prompt
1---2name: generate-image3description: Generate images using Gemini via scripts/generate-image.js. Creates technical diagrams, architecture visuals, blog headers, and branded graphics. Use when the user asks to "create an image", "generate a diagram", "make a visual", or "create a graphic". Triggers on "generate image", "create image", "make diagram", "create visual", "architecture diagram".4---56# Image Generation Skill78Generate images using Gemini's image model via `scripts/generate-image.js`. Specializes in technical architecture diagrams, pipeline visuals, blog headers, and branded project graphics.910## Usage1112```bash13# Generate a new image14node scripts/generate-image.js "<prompt>" "<output-path>" [--aspect-ratio 16:9]1516# Edit an existing image17node scripts/generate-image.js "<edit prompt>" "<output-path>" --input <source-image> [--aspect-ratio 16:9]18```1920Requires `GEMINI_API_KEY` in `.env`.2122## Image Editing2324Pass `--input` / `-i` with a path to an existing image to edit it instead of generating from scratch. The prompt should describe only the desired change — Gemini will preserve the rest of the image.2526Good edit prompts:27- "Change the background color to blue"28- "Add a crown to the lobster"29- "Remove the text in the bottom right corner"30- "Make the arrows thicker and brighter"3132Bad edit prompts (too vague or re-describe the whole image):33- "A diagram with boxes and arrows" — this regenerates rather than edits34- "Make it better" — too vague for targeted edits3536## Aspect Ratios3738| Ratio | Use Case |39|-------|----------|40| `16:9` | Architecture diagrams, pipeline flows, blog banners |41| `1:1` | Logos, icons, social media avatars |42| `4:3` | Documentation images, screenshots |43| `9:16` | Mobile/story format |44| `3:4` | Portrait format |45| `4:1` | Ultra-wide panoramic banners |46| `1:4` | Tall vertical infographics |47| `8:1` | Extreme panoramic strips |48| `1:8` | Extreme vertical strips |4950Default to `16:9` for technical diagrams. Ask the user if unclear.5152## Project Visual Style5354All project diagrams use a **whiteboard sketch style** — hand-drawn feel with colorful markers on a white/off-white background, like a real brainstorming session.5556### Background57- White or off-white background like a real whiteboard58- Subtle marker texture / dry-erase feel5960### Color Palette (marker colors)61| Color | Role |62|-------|------|63| Blue | Messaging channels, data sources, entry points |64| Orange / Red | Orchestration, danger, warnings, attack flows |65| Purple | AI/agent components, processing, databases |66| Green | Containers, active processes, security, safe elements |67| Red | Destructive operations, vulnerabilities, blocked items |68| Yellow | API endpoints, web services, highlights |69| Cyan / Teal | Indexes, search, semantic operations |70| Black | Text, arrows, annotations, connections |7172### Drawing Style73- Hand-sketched boxes with slightly imperfect lines and rounded corners74- Hand-drawn arrows with slight curves and imperfections75- Text that looks like handwritten marker in different colors76- Small doodles, asterisks, underlines, and emphasis marks77- Exclamation marks or stars next to key features78- Lock icons near security features79- Cloud shapes around AI components80- Annotations that look like whiteboard notes with arrows81- Circled keywords and underlined important terms8283### Layout84- Left-to-right or top-to-bottom flow85- Clear stage/step numbering when applicable86- Annotations and callout notes in margins (like a real whiteboard)87- Title in large bold marker text at the top8889## Whiteboard Background9091All whiteboard-style diagrams use a pre-made background image as the canvas. The background is bundled with this skill at multiple locations — use the first one that exists:921. `~/.claude/skills/generate-image/whiteboard-background.png` (container agents)932. `docs/whiteboard-background.png` (host/project root)9495Before generating, resolve the path:96```bash97WB=$(test -f ~/.claude/skills/generate-image/whiteboard-background.png && echo ~/.claude/skills/generate-image/whiteboard-background.png || echo docs/whiteboard-background.png)98```99Then use `--input "$WB"` for all whiteboard diagrams.100101## Prompt Construction102103When the user asks for a diagram, build the prompt by combining:1041051. **Style preamble** (always include):106 ```107 Draw a hand-sketched technical diagram on this whiteboard using colorful markers. Use a hand-sketched marker style with slightly imperfect lines, hand-drawn arrows with natural curves, and handwritten-looking text in colorful markers. Add small doodles, asterisks, underlines, and emphasis marks like a real whiteboard brainstorming session. Include annotations with arrows, circled keywords, and exclamation marks near key features. Keep the whiteboard background texture visible.108 ```1091102. **Color assignments** — map each component type to the marker palette above based on its role1111123. **Content** — the specific boxes, labels, arrows, and relationships the user wants1131144. **Layout instruction**:115 ```116 Keep it readable but energetic — like a whiteboard sketch from a team planning session. Use hand-drawn arrows between stages. Add small annotation notes in the margins for key insights.117 ```118119### Example: Architecture Diagram120121```bash122node scripts/generate-image.js "Draw a hand-sketched technical diagram on this whiteboard using colorful markers. Use a hand-sketched marker style with slightly imperfect lines, hand-drawn arrows with natural curves, and handwritten-looking text in colorful markers. Add small doodles, asterisks, underlines, and emphasis marks like a real whiteboard brainstorming session.123124Color markers: blue for channels, orange for orchestration, purple for AI components, green for containers.125126Title at top: 'System Architecture'127128[... specific boxes, connections, labels ...]129130Keep it readable but energetic — like a whiteboard sketch from a team planning session. Keep the whiteboard background texture visible." "docs/system-architecture-TIMESTAMP.png" --input docs/whiteboard-background.png --aspect-ratio 16:9131```132133## Output Location134135**CRITICAL: Never overwrite existing images.** Always append a timestamp to the filename so previous versions are preserved.136137**Naming format:** `docs/<name>-<YYYYMMDD-HHMM>.png`138139Examples:140- `docs/data-to-wisdom-pipeline-20260221-1430.png`141- `docs/openclaw-vs-bastionclaw-security-20260221-1445.png`142143- Architecture diagrams: `docs/<name>-<timestamp>.png`144- Blog images: user-specified path with timestamp145- Default: `output-<timestamp>.png` in project root146147When the user picks a final version to use in docs, symlink or copy it to the clean name (e.g., `docs/data-to-wisdom-pipeline.png`).148149## Process150151### Generating a New Image1521. Understand what the user wants to visualize1532. Construct the prompt using the style guide above1543. Choose appropriate aspect ratio (default `16:9` for diagrams)1554. Generate output path with timestamp: `docs/<name>-$(date +%Y%m%d-%H%M).png`1565. For whiteboard-style diagrams, use `--input docs/whiteboard-background.png` to draw on the consistent background:157 `node scripts/generate-image.js "<prompt>" "<path>" --input docs/whiteboard-background.png -ar <ratio>`158 For non-whiteboard images (thumbnails, photos, etc.), generate without `--input`:159 `node scripts/generate-image.js "<prompt>" "<path>" -ar <ratio>`1606. Read the generated image to verify quality1617. If the user wants it linked in docs, update the relevant `.md` file162163### Editing an Existing Image1641. Identify the source image to edit (use the most recent timestamped version)1652. Write a focused prompt describing only the change (not the whole image)1663. Generate a new output path with timestamp (never overwrite the source)1674. Run `node scripts/generate-image.js "<edit prompt>" "<path>" --input <source-image>`1685. Read the edited image to verify the change was applied1696. If unsatisfied, iterate with a more specific prompt