Repository navigation
feat(commit): document attaching PR screenshots with gh --attach - #176
Conversation
Agents were claiming gh can't attach images and asking users to drag screenshots in, though gh pr create and gh pr edit support --attach.
Older gh versions reject --attach as an unknown flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
||
| ## Attaching Images to the Pull Request | ||
|
|
||
| Since gh 2.99.0, `gh pr create` and `gh pr edit` upload images and videos with |
There was a problem hiding this comment.
i am not sure we need to index on the version of gh as much, the agent will figure out if it fails the first time and will update vs this might make the agent do a gh version check before any git command
i would also make sure we have a "skip this section if its not a visual change" so it doesn't try and put a screenshot in for all sort of things. or maybe the good models are smart enough to figure that out on their own, but there are probably also visual changes that might not need a screenshot either, i think like if text copy changes, will the llm think oh yeah i need to show before and after?
There was a problem hiding this comment.
I've had this locally for a while and at least my Claude & Opus >=5 combo is smart enough to not trip up on this.
ericapisani
left a comment
There was a problem hiding this comment.
Attaching images on a pull request reads as something distinct from a commit. I wonder if there's a better way (maybe a distinct skill for image attachment and then invoke the 2 skills together a distinct workflow/prompt)?
Oh, actually, I do like that. Since sending this PR I've evolved some practices around tables (when to use before-and-after vs just one row, what columns to put, etc.). Let me go rework this... |
There was a problem hiding this comment.
[Explanation] I, ah, kind of got excited. I directed Claude to look through my last 2 weeks of session chats/feedback and PR descriptions. It distilled them down into basic preferences of how I do things. I trimmed out a bunch of me-specific stuff (e.g. Logs area things). But I'm not sure I drew the line right - is everything here Sentry-general? There's still a lot new... 😅
| image references. Switch to an HTML table only when cells must span rows, such | ||
| as a light and dark row under one location | ||
| (`Location | Theme | Before | After` with `rowspan="2"` on the location cell). | ||
| Do not add `align` attributes. |
There was a problem hiding this comment.
alignattributes
[Explanation] For some reason, whenever there's a real table, Claude loves to add align="right" or whatnot on every column.
| Before writing a body the user may have edited, fetch it again and compare it | ||
| with the version you last read. Keep the user's wording and table edits, swap in | ||
| only your rows and URLs, and keep the body's line endings. Removing an image | ||
| from the body does not delete the uploaded file. |
There was a problem hiding this comment.
[Explanation] I can't tell you how many times Claude clobbered my edits...
ericapisani
left a comment
There was a problem hiding this comment.
To answer the question that you left in one of your comments - I think this is a generalizable skill because I can see this being used by people working on the UI or docs pages.
Left some "food-for-thought" comments but I imagine some of these can only be answered through usage/testing of the skill by others, so am considering them non-blocking.
| |------|--------| | ||
| | Real build only | Screenshot the running app on the PR branch for "after" and on the base branch for "before". Never screenshot a story, mock page, or harness built for the PR, unless the change is to that story. | | ||
| | No injected changes | Never inject CSS or change the DOM to imitate the change. Stubbing API responses is fine; the frontend code must be the real code. | | ||
| | Seed missing data | If a state needs data no account has, create it in a local environment. Do not report a location as impossible to screenshot until seeding has been tried, and then say exactly what failed. | |
There was a problem hiding this comment.
If a state needs data no account has, create it in a local environment.
Is the assumption that there's "seed data initialization" scripts, etc. on hand in the project that the AI will notice? Or does this need to be specified as part of this workflow?
There was a problem hiding this comment.
My Claude has always been smart enough to look for any existing scripts, use them if so, or figure it out if not. My intuition is that any project using skills like this would have a clear enough seed/setup set of docs.
Co-authored-by: Erica Pisani <pisani.erica@gmail.com>
Notes that
gh pr createandgh pr editcan now upload images with--attach, so agents attach screenshots directly.This speeds up local PR description creations for me (which I do as a form of QA too, a lot). Previously it would ask to upload to a branch, or chrome-devtools drag them in, etc.