skills/image-generation/SKILL.md
Gemini画像生成APIを使ってブログ記事やドキュメント用の図・イラストを生成する。Use when user asks to "画像生成", "図を作って", "generate image", "create diagram", "イラスト作って", "図示して", or wants to create visual assets for articles.
npx skillsauth add nyosegawa/skills image-generationInstall 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.
Gemini の画像生成 API を使って、ブログ記事やドキュメント用の図・イラストを生成するスキル。
python3 -c "from google import genai; print('OK')" — if missing: pip install google-genaipython3 -c "from PIL import Image; print('OK')" — if missing: pip install Pillow (JPEG→PNG変換に必要)scripts/generate_image.py を使って画像を生成する。
# 基本
python3 scripts/generate_image.py "prompt text" /path/to/output.png
# モデル指定
python3 scripts/generate_image.py --model gemini-3-pro-image-preview "prompt text" /path/to/output.png
デフォルトモデルは gemini-3-pro-image-preview。高品質な図の生成に適している。
スクリプトの場所はスキルディレクトリ内: ~/.claude/skills/image-generation/scripts/generate_image.py
またはリポジトリ内: ~/src/github.com/nyosegawa/skills/skills/image-generation/scripts/generate_image.py
技術記事に挿入する図は以下の方針で生成する。
1つの記事・ドキュメントに複数の画像を入れる場合、全画像のデザインを統一すること。画像ごとにトーンが異なると全体の品質が大幅に下がる。
方法: 最初にスタイルテンプレートプロンプトをシェル変数として定義し、全画像のプロンプトの冒頭に付与する。
# 全画像で共有するスタイルテンプレート
STYLE="A modern, polished infographic with a white background. Use a vibrant blue (#2563EB) as the primary color and soft gray (#F1F5F9) as secondary. Rounded rectangles with subtle drop shadows. Clean, modern aesthetic like a well-designed slide deck. Large, bold text. Professional and visually appealing."
# 各画像はこのように生成
python3 scripts/generate_image.py "$STYLE [個別の図の内容]" /path/to/output.png
スタイルテンプレートは記事のトーンに応じて調整してよいが、1記事内では必ず同じテンプレートを使う。
Geminiは日本語テキストの描画が不安定。以下のルールで崩壊を防ぐ:
1つの画像に含めるテキスト要素の総量を制限する。これを守らないと日本語が崩壊する。
| 項目 | 上限 | |------|------| | テキスト要素(ボックス、ラベル等)の総数 | 10個以下 | | 1つのラベルの文字数 | 日本語7文字以内、英語15文字以内 | | 図全体の日本語文字数合計 | 50文字以内 |
上限を超えそうな場合は、図を2枚に分割するか、情報を削って本質だけに絞る。「記事本文で補足すればよい」と割り切ること。
Gemini の画像生成は自然言語でプロンプトを書く。昔のStable Diffusion的なタグ羅列ではなく、文章として何を描いてほしいかを説明する。
良い例:
A clean technical diagram on white background showing the architecture of a speech recognition system.
On the left, a waveform labeled "Audio Input (16kHz)" feeds into a box labeled "wav2vec2 CNN Feature Extractor (frozen)".
An arrow goes down to "Transformer Encoder (24 layers)".
From layer 12, a branch goes right to "Phoneme CTC Head" outputting phoneme symbols.
From layer 24, another branch goes right to "Kana CTC Head" outputting hiragana characters.
Use a blue color scheme. Keep it minimal and professional.
悪い例:
architecture, diagram, speech recognition, wav2vec2, CTC, blue, white background, minimal
~/src/github.com/nyosegawa/nyosegawa.github.io/img/{slug}/{image-name}.png生成した画像は必ず read_file で視覚的に確認すること。以下をチェックする:
問題がある場合は即座に再生成する。複数画像を生成した場合は、最後に全画像を並べて統一性を最終チェックする。
development
Analyzes Claude Code session transcripts to evaluate skill portfolio health — routing errors, attention competition between descriptions, and coverage gaps. Generates an interactive HTML report with per-skill health cards, competition matrix, attention budget analysis, and actionable patches. Unlike skill-creator which optimizes individual skills in isolation, skill-auditor optimizes the portfolio as a system, detecting cross-skill attention theft and cascade risks. Use when user says "audit my skills", "skill audit", "run skill-auditor", "analyze skill routing", "check skill competition", "portfolio health", "スキル監査", "スキルの精度を分析", "スキルルーティング分析".
tools
Build high-quality Remotion promo and intro videos for any app type (web, mobile, API/SDK, developer tool, AI product) using app-type blueprints, timeline patterns, and frame-capture QA. Use when users ask to create a product promo, teaser, app intro, UX flow video, or Remotion-based demo video.
tools
MCPサーバーの「Light版」を生成する。descriptionを1行に圧縮し、ベストプラクティスをAgent Skillとして分離する。Use when user asks to "MCP Light版を作って", "MCPを軽量化", "Light MCP", "mcp-light", "create light mcp", "compress mcp descriptions", "MCP description圧縮", or wants to reduce MCP tool definition token usage.
development
セッションtranscriptを分析してドキュメントの効果を評価する。 doc参照がAgentの行動を改善したか、Context浪費か、腐敗して有害かを判定。 last-validated がないドキュメントにもgit履歴ベースで対応。 HTML reportでper-doc健全性、Context budget、freshness、推奨アクションを表示。 Use when user says "audit docs", "docs audit", "run docs-auditor", "ドキュメント監査", "doc ROI", "ドキュメントの効果分析".