snipgrapher — скилл для Claude Code: что делает и как установить
Генерирует изображения сниппетов кода в форматах PNG, SVG и WebP через утилиту snipgrapher. Пригодится для подготовки иллюстраций в документацию, чейнджлоги и публикации в соцсетях.
npx skills add mcollina/skills --skill snipgrapher -a claude-codeЧто делает snipgrapher
Скилл учит агента создавать скриншоты кода с подсветкой синтаксиса через утилиту snipgrapher или npx. Инструмент поддерживает одиночные файлы, пакетную обработку и режим watch. Итоговые изображения можно сохранять в PNG, SVG или WebP. Стили и темы фиксируются в файле snipgrapher.config.json через именованные профили.
Перед серией снимков скилл советует выполнить npx snipgrapher init. Это исключит расхождения в оформлении. После сборки агент проверяет размер файла командой ls -lh, чтобы исключить пустой вывод. Если в профиле задан кастомный шрифт, операционная система должна содержать его заранее, иначе рендер упадёт.
Какие задачи решает
- создать изображение с кодом в формате PNG, SVG или WebP
- настроить файл конфигурации
snipgrapher.config.jsonс именованными профилями - пакетно сгенерировать иллюстрации кода для документации и чейнджлогов
- запустить режим
watchдля автоматического обновления картинок при правках исходников
Примеры запросов агенту
- Сделай красивый PNG-скриншот файла src/index.ts с помощью snipgrapher
- Инициализируй snipgrapher.config.json и сгенерируй SVG для docs/example.py по профилю default
- Подготовь WebP-сниппеты из папки examples для публикации в чейнджлоге
Как установить snipgrapher
1Через Skills CLI (Vercel)
npx skills add mcollina/skills --skill snipgrapher -a claude-code2Вручную: положить файлы
~/.claude/skills/snipgrapher/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/snipgrapher/
1Через Skills CLI (Vercel)
npx skills add mcollina/skills --skill snipgrapher -a codex2Вручную: положить файлы
.agents/skills/snipgrapher/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add mcollina/skills --skill snipgrapher -a cursor2Вручную: положить файлы
.cursor/skills/snipgrapher/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install mcollina/skills snipgrapher2Вручную: положить файлы
.github/skills/snipgrapher/SKILL.md1Через Skills CLI (Vercel)
npx skills add mcollina/skills --skill snipgrapher -a gemini-cli2Командой платформы
gemini skills install https://github.com/mcollina/skills --path skills/snipgrapherВручную: положить файлы
.devin/skills/snipgrapher/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add mcollina/skills --skill snipgrapher -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора11
Похожие
Рядом в теме «Тексты и документация»
Всё по теме «Тексты и документация» →Вопросы о snipgrapher
Как установить snipgrapher в Claude Code?
Выполните команду npx skills add mcollina/skills --skill snipgrapher -a claude-code.
Какие форматы файлов поддерживает snipgrapher?
Скилл позволяет сохранять сниппеты с подсветкой синтаксиса в PNG, SVG и WebP.
Что делать, если при генерации изображения возникает ошибка шрифта?
Убедитесь, что все пользовательские шрифты из конфига snipgrapher.config.json установлены в вашей операционной системе. При неподдерживаемом синтаксисе языка рендер переключается на обычный текст.
Исходный текст
SKILL.md · MIT
--- name: snipgrapher description: Configures and uses snipgrapher to generate polished code snippet images, including syntax-highlighted PNGs, SVGs, and WebP exports with custom themes, profiles, and styling options. Use when the user wants to create code screenshots, turn code into shareable images, generate pretty code snippets for docs or social posts, produce syntax-highlighted images from source files, or explicitly mentions snipgrapher. Supports single-file renders, batch jobs, watch mode, and reusable named profiles via the snipgrapher CLI or npx. metadata: tags: snipgrapher, snippets, images, svg, png, webp, cli --- ## When to use Use this skill when you need to: - Generate image snippets from source code - Configure reusable snippet rendering defaults - Batch-render snippet assets for docs, social posts, or changelogs - Use published `snipgrapher` from npm to generate snippet images ## Quick start Render a single file to a PNG immediately with no config required: ```bash npx snipgrapher render file.ts -o output.png ``` For ongoing use, initialise a project config first, then render: ```bash npx snipgrapher init # creates snipgrapher.config.json npx snipgrapher render file.ts --profile default -o output.png ``` After rendering, verify the output exists and is non-zero in size before treating the job as successful: ```bash ls -lh output.png # confirm file exists and size > 0 ``` ## How to use Read these rule files in order: - [rules/setup-and-configuration.md](rules/setup-and-configuration.md) - Install, select executable, initialize config, and define profiles - [rules/rendering-workflows.md](rules/rendering-workflows.md) - Render single snippets, batch jobs, watch mode, and output practices ## Core principles - **Configure first**: establish a project config before repeated renders - **Reproducible output**: prefer named profiles and explicit output paths - **Portable commands**: use command patterns that work with installed binaries and `npx` - **Automation-friendly**: rely on CLI flags/config/env precedence intentionally ## Troubleshooting common render failures If a render fails or produces an unexpected output, check for these common causes: - **Missing fonts**: ensure any custom font specified in the profile or config is installed on the system - **Unsupported syntax**: confirm the language/extension is supported by snipgrapher; fall back to plain text highlighting if not - **Empty or corrupt output**: re-run with `--verbose` (if supported) to surface error details, and verify the input file is readable and non-empty - **Profile not found**: run `npx snipgrapher init` to regenerate `snipgrapher.config.json` if the config file is missing or malformed
© mcollina · MIT · mcollina/skills