[recipes] Infographic Generator: turn research docs into visual infographics#85
Conversation
justfinethanku
left a comment
There was a problem hiding this comment.
Code Review: Infographic Generator Recipe
Summary
This is a well-structured and thoughtfully designed contribution. The recipe adds a valuable capability to the Open Brain ecosystem by enabling users to generate professional infographic images from their research and thoughts using Gemini's free-tier API. The contribution demonstrates excellent documentation, clean code, and strong integration with the Open Brain flywheel concept.
What's Good
Documentation Excellence:
- README is comprehensive with all required sections (Prerequisites, Steps, Expected Outcome, Troubleshooting)
- Credential tracker is a nice touch for helping users track their setup
- Troubleshooting section covers realistic failure scenarios with actionable solutions
- Clear connection to the Open Brain Flywheel (#84) provides context for the contribution's role
Code Quality:
- Python script properly checks for environment variables before proceeding
- No hardcoded credentials anywhere
- Clean error handling with retry logic for API failures
- Well-structured argument parsing with helpful usage documentation
- Proper use of pathlib for cross-platform compatibility
Skill Design:
- Comprehensive step-by-step process with clear routing logic
- Audience calibration is a thoughtful feature
- Detailed prompt template ensures consistent, high-quality outputs
- Good integration points with Open Brain (both read and write sides)
metadata.json:
- All required fields present and valid
- Appropriate difficulty level (intermediate) and time estimate (15 minutes)
- Tags are relevant and searchable
- Free-tier service requirement aligns with OB1 principles
Required Changes
1. Reference to non-existent recipe (blocking)
Line 132 in README.md references ../brain-dump-processor/:
Together with [Panning for Gold](../brain-dump-processor/) and [Auto-Capture Protocol](../auto-capture-protocol/)...The correct path should be ../panning-for-gold/ (checking the recipes directory). Also, the Auto-Capture Protocol recipe doesn't exist yet in the repo (PR #42 is still open). You should either:
- Change to:
Together with [Panning for Gold](../panning-for-gold/) and Auto-Capture Protocol (PR #42)... - Or remove the broken link until PR #42 merges
2. Skills directory path assumption (minor but important)
The README assumes the user has a ~/.claude/skills/ directory structure. While this is common for Claude Code, it would be helpful to add a note in the Prerequisites or Step 1 clarifying this is for Claude Code specifically, or provide alternative instructions for other AI coding tools mentioned in the prerequisites.
3. Missing validation for prompt file format (nice-to-have)
The generate.py script assumes the prompts file follows a specific markdown format. If the format is wrong, users get a generic "No prompts found" error. Consider adding:
- More specific error messages about what's expected (e.g., "Expected '## Infographic N: Title' headers followed by '### Prompt' sections")
- Or a
--validateflag to check file format before attempting generation
The script does print the expected format on line 142, which is good, but catching specific format errors earlier would improve UX.
Nice-to-Haves (optional improvements)
-
Dependencies documentation: Consider mentioning approximate install sizes or noting that
google-genaiandPilloware the only dependencies (keeping the venv lightweight). -
Example output: A brief description or even a note about what the generated images typically look like would help users set expectations.
-
Model versioning: The Gemini model names (
gemini-2.5-flash-image,gemini-3.1-flash-image-preview) may change. Consider adding a comment in the code about when these were last verified or a link to Gemini's model documentation.
Security & Safety ✅
- No credentials, API keys, or secrets in any file
- No SQL (not applicable)
- No binary blobs
- No modifications to core Open Brain infrastructure
- Environment variable properly checked before use
- No destructive operations
Category-Specific Requirements ✅
Recipe requirements met:
- Folder structure correct (recipes/infographic-generator/)
- README.md present and complete
- metadata.json present and valid
- Code files present (generate.py, skill file)
- Step-by-step instructions clear and copy-paste ready
- Troubleshooting section with multiple scenarios
PR Format ✅
- Title follows
[recipes] Descriptionformat - Body includes what it does, requirements, and test plan
- Proper attribution to @jaredirish
Verdict: Minor fixes needed
This is a strong contribution that's nearly ready to merge. The primary blocker is the broken internal link to brain-dump-processor which should be panning-for-gold. Once that's fixed (and ideally the Auto-Capture Protocol link is updated to note it's not yet merged), this should be good to go.
Great work @jaredirish! This is a creative and practical addition to the Open Brain ecosystem. The skill design is particularly well thought out, and I appreciate how it fits into the larger capture-process-visualize workflow.
justfinethanku
left a comment
There was a problem hiding this comment.
Code Review: Infographic Generator Recipe
Summary
This is a well-structured and thoughtfully designed contribution. The recipe adds a valuable capability to the Open Brain ecosystem by enabling users to generate professional infographic images from their research and thoughts using Gemini's free-tier API. The contribution demonstrates excellent documentation, clean code, and strong integration with the Open Brain flywheel concept.
What's Good
Documentation Excellence:
- README is comprehensive with all required sections (Prerequisites, Steps, Expected Outcome, Troubleshooting)
- Credential tracker is a nice touch for helping users track their setup
- Troubleshooting section covers realistic failure scenarios with actionable solutions
- Clear connection to the Open Brain Flywheel (#84) provides context for the contribution's role
Code Quality:
- Python script properly checks for environment variables before proceeding
- No hardcoded credentials anywhere
- Clean error handling with retry logic for API failures
- Well-structured argument parsing with helpful usage documentation
- Proper use of pathlib for cross-platform compatibility
Skill Design:
- Comprehensive step-by-step process with clear routing logic
- Audience calibration is a thoughtful feature
- Detailed prompt template ensures consistent, high-quality outputs
- Good integration points with Open Brain (both read and write sides)
metadata.json:
- All required fields present and valid
- Appropriate difficulty level (intermediate) and time estimate (15 minutes)
- Tags are relevant and searchable
- Free-tier service requirement aligns with OB1 principles
Required Changes
1. Reference to non-existent recipe (blocking)
Line 132 in README.md references ../brain-dump-processor/:
Together with [Panning for Gold](../brain-dump-processor/) and [Auto-Capture Protocol](../auto-capture-protocol/)...The correct path should be ../panning-for-gold/ (the actual directory name in the repo). Also, the Auto-Capture Protocol recipe doesn't exist yet (PR #42 is still open). You should either:
- Change to:
Together with [Panning for Gold](../panning-for-gold/) and Auto-Capture Protocol (PR #42)... - Or remove the broken link until PR #42 merges
2. Skills directory path assumption (minor but important)
The README assumes the user has a ~/.claude/skills/ directory structure. While this is common for Claude Code, it would be helpful to add a note in the Prerequisites or Step 1 clarifying this is for Claude Code specifically, or provide alternative instructions for other AI coding tools mentioned in the prerequisites.
3. Missing validation for prompt file format (nice-to-have)
The generate.py script assumes the prompts file follows a specific markdown format. If the format is wrong, users get a generic "No prompts found" error. Consider adding more specific error messages about what's expected (the script does print the expected format on line 142, which helps).
Nice-to-Haves (optional improvements)
-
Dependencies documentation: Consider mentioning approximate install sizes or noting that
google-genaiandPilloware the only dependencies (keeping the venv lightweight). -
Example output: A brief description of what the generated images typically look like would help users set expectations.
-
Model versioning: The Gemini model names (
gemini-2.5-flash-image,gemini-3.1-flash-image-preview) may change. Consider adding a comment in the code about when these were last verified.
Security & Safety ✅
- No credentials, API keys, or secrets in any file
- No SQL (not applicable)
- No binary blobs
- No modifications to core Open Brain infrastructure
- Environment variable properly checked before use
- No destructive operations
Category-Specific Requirements ✅
Recipe requirements met:
- Folder structure correct (recipes/infographic-generator/)
- README.md present and complete
- metadata.json present and valid
- Code files present (generate.py, skill file)
- Step-by-step instructions clear and copy-paste ready
- Troubleshooting section with multiple scenarios
PR Format ✅
- Title follows
[recipes] Descriptionformat - Body includes what it does, requirements, and test plan
- Proper attribution to @jaredirish
Verdict: Minor fixes needed
This is a strong contribution that's nearly ready to merge. The primary blocker is the broken internal link to brain-dump-processor which should be panning-for-gold. Once that's fixed (and ideally the Auto-Capture Protocol link is updated to note it's not yet merged), this should be good to go.
Great work @jaredirish! This is a creative and practical addition to the Open Brain ecosystem. The skill design is particularly well thought out, and I appreciate how it fits into the larger capture-process-visualize workflow.
|
@claude review this PR |
|
I'll analyze this and get back to you. |
|
@claude review this PR |
|
Claude finished @matthallett1's task in 1m 42s —— View job PR Review: Infographic Generator
@matthallett1 — review complete. Building on @justfinethanku's earlier feedback (which covers the documentation issues well), I want to flag some technical correctness concerns that need attention before merge. Alignment & Value ✅This fits OB1's flywheel framing cleanly. Using Open Brain as both a source ( One nuance worth flagging: Blocking Technical Issues1.
The correct approach looks like: from PIL import Image
import io
# ...
image_bytes = part.inline_data.data
image = Image.open(io.BytesIO(image_bytes))
image.save(str(out_path))This also explains why 2. Model names look speculative
Please verify these against the current Gemini model documentation and update accordingly. Fix this → 3. Broken internal links (confirming @justfinethanku's finding)
Suggested fix: Together with [Panning for Gold](../panning-for-gold/) and Auto-Capture Protocol (coming in PR #42), this forms a complete capture-process-visualize flywheel...Minor Issues
Skill path is Claude Code-specific: The skill hardcodes What's Working WellThe skill file's prompt template is genuinely high quality — the "what to avoid" section, the hex color requirement, and the audience calibration table are all thoughtful touches that will actually improve output. The step-by-step README structure is clear, the credential tracker is a nice UX addition, and the manifest JSON output makes the skill's handoff clean. Verdict: Needs fixes before mergeIssues 1 and 2 above (the broken API call and unverified model names) mean the script won't generate any images as written — the core function of the recipe won't work. These need to be confirmed against the actual Gemini SDK + model list. Issue 3 (broken links) was already flagged and also needs to be addressed. Once those three are fixed, this is a solid contribution. Great work @jaredirish on the overall design and documentation quality. |
matthallett1
left a comment
There was a problem hiding this comment.
Great concept and the skill prompt template is genuinely high quality. However, the automated review caught two issues that mean the script won't produce any images as written:
P1: part.as_image() doesn't exist in the google-genai SDK. Lines 99 and 116 of generate.py call this method, but it's not a standard API. The correct pattern is part.inline_data.data (raw bytes) + PIL.Image.open(io.BytesIO(...)). As written, every generation attempt throws AttributeError.
P1: Model names need verification. gemini-2.5-flash-image and gemini-3.1-flash-image-preview don't match documented Gemini model IDs. The actual names follow patterns like gemini-2.0-flash-preview-image-generation. Please verify against https://ai.google.dev/gemini-api/docs/models.
P2: Broken links. ../brain-dump-processor/ should be ../panning-for-gold/, and ../auto-capture-protocol/ doesn't exist yet.
Once the script actually runs and produces images, this is a strong contribution. The design and documentation quality are well above the bar.
fb36242 to
8fbeceb
Compare
|
Thanks for the thorough review! Pushed fixes addressing all the feedback. Here's what changed and what was clarified: Fixed:
Clarification on the two "P1" items:
The script generates images correctly as written — tested daily across multiple projects. |
|
"gemini-2.5-flash-image is a real model. It's documented in the SDK and has been the free-tier image generation model. The premium model name (gemini-3.1-flash-image-preview) is also working in production." yay for ai having NO IDEA what the latest models are facepalm |
|
Thanks for the work here. This is close, and we’ll merge it as soon as these last small issues are cleaned up:
If you want, enable maintainer edits and we can patch the small stuff directly. |
…raphics Second recipe from @jaredirish. Part of the Open Brain Flywheel (capture-process-visualize loop, see Issue NateBJones-Projects#84). Takes any markdown doc or Open Brain thought cluster and generates professional infographic images via Gemini's free-tier API. Auto-chunks content, writes verbose prompts (300+ words each), generates PNGs with specific colors/layout/typography. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
../brain-dump-processor/ → ../panning-for-gold/ ../auto-capture-protocol/ → ../auto-capture/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Sync generate.py with working local version (cleaner error handling, fix --redo display counter bug) - Fix auto-capture link: directory doesn't exist until PR NateBJones-Projects#42 merges, so link to the PR instead of a non-existent directory Note: part.as_image() and gemini-2.5-flash-image are both valid per the official google-genai SDK docs. Reviewer concerns on those were based on outdated information. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
09fc2ea to
406b42f
Compare
19a1c42
into
NateBJones-Projects:main
…raphics (NateBJones-Projects#85) * [recipes] Infographic Generator: turn research docs into visual infographics Second recipe from @jaredirish. Part of the Open Brain Flywheel (capture-process-visualize loop, see Issue NateBJones-Projects#84). Takes any markdown doc or Open Brain thought cluster and generates professional infographic images via Gemini's free-tier API. Auto-chunks content, writes verbose prompts (300+ words each), generates PNGs with specific colors/layout/typography. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * [recipes] Fix broken relative links in infographic-generator README ../brain-dump-processor/ → ../panning-for-gold/ ../auto-capture-protocol/ → ../auto-capture/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * [recipes] Address review feedback on infographic generator - Sync generate.py with working local version (cleaner error handling, fix --redo display counter bug) - Fix auto-capture link: directory doesn't exist until PR NateBJones-Projects#42 merges, so link to the PR instead of a non-existent directory Note: part.as_image() and gemini-2.5-flash-image are both valid per the official google-genai SDK docs. Reviewer concerns on those were based on outdated information. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * [recipes] Fix infographic redo progress output --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Jonathan Edwards <justfinethanku@gmail.com>
…raphics (NateBJones-Projects#85) * [recipes] Infographic Generator: turn research docs into visual infographics Second recipe from @jaredirish. Part of the Open Brain Flywheel (capture-process-visualize loop, see Issue NateBJones-Projects#84). Takes any markdown doc or Open Brain thought cluster and generates professional infographic images via Gemini's free-tier API. Auto-chunks content, writes verbose prompts (300+ words each), generates PNGs with specific colors/layout/typography. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * [recipes] Fix broken relative links in infographic-generator README ../brain-dump-processor/ → ../panning-for-gold/ ../auto-capture-protocol/ → ../auto-capture/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * [recipes] Address review feedback on infographic generator - Sync generate.py with working local version (cleaner error handling, fix --redo display counter bug) - Fix auto-capture link: directory doesn't exist until PR NateBJones-Projects#42 merges, so link to the PR instead of a non-existent directory Note: part.as_image() and gemini-2.5-flash-image are both valid per the official google-genai SDK docs. Reviewer concerns on those were based on outdated information. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * [recipes] Fix infographic redo progress output --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Jonathan Edwards <justfinethanku@gmail.com>
…raphics (NateBJones-Projects#85) * [recipes] Infographic Generator: turn research docs into visual infographics Second recipe from @jaredirish. Part of the Open Brain Flywheel (capture-process-visualize loop, see Issue NateBJones-Projects#84). Takes any markdown doc or Open Brain thought cluster and generates professional infographic images via Gemini's free-tier API. Auto-chunks content, writes verbose prompts (300+ words each), generates PNGs with specific colors/layout/typography. * [recipes] Fix broken relative links in infographic-generator README ../brain-dump-processor/ → ../panning-for-gold/ ../auto-capture-protocol/ → ../auto-capture/ * [recipes] Address review feedback on infographic generator - Sync generate.py with working local version (cleaner error handling, fix --redo display counter bug) - Fix auto-capture link: directory doesn't exist until PR NateBJones-Projects#42 merges, so link to the PR instead of a non-existent directory Note: part.as_image() and gemini-2.5-flash-image are both valid per the official google-genai SDK docs. Reviewer concerns on those were based on outdated information. * [recipes] Fix infographic redo progress output --------- Co-authored-by: Jonathan Edwards <justfinethanku@gmail.com>

Summary
Turn any research doc, analysis, or Open Brain thought cluster into professional infographic images using Gemini's free-tier image generation API.
--redo Nfor individual image regeneration and--premiumfor better textPart of the Open Brain Flywheel (#84)
This is the visualize side of a three-recipe capture-process-visualize loop:
Second recipe contribution from @jaredirish.
Files
README.md- Full recipe with Prerequisites, Steps, Expected Outcome, Troubleshootingmetadata.json- Recipe metadatainfographic-generator.skill.md- AI coding tool skill (Claude Code compatible)generate.py- Image generation script (usesGEMINI_API_KEYenv var, no hardcoded keys)Test Plan
generate.pyerrors cleanly whenGEMINI_API_KEYis not set