_migrate-workers
Skill44 starsChanged 57 days agoApache-2.0View on GitHub
Internal helper invoked by /start. One-time migration for users coming from a Hypervibe version older than 2.5: consolidates the old separate background mechanisms (db-backup, quota-monitor, cron-dispatcher, each a loose Cloudflare worker) into the new unified shared worker hypervibe-jobs (one worker, one cron slot, git-versioned registry). Self-detecting and safe: if there is nothing legacy on the machine it does nothing. Nothing is deleted without explicit consent, and the old mechanisms keep working until the new one is deployed and verified. Not meant to be invoked directly by users (they just re-run /start). Transitional helper, will be removed in a future version once everyone has migrated.
- Reads credentials
In this repository88 other files it gives its agents.
- accessibilitySkill
- add-2faSkill
- add-agent-dashboardSkill
- add-aiSkill
- add-analyticsSkill
- add-authSkill
- add-automationSkill
- add-backup-dbSkill
- add-collabSkill
- add-cronSkill
- add-dark-modeSkill
- add-dbSkill
- add-domainSkill
- add-emailSkill
- add-github-authSkill
- add-google-authSkill
- add-i18nSkill
- _add-keyringSkill
- add-mapSkill
- add-notification-centerSkill
- add-push-notificationSkill
- add-pwaSkill
- add-roleSkill
- add-routineSkill
- add-storageSkill
- add-stripeSkill
- add-testSkill
- bootstrapSkill
- _check-depsSkill
- cleanSkill
- _collect-secretSkill
- _convert-to-turborepoSkill
- _create-agentSkill
- _create-cloudflare-workerSkill
- _create-contact-pageSkill
- _create-render-workerSkill
- _create-routineSkill
- _create-workflowSkill
- delete-projectSkill
- _detect-project-rootSkill
- _dns-brevoSkill
- _dns-cloudflareSkill
- _dns-gandiSkill
- _dns-godaddy-manualSkill
- _dns-hostingerSkill
- _dns-infomaniak-manualSkill
- _dns-ionos-manualSkill
- _dns-namecheapSkill
- _dns-ovhSkill
- _dns-porkbunSkill
- _dns-resendSkill
- _dns-squarespace-manualSkill
- eco-auditSkill
- _ensure-aiSkill
- _ensure-vaultSkill
- _generate-secretSkill
- geoSkill
- _get-secretSkill
- gscSkill
- _hash-passwordSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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
- Distinctive: line 15
Use plain, non-technical business language.
- Distinctive: line 17
NEVER ask the user to type shell commands.
- Distinctive: line 26
Every script here is idempotent: on any failure, fix the cause and re-run.
- Distinctive: line 94
Do not continue until a verification passes.
- Very specific: line 110
If the user prefers NOT to decommission yet: fine, stop here.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.
Files
_migrate-workers - Consolidate the old background mechanisms into the shared clock (internal)
Invoked by /start when it detects legacy background workers on the machine. Users never call this directly: the user-facing instruction is simply "re-run /start".
Communication
- Detect the user's language from the conversation (the user's own messages, anywhere in the session - not just this invocation: a bare slash command like
/bootstrapcarries no language signal by itself). If nothing in the conversation gives a signal, fall back to the OS locale (node -e "console.log(Intl.DateTimeFormat().resolvedOptions().locale)") before defaulting to English. ALWAYS reply in that language for every user-facing message: questions, progress, confirmations, summaries, errors - including any example text quoted in this skill, which is illustrative and must be translated, never sent verbatim. - Use plain, non-technical business language. Never expose internal script names (*.mjs) or jargon; describe actions in human terms.
- Show progress as a short natural-language checklist (in-progress and done states).
- NEVER ask the user to type shell commands. You run everything; they only answer questions.
What this does (say it simply if asked)
Older Hypervibe versions could set up to three separate background mechanisms on the user's Cloudflare account: database backups, quota alerts, and scheduled task triggers. Version 2.5 unifies all three into ONE mechanism ("your shared clock", technically hypervibe-jobs), living in a small git-versioned folder, using a single Cloudflare cron slot in total. Same schedules, same behavior, safer bookkeeping, and it frees up to 2-3 slots.
Safety rails (absolute)
- NOTHING legacy is modified or deleted until the new mechanism is deployed AND verified with a real run.
- Decommission (Step 6) happens ONLY after explicit user consent, never silently.
- Every script here is idempotent: on any failure, fix the cause and re-run. The legacy mechanisms keep working the whole time.
Step 1 - Detect what needs migrating (do this FIRST, before anything)
for d in ~/.db-backup-worker ~/.quota-monitor-worker ~/.cron-dispatcher; do
[ -f "$d/wrangler.toml" ] && echo "LEGACY: $d"
done
[ -f ~/.hypervibe-jobs/jobs.js ] && echo "UNIFIED: present"- No
LEGACY:line then there is nothing to migrate. Tell the user, in one friendly sentence, that everything is already up to date (fresh install, or already migrated) and STOP here. Do not run any of the following steps. (This is the expected result for anyone who never used a pre-2.5 version.) - One or more
LEGACY:lines then continue. List them to the user in plain words (which of the three old mechanisms they have) and tell them you will consolidate them, safely, step by step.
Step 2 - Prerequisites
The migration reads the Cloudflare token (and the Neon/Brevo keys, for backups/quota) from the vault. Ensure it is unlocked (follow _ensure-vault): node "${CLAUDE_SKILL_DIR}/../../scripts/vault/vault.mjs" status then if locked/expired, run launch.mjs unlock (tell the user a window is opening for their master password); if the vault does not exist, delegate to _add-keyring. Then load the Cloudflare env + PATH:
eval "$(node "${CLAUDE_SKILL_DIR}/../../scripts/wrangler-env-init.mjs")"Step 3 - Provision the unified shared clock (idempotent)
node "${CLAUDE_SKILL_DIR}/../../scripts/shared-worker/ensure.mjs" --dry-runThe dry run changes nothing and says whether the real run would deploy: status: "not-scaffolded" (first setup, the clock would be created and deployed), "would-deploy" (the clock is behind or missing on the account; reasons says why), or "in-step" (nothing would change). In step: do not run the real command, treat the dry run's JSON as the provisioning result (it carries dir, workerName, workerUrl, jobs; read its status as already_present). Otherwise, say in one sentence what is about to happen on the user's Cloudflare account, then run the real command below; the guardrail asks for confirmation at that moment, and that question is the user's yes (outside review, 3.1.6):
node "${CLAUDE_SKILL_DIR}/../../scripts/shared-worker/ensure.mjs"Parse the JSON. Expect ok: true (status: "created" or "already_present"). Keep workerUrl. On ok: false, stop and explain the howTo in plain words (usually: run /start to enable Cloudflare).
Step 4 - Carry over the legacy configurations
node "${CLAUDE_SKILL_DIR}/../../scripts/shared-worker/migrate-live.mjs" --put-secretsParse the JSON:
migrated- what was carried over (backup targets, quota config, scheduled pings). Recap it in plain words.skippedentries about mechanisms the user does not have are NORMAL, not errors.uploadedSecrets/missingSecrets- with--put-secretsthe Neon/Cloudflare/Brevo keys are uploaded from the vault automatically. If anything remains inmissingSecrets, follow the guidance in the output.pingSecretsToReupload(only when an old cron-dispatcher existed) - these secret VALUES cannot be read back from Cloudflare. For each name (e.g.CRON_SECRET_MYAPP), the value lives in the matching project's.envfile underCRON_SECRET. If you know where that project is, upload it from there: the value goes from that.envto the Worker without passing through the conversation, and nothing is sent when it is absent:
Otherwise ask the user where that project's folder is. Until a secret is uploaded, that specific scheduled task is skipped with a harmless log line, nothing crashes. Tell the user which ones still need their key.V=$(node "${CLAUDE_SKILL_DIR}/../../scripts/env-value.mjs" --project-dir "<that project's folder>" CRON_SECRET) && [ -n "$V" ] \ || { echo "CRON_SECRET is not in that project's .env: nothing was uploaded."; exit 1; } cd ~/.hypervibe-jobs && printf '%s' "$V" | npx wrangler secret put <NAME>
Step 5 - Verify before touching anything legacy
ADMIN=$(node "${CLAUDE_SKILL_DIR}/../../scripts/_read-user-env.mjs" HYPERVIBE_JOBS_ADMIN_TOKEN)
printf 'header = "Authorization: Bearer %s"\n' "$ADMIN" | curl -s --config - "<workerUrl>/status"Check every migrated job is listed with the right schedule (nextDue populated). Then force a real run of ONE migrated job and verify its effect. If workerUrl is null (controlPlane: "off": the account has no workers.dev address), these two calls cannot answer: verify through cd ~/.hypervibe-jobs && npx wrangler tail at the next scheduled run instead, and say so.
- If backups were migrated:
printf 'header = "Authorization: Bearer %s"\n' "$ADMIN" | curl -s --config - -X POST "<workerUrl>/trigger?name=neon-backups&target=<one migrated target>"(one database: all of them at once is refused beyond ten), wait ~30 seconds, then verify via the Neon API that a fresh branch namedbk-<project>-r-<today>exists on that target (Neon key from the vault). This is the strong proof. - If only scheduled tasks were migrated: trigger one ping job the same way and confirm the target endpoint answered (or watch
cd ~/.hypervibe-jobs && npx wrangler tailwhile triggering).
Do not continue until a verification passes. If it fails, say so honestly, LEAVE the legacy mechanisms in place (they still work), and troubleshoot.
Step 6 - Decommission the old mechanisms (with explicit consent)
Show the user what will be removed and why it is now safe (the shared clock is deployed and verified; this frees their Cloudflare slots). Ask for an explicit yes. Then run the exact commands from the migration output's decommission_after_verification (a worker deletion in each legacy folder), and ARCHIVE the folders rather than deleting them:
# for each legacy folder that existed (uses today's date):
D=$(date +%Y-%m-%d)
[ -d ~/.db-backup-worker ] && mv ~/.db-backup-worker ~/.db-backup-worker-decommissioned-$D
[ -d ~/.quota-monitor-worker ] && mv ~/.quota-monitor-worker ~/.quota-monitor-worker-decommissioned-$D
[ -d ~/.cron-dispatcher ] && mv ~/.cron-dispatcher ~/.cron-dispatcher-decommissioned-$DTell the user the archived folders can be deleted after a few healthy cycles (for example after the next 1st-or-15th backup run).
If the user prefers NOT to decommission yet: fine, stop here. Warn them that until they do, the old and new mechanisms both run (duplicate backups each cycle, and the freed Cloudflare slots stay occupied), and they can re-run /start any time to finish.
Step 7 - Final recap (plain words)
Summarize: what was migrated, what was verified (with the concrete proof, e.g. "a fresh backup was created a minute ago"), how many Cloudflare slots were freed, where the shared clock lives now (~/.hypervibe-jobs/, versioned and safe), and how to interact with it from now on: just ask Claude ("show my scheduled tasks", "run a backup right now", "change the quota alert threshold"). No further action is needed unless some pingSecretsToReupload remain.
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
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.

