Skip to content

[recipes] Infographic Generator: turn research docs into visual infographics#85

Open
jaredirish wants to merge 1 commit intoNateBJones-Projects:mainfrom
jaredirish:recipes/infographic-generator
Open

[recipes] Infographic Generator: turn research docs into visual infographics#85
jaredirish wants to merge 1 commit intoNateBJones-Projects:mainfrom
jaredirish:recipes/infographic-generator

Conversation

@jaredirish
Copy link
Contributor

Summary

Turn any research doc, analysis, or Open Brain thought cluster into professional infographic images using Gemini's free-tier image generation API.

  • Auto-chunks content into logical segments (one infographic per topic)
  • Writes verbose prompts (300+ words each with specific hex colors, layout, typography)
  • Generates PNG images via Gemini API
  • Supports --redo N for individual image regeneration and --premium for better text
  • Open Brain integration: search thoughts as source, capture prompts as searchable templates

Part of the Open Brain Flywheel (#84)

This is the visualize side of a three-recipe capture-process-visualize loop:

Recipe PR Role
Panning for Gold #21 (merged) Process raw brain dumps into evaluated ideas
Auto-Capture Protocol #42 (open) Automatically save session insights on close
Infographic Generator This PR Turn findings into shareable visuals

Second recipe contribution from @jaredirish.

Files

  • README.md - Full recipe with Prerequisites, Steps, Expected Outcome, Troubleshooting
  • metadata.json - Recipe metadata
  • infographic-generator.skill.md - AI coding tool skill (Claude Code compatible)
  • generate.py - Image generation script (uses GEMINI_API_KEY env var, no hardcoded keys)

Test Plan

  • CI passes all 14 OB1 checks
  • generate.py errors cleanly when GEMINI_API_KEY is not set
  • README sections match OB1 requirements (Prerequisites, Steps, Expected Outcome, Troubleshooting)
  • No credentials or API keys in any file

…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>
Copy link
Collaborator

@justfinethanku justfinethanku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --validate flag 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)

  1. Dependencies documentation: Consider mentioning approximate install sizes or noting that google-genai and Pillow are the only dependencies (keeping the venv lightweight).

  2. Example output: A brief description or even a note about what the generated images typically look like would help users set expectations.

  3. 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] Description format
  • 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.

Copy link
Collaborator

@justfinethanku justfinethanku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

  1. Dependencies documentation: Consider mentioning approximate install sizes or noting that google-genai and Pillow are the only dependencies (keeping the venv lightweight).

  2. Example output: A brief description of what the generated images typically look like would help users set expectations.

  3. 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] Description format
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants