agentleFS
jocarrdjocarrd/crux-agents/skills/before-after/SKILL.md

before-after

Skill4 starsChanged 19 days agoMITView on GitHub

Show whoever decides the before and after of a visual change —the published version on the left, the new one on the right and a red bar in the middle, on desktop, tablet and mobile— and push nothing until they approve; once approved, those screenshots go with the PR. Use when you finish a change that can be seen —redesign, polish, new page, responsive—, when asked "enséñame cómo queda antes de subirlo", "pásame el antes y el después" or "quiero verlo en el móvil", or before pushing the branch of anything that touches the interface.

  • Installs packages

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before proposing the change (crux workspace finish), after /ship.

    line 17
  2. Very specific:

    If the proposal is already open and is shown again after comments: crux visual pr <number> replaces that section instead of adding another.

    line 93

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

before-after

A visual change is finished when whoever decides has seen it. This skill prepares the before and the after for them, side by side, at three screen sizes, so they can decide in a minute from their phone. The reason behind each step and each gotcha: <this-skill-directory>/references/why.md.

When to use

  • The diff touches something that can be seen: interface, styles, a new page, a chart.
  • Before proposing the change (crux workspace finish), after /ship.
  • Again if, after showing it, there were changes: from the person's comments or from the proposal's review.

When not to use

  • Changes that cannot be seen: logic, backend, data, documentation.
  • Iterating on a detail yourself while laying out: that is /render-loop.
  • Measuring the deviation against an official design: that is /visual-diff.

The procedure

1. Decide what is shown

The pages the diff touches, not the whole site, at three widths: desktop (1440), tablet (820) and mobile (390). If there are pieces that are not pages —a video, a PDF, a downloadable image—, they are generated and shown too, as a file.

2. Capture both versions with the same script

The before, from what is published if the base is what is deployed; otherwise, the base on another port from the main checkout. The after, from the branch, preferably with the production build locally. Both with the same script and the same data.

mkdir -p ~/.cache/visual-test && cd ~/.cache/visual-test
[ -d node_modules/playwright-core ] || npm i playwright-core >/dev/null 2>&1
cp "<this-skill-directory>/scripts/capture.mjs" .

node capture.mjs --base https://<published> --head http://localhost:<port> \
  --paths /,/<other> --widths 1440,820,390 --out <folder> \
  --hide '<selectors for cookie notices, chat and floating layers>'

3. Assemble the comparisons

python3 "<this-skill-directory>/scripts/compose.py" <folder> --lang es

It leaves in <folder>/compare/ one montage per page and width (before on the left, after on the right, red bar), in sections of about 3,000 px and in WebP.

4. Look at them before sending them

Open each montage. Whatever looks wrong is fixed before showing; tell capture artefacts apart (see Gotchas).

5. Show them and wait

They are sent to whoever decides through the conversation channel, with one line on what changed. Desktop and mobile first; tablet if something specific to it changes. Nothing is pushed —neither push nor proposal— until they say yes.

6. Record the yes

crux visual approve <folder>/compare --note "<what was reviewed, in one sentence>"

It saves the .crux-visual receipt with the commit the capture was taken on. If another commit goes in afterwards, the screenshots no longer show what is being proposed: go back to step 2.

7. Propose

crux workspace finish reads the receipt and adds to the proposal a section "Antes y después". Depending on the project's profile:

visual.publishWhat it does
branch (default)Pushes the images to a separate branch that is never merged (visual.branch, crux-review by default) and links them in the proposal
none (client repos)Only the review note, without images and without leaving anything of ours in their repo

If the proposal is already open and is shown again after comments: crux visual pr <number> replaces that section instead of adding another.

Gotchas

  • An empty chart in the capture is usually the animation restarted when the window is resized; capture.mjs already waits. Check it in the browser before calling it a bug.
  • What loads on entering the screen needs the page to be scrolled through; the script does it.
  • With a development server, the system Chrome may not paint; the production build is better.
  • Cookie notices, chat and floating layers: --hide with their selectors, which go in the project's adapter.
  • Fixed elements appear at the end of the full capture: they belong to the capture, not the design.
  • Only the pages the diff touched: nobody reviews twenty-seven images.

Anti-patterns

  • Sending only desktop.
  • Showing the after without the before.
  • Pushing "so they can see it in the proposal": what is shown for approval goes before pushing.
  • Publishing screenshots of an earlier commit (it is not dodged by deleting the receipt).

Related

  • /ship — the gate that comes before; its gate 7 is the one the agent sees
  • /visual-test — inspect a page at both widths while working
  • /render-loop — iterate on a layout detail
  • /visual-diff — measure against an official design
  • /flow — where this fits in the cycle

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.