pr-lens
Что он делает
Скилл превращает изменение в коде или кодовую базу в визуальные диаграммы, которые показывают связи частей и движение данных. Он нужен разработчикам, которые хотят объяснить pull request или систему другим людям.
Когда использовать
- ✓Когда вы хотите диаграмму, которая объясняет, что делает изменение в коде.
- ✓Когда вам нужна картина архитектуры или потоков данных системы для pull request.
- ✓Когда вы просите ИИ визуализировать или объяснить, как устроена кодовая база.
Ссылка на скилл
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/software-development/pr-lens/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Нарисуй диаграмму архитектуры для этого pull request, чтобы рецензенты видели, как движутся данные.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Скилл заставляет ИИ написать описание дорожек, узлов и связей в JSON, затем запускает командный инструмент PR Lens, который рисует анимированные диаграммы SVG. Ошибок он не ищет.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
PR Lens Skill
PR Lens draws code as visually rich animated diagrams: diffs, architecture, data flows. You describe the diff or codebase as one JSON document (lanes, nodes, edges, ordered flows) and the CLI renders it as animated SVGs. There is no findings lens — PR Lens is a comprehension layer, not a review bot. There is no field for a bug, risk, or security note, and a document that invents one is rejected.
When to Use
- Asked to diagram, visualise, or explain a code change or a system.
- A pull request should carry an architecture or data-flow diagram.
- Keywords: PR Lens, diagram, architecture, data flow, visualise, pull request.
Prerequisites
- Node.js with
npx(the CLI runs vianpx @coldtea/pr-lens-cli@latest; no install step). gh(GitHub CLI) — optional, only for attaching diagrams to PRs.- Optional canvas publishing calls the third-party service prlens.dev (see step 4b).
How to Run
Run all commands with the terminal tool from the repository root.
Read the diff. When representing a code change:
git diff --find-renames <base>...<head>. The base is the merge base, not the tip of the base branch. If not expressing a diff, read the code to be visualised.Write the document to
.pr-lens/graph.json, followingreferences/graph-document.md.references/example.graph.jsonis a valid reference with three lanes, all four delta states, a hero edge, a seven-step flow, a nested drill-down tree and a six-step walkthrough. Read it before writing your first document — quicker than reading the reference.Validate, and fix.
npx @coldtea/pr-lens-cli@latest validate .pr-lens/graph.jsonFix every failure and run it again. Do not render an invalid document; do not "work around" a failure by deleting the element it names.
Render.
npx @coldtea/pr-lens-cli@latest render .pr-lens/graph.json --theme lightRender light by default unless the user requests another theme. The SVGs, the manifest and
drawn.graph.jsonland in.pr-lens/, which the CLI adds to the repository's .gitignore. Do not commit any of it — these files are rebuilt from the diff on demand. Each SVG is named after its view, theme and content hash;manifest.jsonlists them by lens and view.
4b. Canvas push — OPTIONAL, opt-in. Only when the user explicitly asks for a shareable link. This publishes .pr-lens/drawn.graph.json to the third-party service prlens.dev:
npx @coldtea/pr-lens-cli@latest canvas push
It prints three links. Give the user the view link (https://prlens.dev/c/{id}): the full-screen diagram, every view on one page, no login. The edit link (ending in #w=…) lets its holder overwrite the canvas — it is a secret: leave it out of the reply unless asked, never paste it anywhere public. The embed link serves the top view as an SVG for a README. Pushing the same file again updates the same canvas, so "rename that node" is: edit, validate, render, push — the link stays the same. If the push fails, say so and tell the user where the local SVGs are and which is the top view.
Attach to a PR, when there is one. Upstream documents
gh pr create/edit/comment --attach <path>, but--attacharrived in GitHub CLI 2.99 — checkgh --versionfirst (e.g. gh 2.97 does NOT have it). With gh ≥ 2.99: write the body with a Markdown image(an HTML<img>is left as written and the file appended at the bottom instead; alt text is the one-line caption a reader without images gets), then repeat--attach <path>per referenced diagram:gh pr create --title "…" --body-file .pr-lens/body.md --attach .pr-lens/overview-light-<hash>.svgWithout
--attach, use a commit-free path:- Upload the SVGs to a gist:
gh gist create .pr-lens/<view>.svg, then reference the raw gist URL in the PR body/comment, or - Publish via the canvas link (step 4b, with user consent) and link the view URL, or
- Note the local
.pr-lens/path in the PR body so reviewers can rebuild.
Once published somewhere durable, let the CLI compose the comment markdown:
npx @coldtea/pr-lens-cli@latest comment \ --graph .pr-lens/drawn.graph.json \ --manifest .pr-lens/manifest.json \ --asset-base-url <where you published the SVGs>--graphtakesdrawn.graph.json, not the document you wrote — the CLI refuses a document its manifest does not descr- Upload the SVGs to a gist:
Частые вопросы
Ищет ли он ошибки или проблемы безопасности?
Нет. Скилл говорит, что PR Lens — инструмент для понимания, в нём нет полей для ошибок или рисков.
Нужна ли установка?
Скилл запускает инструмент через npx, поэтому отдельной установки нет, но нужен Node.js.
Можно ли прикрепить диаграммы к pull request?
Да. Скилл говорит, что GitHub CLI может прикрепить диаграммы к PR, хотя этот шаг необязателен.
Подробности
Оригинальное описание автора
Draw code changes as animated architecture/data-flow SVGs.
Популярность
- Звёзды на GitHub
- 260k
- Место в рейтинге
- #573
- Лицензия
- MIT
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
agent-merge-conflict-arbiter
260kРазрешает конфликт слияния git между ветками двух агентов как нейтральная третья сторона и создает один объединенный результат для репозитория.
antigravity-cli
260kПомогает установить, обновить и устранить неполадки в командной строке Antigravity, включая плагины, вход в аккаунт и песочницу.
blackbox
260kПозволяет агенту передать задачу по коду инструменту командной строки Blackbox AI, который запускает несколько ИИ-моделей и выбирает лучший результат.
dynamic-workflow
260kУчит агента выполнять большие пакеты однотипной работы как сохраненный скрипт, чтобы в основной разговор возвращались только проверенные результаты.
Похожие скиллы
diffs
394kПозволяет агенту создать настоящее сравнение правок в виде ссылки или файла изображения, которым можно поделиться, вместо ручной сводки.
coding-agent
394kПомогает агенту передать большую задачу по коду в Codex, Claude Code или OpenCode как фоновому исполнителю, а затем проверять ее ход.
gh-issues
394kПомогает агенту находить задачи GitHub, выбирать, над какими работать, и открывать запросы на слияние с исправлениями, включая ответы на комментарии рецензентов.