pr-evidence
Captures a screenshot of a web page and puts it, or a screen recording, into a pull request as evidence, through the user's file host. Load it before adding an image or recording to a PR, an issue or a review reply, and before committing an image that only shows a change.
- License 许可
- MIT
- 所属仓库
- zgeoff/hq
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- pr-evidence
- description
- Captures a screenshot of a web page and puts it, or a screen recording, into a pull request as evidence, through the user's file host. Load it before adding an image or recording to a PR, an issue or a review reply, and before committing an image that only shows a change.
03 SKILL.md 正文
PR evidence
Upload a screenshot or a recording to the user's file host, a web service that stores the file and gives back a URL. Put that URL in the PR as a Markdown line, and hand back the line. Never commit an image just to show a change: it stays in the repo's history forever. Anyone with the link can open the file, so keep every token, secret and piece of personal data out of it.
Key rules
- Pick the upload path: the
cloudCLI, orcurlto the address inPR_EVIDENCE_URL; otherwise stop before you capture. - Save and capture: each file in
.scratch/, kept out of git, named for what it shows. - Upload it: with a label and a 30-day expiry, and check the file host's response.
- Put it in the PR: the label as the alt text, under the entry it proves.
Pick the upload path
Pick the path before you capture anything. Take the first row that matches:
| Check | Path |
|---|---|
command -v cloud prints a path |
the cloud CLI, the file host's own client |
test -n "$PR_EVIDENCE_URL" && test -n "${PR_EVIDENCE_TOKEN_PATH:-$PR_EVIDENCE_TOKEN_REF}" is true |
curl |
| neither | none: stop and tell the user |
The user sets these variables on the machine:
PR_EVIDENCE_URL: the file host's upload address, such ashttps://files.example.com/api/files.PR_EVIDENCE_TOKEN_PATH: where 1Password keeps the upload token, as<vault>/<item>/<field>.PR_EVIDENCE_TOKEN_REF: the same place as anop://<vault>/<item>/<field>reference. A machine sets this one or the token path, and the token path wins when both are set.
op run resolves every op:// value in its environment, and fails on one its token can't read. So
the token path has no op:// prefix. Build the reference only inside an op read call, as the
commands below do, and never export it.
The curl path also needs the 1Password op CLI, signed in. Run this check:
op read "op://${PR_EVIDENCE_TOKEN_PATH:-${PR_EVIDENCE_TOKEN_REF#op://}}" > /dev/null
When it fails, stop and give the user op's error. Never set any of these variables yourself, and
never write a value of one in a file you commit.
Save and capture
-
Save each file in
.scratch/at the root of the checkout. When git doesn't ignore that folder yet, add it to the clone's own exclude file, which changes no tracked file:git check-ignore -q .scratch/ || echo .scratch/ >> "$(git rev-parse --git-path info/exclude)" mkdir -p .scratch -
Name the file for what it shows, in lowercase letters, digits and hyphens, such as
login-form-email-error.png. The name is part of the URL. -
Capture a web page with headless Chromium:
chromium --headless --hide-scrollbars --window-size=1280,800 --screenshot=.scratch/login-form-email-error.png http://localhost:3000/loginExpect the PNG at the
--screenshotpath. For an SVG or a diagram, pass itsfile://URL in place of the page's URL. Save a recording as MP4 or WebM. GitHub shows PNG, JPEG, GIF, WebP and AVIF in the PR as an image, MP4 and WebM as a link, and offers any other format as a download.When
command -v chromiumprints nothing, use another screenshot tool that runs without a person at the screen, or stop and tell the user. For a recording, use any recorder on the machine, or stop and tell the user when the machine has none. -
View the image before you upload it, with a tool that shows you images, such as your file-read tool. Check that it shows the change, and holds no token, secret or personal data. When you can't view a recording, ask the user to check it before you upload it.
Upload it
Write a label first: a few words on what the file shows, such as Login form with the email error.
Leave out square brackets, which break the Markdown line. The file host stores the label, and you
use it as the alt text on both paths.
Set expires to 30d on both paths. Without expires, the file host deletes the file after 7
days, which breaks the image in a PR that stays open longer than a week. Never set expires to
never: the image only needs to last through the review.
-
With the
cloudCLI:cloud up .scratch/login-form-email-error.png --label 'Login form with the email error' --expires 30d --mdExpect the Markdown line, with the label as the alt text. On a failure it prints an error, prints no line, and exits non-zero: stop and tell the user.
--expires 30dsets the expiry, so this path needs no expiry check. -
With
curl, pass the label with--form-string.-Fcuts a label at a;.curl -sS -w '\nHTTP %{http_code}\n' --oauth2-bearer "$(op read "op://${PR_EVIDENCE_TOKEN_PATH:-${PR_EVIDENCE_TOKEN_REF#op://}}")" -F file=@.scratch/login-form-email-error.png --form-string 'label=Login form with the email error' -F expires=30d "$PR_EVIDENCE_URL"Expect a JSON body, then
HTTP 201. Check that the body'sexpiresAt, an ISO 8601 timestamp, falls on the date 30 days from today, in UTC. Then write the line from the body'slabelandurl:.Any other status means the upload failed, and the body's
messageholds the reason. When the upload fails orexpiresAtis wrong, stop and tell the user.
Put it in the PR
For a recording, drop the leading ! from the line, so the line shows as a link. Then, for PR
number <n>:
- Read the body:
gh pr view <n> --json body -q .body > .scratch/pr-body.md. - Put the line under the entry that the file is evidence for, such as a bullet or a checklist line.
Indent it to the entry's content column, the first column after the list marker: 2 spaces under a
-bullet, checklist lines included, and 3 under1.. A deeper indent turns the line into a code block. When no entry matches, put it at the end. - Write the body back:
gh pr edit <n> --body-file .scratch/pr-body.md. Expect the PR's URL.
For an issue, use gh issue view and gh issue edit the same way. For a reply to a review comment,
post the line with
gh api repos/<owner>/<repo>/pulls/<n>/comments/<comment id>/replies -f body='<line>'.
Reply: the Markdown line you added.
04 同仓库更多 Skills
tickets
What a good Linear issue is in team GEO - its sections, when it is Ready, its fields, the Actions an agent may take, cross-repo and umbrella work, and how to save it. Load it before you write, rewrite, groom, split or save an issue, or judge whether one is Ready.
release
How z-release takes merged work to live across the zgeoff repos - release PRs, the nightly batch, cloud deploys, bump PRs, host switches, the nixie memory-store backup check, recovery and the hard timing rules. Load it in z-release's session, and before any release, deploy, host switch, atc upgrade or rollback.
preview-qa
Runs live checks for the owner's issues, on a PR's preview environment before the merge and read-only on production once the release ships, records the evidence on the issue, closes it, and hands back only the checks that need the owner. Use when z-review sends a preview check with an issue, its PR and the items to check, or when hq or z-release messages "Shipped, now live-check".
pr-review
How z-review reviews and merges every PR in the zgeoff repos, and files the only follow-up issues a PR may leave. Load it when hq messages "Final: GEO-n (repo#n at <sha>)", when an agent answers a finding, when a session sends z-review a PR to merge, or before an issue is filed from a PR.
owner-calls
What only the owner decides, how a session puts something to the owner, how the owner's answers count, and the fleet's shared terms. Load it before you flag an issue for the owner, send a decision or a hands-on step for the owner, decide something under a grant, or act on an answer of the owner's.
linear-triage
How z-triage keeps the owner's Linear workspace accurate: grooming every open issue, moving it to Ready once it meets the criteria, acting on hq's alerts, and queuing the owner's questions as calls. Load it for each scheduled pass and check, when a session asks for a check now, when hq sends an alert, and before an issue is written or rewritten.