From build-loop
Use when wiring auth to a new project, debugging login errors (redirect_uri_mismatch, invalid_grant, session callback, refresh_token), or adding social/magic link flows. Covers Better Auth (Drizzle/Neon), Supabase Auth (SSR), Google OAuth, and Resend transactional email.
How this skill is triggered — by the user, by Claude, or both
Slash command
/build-loop:authenticationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <[email protected]> | SPDX-License-Identifier: Apache-2.0 -->
references/better-auth-magic-link.mdreferences/better-auth-setup.mdreferences/google-calendar-sync.mdreferences/google-cloud-console.mdreferences/google-geocoding-directions.mdreferences/google-lessons-example-web-app.mdreferences/google-maps.mdreferences/google-oauth-setup.mdreferences/google-places.mdreferences/lessons-example-web-app-better-auth.mdreferences/resend-email.mdreferences/resend-otp-magic-link.mdreferences/supabase-auth.mdReference library for wiring external authentication and authorization into a web or mobile app. Each service has its own reference file — load the one you need, don't pre-load all.
Stack default for new Next.js work: Neon + Better Auth + Drizzle. Supabase is covered for legacy projects and as an alternate. Magic-link delivery and transactional email default to Resend.
redirect_uri_mismatch, invalid_grant, token refresh loops, session callback failuresgetAll/setAll ≥0.3 breaking changegapi.auth2, @supabase/ssr <0.3)| If the user is asking about... | Load | Context7 lib id |
|---|---|---|
| Better Auth setup, Drizzle adapter, social providers, refresh_token | references/better-auth-setup.md | /better-auth/better-auth |
| Magic links / OTP via Better Auth | references/better-auth-magic-link.md | /better-auth/better-auth |
| Example Web App Better Auth real-build lessons | references/lessons-example-web-app-better-auth.md | — |
| Supabase Auth (SSR cookies, RLS, env validation, when-to-use vs Better Auth) | references/supabase-auth.md | /supabase/supabase |
Resend transactional + Better Auth sendVerificationEmail integration + webhook signatures | references/resend-email.md | /websites/resend |
| Resend OTP / magic-link delivery + retries + bounce handling | references/resend-otp-magic-link.md | /websites/resend, /resend/resend-skills |
| Google OAuth sign-in | references/google-oauth-setup.md + references/google-cloud-console.md | — |
| Google Maps in a UI | references/google-maps.md | — |
| Google Places API (New) | references/google-places.md | — |
| Google Geocoding / Directions | references/google-geocoding-directions.md | — |
| Google Calendar sync | references/google-calendar-sync.md | — |
| Broad Google Cloud Console walkthrough (4-layer mental model: identity, APIs, credentials, quotas) | references/google-cloud-console.md | — |
| Real Google build incident lessons (Example Web App, Next.js + Supabase) | references/google-lessons-example-web-app.md | — |
Services not yet documented (planned as additional references): GitHub OAuth, generic OAuth 2.0 callbacks, service-account key handling, API key rotation. Add them as references/<service>-<topic>.md following the same pattern.
https://app.com/cb ≠ https://app.com/cb/ ≠ http://app.com/cb. Register every variant you use in dev and prod.NEXT_PUBLIC_APP_URL / BETTER_AUTH_URL mismatch on Vercel CNAMEs. Preview/production URLs diverge from the registered redirect; bind detection to the actual VERCEL_URL fallback and verify at boot. Example Web App shipped a production-only auth failure from this exact mismatch.accessType: 'offline' AND prompt: 'select_account consent' — otherwise refresh_token is missing on second consent. Verify the account.refresh_token and account.expires_at columns populate before shipping. (See references/better-auth-setup.md.)dbForUser(userId) wrappers (or RLS) — never trust client-supplied user IDs in queries. Example Web App's lib/db/index.ts is the canonical pattern.magicLink({ expiresIn: 60 * 10 }) is the reference config.httpOnly: true, secure: true (prod), sameSite: 'lax' for OAuth redirects. sameSite: 'strict' breaks Google callback. Better Auth defaults are correct; override with care.When expanding this skill:
references/<service>-<topic>.md with a clear ## When to use section at top.Auth SDKs change frequently — Better Auth in particular adds plugins and provider options on a fast cadence. Before writing config or debugging a session callback, fetch live docs via the Context7 MCP (mirrors the pattern in building-with-deepagents/SKILL.md:33):
mcp__plugin_context7_context7__resolve-library-id("better-auth") → /better-auth/better-authmcp__plugin_context7_context7__query-docs with library: "/better-auth/better-auth" and topic: "magic link plugin config" (or "social provider refresh_token", "SSR getAll setAll", "webhook signature verification").Known Context7 ids (verified 2026-05-02): /better-auth/better-auth, /supabase/supabase, /websites/resend, /resend/resend-skills. If a query returns thin results, retry with the alternate (/resend/resend-skills is better tuned for agent-flavored questions; /websites/resend covers the broader SDK surface).
Originally imported from a standalone google-cloud-console skill (2025, Example Web App build). Converted to a general authentication parent skill on 2026-04-21 so GitHub OAuth, generic OAuth 2.0, and API-key patterns can share the routing layer and universal footgun section without each becoming its own island.
Extended on 2026-05-02 to multi-provider coverage: added Better Auth (Drizzle/Neon, magic-link, Google + Apple social), Supabase Auth (legacy + alternate), and Resend (transactional, magic-link/OTP, webhook verification). Lessons harvested from Example Web App, example-app, Example App, and example-app. Adopted the Context7 lookup pattern so SKILL.md stays light while doc depth lives in references and the live Context7 index.
npx claudepluginhub tyroneross/build-loop --plugin build-loopGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.