No slash command · from hypervibe
Converts a single Next.js project into a Turborepo monorepo by moving code to apps/web/, creating root config files, and optionally extracting a Drizzle DB package. Idempotent.
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.
None: SKILL.md is the whole skill.
/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.Convert a single Next.js project into a Turborepo monorepo. Idempotent - if already a monorepo, return immediately.
test -d apps/web && echo "already-monorepo" || echo "single-app"
If already-monorepo, tell the user:
The project is already a Turborepo monorepo. There is nothing for me to do.
Return control to the caller immediately. Skip all remaining steps.
If single-app, continue to Step 2.
Read the current project name from package.json:
node -e "process.stdout.write(require('./package.json').name)"
Detect if a Drizzle DB is configured:
test -f drizzle.config.ts -o -f drizzle.config.js && echo "has-db" || echo "no-db"
Tell the user:
I am going to convert your project into a Turborepo monorepo: the current code moves to
apps/web/, with a new rootpackage.json+pnpm-workspace.yaml+turbo.json, and turbo added as a devDep, plus the Drizzle DB extracted intopackages/db/. What belongs to the repository itself (its automations, the project's resource list, your project rules) stays where it is.⚠️ Commit your work in progress first - this operation moves a lot of files and is hard to revert. And one setting will have to change on Vercel before the next push: I will tell you which, at the end.
Ready to go? (reply
yesto continue)
Wait for confirmation. Don't start without it.
git status --porcelain
If there are uncommitted changes, refuse:
❌ You have uncommitted changes. Commit or stash them first, then re-run
/add-automation.
Return to caller without doing anything.
mkdir -p apps/web
Only the APPLICATION moves. What belongs to the REPOSITORY stays at its root, because what reads it looks there and nowhere else:
.github/: the forge reads a repository's automations at its root only (deployment, scheduled tasks, checks). Moved, they would silently stop..hypervibe/: the project's resource manifest, one per repository, at its root. Moved, a second one would be born at the root, and each half would miss the other's resources.CLAUDE.md and .claude/: the project's rules and settings, read from where the sessions open, the repository's root..git, .gitattributes, the lockfile (pnpm keeps a workspace's single lockfile at its root), and the files that tools read from the root of a workspace or look for upward from any folder (.npmrc, .nvmrc, .node-version, .tool-versions, .editorconfig, .vscode/)..gitignore is copied, not moved: the root one keeps covering what stays at the root, and the copy keeps the application's own patterns (/.next/, /node_modules) meaning the same thing in apps/web/.What git tracks moves with git mv (its history follows). The application's own untracked files (.env, .env.*, .vercel/) move with a plain mv: they belong to the application, and they never go through git. Anything else that git does not track stays where it is, and is named.
shopt -s dotglob nullglob
for item in *; do
case "$item" in
apps|packages|.git|.github|.hypervibe|.claude|CLAUDE.md|.gitattributes|.gitignore|.npmrc|.nvmrc|.node-version|.tool-versions|.editorconfig|.vscode|node_modules|pnpm-lock.yaml|package-lock.json|yarn.lock) continue ;;
esac
if git ls-files --error-unmatch -- "$item" >/dev/null 2>&1; then
git mv -- "$item" "apps/web/$item"
else
case "$item" in
.env|.env.*|.vercel) mv -- "$item" "apps/web/$item" ;;
*) echo "LEFT AT THE ROOT (not tracked by git): $item" ;;
esac
fi
done
shopt -u dotglob nullglob
test -f .gitignore && cp .gitignore apps/web/.gitignore
rm -rf node_modules # we'll reinstall at the end
If a LEFT AT THE ROOT line names something the application needs (a local file it reads at run time), say so to the user and move it into apps/web/ with a plain mv.
cat > package.json <<'EOF'
{
"name": "<project-name>-monorepo",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "turbo dev",
"build": "turbo build",
"lint": "turbo lint"
},
"devDependencies": {
"turbo": "^2.0.0"
},
"packageManager": "[email protected]"
}
EOF
Replace <project-name> with the actual name from the original package.json.
packages:
- "apps/*"
- "packages/*"
Step 4 moved the app's own pnpm-workspace.yaml into apps/web/. pnpm only honours the file at the workspace root, and a nested one makes pnpm treat apps/web as a separate workspace whenever a command runs from there. So if apps/web/pnpm-workspace.yaml exists: copy its other top-level blocks (allowBuilds:, overrides:) below packages: in the root file, then git rm apps/web/pnpm-workspace.yaml. Keep overrides: exactly as it is: it holds the security floors written by /bootstrap, and the lockfile must keep recording them. Never move them into a package.json (pnpm.overrides): pnpm 11+ ignores that field while Vercel's pnpm 10 reads it, and the deploy fails with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH.
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": [".next/**", "!.next/cache/**", "dist/**"]
},
"dev": {
"cache": false,
"persistent": true
},
"lint": {}
}
}
Skip this step if no-db.
If has-db:
mkdir -p packages/db
Move the Drizzle config and schema (the git mv renames db/ to packages/db/src/, so packages/db/src must not pre-exist):
git mv apps/web/drizzle.config.ts packages/db/drizzle.config.ts
git mv apps/web/src/server/db packages/db/src
Create packages/db/package.json:
{
"name": "@<project-name>/db",
"version": "0.0.0",
"private": true,
"main": "./src/index.ts",
"types": "./src/index.ts",
"scripts": {
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio"
}
}
Create packages/db/tsconfig.json:
{
"extends": "../../apps/web/tsconfig.json",
"include": ["src/**/*", "drizzle.config.ts"]
}
Make sure packages/db/src/index.ts exists and re-exports the Drizzle client:
export * from "./schema";
// Adjust depending on what was in src/server/db originally
Find all files in apps/web that import from ~/server/db or @/server/db and rewrite them to @<project-name>/db:
cd apps/web
grep -rln "from \"~/server/db" src/ | xargs sed -i 's|from "~/server/db|from "@<project-name>/db|g'
grep -rln "from \"@/server/db" src/ | xargs sed -i 's|from "@/server/db|from "@<project-name>/db|g'
Be careful: only rewrite the exact ~/server/db and @/server/db prefixes, not other things.
Add to apps/web/package.json:
{
"dependencies": {
"@<project-name>/db": "workspace:*"
}
}
pnpm install
This rewrites the root pnpm-lock.yaml for the workspace and installs everything across it.
pnpm dev --filter=web
Wait a few seconds. If Next.js starts on port 3000 without errors, kill it (Ctrl+C). The conversion is successful.
If it errors:
rm -rf node_modules apps/*/node_modules packages/*/node_modules pnpm-lock.yaml && pnpm installThis conversion moves the whole tree: naming every moved file would be absurd, so it is the one documented case where a sweeping stage is legitimate, for the files git already tracks, and for them only. git add -u stages moves and rewrites, never a new file: an .env or a .vercel/ folder cannot enter the commit. What the conversion created is then staged by name. First make sure nothing foreign is pending:
git status --short # must show ONLY what this conversion moved, created or rewrote; stop and ask if anything else is pending
HYPERVIBE_GUARD_ALLOW_SWEEP=1 git add -u
git add -- package.json pnpm-workspace.yaml turbo.json apps/web/.gitignore
test -d packages/db && git add -- packages/db
git status --short # what is staged: no .env, no .vercel/, nothing this conversion did not touch
git commit -m "refactor: convert to Turborepo monorepo"
⚠️ Don't push automatically - let the caller (/add-automation) decide when to push.
The site now lives in apps/web/, and its hosting still builds the repository's root: from the next push on, every deployment of the site would fail (the live site keeps its last version, and nothing new goes online). Before anything is pushed, the person changes one setting. Tell the user:
✅ Conversion to a Turborepo monorepo complete. Your app now lives in
apps/web/, and your shared DB inpackages/db/.One setting to change on Vercel before the next push, or every deployment of your site will fail from then on (your live site stays as it is, but nothing new goes online):
- Open your project on https://vercel.com, then Settings → Build and Deployment
- Root Directory:
apps/web, then SaveTell me once it is done.
New commands:
pnpm dev(all apps),pnpm dev --filter=web(just the frontend),pnpm build.Commit made locally, not pushed - the caller will decide when to push.
Wait for the confirmation, and pass it on to the caller: it pushes only once the setting is changed, then checks that the site still deploys.
Return control to the calling skill (/add-automation).
What SKILL.md sets; muted values are Claude Code's defaults
90 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`)./npx claudepluginhub flavien-ia/hypervibe-craft --plugin hypervibeOther plugins' skills for the same job