/hypervibe:add-automationfrom hypervibe
Routes automation needs to the right architecture: scheduled tasks, event-triggered pipelines, background workers, autonomous agents, or personal recurring missions. Helps decide which shape fits before delegating to helper skills.
Ships in hypervibe. 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.
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.
/bootstrap carries 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.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-workflow - finite event-triggered pipelines running INSIDE the app (2-8 known steps, some intelligent through the project's AI brick, bounded duration). The most common shape behind "I want an agent"._create-routine - operator-side recurring AI missions (a routine run by the user's own AI tool on their own account, where that tool can schedule one). Direct user entry: add-routine (thin front over the same engine - when routing from here, call the engine directly)._create-agent - AI-driven processes that are part of the PRODUCT (serve the app's end users) with a true agentic loop or autonomy_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 process in apps/worker/ (free web service by default, paid background worker on request)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 organisation): 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 AI tool runs the mission on a schedule. A routine needs a scheduler that the tool itself provides: when _create-routine is not among the skills available in this session, this tool has none. Say so in one sentence, and do not rebuild one out of app infrastructure (a brief for the operator is not an app job)._create-workflow. This is the MOST COMMON case behind the words "I want an agent": no agent is needed, the app itself runs the chain within a serverless function, every run traced step by step. Check it BEFORE reaching for a full agent._create-agent with the brief. It scaffolds a production agent (Render worker, tools, memory, its own capped key, full traceability). Sample phrasing:What you are describing is an AI agent that is part of your product. I can build it properly: memory between runs, its own capped budget, the tools it may use, a circuit breaker, cost tracking and detailed logs. It gets its own server, separate from your site. Shall I set that up?
Edge cases: a script that calls a model once (no tool loop) inside a simple SCHEDULED job → add-cron territory. The same single call triggered by an EVENT, or chained with other steps → _create-workflow. The decisive criterion for _create-agent is: agentic loop (multi-turn tool use) or autonomy, IN THE PRODUCT - a finite chain, however smart, is a workflow.
You are the only place this routing lives. The forms no longer carry their own routing tables: they trust the brief you hand them, so the decision must be made here, and made once.
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")"
dry=$(node "${CLAUDE_SKILL_DIR}/../../scripts/shared-worker/ensure.mjs" --dry-run)
The 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):
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:_create-routine is available in this session (otherwise this tool cannot schedule a mission: say so, and do not offer one)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._create-workflow) if:CF_OK=true. For an ordinary webhook (Stripe, Telegram at normal volume), prefer an in-app workflow: the app can absorb it, one less deployment._create-render-worker carries the detail.Tell the user, with explicit reasoning:
📋 Recommendation:
Given your need (<1-sentence summary>), I recommend <a Claude routine | add-cron | an in-app workflow | Cloudflare Worker | a Render background process> 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 set up a scheduled task, 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 set up **an intelligent chain inside your app**: 1. The trigger you described () 2. The steps, executed in order, with automatic retry on network hiccups - the intelligent ones call Claude with your own API key 3. A trace of every run, step by step, in your databaseNo new infrastructure, no deployment beyond your app itself. Setup in ~5-10 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`: a route of your site wakes the service at the chosen times (Render free has no clock of its own)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.
Invoke the _create-workflow skill with the brief (TRIGGER, STEPS and which are intelligent, VOLUME, NAME). It handles its own scaffolding, duration gate, CLAUDE.md section and summary - when it returns, go straight to Step 7 (skip Steps 5 and 6, already covered).
_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.Invoke _setup-render (idempotent - ensures RENDER.api_key is in the vault)
Invoke _convert-to-turborepo (idempotent)
Invoke _create-render-worker. It scaffolds a web service on the free plan by default, exposing POST /run. If the discovery established that the process must never stop, say so when invoking it: it then switches to type: worker + plan: starter and drops the HTTP layer.
If the user needs scheduled execution → once _create-render-worker has returned with the relay wired (its Step 6: the service's address and its secret are on the site), invoke add-cron for the schedule, like any task of the site. Then put the relay _create-render-worker handed back in place of the // YOUR CRON LOGIC HERE line of the route add-cron created, and commit that route by name. Tell the user explicitly:
Render has no clock of its own on the free plan, so the schedule comes from your shared clock: it calls a route of your site, and that route wakes the service, with a secret only the two of them know. The call is also what wakes the service up, which is exactly the point: it sleeps the rest of the time and costs nothing.
The shared clock only ever calls the project's own site: never register the service's address on it.
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 web service (free) | Render background worker (paid)>
- **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 a Render background process, 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.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub flavien-ia/hypervibe-craft --plugin hypervibe90 skills in this plugin
/accessibilityAccessibility audit of a Next.js app: reads the code (images, buttons, links, form fields, keyboard, focus, zoom, motion), measures the live pages with PageSpeed Insights, explains each problem plainly, then applies the fixes the user approves./add-2faAdd two-factor authentication (2FA TOTP) to an existing T3 project's login. Orchestrator - asks which authenticator app the user wants, detects whether the project uses admin auth (single fixed login) or user accounts, and delegates to the right setup. Admin mode - 2FA is mandatory for the single admin, secret + backup codes stored in the Bitwarden vault. User mode - 2FA is optional per user, each user enables it from their account page, secrets + backup codes stored per-user in the database. Requires the project to already have hypervibe auth (`/add-auth`)./Other plugins' skills for the same job