/userscript-lab:userscript-authorfrom userscript-lab
This skill should be used when the user asks to make a site do X ("make <site> do X"), write a userscript for a site, fix a broken userscript, remove or restyle an element that annoys them ("this site's sidebar annoys me", "hide this banner"), or publish a userscript to Greasy Fork. It authors a lint-clean Violentmonkey `.user.js` by measuring the live page first through Claude in Chrome — never by guessing a selector.
Ships in userscript-lab. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The invariant is MEASURE. Never ship a selector, class or breakpoint that was not dumped from the live page. If the page cannot be reached, say so and stop — asking the operator to paste a probe result is a measurement; inventing a selector is not.
This skill owns the judgment: is the wanted state already rendered by the site, which selectors are real, what gets asked instead of guessed.
wish → shelf → open tab → measure A vs B → diff → replay-or-select → write → lint → install → prove
The rail is Claude in Chrome, in the operator's own Chrome — the same profile, logins and Violentmonkey the script ships into.
No document-start proof is available on this rail: Claude in Chrome injects only after load. Its computer clicks and key presses are trusted (isTrusted: true, measured 2026-11-14). Verify by installing in Violentmonkey and checking with Claude in Chrome; say which checks ran.
Delivery is out of scope. This skill stops at a lint-clean, installed, proven file.
@require / @resource from a CDN. Fetched at install time, no SRI or
integrity field exists, nothing pins it; Violentmonkey also refuses local files. Reuse
enters as vendored source, which Greasy Fork permits provided the block carries
name/version/URL attribution (greasyfork.md).${ is banned — untraceable to a measurement.@grant none is the target. Every grant comes from the verified set in
patterns.md § 6 — no linter checks grant values, so a typo grants
nothing, silently. Portability: gm-api.md.@match + @noframes by default (patterns.md § 7). @downloadURL /
@updateURL / @installURL are lint-enforced bans (greasyfork.md).javascript_tool has shown
document.querySelectorAll(sel).length === 1 (or the exact count the script expects) on
the page it ships against, and its reachability is known (el.getRootNode() === document,
window.top === window). A shadow root → patterns.md § 11; a cross-frame target → @match the frame's own URL and drop @noframes. A find hit or a screenshot is a lead, never a selector.Authoring is the fallback. Both hosts publish a free, no-auth by-site index, so "has
someone already solved this" is one fetch. Mechanics and the Sleazy Fork split:
greasyfork.md § The shelf check.
https://greasyfork.org/en/scripts/by-site/<domain> for the bare domain
(civitai.com, not www.civitai.com), and Sleazy Fork too if the site is adult-adjacent.@required (rule 1) and must
not be pasted unread. Read it for its measured selectors and its condition, then vendor
with attribution or re-derive.@match), and which state is "good"?select:mcp__claude-in-chrome__tabs_context_mcp,mcp__claude-in-chrome__tabs_create_mcp,mcp__claude-in-chrome__navigate,mcp__claude-in-chrome__javascript_tool,mcp__claude-in-chrome__read_page,mcp__claude-in-chrome__find,mcp__claude-in-chrome__computer,mcp__claude-in-chrome__resize_window,mcp__claude-in-chrome__read_console_messages,mcp__claude-in-chrome__tabs_close_mcp.tabs_context_mcp first (it answers not connected when the extension is down — that
is not shell-probeable, so this call is the probe), then tabs_create_mcp +
navigate to the exact URL. Reuse an operator tab only when asked to.probes.md).dumpSubtree(rootSelector) (probes.md) through
javascript_tool, storing the payload on window. The tool silently truncates
large output, so diff in the page and return only the summary (probes.md § Running on
Claude in Chrome).mediaRules(); note crossOrigin — a high count means the replay route may be
unavailable, and this rail has no engine-side way around it.find or read_page to get
candidates, then prove each with querySelectorAll(sel).length (rule 6). A
computer screenshot shows the human what you mean; it is not the measurement.dumpSubtree on the same root, record innerWidth.resize_window — repeatable and
bisectable. It sets the window, not the viewport: read innerWidth from the probe,
never assume it from the size you asked for.diff(a, b) (probes.md). An empty diff is the finding, not a
failure. Probe 3's own table maps the counts to the three verdicts — DOM-DIFFERS,
DOM-IDENTICAL, STATE-B-UNREACHABLE — and what each one licenses.patterns.md § 5). Reimplementing a state the site
already renders is the classic loss.javascript_tool (a scratch <style> or adopted sheet), check it,
reload, and promote only what survived. A rule that needed !important in the
prototype needs it in the file — one that did not must not carry it.patterns.md, first hit wins: platform
web API → metadata key → granted GM_* → vendored source. Take the navigation, waiting,
CSS-injection and idempotence shapes from there; do not improvise them."${CLAUDE_PLUGIN_ROOT}/scripts/userscript-meta-lint.sh" <file.user.js> # or a directory
node --check, required/banned metadata keys, dotted-numeric @version, minified or bundled
output, and vendored attribution. What it cannot check: patterns.md § 10.
Lint plus geometry is not a gate. A shipped script passed both with its search completely
dead: the button was present, 40x40, on top at its own centre, and inert under a real click —
activeElement stayed BODY. getBoundingClientRect proves a control is present; only
operating it proves it works.
computer (a real
pointer click, never el.click() from javascript_tool), then read the effect with
javascript_tool (document.activeElement, the target's rect, location.pathname).
That is the thing the user came to the site to do, plus anything the script moved, hid or
floated over.javascript_tool, then confirm moved nodes are back at their original parent and
next-sibling.assertEffect() + dumpSubtree and diff against the recorded state B.
Eyeballing is not a check.document-start timing as not run.read_console_messages with a pattern for the script's own log prefix catches a
throw the page swallowed. A computer screenshot or a gif_creator recording is
proof for the operator; the JSON diff is the measurement.greasyfork.md — rulebook, metadata contract, adult-content marking, and how
to make a git push the release without @updateURL.
GM_* plus a settings UI ⇒ STOP.
Ship nothing; propose adopting vite-plugin-monkey as its own change.Bump @version first — dotted-numeric; a same-version re-install is a silent no-op.
Re-measure before re-writing (B–D): the page changed, the recorded measurement did not. Then
re-lint (F), re-install and re-prove (F.5, G).
The operator's profile already runs the old version. Before any live test of the new one,
settle which copy you are measuring: patterns.md § 13.
One-time per profile on Violentmonkey's chrome://extensions details page: Allow User
Scripts (Chrome 138+ requires it; scripts silently never run without it), plus Allow
access to file URLs for a file:// install. An agent cannot flip a toggle or drive the
manager's confirm dialog — that click is the operator's. Why the toggle exists and why policy
cannot set it: gm-api.md.
Iterating without re-installing by hand: Violentmonkey's Track external edits turns each
save into an auto-reinstall plus a tab reload. Setup, and the three silent ways tracking dies
(a git write to the file being the worst): patterns.md § 12.
CDN @require/@resource (patterns.md § 9) · setInterval polling for a URL
or an element (§ 1, § 2) · document + subtree: true on a virtualised list (§ 2) ·
!important escalation to win the cascade (§ 4) · hardcoded generated class names where a
condition exists (§ 5) · shipping a selector from a find hit or a screenshot without a
count (rule 6).
## Userscript report
- **Wish:** (URL + the state asked for)
- **Shelf:** hit-adapted | hit-rejected (why) | empty — (which index/indices were fetched)
- **Measured:** (probes run, `innerWidth` A/B, cross-origin sheet count)
- **Diff verdict:** DOM-DIFFERS | DOM-IDENTICAL | STATE-B-UNREACHABLE
- **Approach:** (attribute set | rules lifted by condition in band X–Y | constructed UI)
- **Selectors shipped:** (each one, with the date measured — or "none")
- **Lint:** ✅/❌
- **Checks ran:** (which F.5/G checks ran on Claude in Chrome; which did not, e.g. document-start timing)
- **Operator action:** (install / toggle / publish — whatever a human must click)
- **Verdict:** SHIPPED | BLOCKED (why) | ESCALATED (vite-plugin-monkey)
probes.md — the four probe bodies, how to run them on Claude in Chrome, the verdict table.patterns.md — reuse ladder, vetted code shapes, live-edit loop.gm-api.md — GM_* portability, @grant asymmetry, metadata traps.greasyfork.md — the publishing rulebook.[F-…] tags in the references cite rows of a facts table that shipped with this plugin's
predecessor; the fact itself is stated beside each tag. The table with its dates and
reproduction recipes: https://github.com/kattakath/skills/blob/f110f8d7780d1bbdd68b9b87824281d2188d8a92/plugins/page-lab/references/facts.md.
Out of scope: delivery (the fleet's own skill), whole-site redesigns
(userscript-lab:site-redesign), and general page diagnosis (Claude in Chrome's own skill).
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kattakath/skills --plugin userscript-lab2 skills in this plugin