agentleFS
wormeymanwormeyman/wormeyman-skills/skills/cloudflare-migration-sweep/SKILL.md

cloudflare-migration-sweep

Skill4 starsChanged 11 days agoMITView on GitHub

Use when asked which repos still need a Cloudflare migration or deprecation fix - a Cloudflare migration guide or changelog post (vitest-pool-workers to vitest-plugin, Miniflare 2, unstable_dev, Wrangler v1 or v3, Workers Sites, Pages to Workers, next-on-pages, pages-action, workers-types, deprecated Workers AI models, legacy KV routes, Service Keys, an API end-of-life date), or "find all my projects that use X" across every repo and org a GitHub account can reach.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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. Distinctive:

    Check the catalog's build date against today.

    line 32
  2. Very specific:

    Search the repo's issues first (gh issue list --state all --search ...).

    line 64
  3. Distinctive:

    Run the type check and read its warnings, not just its errors.

    line 77

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

Cloudflare migration sweep

Find every repo that still needs a Cloudflare migration, across a whole GitHub account and its orgs, then decide which findings are real before filing anything.

Do not use GitHub code search for this

gh search code does not return every private repo, and says nothing about the ones it skipped. In the sweep that produced this skill it returned zero hits for a private repo whose package.json, tsconfig.json and vitest.config.ts all used the package being searched for. An empty result looks exactly like a clean account. Clone and scan instead - it is faster than it sounds (93 repos, 1.75 GB of history: 30 s to shallow-clone, 6 s to scan).

Run it

Scratch space only - never point --dest at a folder that holds real work.

python3 scripts/fetch_repos.py --dest <scratch>/cf-sweep   # you + all your orgs; --owner to narrow
python3 scripts/scan.py --dest <scratch>/cf-sweep          # summary; --jsonl for file:line; --repo owner/name

fetch_repos.py refreshes existing clones on re-run, so a second sweep reads current code. scan.py groups hits per repo by tier and catalog entry. Entry numbers index references/catalog.md: docs link, the fix, and any deadline. Check the catalog's build date against today; if it is months old, refresh it (instructions at its top) before trusting a clean result.

For one specific guide the user pasted, find its entry in the catalog. If it is not there, add a rule to scan.py and an entry to the catalog first.

Triage every hit before reporting

The scan finds text. These are the ways text lies, all seen in real sweeps:

OutputWhat it usually is
"Every hit is in a comment" section, or <- every hit is a comment lineA note about a migration already done. Open one to confirm, then drop it.
Tier reviewA pattern shared with non-Cloudflare tools (CF_API_KEY is flarectl's too; addEventListener('fetch') is also a PWA). Read each.
[archived]Cannot take issues. Report it; do not file.
[fork]Probably upstream's code. Report it; ask before filing.
[collaborator]Someone else's repo. Report it; ask before filing there.
Tier optionalCloudflare recommends it; nothing breaks. Report separately and let the user choose.

Then read every repo in the "read these by hand" list at the end of the summary. Those mention Cloudflare but matched no rule, which is where the misses are: a deploy documented only in a README, a script type the rules do not cover, a pattern nobody has written a rule for yet. When a miss turns out to be real, add the rule to scan.py so the next sweep catches it.

The scan reads each repo's default branch only. It cannot see other branches, or account-level state: Service Keys used by other tools, Vectorize V1 indexes, D1 alpha databases, dashboard-built Pages projects. Say so in the report rather than implying a clean account.

Before filing

  • Search the repo's issues first (gh issue list --state all --search ...). A planned migration often already has one.
  • Separate required (removed, deprecated, or dated) from optional in the report, and put the optional ones to the user as a choice.
  • Give file:line on the default branch at a named commit, the exact change, and a "done when" the next person can check.

When doing the migration

  • Cloudflare codemods replace names inside comments too, so a comment can end up describing a version that never existed. Read the whole diff, not just the code lines.
  • The new package's types may flag further deprecations the old one did not. Run the type check and read its warnings, not just its errors.
  • A lockfile allowScripts (or pnpm onlyBuiltDependencies) that names workerd@<exact version> needs the new version, or its install script is skipped.

compatibility_date is not a migration

Old dates are supported forever. Raising one turns on every runtime behavior change dated in between, in production, on the next deploy - so it is its own change, never bundled with a package migration.

The local test runtime caps it: the Vitest plugin bundles one workerd, and a date newer than that build knows fails every test with ERR_FUTURE_COMPATIBILITY_DATE (or ERR_RUNTIME_FAILURE on older plugins). Find the cap by trying the date and the day after. To see what a raise turns on, read src/workerd/io/compatibility-date.capnp at the workerd tag in use (compatEnableDate and impliedByAfterDate lines) - it can be ahead of the docs page.

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.