一键导入
generate-image
Generate AI images using Gemini. Interactively asks for prompt and options, then generates and saves the image.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate AI images using Gemini. Interactively asks for prompt and options, then generates and saves the image.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Critique book prose in the author's voice using patterns learned from his own git edit history (not a hand-written rubric). Use when asked to "voice-check", "punch up", "make this sound like me / like Vonnegut / like Cunk", or to review whether a passage is too pompous / cute / self-aware. Catches what the regex scanner (voice-check.py, ~1.4% of real edits) misses.
Review and improve QMD chapter writing quality by replacing boring/consultant text with Wishonia's deadpan alien voice, consolidating redundancy, and reducing word count. Use when asked to fix voice, make content funnier, remove jargon, or enforce the book's writing style.
Spawns parallel agents to review all paperback QMD files. Reads variable-resolved previews, flags judgment-required issues with REVIEW comments.
Automated book maintenance. Runs health checks, prioritizes work, and systematically fixes issues. Use when you want Codex to autonomously improve the book.
Check GitHub Actions workflow status, diagnose failures, fetch logs, and fix common build issues. Use when builds fail, deploys break, or you need to investigate CI/CD problems.
Critically analyze a calculated parameter for academic rigor. Checks methodology, identifies weaknesses, suggests improvements for economist audiences.
| name | generate-image |
| description | Generate AI images using Gemini. Interactively asks for prompt and options, then generates and saves the image. |
| allowed-tools | ["AskUserQuestion","Bash","Read","Glob","Edit"] |
Generate AI images using Gemini with interactive option selection.
/generate-image
/generate-image "A diagram showing the treaty adoption process"
Read source files for available options:
scripts/images/generate-image.ts → ImageTypes, AspectRatiosscripts/lib/image-prompts.ts → VisualStylesDetermine target QMD file (priority order):
@knowledge/appendix/file.qmd)git diff --name-only HEAD~3 | grep "\.qmd$" | head -1Derive output folder from QMD filename:
knowledge/problem/regulatory-capture.qmd → assets/images/regulatory-capture/knowledge/appendix/invisible-graveyard.qmd → assets/images/invisible-graveyard/assets/images/generated/ (fallback)For charts, get actual numbers:
.venv/Scripts/python.exe scripts/preview-qmd-with-variables.py <file.qmd> --numbers-only
IMPORTANT: Include confidence intervals when available. The preview output shows values with 95% CIs in format X (95% CI: Y-Z). Always include these uncertainty ranges in chart prompts - request error bars or uncertainty visualization.
Use AskUserQuestion. Order options by inferred likelihood, putting recommended choice first with "(Recommended)" suffix.
Inference heuristics:
| Context Signal | Suggested Type |
|---|---|
| Economics files, data, costs, comparisons | chart |
| Process, workflow, pipeline, stages | diagram |
| Concepts, vision, metaphor | illustration |
| Marketing, propaganda | figure + retro-futuristic style |
| General/unclear | figure |
Aspect ratio hints: QMD chapters → 16:9, Social media → 1:1
Extract comprehensive context from the QMD file (with variables resolved). Include enough surrounding text for the image generator to understand the full concept.
Run preview script with broad line range (e.g., 30-50 lines) to capture full context:
.venv/Scripts/python.exe scripts/preview-qmd-with-variables.py <file.qmd> --line-range "X-Y"
CRITICAL: Gemini renders most text literally. Avoid meta-labels and editorial commentary.
| DON'T (appears in image) | DO (clean prompt) |
|---|---|
Title: Cost Comparison | A cost comparison chart showing... |
Context: The 1% Treaty... | The 1% Treaty redirects... |
Key insight: Lower is better | Lower cost per DALY = better |
Data to visualize: | Just state the data directly |
Write prompts as plain descriptive prose:
Do NOT prescribe specific layouts (e.g., "left bar should be X, right bar should be Y"). Provide the content and let the generator be creative.
For charts:
NEVER generate without showing the prompt and getting explicit user confirmation. This applies to initial generation AND regeneration/edits.
Present the full prompt in a code block:
Prompt: [full prompt text]
Type: [type]
Aspect: [aspect]
Style: [style]
Alt text: [alt]
Use AskUserQuestion to confirm: "Generate with this prompt?" with options:
Do NOT proceed to Step 4 until user confirms.
After user confirms:
npx tsx scripts/images/generate-image.ts '<prompt>' \
--type <type> --aspect <aspect> --style <style> --alt '<alt_text>' \
--output 'assets/images/<qmd-basename>/'
Examples:
regulatory-capture.qmd → --output 'assets/images/regulatory-capture/'invisible-graveyard.qmd → --output 'assets/images/invisible-graveyard/'--output 'assets/images/generated/'IMPORTANT: Use single quotes around prompt and alt text to prevent bash from interpreting $ as variable expansion (e.g., $8 trillion would break with double quotes).
Insert where the content is discussed, NOT at the end.
| Image Subject | Insert After |
|---|---|
| Data/statistics | Paragraph presenting those numbers |
| Process/workflow | Section heading introducing the process |
| Comparison | Paragraph setting up the comparison |
Use Edit tool with correct relative path from QMD to assets/images/<qmd-basename>/.
Report: image file path, where inserted, remind user to preview.
Requires GOOGLE_GENERATIVE_AI_API_KEY environment variable.