/hypervibe:add-aifrom hypervibe
Adds AI capabilities (chat assistant, content processing, generation) to an existing Next.js project via OpenRouter. Estimates costs from live prices, provisions a spending-capped key, and creates a single shared AI file.
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.
Adds AI to the user's application: a chat assistant, a processing step, a
generator. Everything routes through one file in the project
(src/server/ai.ts), and through OpenRouter, so that changing model is a
string to edit rather than a migration.
You own the feature: what it does, where it plugs in, what the user sees.
The brick underneath (the key, the budget, the shared file) is installed by
_ensure-ai, which every intelligence-needing skill of the plugin calls.
That is what guarantees the same three boundaries everywhere.
/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.Three boundaries, and they matter more than the features. They are applied by
_ensure-ai, so they hold identically whichever skill installed the AI:
A user who deliberately wants to call OpenAI or Anthropic directly is never
blocked: _ensure-ai offers the same brick on their provider, records the
choice if they decline even that, and every later skill honours it silently.
Before anything, check this is the right skill:
_create-agent, invoked with a brief./add-automation,
which routes to the right shape./add-routine, when this tool offers it (otherwise say that
this tool cannot schedule a mission).Say which one and hand off. Do not build a second agent runtime here.
Use AskUserQuestion. Do not ask what you can infer from the project.
Q1 - What should the AI do? Free text, then classify into one recipe:
| Recipe | Signals | What gets built |
|---|---|---|
chat | "assistant", "answer questions", "support", "converse" | Streaming route + chat panel |
traitement | "classify", "extract", "sort", "analyse", "summarise" | traiterAvecIA() helper returning validated JSON |
generation | "write", "draft", "produce a text", "description" | Same helper, higher temperature, free-text output |
If the answer covers several, build the dominant one and say the others are one
MODELES entry away.
Q2 - Who uses it?
Q3 - Roughly how many uses per day? A number, even vague. It drives the estimate. If they have no idea, propose 50 and say the cap protects them anyway.
Q4 - Will personal data pass through? (customer messages, CVs, health, anything identifying.) If yes -> the free tier is off the table, and the GDPR entry is mandatory.
Invoke _ensure-ai with the brief:
| Field | Value |
|---|---|
USAGE | the recipe name (chat, traitement, generation) |
PROFIL | same as the recipe (qr for a short question-answer) |
PAR_JOUR | Q3 |
DONNEES_PERSONNELLES | Q4 |
CIBLE | app |
It handles the account check, the cost estimate, the budget the user validates, the capped key, the shared file, the cost-log table, the GDPR entry and the CLAUDE.md convention. When the project already has its brick, it is silent and just binds the new usage.
It hands back MODE, FOURNISSEUR, MODELE and PLAFOND_USD. If MODE is
direct, the project deliberately calls a provider itself: build the recipe
below against the project's existing pattern instead of appelerIA, and do not
bring up OpenRouter again.
chat -> templates/ai/chat-route.ts to src/app/api/chat/route.ts (fill
__CONSIGNE_SYSTEME__ from what the user described, __GARDE_ACCES__ from
Q2, __USER_ID__ with the session user or null), and
templates/ai/chat-panel.tsx to src/components/chat-panel.tsx. Wire it into
a real page, never leave it orphaned.traitement / generation -> templates/ai/traitement.ts to
src/server/ai-traitement.ts, __SCHEMA_CHAMPS__ filled with the fields the
user actually needs, and call it from a real place in the project.Rate limit if Q2 said users or public: reuse the project's existing limiter
if there is one; otherwise a simple per-user-and-hour count on ai_usage, which
is already indexed for it.
✅ AI installed.
- What it does: <recipe, in one sentence>
- Model: (tier <Éco/Qualité>)
- Estimated cost: $ per month for uses a day
- Hard cap: $, held by OpenRouter. Past it, calls stop and the app says so rather than failing silently.
- Every call is logged with its real cost in the
ai_usagetable.To change model, edit
MODELESinsrc/server/ai.ts. To change the cap, go to openrouter.ai/settings/keys.
Then say the one thing they will hit first: the first call fails if the OpenRouter account has no credits, even for free models beyond 50 requests a day. Adding 10 $ of credits also raises the free-model limit to 1000 a day.
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