From hypervibe
Add GitHub OAuth login to an existing project. Guides through GitHub OAuth App setup and configures env vars automatically. Can be used standalone or called by /add-auth.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hypervibe:add-github-authThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- Detect the user's language from their messages and ALWAYS reply in that language (default: English). This applies to every user-facing message: questions, progress, confirmations, summaries, errors.
Adds GitHub OAuth authentication to an existing project. Can be used:
/add-github-auth) - on a project that already has NextAuth configured (via /add-auth or /bootstrap)/add-auth - when the user picks GitHub as a providerThis skill walks the user step by step through the GitHub settings, then Claude Code takes over to configure the environment variables everywhere.
Before starting, identify:
http://localhost:3000<base_url>/api/auth/callback/githubThis skill requires NextAuth to already be in place (via /add-auth or /bootstrap). We check before sending the user into the GitHub configuration for nothing.
Invoke _check-deps auth:
result=$(node "${CLAUDE_SKILL_DIR}/../../scripts/check-deps.mjs" auth)
auth_ok=$(echo "$result" | node -e "console.log(JSON.parse(require('fs').readFileSync(0,'utf8')).auth.ok)")
auth_mode=$(echo "$result" | node -e "console.log(JSON.parse(require('fs').readFileSync(0,'utf8')).auth.mode || 'unknown')")
If auth_ok = false (no auth.ts or no AUTH_SECRET) - abort with a simple message:
⚠️ Basic authentication is not in place yet in this project. First run
/add-authto set up email/password login, then come back to/add-github-authto add GitHub login on top of it.
If auth_mode = "admin-credentials" - abort. GitHub OAuth does not apply to admin mode (where you are the only one logging in with a fixed password). Message to the user:
Your project is configured in admin-only mode - only you log in via a fixed password. GitHub login is meant for a system where your users create accounts. So it is not compatible with your current setup.
If you would rather switch to a user-accounts system (with GitHub as a bonus), you need to start over from
/add-auth, this time choosing "system for your users".
Otherwise (auth_mode = "user-credentials") → continue to Step 1.
Show this message to the user:
GitHub OAuth Configuration
We are going to set up GitHub authentication together. I will guide you through the GitHub settings, and I will take care of configuring everything on the code and Vercel side afterwards.
1. Open the GitHub developer settings: Go to github.com/settings/developers
(You can also get there via: GitHub → your avatar in the top right → Settings → Developer settings at the very bottom of the left menu)
2. Create a new OAuth App:
- Click "OAuth Apps" in the left menu
- Click "New OAuth App" (or "Register a new application")
3. Fill in the form:
- Application name: the name of your app (e.g.
My App)- Homepage URL:
https://<production_url>- Application description: optional, a short description of your app
- Authorization callback URL:
http://localhost:3000/api/auth/callback/github⚠️ We use the local URL for now. We will add the production URL afterwards.
4. Click "Register application"
Let me know when it is done.
Replace <production_url> with the project's real URL before displaying.
Wait for the user's confirmation before continuing.
Show this message:
Get the credentials
You should now be on your OAuth App's page.
5. Client ID:
- The Client ID is displayed directly on the page (a string of ~20 characters)
6. Generate the Client Secret:
- Click "Generate a new client secret"
- GitHub shows the secret only once - copy it immediately
- ⚠️ If you leave the page without copying it, you will have to generate a new one
Send me the Client ID and the Client Secret and I will take care of configuring everything.
Wait for the user to provide the Client ID and the Client Secret.
Once both values are received:
Invoke _push-env-vars with:
AUTH_GITHUB_ID=<provided_client_id>AUTH_GITHUB_SECRET=<provided_client_secret>The helper writes to the local .env AND pushes to Vercel (production/preview/development) idempotently.
In src/server/auth.ts, make sure the GitHub provider is configured:
import GitHubProvider from "next-auth/providers/github";
// In the providers config:
GitHubProvider({
clientId: process.env.AUTH_GITHUB_ID!,
clientSecret: process.env.AUTH_GITHUB_SECRET!,
}),
Invoke _detect-project-root to get WEB_DIR, then run the helper that patches the auth pages:
node "${CLAUDE_SKILL_DIR}/../../scripts/setup-oauth-button.mjs" \
--web-dir "$WEB_DIR" \
--provider github
The script:
src/app/signin/page.tsx and src/app/signup/page.tsx (or their equivalents under [locale]/ if i18n is active), and inserts a "Continue with GitHub" button + an "or" separator below the email/password submit buttonsignIn("github" is already present in the page, it touches nothing; if an OAuth block already exists (Google added before), it stacks GitHub into it without duplicating the separatoruseTranslations (i18n variant) or hardcoded FR strings (plain variant), and writes the appropriate snippetsignin.orSeparator, signin.continueWithGithub, signup.orSeparator, signup.continueWithGithub to the messages/<locale>.json filesWithout this step, the GitHub provider would technically be configured on the server side but no button would be visible - the user would have to go through /api/auth/signin (NextAuth's fallback page) to use it.
Invoke _update-claude-md with:
conventions: - **OAuth GitHub** : callback URL = \https://<production_url>/api/auth/callback/github``Show this message:
Add the production URL
Last manual step! You need to add the production callback URL in your GitHub OAuth App.
7. Go back to your OAuth App's page: github.com/settings/developers → click on your app's name
8. Edit the Authorization callback URL:
- Replace the current URL (
http://localhost:3000/api/auth/callback/github)- With the production URL:
https://<production_url>/api/auth/callback/github9. Click "Update application"
💡 Tip: GitHub supports only one callback URL per OAuth App. For local dev to work too, two options:
- Option A (recommended): create a second OAuth App dedicated to local dev (callback =
http://localhost:3000/api/auth/callback/github) and use its credentials in the local.env- Option B: switch the URL in the GitHub settings depending on whether you are testing locally or in prod
Let me know if you want me to help you create a second OAuth App for local dev.
Replace <production_url> with the project's real URL before displaying.
Add GitHub to the project's RGPD subprocessor registry:
node "${CLAUDE_SKILL_DIR}/../../scripts/update-privacy-policy.mjs" --add github-oauth
The helper is idempotent. If the politique-de-confidentialite/page.tsx page exists, it updates automatically. Otherwise, only the registry is created - /rgpd-audit can generate the page later.
Confirm to the user that everything is configured:
.env updated with AUTH_GITHUB_ID and AUTH_GITHUB_SECRETsrc/server/auth.tsRemind them that:
pnpm dev then go to /signin - the "Continue with GitHub" button should appear below the email/password formnpx claudepluginhub flavien-ia/hypervibe-harness --plugin hypervibeAdd Google OAuth login to an existing project. Guides through Google Cloud Console setup and configures env vars automatically. Can be used standalone or called by /add-auth.
Configure OAuth authentication providers for Clerk (Google, GitHub, Discord, Apple, Microsoft, Facebook, LinkedIn, Twitter, and 11+ more). Use when setting up social login, configuring OAuth providers, implementing authentication flows, generating redirect URLs, testing OAuth connections, or when user mentions Clerk OAuth, social authentication, provider setup, or multi-provider auth.
Sets up Neon Auth in Next.js, React SPA, or Node.js apps. Configures auth routes, session management, social providers, and generates UI components.