@jesdi/skills 0.0.24 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jesdi/skills",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "description": "jesdi's agent skills (content package consumed by @jesdi/skills-cli)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -6,7 +6,8 @@ description: Capture before/after screenshots of UI views with Playwright and em
6
6
  # PR Visual Diff
7
7
 
8
8
  Produce before/after screenshots of the views affected by a branch's frontend
9
- changes, commit them on the PR branch, and embed them in the PR body. Reviewers
9
+ changes, push them to a hidden ref (never the PR branch), and embed them in the
10
+ PR body. Reviewers
10
11
  should see what changed visually without checking out the branch.
11
12
 
12
13
  The approach leans on the project's existing Playwright e2e harness with the
@@ -44,7 +45,6 @@ file as JSON:
44
45
  | `deviceProjects` | the config's `projects` (default to a desktop + a mobile project) |
45
46
  | `baseBranch` | the repo's default branch (`main`/`master`; `git symbolic-ref refs/remotes/origin/HEAD`) |
46
47
  | `packageManager` | infer from lockfile: `pnpm-lock.yaml`→pnpm, `package-lock.json`→npm, `yarn.lock`→yarn, `bun.lockb`→bun |
47
- | `screenshotDir` | default `docs/pr-screenshots` |
48
48
  | `spinnerSelector` | the app's loading-indicator selector (search for a spinner/`role="status"`/`aria-busy` component) |
49
49
 
50
50
  ### Preconditions gate
@@ -66,14 +66,14 @@ screenshots.
66
66
  ## Always run the capture in a subagent
67
67
 
68
68
  Steps 2–6 (writing the spec, capturing, **reading every PNG back to eyeball
69
- it**, committing, embedding) MUST run inside a single dispatched subagent — not
69
+ it**, pushing them to the hidden ref, embedding) MUST run inside a single dispatched subagent — not
70
70
  in the main context. Reading screenshots back is this skill's dominant token
71
71
  cost, and those image bytes are worthless to the main thread; keeping them in a
72
72
  subagent's throwaway context is the whole savings, with no loss of verification.
73
73
 
74
74
  Main context does only: step 1 (map the diff, get the user's go-ahead), then
75
75
  dispatch a subagent with the plan and the config values. The subagent returns a
76
- compact report: the committed screenshot paths + pinned URLs, the PR-body
76
+ compact report: the screenshot file names + pinned URLs, the PR-body
77
77
  markdown, and any views it flagged. The main context creates/edits the PR from
78
78
  that report — it never reads a PNG.
79
79
 
@@ -88,11 +88,11 @@ make it visible (open a modal, select a tab). Classify each view as **changed**
88
88
  (existed at the merge base) or **new** (introduced by this branch) — new ones
89
89
  get an after-only shot.
90
90
 
91
- This capture is heavy (temp worktree, two Playwright passes, a commit pushed to
92
- the branch, PR body rewritten). ALWAYS confirm with AskUserQuestion before
91
+ This capture is heavy (temp worktree, two Playwright passes, images pushed to a
92
+ hidden ref, PR body rewritten). ALWAYS confirm with AskUserQuestion before
93
93
  running any of it. The question must cover **both** (a) whether to run the whole
94
- before/after capture at all, and (b) that it will commit the screenshots and
95
- embed them in the PR. Include the proposed plan: which routes/states, and which
94
+ before/after capture at all, and (b) that it will push the screenshots to a
95
+ hidden ref on the remote and embed them in the PR. Include the proposed plan: which routes/states, and which
96
96
  device projects — default to the config's `deviceProjects`; add more only when
97
97
  the change is layout-sensitive. If they decline, create the PR normally and stop.
98
98
 
@@ -167,24 +167,43 @@ Remove the worktree when done:
167
167
  `git worktree remove --force <scratchpad>/pr-before-shots` (`--force` because
168
168
  install left untracked artifacts).
169
169
 
170
- ### 5. Commit the images on the PR branch
170
+ ### 5. Push the images to a hidden ref
171
171
 
172
+ The images must never land on the PR branch: once merged they would sit in the
173
+ base branch's history forever and every clone would download them. Instead,
174
+ build an orphan commit that holds only the PNGs and push it to a ref outside
175
+ `refs/heads/*`, which clones and fetches never transfer (GitHub's own
176
+ `refs/pull/*` works the same way). The working tree, the index and the PR
177
+ branch are not touched.
178
+
179
+ Collect the shots you'll reference into one flat directory, named
180
+ `<view>--<project>--{before|after}.png`, then:
181
+
182
+ ```bash
183
+ SLUG=$(git branch --show-current | tr / -)
184
+ TREE=$(for f in <scratchpad>/shots/*.png; do
185
+ printf '100644 blob %s\t%s\n' "$(git hash-object -w "$f")" "$(basename "$f")"
186
+ done | git mktree)
187
+ SHA=$(git commit-tree "$TREE" -m "pr-screenshots: ${SLUG}")
188
+ git push origin "${SHA}:refs/pr-screenshots/${SLUG}/${SHA}"
172
189
  ```
173
- <screenshotDir>/<branch-slug>/<view>--<project>--{before|after}.png
174
- ```
175
190
 
176
- `<branch-slug>` = branch name with `/` → `-`. Keep only the shots you'll
177
- reference. Commit them, delete the temp spec, and push.
191
+ Keep the braces in `${SHA}:` — zsh reads a bare `$SHA:r` as a modifier and
192
+ mangles the refspec. Each capture gets its own ref (the commit SHA is part of
193
+ the name), so a re-capture never needs a force push, two machines never
194
+ collide, and URLs from earlier captures keep working. Never delete these refs:
195
+ they are what keeps the images alive on GitHub.
196
+
197
+ Delete the temp spec. Nothing from this skill is committed to the PR branch.
178
198
 
179
199
  ### 6. Embed in the PR body
180
200
 
181
- After pushing, pin image URLs to the exact commit so they keep rendering after
182
- later force-pushes or branch deletion:
201
+ Pin image URLs to the orphan commit; they render regardless of what happens to
202
+ the PR branch:
183
203
 
184
204
  ```bash
185
- SHA=$(git rev-parse HEAD)
186
205
  REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
187
- # → https://github.com/$REPO/blob/$SHA/<screenshotDir>/<slug>/<file>.png?raw=true
206
+ # → https://github.com/$REPO/blob/$SHA/<file>.png?raw=true
188
207
  ```
189
208
 
190
209
  Per view, one table. Put **Before on the left and After on the right** (one
@@ -201,12 +220,11 @@ side:
201
220
  ```
202
221
 
203
222
  If the repo is private, GitHub's image proxy may refuse to inline blob URLs in
204
- the PR body. Add a one-line note under the tables linking to the
205
- `<screenshotDir>/<slug>/` directory on the branch as a fallback — the images
206
- always render in the Files-changed tab and in blob view for authenticated
207
- viewers.
223
+ the PR body. Add a one-line note under the tables linking to the orphan
224
+ commit's tree (`https://github.com/$REPO/tree/$SHA`) as a fallback — the images
225
+ always render there for authenticated viewers.
208
226
 
209
- The subagent's job ends here: it has pushed the commit and produced the PR-body
227
+ The subagent's job ends here: it has pushed the hidden ref and produced the PR-body
210
228
  markdown, and returns both. The **main context** creates (or edits) the PR with
211
229
  that body, then opens it (`gh pr view --web`) so the user can confirm the embeds
212
230
  render.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-09-30T22:48:58.981Z",
3
+ "generatedAt": "2026-10-01T01:49:46.043Z",
4
4
  "skills": [
5
5
  {
6
6
  "name": "backlog",
@@ -52,8 +52,8 @@
52
52
  },
53
53
  {
54
54
  "name": "pr-visual-diff",
55
- "version": "0.1.0",
56
- "hash": "sha256-4e386dd175a34e55e89e0e29e37f5d0afd927560b7e3ba4c5f3ef482fb73f722",
55
+ "version": "0.1.1",
56
+ "hash": "sha256-c90f308a7529ead883b4c379d034724a33da43e91f2d8ba0f2bdc5d79c894df2",
57
57
  "description": "Capture before/after screenshots of UI views with Playwright and embed them in a PR. Use this skill whenever creating or preparing a pull request that touches frontend code (components, views, styles, layout, Tailwind classes) — even if the user just says \"open a PR\" or \"create the PR\" after UI work, and especially if they mention screenshots, visual diff, before/after, or \"show what changed\". Also use when the user asks to add screenshots to an existing PR."
58
58
  },
59
59
  {