From hypervibe
Scaffold an autonomous AI agent into the user's project. The agent runs on Render Background Worker, uses Anthropic Claude (Sonnet 4.6 by default) with prompt caching, has tools (http-fetch, send-email, db-query by default; more added based on the agent's job), optional Postgres KV memory, a daily/monthly cost circuit breaker (default 5 USD/day, 50 USD/month - kills runs over budget and emails the admin), and persists every invocation + every loop turn to Postgres for full traceability. Use this when the user wants an LLM-driven process that is part of the PRODUCT (serves the app or its end users), decides actions, uses tools, and optionally has memory - distinct from /add-automation which handles non-AI background processing. When the mission is actually a personal recurring task for the OPERATOR (a brief, a watch, a weekly analysis for themselves) at a cadence of 1 hour or more, the discovery short-circuits to the much lighter _create-routine (a Claude routine on the user's own account, zero infrastructure). Discovery phase asks ~5 questions about the agent's job (goal, trigger, memory needs, model, budget) then runs setup-agent.mjs to scaffold and deploy. NOT for chatbots (real-time per-user UI agents) - those need a dedicated /add-chatbot skill (not yet built). Suitable for: continuous background agents (email surveillance, monitoring), cron-driven product agents, and on-demand agents (triggered manually from a dashboard).
How this skill is triggered — by the user, by Claude, or both
Slash command
/hypervibe:add-agentThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
```bash
# Detect the project's root organization
node "${CLAUDE_SKILL_DIR}/../../scripts/wrangler-env-init.mjs" 2>/dev/null
(Not strictly required for add-agent, but handy if you hit a case where Wrangler is needed - typically not.)
You help the user set up an AI agent in their project. You ask few questions (max 5 needed), and you do the scaffolding + deployment work for them.
The deterministic code (scaffold templates, install deps, push schema, etc.) lives in scripts/setup-agent.mjs. This SKILL:
_create-routine when the mission is operator-side and low-frequency - see Q1.bis)_convert-to-turborepo if the project is not a monoreposetup-agent.mjs with the right argsThis skill reads the Anthropic key (and often Render/Cloudflare) from the vault → first, make sure it 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.
Check up front that the ground is OK before asking questions.
Invoke _detect-project-root to get PROJECT_NAME, WEB_DIR, IS_NEXTJS, IS_MONOREPO. If IS_NEXTJS=no → explain to the user that a Next.js project is required (run /bootstrap first).
The agent sends emails (failures, daily digests, etc.) - email MUST be configured, otherwise error notifications won't go out.
node "${CLAUDE_SKILL_DIR}/../../scripts/check-deps.mjs" email
If email_ok = false → stop and tell the user:
For an agent to be able to send you emails (error alerts, budget cap exceeded, its own emails if it sends any) - I need you to have email sending configured on your project. Run
/add-emailfirst, then come back here. It takes ~3 min.
The agent persists its invocations + turns + memory to the DB.
node "${CLAUDE_SKILL_DIR}/../../scripts/check-deps.mjs" db
If db_ok = false → ask the user:
An agent stores its execution history and its memory in a database. You don't have a database configured yet. Do you want me to run
/add-dbnow to set one up before continuing? (takes 1 min)
If yes → invoke /add-db, wait, come back here. If no → explain that we can't continue without a DB and stop.
You ask the questions one by one, in simple language. The answers fill the args for setup-agent.mjs.
If the user already gave a description as a command argument (/add-agent <description>), skip Q1 and infer the goal from their description.
Describe in one sentence what you want your agent to do. A few examples to inspire you:
- "Every morning at 7am, read my RSS feeds and email me a brief of the important articles"
- "Watch my support emails, and for each email with a simple question, propose a reply as a draft"
- "Once a week, aggregate Stripe + Vercel + Brevo stats and send me a dashboard"
What's yours?
→ Capture as <USER_DESCRIPTION>. Used for Q2 (inferring the trigger), for the system prompt, and for the additional tools.
Look at WHO the mission serves and HOW OFTEN it runs:
Good news: for this kind of personal recurring mission, you don't need any infrastructure at all. I can set it up as a routine: your own Claude runs the mission on schedule (it consumes a bit of your Claude subscription, and it serves you personally - not your app). Zero code, zero hosting, ready in 2 minutes.
The full agent (with its own server, database traces and dashboard) stays the right choice if you want this to run for your app's users, or if you want detailed execution logs you can audit. Which do you prefer, the routine (recommended here) or the full agent?
If the user picks the routine → invoke _create-routine with the goal + cadence, and STOP here (no Step 2-7; _create-routine handles everything including the final summary).
If the user picks the full agent (or the mission is genuinely product-side / continuous / on-demand for a team) → continue with Q2.
Infer a default from the description, but ask for confirmation:
Based on what you describe, your agent would be triggered: [INFER: "at a fixed time (cron)" / "continuously (watches all the time)" / "on demand (you click to launch it)"].
- ⏰ At a fixed time - a cron (every morning 7am, every Monday…)
- 🔄 Continuously - the agent runs 24/7 and reacts to events (incoming emails, webhooks)
- 👤 On demand - you click a "Run" button from the dashboard to trigger it
Which one? (the scaffold will differ slightly: for cron I'll ask you the schedule, for continuous you need an event source, for manual you'll just get the dashboard button.)
→ Capture --trigger: cron | continuous | manual.
If cron → ask a Q2.bis:
At what cadence? (in plain words, I'll translate it into a cron expression)
- Every day at a fixed time (e.g. 7am)
- Every Monday morning
- Every X hours
- Other - specify
→ Capture AGENT_CRON_SCHEDULE (e.g. 0 7 * * * for 7am every day).
→ Also capture AGENT_CRON_PROMPT: a default prompt sent to the agent on each tick (e.g. "Read the RSS feeds and send today's brief."). Infer it from the description.
Should your agent remember things between its runs?
- No, stateless agent - it does its job, forgets everything, starts from scratch each time (the simplest, for cases like "summarize my RSS every morning")
- Yes, structured memory - it retains specific things identified by a key: "who I've already replied to", "the last article I summarized", counters… (a simple table in the database, free)
- Yes, semantic memory (advanced) - it can recall memories by meaning, not by key: "find the memories related to a theme", "search my knowledge base", RAG. Uses Cloudflare Workers AI to compute the embeddings - no new key to create, we reuse your existing Cloudflare token.
→ Capture --memory: none | kv | pgvector.
Recommendation: kv covers 80% of cases. pgvector is useful if the agent needs to do semantic search over hundreds/thousands of memories. If the user hesitates, suggest kv - they can always add vector memory later via a second /add-agent command on the same name.
(This sub-question only comes up if the user chose pgvector at Q3.)
The Cloudflare token created by /start today includes the Workers AI:Read scope (checked in the /start checklist). BUT for older users who created their token before this addition, the scope is missing.
The setup-agent.mjs script runs an automatic smoke test at the start of the patchMemory step: a POST call to the embedding endpoint to verify the scope. If it fails, the script fails with a clear message:
Cloudflare Workers AI smoke test failed. Your token probably lacks the 'Workers AI:Read' scope. Regenerate at https://dash.cloudflare.com/profile/api-tokens and ADD that scope.
If you (Claude) get this error from the script, tell the user:
Your current Cloudflare token doesn't allow using Workers AI (which is needed for semantic memory). No problem, it takes 30 seconds to update it:
- Go to https://dash.cloudflare.com/profile/api-tokens
- Find your "Claude Code" token (created by
/start) → click "Edit"- In Permissions, click "+ Add more" and add: Account · Workers AI · Read
- Click "Continue to summary" → "Save Token"
- Come back here and tell me "done" - I'll re-run the scaffold
No need to regenerate the entire token (so no re-paste to do). Cloudflare lets you edit an existing token to add a scope.
Sonnet 4.6 by default. Ask only if the user has a use case that justifies another:
I use Claude Sonnet 4.6 by default (optimal cost/quality balance). Do you want to switch to:
- Opus 4.7 - max quality, 5x more expensive (justified for complex analysis tasks)
- Haiku 4.5 - 3x faster and 3x cheaper (for simple agents that call few tools)
- Keep Sonnet 4.6 (default, recommended)
→ Capture --model. Map:
claude-sonnet-4-6claude-opus-4-7claude-haiku-4-5-20251001Clear display:
⚠️ Budget guardrail
To avoid an agent that loops costing you 200 EUR overnight, there's an automatic cap: if consumption exceeds the cap, the agent auto-pauses and you receive an email.
Default caps:
- 5 USD / day
- 50 USD / month
Do you want to adjust them?
- Keep the defaults (recommended to start)
- Customize
→ Capture AGENT_DAILY_BUDGET_USD and AGENT_MONTHLY_BUDGET_USD (defaults 5 and 50).
No question - infer a kebab-case slug from the description. E.g.:
rss-digestsupport-email-watcherweekly-stats-reportCheck that no apps/<slug>/ already exists - if it does, suffix it (-2, -3).
Generate a clear system prompt from the description. Format:
You are <NAME>, an autonomous agent. Your goal: <GOAL>.
Triggers: <HOW_TRIGGERED>.
Tools at your disposal:
- <list>
Memory: <stateless|kv table>.
When done with a task, respond with a brief summary of what you did. If you can't accomplish the task, explain why in plain text.
node "${CLAUDE_SKILL_DIR}/../../scripts/_read-user-env.mjs" ANTHROPIC_API_KEY
If the command returns a value that starts with sk-ant-, OK, move to Step 3.
Otherwise, ask the user:
To run the agent I need an Anthropic API key. It's free up to a certain volume, paid beyond that (but the budget guardrail prevents surprises).
- Go to https://console.anthropic.com/settings/keys
- Click "Create Key", give it a name (e.g.
Hypervibe)- Copy the key that appears (starts with
sk-ant-...)- Paste it to me here (I store it locally, never in the repo)
When the user pastes the key:
^sk-ant- + 50+ charsnode "${CLAUDE_SKILL_DIR}/../../scripts/_write-user-env.mjs" ANTHROPIC_API_KEY "<the_pasted_key>"
→ The key is now available for this session AND future ones.
The agent lives in apps/<slug>/ - so the project must be a Turborepo monorepo.
If IS_MONOREPO=no (Step 0.a), invoke _convert-to-turborepo:
To have your agent live alongside your Next.js site, I need to turn your project into a monorepo (just a new
apps/web/folder that contains your site, and you'll be able to have other apps next to it). It's safe and we can roll it back if needed.
Invoke skill: _convert-to-turborepo then re-check IS_MONOREPO=yes before continuing.
Render is driven via its REST API (api.render.com/v1), no CLI to install. Invoke _setup-render (checks/adds the RENDER.api_key key in the vault, idempotent).
node "${CLAUDE_SKILL_DIR}/../../scripts/setup-agent.mjs" \
--name "<SLUG>" \
--description "<USER_DESCRIPTION>" \
--web-dir "<WEB_DIR>" \
--trigger "<TRIGGER>" \
--memory "<MEMORY_MODE>" \
--model "<MODEL_ID>" \
--system-prompt "<GENERATED_SYSTEM_PROMPT>"
The script chains 12 sub-steps (preflight, anthropicKey, ensureMonorepo, scaffoldAgent, patchSystemPrompt, patchAgentName, patchTools, patchMemory, mergeSchema, installDeps, drizzlePush, handoff). Show progress to the user via ↳ <action> then ✅.
{
"success": true,
"agentName": "<slug>",
"agentDir": "apps/<slug>",
"trigger": "cron",
"memory": "kv",
"model": "claude-sonnet-4-6",
"schemaPatched": true,
"warnings": [],
"nextSteps": { ... }
}
Capture this JSON, use it for the final summary (Step 7).
Read the error just above the handoff banner. Diagnose by step:
preflight → bad args (invalid slug, folder already existing) - fix then re-runanthropicKey → the key was not persisted correctly, back to Step 2ensureMonorepo → _convert-to-turborepo did not run, back to Step 3scaffoldAgent / patchXxx → rare (filesystem issue), inspectmergeSchema → conflict in src/server/db/schema.ts (resolve manually at the end)installDeps → pnpm/network error (retry)drizzlePush → invalid schema or DB issue (often recoverable)🎛️ Do you want the dashboard to monitor your agent?
Without a dashboard, your agent runs in the background and you see its logs on Render - functional but blind. With a dashboard, you get in your admin area (
/admin/agents):
- A list of each run with date, duration, cost
- Turn-by-turn detail (each decision, each tool called) - useful for debugging
- Aggregated cost stats (per day, over 30 days)
- A "Run now" button with a custom prompt - handy for testing
⚠️ Prerequisite: your site must have admin authentication configured (
/add-authin admin mode). Without that, I can't install the dashboard because the pages would be public.Do you want me to add it? (I'll invoke
/add-agent-dashboardwhich handles everything)
If the user says yes:
/add-auth admin is in place (look at apps/web/src/server/auth.ts for isAdmin or adminProcedure)./add-auth (admin mode) first./add-agent-dashboard. This skill is idempotent: if already installed, it no-ops.If the user says no:
OK, your agent runs without a dashboard. You can follow the logs on https://dashboard.render.com → your service → Logs. If you change your mind later, run
/add-agent-dashboardto add it - it works with all your existing agents.
Add Anthropic and Render to the project's RGPD subprocessor registry:
node "${CLAUDE_SKILL_DIR}/../../scripts/update-privacy-policy.mjs" --add anthropic --add render
Anthropic receives the prompts sent by the agent (potentially user data - varies by agent). Render hosts the background worker. The helper is idempotent.
If the politique-de-confidentialite/page.tsx page exists (created by /bootstrap), it updates automatically. Otherwise, only the registry is created - /rgpd-audit can generate the page later.
From the JSON captured in Step 5, display exactly:
✅ Your agent is scaffolded
📁 Code:
apps/<NAME>/(15+ files: loop, tools, memory, render config, …) 🗃️ DB tables created in Neon:agent_invocations,agent_turns,agent_memory_kv,agent_trigger_queue🤖 Model: <MODEL_ID> ⏰ Trigger: (+ cron expression if applicable) 🧠 Memory: <kv | stateless> 💰 Caps: USD/day, USD/monthTo put it live
Commit + push what I just scaffolded:
git add . && git commit -m "feat(agent): scaffold <NAME> agent" && git pushCreate the Render service (manual action, ~2 min):
- Go to https://dashboard.render.com/blueprints
- Click "New Blueprint Instance"
- Select your GitHub repo
- Render automatically detects
apps/<NAME>/render.yaml- Fill in the environment variables (list below)
- Click "Apply"
Environment variables to fill in on Render:
ANTHROPIC_API_KEY- the one we configured earlierDATABASE_URL- copy from your web project's.envBREVO_API_KEY+BREVO_SENDER_EMAIL+BREVO_SENDER_NAME(or Resend equivalents)ADMIN_EMAIL- where the agent's error emails arriveAGENT_DAILY_BUDGET_USD=5(or what you chose)AGENT_MONTHLY_BUDGET_USD=50- {{IF cron}}
AGENT_CRON_SCHEDULE- (e.g.0 7 * * *)- {{IF cron}}
AGENT_CRON_PROMPT- the prompt sent to the agent on each runOnce live
- The agent's logs appear in the Render dashboard → "Logs"
- You receive an automatic email on error or when a cap is reached
- To trigger manually (without a custom dashboard): insert a row into the
agent_trigger_queuetable with your prompt → the agent reads it within 5 sWhen you have a larger project, tell me "add my agent's dashboard" (or run
/add-agent-dashboard) and I'll scaffold the monitoring pages.
.env. Persisted by _write-user-env.mjs. Render receives it via the dashboard.agent_* tables live in the main Neon DB, not in a separate DB. The worker has its own copy of schema.ts that points to the same physical tables./add-agent v1, propose /add-automation or waiting for the future /add-chatbot skill.pnpm dev in apps/<name>/ - but they'll need to keep their terminal open.AGENT_CRON_SCHEDULE is set on the Render dashboard (not in the yaml - sync:false). Also check the cron format (5 fields: m h dom mon dow).ADMIN_EMAIL is set on Render + email provider (BREVO/RESEND) operational. Test with an invocation that fails on purpose.agent_invocations already present with other columns?). Inspect the diff.npx claudepluginhub flavien-ia/hypervibe-harness --plugin hypervibeGuides step-by-step through building and deploying AI agents on GreenNode AgentBase, from scaffolding to deployment and testing.
Provides the full ADK development lifecycle: scaffold, build, evaluate, deploy, publish, and observe agents. Includes code preservation rules, model selection guidance, and troubleshooting.
Creates Claude Code agents from scratch or by adapting templates. Guides requirements gathering, template selection, and file generation following Anthropic best practices (v2.1.63+).