Skip to content

docs: add agent rules for screenshots in pull requests - #43

Merged
kalaspuff merged 3 commits into
mainfrom
fctl/17-let-s-add-add-a-brief-agents-md-instruct
Oct 18, 2026
Merged

kalaspuff merged 3 commits into
mainfrom
fctl/17-let-s-add-add-a-brief-agents-md-instruct

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

A pull request that changes how fctl looks now shows it with screenshots in its description, and keeps them current. AGENTS.md says so in one bullet, and a new screenshots skill says how.

What changed

  • AGENTS.md: a pull request that changes how fctl looks shows it with screenshots: before and after when it changes something that exists, after alone when it adds something. When a later commit changes what a screenshot shows, the agent replaces it. Screenshots are attached with gh pr edit --attach and never committed.
  • .claude/skills/screenshots: which changes need screenshots, and when to show before and after or after alone.
    • Taking them with Playwright against cargo xtask dev, using a short script that signs in as the dev owner, asks for reduced motion and seeds Math.random, so the foundry scene draws the same frame on every load.
    • Running main from a worktree for the before screenshots.
    • Attaching them with gh pr edit --attach in a before/after table.
    • Keeping them current: retake and replace them in the same turn, with the commit they show named in the description.
  • The commit and pull-requests skills point to it.

Why gh --attach, and what doesn't work yet

Screenshots are never committed. gh 2.99 added --attach to gh pr create, gh pr edit and gh pr comment: it uploads a file the way dragging it into GitHub's editor does. That works with a person's token, but not in an fctl session. Sessions have the GitHub App's installation token: gh refuses it ("unsupported authentication type"), and GitHub's upload endpoint answers 404. Until #40 is decided and done, the skill tells agents in sessions to take and check the screenshots anyway, describe them in words, and say that the session can't attach them.

How I verified it

  • Screenshot script. Ran the skill's setup and script verbatim in a fresh directory against cargo xtask dev:
    • the project page (light, 1440 px), a session page with its live socket (dark, 390 px), and the floor;
    • two runs of the floor are pixel-identical (without the seed they differed by 63 pixels, in the foundry scene).
  • Before screenshots. Ran main's web app from a worktree on port 5175 against the same control plane. Before and after differed only in a session's relative time ("2m" against "3m").
  • Reference rewriting. Ran gh 2.102's own code (internal/attachments in cli/cli) on the skill's example description. Both table cells point at the uploads, an image uploaded earlier is left alone, and nothing is appended.
  • Upload in a session. gh pr edit 35 --attach probe.png printed "unsupported authentication type" and left the pull request as it was. POST https://uploads.github.com/user-attachments/assets with the session's token returned 404.
  • Not verified: an upload with a person's token. None is reachable from the session.

Also filed: #41. cargo xtask dev doesn't install worker-build, which a fresh sandbox needs, and the skill points there.

Refs #40
hyperstructure/fctl-site#6 adds the same rules for fctl.sh.

Made in fctl session https://app.fctl.sh/s/ses_01M56CE8ANDXBDMB930CSXN186

fctl-sh Bot and others added 3 commits October 18, 2026 02:36
A pull request that changes how fctl looks shows it with screenshots in
its description: before and after, or after alone for something new.
They are attached with `gh pr edit --attach`, never committed, and
replaced when a later commit changes what they show. The screenshots
skill says how to take them with Playwright against `cargo xtask dev`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The foundry scene picks its lanes with Math.random, so even with reduced
motion two loads of the floor drew different frames. Seeded, before and
after differ only where the change does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kalaspuff
kalaspuff merged commit e523856 into main Oct 18, 2026
4 of 5 checks passed
@kalaspuff
kalaspuff deleted the fctl/17-let-s-add-add-a-brief-agents-md-instruct branch October 18, 2026 02:46
kalaspuff pushed a commit to hyperstructure/fctl-site that referenced this pull request Oct 18, 2026
A pull request that changes how fctl.sh looks now shows it with
screenshots in its description, and keeps them current. AGENTS.md says
so in one bullet, and a new `screenshots` skill says how. These are the
same rules as hyperstructure/fctl#43 adds there.

## What changed

- **AGENTS.md**: a pull request that changes how fctl.sh looks shows it
with screenshots: before and after when it changes something that
exists, after alone when it adds something. When a later commit changes
what a screenshot shows, the agent replaces it. Screenshots are attached
with `gh pr edit --attach` and never committed.
- **`.claude/skills/screenshots`**: which changes need screenshots (the
landing page, how docs and legal pages render, the 404 page, design
tags), and when to show before and after or after alone.
- Taking them with Playwright against `npm run dev` (the landing page)
or `npm run build && npx wrangler dev` (docs and legal pages), using a
short script that asks for reduced motion and seeds `Math.random`.
  - Running `main` from a worktree for the before screenshots.
  - Attaching them with `gh pr edit --attach` in a before/after table.
- Keeping them current: retake and replace them in the same turn, with
the commit they show named in the description.
- The `commit` and `pull-requests` skills point to it.

## Why `gh --attach`, and what doesn't work yet

Screenshots are never committed. gh 2.99 added `--attach` to `gh pr
create`, `gh pr edit` and `gh pr comment`: it uploads a file the way
dragging it into GitHub's editor does. That works with a person's token,
but not in an fctl session. Sessions have the GitHub App's installation
token: gh refuses it ("unsupported authentication type"), and GitHub's
upload endpoint answers 404. Until hyperstructure/fctl#40 is decided and
done, the skill tells agents in sessions to take and check the
screenshots anyway, describe them in words, and say that the session
can't attach them.

## How I verified it

- **Checks.** `npm run check`, `npm test` and `npm run build` pass.
Biome's one note is the existing deprecation notice in `biome.json`.
- **Screenshot script.** Ran the skill's script verbatim:
  - the landing page in both themes at 1440 and 390 px;
- a docs page and the privacy policy through `wrangler dev`, built with
fctl's docs.
- **Reduced motion.** Without it, the hero is still fading in when the
screenshot is taken.
- **The seed.** Without it, two loads of the landing page differ in
about 7.5% of their pixels: the foundry scene picks its lanes with
`Math.random`. With it, `main` from a worktree on port 5175 and this
branch on 5174 are pixel-identical.
- **Reference rewriting.** gh 2.102's own code rewrites both cells of
the example table to the upload URLs (run in hyperstructure/fctl#43).
- **Not verified:** an upload with a person's token. None is reachable
from the session.

Refs hyperstructure/fctl#40

Made in fctl session
https://app.fctl.sh/s/ses_01M56CE8ANDXBDMB930CSXN186

Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant