code-snippet-images
Generate beautiful code snippet images (PNG) for social media, tweets, LinkedIn, and documentation. Creates light-themed, macOS-style window chrome screenshots from code using HTML templates and Chrome headless. Use when asked to create code images, tweet images, snippet screenshots, code cards, or visual code examples for sharing. Supports single snippets, multi-image sets, and 2x2 grid composites.
What this skill does
# Code Snippet Images
Generate high-resolution code snippet PNGs using HTML templates rendered with Chrome headless at 2x scale.
## Quick Start
1. Copy the template from `assets/template.html` to a temp file
2. Replace `<!-- FILENAME -->` with the title bar text (e.g., filename or description)
3. Replace `<!-- CODE CONTENT -->` with syntax-highlighted HTML (see Syntax Highlighting below)
4. Render with `scripts/render.sh`:
```bash
scripts/render.sh /tmp/snippet.html /tmp/snippet.png
# Produces 2400x1350 PNG (1200x675 at 2x scale)
```
## Design Specs
- **Viewport**: 1200×675px, rendered at 2x scale → **2400×1350px** output
- **Style**: Light theme, warm off-white (#f0ece8 background, #faf8f6 card)
- **Window chrome**: macOS-style red/yellow/green dots, no badges or pills
- **Font**: JetBrains Mono (loaded from Google Fonts), ligatures disabled
- **Code font size**: 25px default (23px if code is longer, 20px if very dense). Use large fonts to fill the card.
- **No footer text** below the code card
- **Color scheme**: GitHub-light inspired syntax highlighting
## Syntax Highlighting
Wrap code tokens in `<span>` with these classes:
| Class | Color | Use for |
|-------|-------|---------|
| `.keyword` | green #22863a | `use`, `function`, `class`, `return`, `new`, `fn` |
| `.string` | blue #032f62 | `'quoted strings'` |
| `.method` | purple #6f42c1 | method/function names |
| `.class-name` | purple #6f42c1 | class and namespace names |
| `.facade` | purple #6f42c1 | Facade names like `Pdf` |
| `.comment` | gray italic #6a737d | `// comments` and `# comments` |
| `.variable` | orange #e36209 | `$variables` |
| `.named-arg` | orange #e36209 | PHP named args `key:` |
| `.arrow` | dark #24292e | `->` and `=>` |
| `.punctuation` | dark #24292e | `()`, `{}`, `[]`, `;`, `::` |
| `.env-key` | green bold #22863a | `.env` keys |
| `.env-val` | blue #032f62 | `.env` values |
| `.number` | blue #005cc5 | numeric literals |
| `.type` | purple #6f42c1 | type hints |
Use `<br>` for line breaks. Use ` ` for indentation (4× per level).
## Example
```html
<span class="keyword">use</span> <span class="class-name">App\Models\User</span><span class="punctuation">;</span><br><br>
<span class="variable">$users</span> <span class="punctuation">=</span> <span class="class-name">User</span><span class="punctuation">::</span><span class="method">where</span><span class="punctuation">(</span><span class="string">'active'</span><span class="punctuation">,</span> <span class="keyword">true</span><span class="punctuation">)-></span><span class="method">get</span><span class="punctuation">();</span>
```
## Grid Composite (2×2)
For combining 4 snippets into one image (e.g., LinkedIn posts):
1. Copy `assets/grid-2x2.html` to a temp file
2. Fill in the 4 `<!-- FILENAME N -->` and `<!-- CODE N -->` placeholders
3. Render at 2400×1350 native (no scaling needed since the grid is already 2400px wide):
```bash
scripts/render.sh /tmp/grid.html /tmp/grid.png 2400 1350 1
```
Grid uses slightly smaller fonts (17px) and padding to fit 4 cards.
## Render Script
`scripts/render.sh <input.html> <output.png> [width] [height] [scale]`
| Param | Default | Notes |
|-------|---------|-------|
| width | 1200 | Viewport width in px |
| height | 675 | Viewport height in px |
| scale | 2 | Device scale factor (2 = retina) |
## Tips
- **Adjust font size** if code doesn't fit: change `.code { font-size }` in the HTML
- **Adjust card height**: the card auto-sizes to content; body height may need increasing for long snippets
- **Arrow ligatures**: template already disables ligatures (`font-variant-ligatures: none`) to prevent `->` from rendering as `→`
- **Multiple images**: create separate HTML files per snippet, render each independently
- **PHP code**: prefer `pdf()` helper style over `Pdf` facade when showing Laravel examples (Spatie convention)
- Keep code concise — these are for social media, not documentation
Related in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.