| name | sf-imagen | ||||||
|---|---|---|---|---|---|---|---|
| description | AI-powered visual content generation for Salesforce development. Generates ERD diagrams, LWC mockups, architecture visuals using Nano Banana Pro. Also provides Gemini as a parallel sub-agent for code review and research. | ||||||
| license | MIT | ||||||
| metadata |
|
Visual content generation and AI sub-agent for Salesforce development using Gemini CLI with Nano Banana Pro extension.
Before using this skill, ALWAYS run the prerequisites check first:
~/.claude/plugins/marketplaces/sf-skills/sf-imagen/scripts/check-prerequisites.shIf the check fails, DO NOT invoke this skill. The user must fix the missing prerequisites first.
| Requirement | Description | How to Get |
|---|---|---|
| macOS | Required for Preview app image display | Built-in |
| GEMINI_API_KEY | Personal API key for Nano Banana Pro | https://aistudio.google.com/apikey |
| Gemini CLI | Command-line interface for Gemini | npm install -g @google/gemini-cli |
| Nano Banana Extension | Image generation extension | gemini extensions install nanobanana |
| Requirement | Description | How to Get |
|---|---|---|
| uv | Fast Python package runner | curl -LsSf https://astral.sh/uv/install.sh | sh |
Add to ~/.zshrc (DO NOT commit to version control):
export GEMINI_API_KEY="your-personal-api-key"
export NANOBANANA_MODEL=gemini-3-pro-image-previewGenerate actual rendered ERD diagrams (not just Mermaid code):
- Query object metadata via sf-metadata
- Generate visual diagram with Nano Banana Pro
- Display in macOS Preview app (default)
Generate wireframes and component mockups:
- Data tables, record forms, dashboard cards
- Experience Cloud page layouts
- Mobile-responsive designs following SLDS
Parallel code review while Claude continues working:
- Apex class/trigger review for best practices
- LWC component review for accessibility
- SOQL query optimization suggestions
Parallel Salesforce documentation research:
- Look up API references and limits
- Find best practices and patterns
- Research release notes
For complex visuals, iterate at low resolution before generating the final:
| Phase | Resolution | Purpose | Time | Method |
|---|---|---|---|---|
| Draft | 1K | Quick feedback, prompt refinement | ~3s | CLI or Python |
| Iteration | 1K | Style/layout adjustments | ~3s | CLI /edit or Python |
| Final | 4K | Production-quality output | ~10s | Python script only |
- Draft at 1K - Generate initial image quickly
- Iterate - Refine prompt or use
/editto adjust - Final at 4K - Once satisfied, generate production quality
# Step 1: Draft (fast, cheap)
gemini --yolo "/generate 'Account-Contact ERD with blue boxes'"
open ~/nanobanana-output/*.png # Review
# Step 2: Iterate with /edit
gemini --yolo "/edit 'Add Opportunity, use thicker arrows'"
# Step 3: Final at 4K (requires Python script)
uv run scripts/generate_image.py \
-p "Account-Contact-Opportunity ERD, blue boxes, thick arrows, legend" \
-f "crm-erd-final.png" \
-r 4K
open ~/nanobanana-output/*crm-erd-final*.pngRefine existing images with natural language instructions:
# Edit the most recent generated image
gemini --yolo "/edit 'Move Account box to center, make relationship arrows thicker'"
# Common editing commands
gemini --yolo "/edit 'Add a legend in the bottom right corner'"
gemini --yolo "/edit 'Change background to light gray'"
gemini --yolo "/edit 'Add Salesforce Lightning blue (#0176D3) to headers'"uv run scripts/generate_image.py \
-p "Add legend in bottom right, use SLDS colors" \
-i ~/nanobanana-output/previous-erd.png \
-f "erd-with-legend.png" \
-r 2KThe CLI extension supports style modifiers for creative control:
# Apply artistic styles
gemini --yolo "/generate 'Salesforce ERD' --styles=modern,minimalist"
# Available styles
# photorealistic, watercolor, oil-painting, sketch, pixel-art
# anime, vintage, modern, abstract, minimalist
# Generate multiple variations
gemini --yolo "/generate 'Dashboard mockup' --count=3 --variations=color-palette"
# Reproducible output with seed
gemini --yolo "/generate 'Account ERD' --seed=42"Trigger: User asks for visual ERD, rendered diagram, or image-based data model
Workflow:
- Run prerequisites check
- Query object metadata via sf-metadata (if org connected)
- Build Nano Banana prompt with object relationships
- Execute Gemini CLI with
/generatecommand (requires --yolo flag) - Open result in macOS Preview app using
opencommand
Example:
# Generate image
gemini --yolo "/generate 'Professional Salesforce ERD diagram showing:
- Account (blue box, center)
- Contact (green box, linked to Account with lookup arrow)
- Opportunity (yellow box, linked to Account with master-detail thick arrow)
Include legend. Clean white background, Salesforce Lightning style.'"
# Open in macOS Preview (DEFAULT)
open ~/nanobanana-output/[generated-file].pngTrigger: User asks for component mockup, wireframe, or UI design
Workflow:
- Load appropriate template from
templates/lwc/ - Customize prompt with user requirements
- Execute via Nano Banana
- Open in Preview app
Trigger: User asks for code review, second opinion, or "review while I work"
Workflow:
- Run Gemini in background with JSON output
- Claude continues with current task
- Return Gemini's findings when ready
Example:
gemini "Review this Apex trigger for:
- Bulkification issues
- Best practices violations
- Security concerns (CRUD/FLS)
Code: [trigger code]" -o jsonTrigger: User asks to look up, research, or find documentation
Workflow:
- Run Gemini with documentation query
- Return findings with sources
# Generate image from prompt (MUST use --yolo for non-interactive)
gemini --yolo "/generate 'description'"
# Images are saved to ~/nanobanana-output/# Open in macOS Preview app (default)
open /path/to/image.png
# Open most recent generated image
open ~/nanobanana-output/$(ls -t ~/nanobanana-output/*.png | head -1)
# View inline in Claude Code conversation (multimodal vision)
# Use the Read tool → /path/to/image.png| Skill | Integration | Usage |
|---|---|---|
| sf-diagram | Enhance Mermaid with visual rendering | "Convert this Mermaid ERD to a visual diagram" |
| sf-metadata | Get object/field data for ERDs | Query org before generating ERD |
| sf-lwc | Generate component mockups | "Mockup for the AccountList component" |
| sf-apex | Review Apex code via Gemini | "Get Gemini's opinion on this trigger" |
| Script | Location | Purpose |
|---|---|---|
check-prerequisites.sh |
scripts/ |
Verify all requirements before use |
generate_image.py |
scripts/ |
Direct API script for 4K resolution and image editing |
core-objects.md- Standard CRM objectscustom-objects.md- Custom data model
data-table.md- Lightning datatable mockupsrecord-form.md- Record form mockupsdashboard-card.md- Dashboard card mockups
integration-flow.md- Integration architecture diagrams
apex-review.md- Apex code review promptslwc-review.md- LWC review prompts
Run scripts/check-prerequisites.sh and fix each issue:
- No API Key: Set GEMINI_API_KEY in ~/.zshrc (personal key from aistudio.google.com)
- No Gemini CLI: Install with npm
- No Nano Banana: Install extension via gemini CLI
- Ensure you're on macOS (Preview app is macOS-only)
- Check the file path exists:
ls ~/nanobanana-output/ - Try opening manually:
open ~/nanobanana-output/[filename].png
- Ensure GEMINI_API_KEY is exported in current shell
- Verify key is valid at https://aistudio.google.com/apikey
- Check billing is enabled on Google Cloud project
- Store API key in
~/.zshrconly (not in project files) - The key is personal and tied to your Google account billing
MIT License. Copyright (c) 2024-2025 Jag Valaiyapathy