agentleFS
jackchukajackchuka/skills/p-violentmonkey-userscript-sync/SKILL.md

p-violentmonkey-userscript-sync

Skill15 starsChanged 9 days agoMITView on GitHub

Edit a Violentmonkey userscript through its cloud sync folder (Dropbox, OneDrive, Google Drive) so the change actually reaches the browser. Use when adding a keybinding, shortcut, or fix to an existing userscript, or when a userscript edit "didn't apply" / "wasn't updated" after syncing. Triggers: "Violentmonkey", "userscript", "user script", "Tampermonkey script in Dropbox", "add a shortcut to my userscript", "ユーザースクリプトに追加", "反映されない".

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is 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.

  • 1

    Very specific

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

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

    If sync still doesn't land (conflict, upload lag), paste directly: pbcopy < /tmp/s.js, then in Violentmonkey open the script editor, select …

    line 80

≈ “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

Violentmonkey Userscript Sync

Violentmonkey's cloud sync folder holds the editable copy of every userscript. Editing the code there is only half the job.

vmscript.py locates the folder itself: --dir wins, then $VM_SYNC_DIR, then the known Dropbox / OneDrive / Google Drive layouts. Never hard-code the path — if detection fails the script says so and lists what it tried.

The failure mode

Violentmonkey decides what to pull by comparing timestamps, not content. If you change a script's code but leave the timestamps alone, the browser sees "no change", keeps its own copy, and pushes the old code back over your edit on the next sync. Nothing errors; the change just silently disappears.

A successful edit must bump all three:

WhereFieldValue
vm@2-<key>props.lastUpdatednow (ms)
Violentmonkey (index)info.<key>.modifiedsame now
Violentmonkey (index)timestampnow + 1

scripts/vmscript.py put does all three. Use it rather than hand-editing JSON.

Folder layout

  • Violentmonkey — index: {timestamp, info: {<key>: {modified, position, enabled, deleted}}}
  • vm@2-<key> — one script: {version, custom, config, props, code}
  • <key> encodes namespace\nname\n with -XX hex escapes (-20 space, -0a newline, -3a colon)

Both are compact JSON. Preserve that: json.dump(..., ensure_ascii=False, separators=(",", ":")).

Workflow

S=scripts/vmscript.py            # in this skill directory

$S list                          # find the script
$S get "Quick Actions" -o /tmp/s.js
# edit /tmp/s.js — bump @version, update @description if the UX changed
$S put "Quick Actions" /tmp/s.js # syntax-checks, writes, bumps timestamps

Then tell the user to sync: Violentmonkey → Settings → Sync → Sync now.

Common mistakes

MistakeConsequence
Editing code onlyEdit is silently reverted on next sync
Pretty-printing the JSONDiff noise; Violentmonkey rewrites it anyway
Skipping node --checkBroken script fails silently in the page
Changing @nameThe sync key is derived from namespace\nname, so a rename orphans the old entry as deleted: true and loses its position/enabled state. Document new shortcuts in @description instead.
Assuming the sync is instantViolentmonkey talks to the cloud provider's API, so the local sync client must finish uploading first

Fallback

If sync still doesn't land (conflict, upload lag), paste directly: pbcopy < /tmp/s.js, then in Violentmonkey open the script editor, select all, paste, save. That writes the browser's copy directly and wins the next comparison.

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.