auth-provider — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited auth-provider (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are in AUTONOMOUS MODE. Do NOT ask questions. Execute the full pipeline below without pausing for user input. Make reasonable decisions using sensible defaults.
PURPOSE: Set up a complete authentication system with OAuth/SSO providers in the current project. This includes SDK installation, provider configuration, session management, token refresh, login/logout UI, and route protection.
INPUT: $ARGUMENTS
The user may specify:
If no arguments, default to Google + GitHub providers with the best-fit auth library.
=== PHASE 1: PROJECT DETECTION ===
Step 1.1 -- Detect Framework and Existing Auth
Scan for project files to determine the tech stack:
| File | Framework | Recommended Auth Library |
|---|---|---|
| package.json with "next" | Next.js | NextAuth.js (Auth.js v5) |
| package.json with "fastify" | Fastify | @fastify/oauth2 + custom JWT |
| package.json with "express" | Express | Passport.js |
| package.json with "nestjs" | NestJS | @nestjs/passport |
| package.json with "hono" | Hono | Custom JWT + OAuth |
| requirements.txt with "django" | Django | django-allauth |
| requirements.txt with "fastapi" | FastAPI | authlib + python-jose |
| Gemfile with "rails" | Rails | devise + omniauth |
| pubspec.yaml with "firebase_auth" | Flutter | Firebase Auth |
| pubspec.yaml (no firebase) | Flutter | Supabase Auth or custom |
Check for existing auth:
Record: FRAMEWORK, AUTH_LIBRARY (user-specified or auto-detected), EXISTING_AUTH
If a complete auth system already exists, report it and exit. If partial auth exists, identify gaps and extend it.
Step 1.2 -- Parse Provider Requirements
From $ARGUMENTS, extract which providers to configure:
Record: PROVIDERS list
=== PHASE 2: AUTH LIBRARY INSTALLATION ===
Step 2.1 -- Install Auth Library
Based on the detected or specified auth library:
NextAuth.js (Auth.js v5) -- for Next.js:
npm install next-auth@beta @auth/prisma-adapter (if using Prisma)
npm install next-auth@beta @auth/drizzle-adapter (if using Drizzle)Passport.js -- for Express/Fastify/NestJS:
npm install passport passport-google-oauth20 passport-github2
npm install express-session connect-pg-simple (for database sessions)
npm install jsonwebtoken @types/jsonwebtoken (for JWT strategy)Firebase Auth -- for Flutter or web apps using Firebase:
flutter pub add firebase_auth google_sign_in (Flutter)
npm install firebase-admin (backend verification)Supabase Auth -- for Supabase projects:
npm install @supabase/supabase-js @supabase/auth-helpers-nextjs
flutter pub add supabase_flutter (Flutter)django-allauth -- for Django:
pip install django-allauthLucia -- for any Node.js framework:
npm install lucia @lucia-auth/adapter-prisma (or appropriate adapter)
npm install arctic (for OAuth helpers)Install only the packages needed for the detected framework and requested providers.
Step 2.2 -- Configure Environment Variables
Add to .env.example:
# Auth
AUTH_SECRET=<random-32-char-string>
AUTH_URL=http://localhost:3000 (or appropriate base URL)
# Google OAuth (if requested)
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# GitHub OAuth (if requested)
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# Apple Sign-In (if requested)
APPLE_CLIENT_ID=
APPLE_CLIENT_SECRET=
APPLE_TEAM_ID=
APPLE_KEY_ID=If the project has a config validation system, update it with the new variables.
=== PHASE 3: AUTH CONFIGURATION ===
Step 3.1 -- Create Auth Configuration Module
Create the central auth configuration at the framework-appropriate location:
NextAuth.js:
auth.ts (or src/auth.ts) with providers, callbacks, session strategyapp/api/auth/[...nextauth]/route.ts catch-all routePassport.js:
src/config/passport.ts with strategy configurationFirebase Auth:
lib/firebase-admin.ts for backend verificationLucia:
src/lib/auth.ts with Lucia instanceFor EACH requested provider, configure:
Step 3.2 -- Database Schema Updates
If the project uses a database, create or update the auth-related tables:
For Prisma (schema.prisma):
model User {
id String @id @default(cuid())
email String @unique
name String?
image String?
emailVerified DateTime?
accounts Account[]
sessions Session[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Account {
id String @id @default(cuid())
userId String
type String
provider String
providerAccountId String
refresh_token String?
access_token String?
expires_at Int?
token_type String?
scope String?
id_token String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
}
model Session {
id String @id @default(cuid())
sessionToken String @unique
userId String
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}Run the migration after schema changes: npx prisma migrate dev --name add-auth-tables
For other ORMs, create equivalent migrations.
If the project is Flutter + Firebase, skip database schema -- Firebase Auth manages this.
Step 3.3 -- Session Management
Configure session handling based on the strategy:
JWT Strategy (default for most setups):
Database Session Strategy:
Token Refresh Flow:
=== PHASE 4: AUTH MIDDLEWARE ===
Step 4.1 -- Create Auth Middleware
Create middleware that can protect routes/pages:
For API routes:
For Next.js:
middleware.ts at the project rootFor Flutter:
Step 4.2 -- Create Auth Helper Functions
Create utility functions:
getCurrentUser(request):
- Extract and verify the token from the request
- Return the user object or null
requireAuth(request):
- Same as getCurrentUser but throws 401 if not authenticated
requireRole(request, role):
- Same as requireAuth but also checks user role
- Throws 403 if insufficient permissions
isAuthenticated(request):
- Returns boolean -- does not throw=== PHASE 5: LOGIN/LOGOUT UI ===
Step 5.1 -- Create Login Page/Screen
For Next.js / React: Create a login page with:
For Flutter: Create a login screen with:
For API-only backends (no frontend):
Step 5.2 -- Create Logout Flow
Create logout functionality:
Step 5.3 -- Create Auth State UI Components
Create reusable auth-aware components:
=== PHASE 6: ROUTE PROTECTION ===
Step 6.1 -- Protect Existing Routes
Scan the project for routes/pages that should be protected:
Apply the auth middleware to these routes.
Step 6.2 -- Create Auth Callback Routes
For each provider, ensure the callback route is configured:
These must match the redirect URIs configured in the provider's developer console.
=== PHASE 7: VERIFICATION ===
Step 7.1 -- Static Verification
Run the project's type checker and linter:
Step 7.2 -- Auth Flow Checklist
Verify and report:
=== OUTPUT ===
Print the following summary:
Framework: [detected framework] Auth library: [library used] Providers: [list of configured providers] Session strategy: [JWT | database]
| File | Purpose |
|---|---|
| [path] | [description] |
| Variable | Purpose | Where to get it |
|---|---|---|
| AUTH_SECRET | Session encryption | Generate: openssl rand -base64 32 |
| GOOGLE_CLIENT_ID | Google OAuth | Google Cloud Console > Credentials |
| GOOGLE_CLIENT_SECRET | Google OAuth | Google Cloud Console > Credentials |
| GITHUB_CLIENT_ID | GitHub OAuth | GitHub Settings > Developer > OAuth Apps |
| GITHUB_CLIENT_SECRET | GitHub OAuth | GitHub Settings > Developer > OAuth Apps |
| Provider | Callback URL |
|---|---|
| http://localhost:3000/api/auth/callback/google | |
| GitHub | http://localhost:3000/api/auth/callback/github |
[List of routes that now require authentication]
Google:
GitHub:
=== NEXT STEPS ===
After auth integration:
/stripe to add payments (will automatically link to authenticated users)."/email to add email verification and password reset flows."/push-notifications to add push notifications (requires user identity)."/integrate audit to check overall integration health."=== DO NOT ===
============================================================ SELF-HEALING VALIDATION (max 3 iterations) ============================================================
After completing the integration, validate:
IF STILL FAILING after 3 iterations:
============================================================ SELF-EVOLUTION TELEMETRY ============================================================
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
~/.claude/projects/skill-telemetry.md in that memory directoryEntry format:
### /auth-provider — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}Only log if the memory directory exists. Skip silently if not found. Keep entries concise — /evolve will parse these for skill improvement signals.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.