From opensaas-migration
Find and replace all @keystone-6 import paths across every file in the project. Invoke as a forked subagent, passing the project root path.
How this skill is triggered — by the user, by Claude, or both
Slash command
/opensaas-migration:migrate-importsgeneral-purposeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Find and replace all KeystoneJS import paths with their OpenSaaS Stack equivalents across the project described below. This is a mechanical find-and-replace across every TypeScript/JavaScript file.
Find and replace all KeystoneJS import paths with their OpenSaaS Stack equivalents across the project described below. This is a mechanical find-and-replace across every TypeScript/JavaScript file.
$ARGUMENTS
| Keystone import (remove/replace) | OpenSaaS import |
|---|---|
@keystone-6/core | @opensaas/stack-core |
@keystone-6/core/fields | @opensaas/stack-core/fields |
@keystone-6/auth | @opensaas/stack-auth (see note) |
@keystone-6/fields-document | @opensaas/stack-tiptap/fields (see note) |
.keystone/types or '.keystone/types' | @opensaas/stack-core |
@keystone-6/core/session | Remove entirely (handled by authPlugin) |
Note on @keystone-6/auth: This is NOT a pure find-and-replace. Keystone's createAuth/withAuth have no equivalent export on @opensaas/stack-auth — replace the whole pattern with authPlugin(...) in the config's plugins array. (The stack's createAuth on @opensaas/stack-auth/server is a different function — it builds the Better-auth server instance for lib/auth.ts.)
Note on @keystone-6/fields-document: Replace with @opensaas/stack-tiptap/fields and change document() → richText(). If document field migration is complex, note it for the user and leave a // TODO: migrate document field comment.
Note on .keystone/types: Common imports to update:
// Before
import type { Session } from '.keystone/types'
import type { KeystoneContext } from '.keystone/types'
import type { Lists } from '.keystone/types'
// After
import type { AccessControl } from '@opensaas/stack-core'
import type { Lists } from '@/.opensaas/lists'
// KeystoneContext is no longer needed — use the context from getContext().
// Keystone's `Lists` types have a direct successor: the generated
// `@/.opensaas/lists` namespace, used as list<Lists.Post.TypeInfo>({ ... }).
If the project has keystone.ts or keystone.config.ts, it should be renamed to opensaas.config.ts. Check if it has already been renamed before doing so.
.ts and .tsx files in the project (exclude node_modules, .next, dist)@keystone-6 or .keystone/types imports.keystone/types imports, update the specific type names (Session → AccessControl, etc.)
d. Edit the file with the changeskeystone.ts or keystone.config.ts exists and rename to opensaas.config.ts if needed (and if not already done)npx claudepluginhub opensaasau/stack --plugin opensaas-migrationGuides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Resolves in-progress git merge or rebase conflicts by analyzing history, understanding intent, and preserving both changes where possible. Runs automated checks after resolution.