skills/migrating-to-scalekit-auth/SKILL.md
Plans and executes a safe, incremental migration from any existing auth system to Scalekit's full-stack auth platform. Use when the user asks to migrate authentication, replace session middleware, import users/organizations to Scalekit, configure SSO, or set up SCIM provisioning with Scalekit.
npx skillsauth add scalekit-inc/skills migrating-to-scalekit-authInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guides an incremental, reversible migration from an existing auth system to Scalekit. Follow these phases in order—do not skip phases.
Copy and track progress:
Migration Progress:
- [ ] Phase 1: Audit and export existing auth data
- [ ] Phase 2: Import organizations and users into Scalekit
- [ ] Phase 3: Configure redirects and roles
- [ ] Phase 4: Update application code
- [ ] Phase 5: Deploy and monitor
Conduct a code audit covering:
Export the following data:
email_verified)Backup checklist before proceeding:
Minimum user schema:
| Field | Required |
|---|---|
| email | Required |
| first_name | Optional |
| last_name | Optional |
| email_verified | Optional (defaults false) |
See AUDIT-CHECKLIST.md for full code audit patterns.
external_id is critical—store original PKs here to preserve system-to-system mappings.
Step 1: Create organizations first
Node.js example:
const result = await scalekit.organization.createOrganization(
org.display_name,
{ externalId: org.external_id, metadata: org.metadata }
);
Step 2: Create users within organizations
const { user } = await scalekit.user.createUserAndMembership("org_scalekit_id", {
email: "[email protected]",
externalId: "usr_987",
userProfile: { firstName: "John", lastName: "Doe" },
});
Rules:
sendInvitationEmail: false during import to skip invite emails; membership auto-activates and email is marked verifiedexternal_id mappings match source data exactlyFor language-specific samples (Python, Go, Java, cURL): See IMPORT-SAMPLES.md.
Redirects:
Roles:
roles array inside the membership objectSession middleware: Replace legacy JWT validation with Scalekit SDK or JWKS endpoint.
Verify:
roles claim from Scalekit tokens used for RBAC checksLogin page: Update logo, colors, copy, and legal links in Scalekit dashboard under Branding.
Secondary flows to update:
Pre-deployment:
Deployment sequence:
Post-deployment monitoring:
| Symptom | Fix |
|---|---|
| Users can't log in | Verify callback URLs registered; check external_id mappings; ensure emails match exactly |
| Session validation fails | Switch JWT validation to Scalekit JWKS endpoint; verify token expiry/refresh logic |
| SSO not working | Confirm org has SSO enabled; verify IdP config; test IdP-initiated login |
Note: Password migration support is coming. If required, contact Scalekit's Solutions team.
tools
Create or review Scalekit custom providers/connectors for proxy-only usage, including MCP providers. Use this skill when the task is to gather API docs, infer whether a connector is OAuth, Basic, Bearer, or API Key, determine if it is an MCP provider, determine required tracked fields like domain or version, generate provider JSON, check for existing custom providers, show update diffs, run approved create or update curls, and print resolved delete curls.
tools
Use when a developer is new to Scalekit and needs guidance on where to start, doesn't know which auth plugin or skill to choose, wants to connect an AI agent or agentic workflow to third-party services (Gmail, Slack, Notion, Google Calendar), needs OAuth or tool-calling auth for agents, wants to add authentication to a project but hasn't chosen an approach yet, or needs to install the Scalekit plugin for their AI coding tool (Claude Code, Codex, Copilot CLI, Cursor, or other agents).
tools
Use when a user asks to generate, review, validate, or fix any code snippet that uses Scalekit APIs or SDKs. This skill is the single source of truth for Scalekit code correctness — it can generate illustration-quality snippets from scratch (for docs, websites, or integration guides) and review existing code to catch wrong method names, missing parameters, security anti-patterns, and broken auth flows. Covers all four SDKs (Node, Python, Go, Java), raw REST API calls, and both Scalekit product suites — SaaSKit (SSO, login, sessions, RBAC, SCIM) and AgentKit (connections, tool calling, MCP auth). Use when the user says review my Scalekit code, generate a Scalekit example, validate this auth flow, check my SDK usage, fix my Scalekit integration, write a code sample for docs, or anything involving Scalekit code quality.
development
Walks through a structured production readiness checklist for Scalekit SSO implementations. Use when the user says they are going live, launching to production, doing a pre-launch review, hardening their SSO setup, or wants to verify their Scalekit implementation is production-ready.