From hypervibe
Add an automation - scheduled task, background process, long-running worker, webhook handler, heavy computation, or a personal recurring AI mission. Acts as a smart orchestrator: discovery phase to understand the user's actual need, infers whether the job belongs to the APP (runs on the app's infrastructure: cron via /add-cron, Cloudflare Worker, or Render Background Worker) or to the OPERATOR (a Claude routine on the user's own account via _create-routine), recommends with plain-words reasoning, and delegates to the right sub-skill after validation. Optionally converts the project to Turborepo when a dedicated worker is needed.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hypervibe:add-automationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```bash
wrangler (to be done BEFORE any other wrangler command in this skill)eval "$(node "${CLAUDE_SKILL_DIR}/../../scripts/wrangler-env-init.mjs")"
This line loads CLOUDFLARE_API_TOKEN from the User scope (Windows registry / shell rc on Mac/Linux) if it is not in process.env, and adds the pnpm bin to the PATH (for bash sessions where pnpm setup has not yet propagated). Without it, wrangler fails with "command not found" on Mac (Spotlight), or may use a different Cloudflare account than the one the user expects.
You help the user add an automation: to their project, or to their own toolkit.
This skill is mostly orchestration. Your job is:
You will rarely write code yourself in this skill - you delegate to:
add-cron - scheduled tasks that fit in a Vercel function (< 60s, stateless). Uses the unified shared hypervibe-jobs worker by default (1 Cloudflare slot for everything)._create-routine - operator-side recurring AI missions (a Claude routine on the user's own account)add-agent - AI-driven processes that are part of the PRODUCT (serve the app's end users)_setup-wrangler - installs Wrangler CLI if missing_setup-render - ensures the Render API key is in the vault (Render via REST API, no CLI)_convert-to-turborepo - converts the project to a monorepo (idempotent)_create-cloudflare-worker - scaffolds and deploys a Cloudflare Worker in apps/worker/_create-render-worker - scaffolds a Render Background Worker in apps/worker/Every automation belongs to one of two worlds, and mixing them up is the one unforgivable routing mistake:
A job of the APP - its output feeds the app or its end users: cleaning the database, sending emails to customers, syncing data the app displays, processing user uploads, webhooks. It must keep running no matter what happens to the operator's tools or subscriptions → it runs on the app's infrastructure (cron, Cloudflare Worker, Render).
A job of the OPERATOR - its output is for the user themselves (or their team): a morning brief, a weekly analysis, a watch that alerts them, a report, a triage with proposals. It is personal tooling → it runs as a Claude routine on the user's own account (their personal AI doing recurring work for them).
Read the beneficiary of the output in the user's phrasing:
Ask ONLY when genuinely ambiguous (e.g. "a weekly report" - for whom?). One short question:
This report, is it for you (your own tracking), or is it something your app sends to its users?
When the user describes a process that must understand / interpret / decide / write (mentions AI, Claude, GPT, agent, or uses verbs like analyze, summarize, classify, judge, draft, reason), combine it with the app/ops split:
_create-routine. This is the sweet spot of routines: no infrastructure at all, the user's own Claude runs the mission on a schedule./add-agent, which scaffolds a production agent (Render worker, tools, memory, budget caps, full traceability). Sample phrasing:What you are describing is an AI agent that is part of your product. I have a dedicated command,
/add-agent, that is built for this: it asks the right questions (Claude model, memory between runs, budget cap, tools) and scaffolds a clean agent with a circuit breaker, cost tracking, and detailed logs. Shall I hand off to/add-agent?
Edge cases: a script that calls Claude once (no tool loop) inside a simple app cron → that is /add-cron territory, not /add-agent. The decisive criterion for /add-agent is: agentic loop (multi-turn tool use) or autonomy, IN THE PRODUCT.
First make sure the vault is unlocked (follow _ensure-vault): node "${CLAUDE_SKILL_DIR}/../../scripts/vault/vault.mjs" status → if locked/expired, run launch.mjs unlock; if the vault does not exist, delegate to _add-keyring.
Then ensure the unified shared worker is provisioned (idempotent, fast when already there):
eval "$(node "${CLAUDE_SKILL_DIR}/../../scripts/wrangler-env-init.mjs")"
result=$(node "${CLAUDE_SKILL_DIR}/../../scripts/shared-worker/ensure.mjs")
ok=true → CF_OK=true (+ keep WORKER_URL, dir, jobs). If status=created, one sentence to the user: "I set up your shared clock, a single mechanism that will serve all your projects (scheduled tasks, database backups, quota watch)."ok=false → CF_OK=false. Cloudflare is not usable on this machine: the cron option degrades to the GitHub clock, and the Cloudflare Worker option disappears from the recommendations. Suggest /start to enable Cloudflare when relevant. Do not abort - Render, GitHub and routines remain available.Never estimate Cloudflare state from memory. If you need per-worker details (rare), run count-cf-cron-slots.mjs.
Tell the user:
Before configuring anything, I need to understand what you want to do.
Describe your need in a few sentences: what this automation will do, how often it should run, and anything else that seems important to you.
Wait for the user's response. Read it carefully. Apply the app/ops inference and the AI routing rule from the sections above BEFORE anything else: if it is clearly an ops mission or a product AI agent, short-circuit to the corresponding branch of Step 3.
Analyze the user's description against these dimensions:
| Dimension | Possible values | Why it matters |
|---|---|---|
| Beneficiary | the app / its users, or the operator | The FIRST split: infrastructure vs routine |
| Execution pattern | event-driven (webhook, API), scheduled (cron), continuous (24/7 polling/streaming) | Determines cron vs worker |
| Load | light (< 60s, < 100MB RAM), heavy (CPU/RAM intensive, large files, generative AI, transcoding) | Determines whether a Vercel function is enough or a dedicated worker is needed |
| Frequency (if scheduled) | Daily, hourly, sub-minute, irregular | Determines the required precision |
| Persistent state | Stateless, stateful (internal queue, memory between runs, persistent websocket) | Stateful = necessarily a worker, never a cron |
If the user's description already covers all these dimensions clearly, skip to Step 3.
If something is ambiguous, ask at most 3 short, targeted questions. Examples:
Rule: no more than 3 questions. If after that it is still unclear, recap what you have understood and ask the user to confirm/correct in one sentence.
Based on what you've learned, choose ONE architecture using these heuristics:
_create-routine) if:add-cron if:add-cron registers the schedule on the unified shared hypervibe-jobs worker by default (one Cloudflare slot for all projects), with a GitHub fallback when Cloudflare is absent.CF_OK=true.Tell the user, with explicit reasoning:
📋 Recommendation:
Given your need (<1-sentence summary>), I recommend <a Claude routine | add-cron | Cloudflare Worker | Render Background Worker> because:
- <reason 1>
- <reason 2>
- <reason 3>
⚙️ What I am going to do concretely
I am going to set up a **routine**: a mission that your own Claude runs for you on a schedule. No infrastructure, no code in your project: we write the mission together, we choose the schedule, and your Claude takes care of the rest. Two honest things to know before you say yes: 1. It runs on **your Claude account** (it consumes a bit of your subscription usage, and stops if your subscription stops - which is fine, because this mission serves you, not your app). 2. Depending on your setup it runs either in the cloud (works even with your computer off) or on this computer while the Claude app is open - I will tell you which. I am going to run the `add-cron` skill, which will: 1. Create a protected `/api/cron` route in your Next.js app 2. Register the schedule on your shared clock (a single mechanism serving all your projects), which will call this route at the right time 3. You will only need to edit the route to put your business logic in itNo monorepo needed. Setup in ~5 minutes.
I am going to: 1. Install Wrangler CLI (the Cloudflare CLI) if not already done 2. Convert your project to a Turborepo monorepo (the worker will live in `apps/worker/`) 3. Create the worker with `wrangler init` and configure the base code 4. Enable the native CRON triggers in `wrangler.toml` on the `` schedule 5. Deploy the workerSetup in ~5-10 minutes depending on the installs.
I am going to: 1. Make sure your Render API key is in the vault (to be generated on dashboard.render.com if needed) - Render is driven via its API, no CLI to install 2. Convert your project to a Turborepo monorepo (the worker will live in `apps/worker/`) 3. Create the worker code with a "long-running process" template 4. Generate `render.yaml` and guide you to create the service via the Render dashboard 5. Configure the scheduled runs via `add-cron` (Render free does not have native CRON)Setup in ~10-15 minutes depending on the installs and the Render deployment.
Do you validate this approach? If you prefer another option, tell me which one and why.
Wait for explicit user validation before continuing.
If the user disagrees with the recommendation, listen to their reasoning. They may have constraints you didn't know about (cost, existing infrastructure, personal preference). Adjust the recommendation accordingly. If the user is convinced of an option that's clearly wrong for their use case, push back politely once, but ultimately respect their choice. The ONE exception where you insist harder: an app-critical job on a routine (explain that their app would silently break if their Claude subscription stopped, and that the shared clock costs them nothing anyway).
add-cronInvoke the add-cron skill. When it returns, skip to Step 5.
_setup-wrangler (idempotent - returns immediately if Wrangler is already installed and authenticated)_convert-to-turborepo (idempotent - returns immediately if already a monorepo)_create-cloudflare-worker with parameters:
NEEDS_CRON=yes if the user needs scheduled execution, otherwise noCRON_EXPRESSION=<5-field cron> if NEEDS_CRON=yesadd-cron - Cloudflare handles CRON natively via wrangler.toml triggers, which _create-cloudflare-worker already configures._setup-render (idempotent - ensures RENDER.api_key is in the vault)_convert-to-turborepo (idempotent)_create-render-workeradd-cron after the worker is up. Tell the user explicitly:
The Render free tier does not support native CRON. For scheduled runs, I am going to use your shared clock (via
add-cron) which will call an HTTP endpoint. This endpoint lives in your Next.js app (apps/web/src/app/api/cron/route.ts) - it is the one that then has to trigger work in the worker, either by publishing a message to a shared queue, or by directly calling an HTTP route of the worker if it exposes one.
Invoke _create-routine with the goal and cadence gathered during discovery. It handles: mechanism detection (cloud/local), the honest warnings, the self-contained mission prompt (validated by the user), creation and verification. When it returns, skip to Step 5 (routine variant).
Branches A/B/C - invoke _update-claude-md with:
custom:
## Worker- **Rôle métier** : <résumé en 1-2 phrases de la description fournie en Step 1>
- **Type** : <add-cron | Cloudflare Worker | Render Background Worker>
- **Emplacement** : <`apps/web/src/app/api/cron/route.ts` | `apps/worker/`>
- **Schedule** : <cron expression if applicable, sinon "event-driven" ou "continuous">
- **Logique implantée** : <oui (implantée pendant /add-automation) | non (placeholder // TODO à compléter)>
- **Dev local** : <`pnpm dev` | `pnpm --filter=worker dev`>
- **Logs** : <`wrangler tail` (cron) | `pnpm --filter=worker tail` | dashboard Render>
If the project was just converted to a monorepo (Branch B or C), also invoke _update-claude-md with:
conventions:
- Monorepo: import shared code from \@<PROJECT_NAME>/db` (ou autres packages). Jamais de chemin relatif cross-app.`- Worker dev: \pnpm dev --filter=worker``Branch D (routine) - invoke _update-claude-md with:
custom:
## Routines (opérateur)- **<routine-id>** - <schedule in plain words> - <1-sentence mission>. Tourne sur le compte Claude de l'opérateur (<cloud | local>), PAS sur l'infra du projet. Gestion : demander à Claude ("mets ma routine en pause", "change l'heure").
The worker infrastructure is in place but the code only contains an empty // TODO. Offer the user to implement it right away or later:
The worker infrastructure is running ✅ with an empty placeholder (
// TODOcomment). For the business logic, two options:
- (a) You describe it to me in detail now and I implement it (15-30 min depending on complexity). You end up with a worker that really does what you want, ready to use.
- (b) You replace the
// TODOyourself as you go. The infrastructure stays in place, you can come back to it whenever you want.
If the user chooses (a):
apps/worker/src/index.ts for CF/Render, or apps/web/src/app/api/cron/route.ts for cron) and replace the // TODO with the real logic. Include: clean error handling, informative logs, and if relevant, DB persistence (reuse @<project>/db if available).Logique implantée : oui.If the user chooses (b):
// TODO as is.Logique implantée : non (placeholder // TODO à compléter).(Branch D has no placeholder: the mission prompt IS the logic, and it was validated inside _create-routine.)
If the branch chosen in Step 4 is Render Background Worker, add Render to the project's RGPD subprocessor registry:
node "${CLAUDE_SKILL_DIR}/../../scripts/update-privacy-policy.mjs" --add render
Why conditional: Cloudflare Workers and GitHub Actions do not store user data persistently (ephemeral stateless execution). Render hosts a long-running process, which in fact can manipulate/cache user data - declaring it as a subprocessor is more cautious. A Claude routine processes the OPERATOR's data on their own account, not the app users' data - nothing to declare either.
The helper is idempotent. If the politique-de-confidentialite/page.tsx page exists (created by /bootstrap), it updates automatically.
Tell the user a concise recap. Adapt based on the branch taken AND based on whether the logic was implemented in Step 6:
✅ <Worker in place | Routine in place>
Chosen architecture: Setup completed: <list of main actions: monorepo created, worker deployed, routine created with next run time, etc.>
If the logic was implemented in Step 6:
🎯 Business logic implemented - your worker now does
<1-sentence summary>. You can test it locally with<dev command>or check the logs with<logs command>.
If the logic was deferred:
Next steps
Edit
apps/web/src/app/api/cron/route.ts(orsrc/app/api/cron/route.tsif no monorepo) and replace the// TODOwith your business logic.Edit
apps/worker/src/index.tsand implement your logic in the<scheduled | fetch>handler. Redeploy withpnpm --filter=worker deploy.Edit
apps/worker/src/index.tsand replace the// TODOloop with your real logic. On every push tomain, Render will automatically redeploy the worker.You can also ask me to implement it later - I already know the intended business role (noted in
CLAUDE.md→ "Worker").
If Branch D (routine):
Your routine is active: <mission in 1 sentence>, , next run <date/time>. To manage it, just tell me: "pause my routine", "change the schedule", "show me its last run", "delete it".
If you change your mind about the architecture later, just run
/add-automationagain.
npx claudepluginhub flavien-ia/hypervibe-harness --plugin hypervibeAdd a scheduled task (CRON) to an existing Next.js project. Creates a protected /api/cron/<task-name> route and registers the schedule on the right clock - by default the unified shared Hypervibe worker (hypervibe-jobs, precise to the minute, zero extra Cloudflare slot), a dedicated Cloudflare Worker only when the task needs isolated resources, or a GitHub Action as the no-Cloudflare fallback. Can be called by /bootstrap, by /add-automation, or standalone.
Automates tasks with cron jobs, webhooks, GitHub Actions, Makefiles, Taskfiles, scripts, and CI/CD pipelines. Adds error handling, locks, idempotency, dry-runs, and logging to existing or new setups.
Manages scheduled Claude Code tasks: add recurring/one-off skills/prompts/scripts, list/pause/resume/remove, view results/logs, test execution with safety controls and notifications. Cross-platform (macOS/Linux/Windows).