$npx -y skills add indranilbanerjee/socialforge --skill index-assetsIndex brand photo library using AI vision. Use when: setting up assets, adding new photos, or refreshing the index.
| 1 | # /socialforge:index-assets — Asset Indexer |
| 2 | |
| 3 | Scan a brand's photo library and create an AI-powered asset index. Each image is analyzed by Gemini Vision to understand what's in it, what mood it conveys, what posts it's suitable for, and how it can be cropped for different platforms. |
| 4 | |
| 5 | ## Context efficiency |
| 6 | |
| 7 | Asset-heavy skill. **Grep before Read** the asset catalog (`${CLAUDE_PLUGIN_DATA}/<brand>/assets/index.json`) — never list the asset directory. Reference generated images / videos by path, not by loading metadata. Brand profile loads once per session. |
| 8 | |
| 9 | ## How It Works |
| 10 | |
| 11 | 1. **Locate assets** — Read asset-source.json for the brand's photo library location |
| 12 | 2. **Scan files** — Find all .jpg, .jpeg, .png, .webp files in the source |
| 13 | 3. **AI analysis** — For each image, use Gemini Vision (gemini-3-flash) to generate: |
| 14 | - Natural language description of the image |
| 15 | - Tags (categories, subjects, setting, mood) |
| 16 | - Dominant colors detected |
| 17 | - Lighting and composition assessment |
| 18 | - What types of social media posts this image suits |
| 19 | - Whether background is removable (for compositing) |
| 20 | - Platform crop feasibility (can this be cropped to 1:1, 4:5, 16:9 without losing key content?) |
| 21 | 4. **Build index** — Create asset-index.json with all analyzed assets |
| 22 | 5. **Identify style references** — Suggest 2-8 images as style reference candidates (best represent the brand's visual DNA) |
| 23 | |
| 24 | ## Pre-Flight Check |
| 25 | |
| 26 | Before indexing, verify: |
| 27 | - Brand profile exists for the specified brand |
| 28 | - Asset source is configured (Google Drive URL or local path) |
| 29 | - If Google Drive: verify Drive MCP is connected or platform integration is available |
| 30 | |
| 31 | If asset source is not configured: |
| 32 | ``` |
| 33 | ⚠️ No asset source configured for brand "{brand}". |
| 34 | Run /socialforge:brand-setup --update {brand} to add an asset source. |
| 35 | Or provide a path now: /socialforge:index-assets {brand} --source local --path /path/to/photos |
| 36 | ``` |
| 37 | |
| 38 | ## Progress Updates |
| 39 | |
| 40 | ``` |
| 41 | [1/4] Scanning asset source... |
| 42 | Found: 47 images (32 .jpg, 12 .png, 3 .webp) |
| 43 | |
| 44 | [2/4] Analyzing images with AI Vision... |
| 45 | Analyzed: 12/47 (25%) — ~3 min remaining |
| 46 | Analyzed: 24/47 (51%) — ~2 min remaining |
| 47 | Analyzed: 47/47 (100%) ✓ |
| 48 | |
| 49 | [3/4] Building asset index... |
| 50 | Tags generated: 184 unique tags across 47 assets |
| 51 | Platform crops: 47 images × 6 platforms = 282 crop assessments |
| 52 | |
| 53 | [4/4] Identifying style reference candidates... |
| 54 | Top 8 candidates selected based on visual consistency and quality |
| 55 | ``` |
| 56 | |
| 57 | ## Output |
| 58 | |
| 59 | ``` |
| 60 | Asset Index Complete: acme-corp |
| 61 | Total assets: 47 |
| 62 | Categories: people (12), products (8), office (6), events (5), lifestyle (9), graphics (7) |
| 63 | Background-removable: 23 assets (suitable for ANCHOR_COMPOSE mode) |
| 64 | Style reference candidates: 8 images suggested |
| 65 | |
| 66 | Saved: ~/socialforge-workspace/brands/acme-corp/asset-index.json |
| 67 | |
| 68 | Would you like to: |
| 69 | - Review style reference candidates? (I'll show all 8 with descriptions) |
| 70 | - Start monthly production? (/socialforge:new-month) |
| 71 | - Update specific assets? (/socialforge:index-assets --refresh) |
| 72 | ``` |
| 73 | |
| 74 | ## Timeout & Fallback |
| 75 | |
| 76 | - Per-image AI analysis: 15-second timeout. If an image times out, mark as `analysis_pending` and continue. |
| 77 | - Large libraries (100+ images): Process in batches of 20. Show progress after each batch. |
| 78 | - If AI Vision is unavailable: Create basic index from file metadata only (dimensions, filename, folder) — flag as `ai_analysis_missing`. |
| 79 | |
| 80 | ## Refresh Mode |
| 81 | |
| 82 | `/socialforge:index-assets [brand] --refresh` |
| 83 | |
| 84 | Only re-analyzes new or modified images since last index. Compares file timestamps with `indexed_at` in asset-index.json. |
| 85 | |
| 86 | ## Cost Awareness |
| 87 | |
| 88 | Each image analysis costs approximately $0.002-0.005 (Gemini Vision). For a 50-image library, expect ~$0.10-0.25 total. |
| 89 | |
| 90 | Show estimated cost before starting: "Indexing 47 images will cost approximately $0.12 in Gemini Vision API calls. Proceed?" |