mirror of
https://github.com/K-Dense-AI/scientific-agent-skills.git
synced 2026-12-05 18:43:55 +08:00
- Enhanced AGENTS.md to clarify skill scope and directory structure, providing clearer guidelines for skill creation and updates. - Updated CONTRIBUTING.md to emphasize the separation of tests from skill directories, ensuring better organization and clarity for contributors. - Revised .gitignore to include .pytest_cache, improving project cleanliness. - Adjusted pyproject.toml to configure pytest for better test path management. - Incremented version number in SKILL.md for autoskill to reflect recent updates.
3.2 KiB
3.2 KiB
Smart Iterative Refinement
The generate-review-refine loop, the command-line reference, and configuration.
Smart Iterative Refinement
How It Works
┌─────────────────────────────────────────────────────┐
│ 1. Generate infographic with Nano Banana Pro │
│ ↓ │
│ 2. Review quality with Gemini 3.6 Flash │
│ ↓ │
│ 3. Score >= threshold? │
│ YES → DONE! (early stop) │
│ NO → Improve prompt, go to step 1 │
│ ↓ │
│ 4. Repeat until quality met OR max iterations │
└─────────────────────────────────────────────────────┘
Quality Review Criteria
Gemini 3.6 Flash evaluates each infographic on:
-
Visual Hierarchy & Layout (0-2 points)
- Clear visual hierarchy
- Logical reading flow
- Balanced composition
-
Typography & Readability (0-2 points)
- Readable text
- Bold headlines
- No overlapping
-
Data Visualization (0-2 points)
- Prominent numbers
- Clear charts/icons
- Proper labels
-
Color & Accessibility (0-2 points)
- Professional colors
- Sufficient contrast
- Colorblind-friendly
-
Overall Impact (0-2 points)
- Professional appearance
- Free of visual bugs
- Achieves communication goal
Review Log
Each generation produces a JSON review log:
{
"user_prompt": "5 benefits of exercise...",
"infographic_type": "list",
"style": "healthcare",
"doc_type": "marketing",
"quality_threshold": 8.5,
"iterations": [
{
"iteration": 1,
"image_path": "figures/exercise_v1.png",
"score": 8.7,
"needs_improvement": false,
"critique": "SCORE: 8.7\nSTRENGTHS:..."
}
],
"final_score": 8.7,
"early_stop": true,
"early_stop_reason": "Quality score 8.7 meets threshold 8.5"
}
Command-Line Reference
python skills/infographics/scripts/generate_infographic.py [OPTIONS] PROMPT
Arguments:
PROMPT Description of the infographic content
Options:
-o, --output PATH Output file path (required)
-t, --type TYPE Infographic type preset
-s, --style STYLE Industry style preset
-p, --palette PALETTE Colorblind-safe palette
-b, --background COLOR Background color (default: white)
--doc-type TYPE Document type for quality threshold
--iterations N Maximum refinement iterations (default: 3)
--api-key KEY OpenRouter API key
-v, --verbose Verbose output
--list-options List all available options
List All Options
python skills/infographics/scripts/generate_infographic.py --list-options
Configuration
API Key Setup
Set your OpenRouter API key:
export OPENROUTER_API_KEY='your_api_key_here'
Get an API key at: https://openrouter.ai/keys