跳到正文
Skillpedia
通用编程6.9k · #13725

pr-visual-writeup

它能做什么

截取变更所影响页面的截图和简短的滚动片段,并把它们放入拉取请求描述中。它适合希望审阅者无需运行即可看到变更的开发者。

适用场景

  • ✓当你希望拉取请求描述中包含已变更页面的截图时。
  • ✓当审阅者需要在合并拉取请求之前看到视觉上的变化时。
  • ✓当你希望在拉取请求描述中放入变更前后的图片的时候。

技能链接

https://github.com/hexclave/hexclave/blob/dev/.agents/skills/pr-visual-writeup/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/hexclave/hexclave/blob/dev/.agents/skills/pr-visual-writeup/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请在我的拉取请求描述中添加新仪表盘布局的变更前后截图。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能会检查代码变更,从正在运行的开发服务器上以多种主题和屏幕尺寸截取页面,将图片上传到 GitHub gist,并将拉取请求描述设置为该结果。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

pr-visual-writeup

Turn a PR into a visual writeup: inspect the diff, capture screenshots + scroll animations from a local dev server across themes and viewports in parallel, host everything in a GitHub gist (PAT-only, no browser cookies), compose a rich markdown body, and set it as the PR description.

When this triggers

  • "make me a pr description with screenshots / gifs / videos"
  • "pr writeup with visuals"
  • "generate pr body from the running dev server"
  • "screenshot all the pages this PR changes and put them in the description"

If the user only wants a text-only PR description, don't use this skill — it's for visual-heavy writeups.

The shape of the work

Six phases. Phases 2 and 3 are the parallel-heavy ones — lean on subagents there. Phase 6 is the cleanup that puts the user's working tree back.

  1. Scope — figure out which PR, which routes, which dev server, which auth, which selectors are new UI
  2. Capture — "after" pass first (parallel: page × theme × viewport, red borders on new UI), then stash + checkout base + capture "before" pass against the same dev server.
  3. Process (parallel) — convert scroll videos → GIFs (inline-playable), prep gist
  4. Upload — one gist, one commit, all files; get raw URLs
  5. Compose + set — markdown body with before/after tables, then gh pr edit --body-file
  6. Restore — git checkout <orig-branch> + git stash pop so the user's working tree is exactly where they left it

Phase 1 — Scope

Before you capture anything, know:

  • PR number + repo — gh pr view <N> --json baseRefName,headRefName,title,url
  • Changed UI routes — gh pr diff <N> --name-only and filter for page/route files. For Next.js look for **/page*.tsx / **/*page-client.tsx. Map route files to URL paths based on the app router convention. Ignore changes purely in backend / shared components unless they have an obvious UI surface.
  • Dev server port — lsof -iTCP -sTCP:LISTEN -P -n | grep node and curl -s http://localhost:<port>/ | grep -oE '<title>[^<]+</title>' to identify which port is the dashboard vs. API vs. docs vs. mock-OAuth.
  • Auth flow — if the app requires login, inspect the sign-in page for the OAuth provider to use, and ask the user (or infer from context) which dev account to sign in as. Mock OAuth servers typically accept any email.
  • New-UI selectors — for each changed route, derive a list of CSS selectors that point to the UI elements added or visibly modified in this PR. Read the diff for that route's component file(s), pick stable selectors (data-testid, semantic role, unique class, or a :has() text match) for each new/changed block. These selectors drive the red-border highlight pass on "after" captures. If a route has no visually changed elements (only behavior/copy refactor), record [] and skip highlighting for that route.
  • Base ref for "before" — gh pr view <N> --json baseRefName gives you the base branch (usually dev or main). The "before" pass swaps the working tree to that ref under the same dev server — see Phase 2. Skip the before pass entirely if the user says "after only" or if every route is greenfield.
  • Working-tree state — git status --porcelain. If there are uncommitted changes, they need to be stashed before the base checkout. Record whether a stash will be needed and the current branch name so you can restore exactly.

Record all of these in /tmp/pr-<N>-visuals/scope.md — the Phase 2 subagents need them.

Phase 2 — Capture

Two ordered passes against a single dev server. The "after" pass runs first while the head branch is checked out; then we swap the working tree to the base ref (same server, same port, HMR rebuilds) and run the "before" pass.

Pass 1 — "after" (parallel)

The head branch is already checked out and the dev server is already running, so this is just the parallel matrix you started with.

Spawn one subagent per (theme, viewport) combination. Each owns a named agent-browser session, authenticates once, captures every page in its slice with red borders injected on new-UI selectors, and returns the output directory.

  • after-light-standard (1920×1200, theme=light, red borders on)
  • after-dark-standard (1920×1200, theme=dark, red borders on)
  • after-light-wide / after-dark-wide (2560×1440, flagship pages only)

Issue all Agent calls in one assistant message so they run concurrently. Unique --session-name per agent.

**Red borders.

常见问题

它会使用我的浏览器登录状态吗?

不会。该技能只使用 GitHub 令牌,不使用浏览器 Cookie。

它会更改我的工作文件吗?

该技能会在结束时恢复你的工作树,让你回到开始时所在的分支。

它能截取需要登录的页面吗?

该技能在设置截取时会考虑身份验证,因此登录后的页面也可以包含在内。

详情

作者的原始描述

Generate a rich GitHub PR description with dashboard/web-UI screenshots and scrolling animations captured from a running dev server, hosted as a GitHub gist, and pushed to the PR via `gh pr edit`. Use this skill whenever the user asks to "make a PR description with screenshots", "write up a PR with visuals", "add screenshots to my PR", "PR description with GIFs / demo / scroll animations", or anything involving turning a code PR into a visual-heavy writeup. Also triggers on phrases like "ship a PR writeup", "PR body with light and dark mode screenshots", "visual PR review", "generate PR body f

repo: hexclave/hexclave

热度

GitHub 星标
6.9k
排名
#13725
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能