skills/figure/SKILL.md
Generate a figure using Google Gemini Nano Banana 2 API based on the prompt or surrounding context.
npx skillsauth add a554b554/Reactant figureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a figure from the prompt and surrounding context.
<@figure ...> tag appears.figure_system_architecture.png).<@figure> tag with a format-appropriate image reference:
.md): .tex): \includegraphics{filename.png}Requires GEMINI_API_KEY environment variable.
Run the entire generate-and-save flow in a single Bash command to avoid redundant API calls. Use single-quoted JSON with the prompt inserted via variable substitution to avoid escaping issues.
source ~/.bashrc && RESPONSE=$(curl -s -X POST \
"https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{
"parts": [{"text": "Generate an image: YOUR_PROMPT_HERE"}]
}],
"generationConfig": {
"responseModalities": ["TEXT", "IMAGE"]
}
}') && echo "$RESPONSE" | python -c "
import json, sys, base64
r = json.load(sys.stdin)
if 'error' in r:
print('API error: ' + r['error'].get('message', 'unknown')); sys.exit(1)
if 'candidates' not in r:
print('No candidates in response'); sys.exit(1)
for part in r['candidates'][0]['content']['parts']:
if 'inlineData' in part:
data = base64.b64decode(part['inlineData']['data'])
with open('OUTPUT_PATH.png', 'wb') as f:
f.write(data)
print(f'Saved {len(data)} bytes')
break
"
The prompt may contain context references wrapped in double backticks ( ``). These point to external resources.
<@figure: a diagram based on the architecture in ``system.md``> — read system.md for context.<@figure: pipeline diagram, save to ``figures/pipeline.png``> — save to figures/pipeline.png. delimiters from the output.GEMINI_API_KEY is not set, warn the user and skip.python (not python3) for base64 decoding. ``) in the prompt before generating.data-ai
Apply a preceding plan/output chain to the content, then remove all tags.
tools
Proofread surrounding text for grammar and spelling errors.
data-ai
Generate and execute a visualization script for a given data file based on user instructions and context.
data-ai
Produce a revision plan for the surrounding text based on the prompt. Supports multi-turn conversation chains.