plugins/full-stack-auth/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/claude-code-authstack 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.
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.
data-ai
Implements complete SSO and authentication flows using Scalekit. Handles modular SSO, IdP-initiated login, user session management, and enterprise customer onboarding. Use when adding authentication, SSO, SAML, OIDC, or user login to applications.
testing
Implements Scalekit's admin portal for customer self-serve SSO and SCIM configuration. Generates portal links server-side and embeds the portal as an iframe in the app's settings UI. Use when the user asks to add an admin portal, customer self-serve SSO setup, iframe embed for SSO config, shareable setup link, or let customers configure their own SSO or SCIM connection.
development
Walks through a structured production readiness checklist for Scalekit SCIM provisioning implementations. Use when the user says they are going live, launching to production, doing a pre-launch review, or wants to verify their SCIM directory sync implementation is production-ready.