skills/migrate/SKILL.md
Use when bulk-migrating import paths, renaming workspace packages, or reorganizing modules across many files in a monorepo. Uses scripted bulk operations with verification gates and atomic commits. Keywords: migrate imports, rename package, bulk import path change, module reorganization, monorepo refactor.
npx skillsauth add acedergren/agentic-tools migrateInstall 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.
Orchestrates monorepo migrations: import path changes, package renames, module moves. Uses scripted bulk operations (never file-by-file edits), deduplicates against existing work, verifies types at each step, and commits atomically.
Do NOT load this skill when the change only touches one or two files, the user wants exploratory refactoring, or the package boundary decision is still unresolved.
grep | xargs sed instead (10x faster, no missed files).packages/ is touched.Does the new import path already exist in the codebase?
├── Yes (many files) → Already migrated; verify or skip
├── Yes (some files) → Partial migration; check what's left
└── No → Proceed with full migration
How many files are affected?
├── 1-2 files → Don't use this skill; use Edit tool directly
├── 3-20 files → Proceed with manifest + scripted sed
└── > 20 files → Show manifest, get user confirmation before sed
Does the change touch packages/ (shared across workspaces)?
├── Yes → Get user confirmation before running sed
└── No → Proceed
bash scripts/build-manifest.sh @old/pkg/name
bash scripts/replace-imports.sh @old/pkg/name @new/pkg/name /tmp/migration-manifest.txt
git log --oneline -20
grep -r "<new-import-path>" apps/ packages/ --include="*.ts" --include="*.svelte" -l | head -10
If migration is already complete or partial: report what exists, ask whether to verify/clean up or skip.
grep -rl "<old-import-path>" apps/ packages/ --include="*.ts" --include="*.tsx" --include="*.svelte" > /tmp/migration-manifest.txt
echo "Files to migrate: $(wc -l < /tmp/migration-manifest.txt)"
cat /tmp/migration-manifest.txt
Print summary grouped by workspace. Ask user to confirm before proceeding if > 20 files or packages/ is affected.
grep -rl "@old/pkg" apps/api/ --include="*.ts" | \
xargs sed -i '' "s|@old/pkg|@new/pkg|g"
grep -rl "@old/pkg" apps/frontend/ --include="*.ts" --include="*.svelte" | \
xargs sed -i '' "s|@old/pkg|@new/pkg|g"
macOS note: sed -i '' (empty string required for in-place edit without backup). Linux uses sed -i without the empty string.
cd apps/api && npx tsc --noEmit 2>&1 | head -30
cd apps/frontend && npx svelte-check --threshold error 2>&1 | tail -20
cd packages/server && npx tsc --noEmit 2>&1 | head -20
Common causes of type errors after migration:
pnpm --filter @portal/server buildpnpm run check:circulargrep -r "<old-import-path>" apps/ packages/ --include="*.ts" --include="*.svelte" -l
Remaining occurrences may be in:
npx vitest run apps/api --reporter=dot
npx vitest run apps/frontend --reporter=dot
If tests fail: check if mock paths still point to the old module path (common missed case in test files).
git commit -m "refactor(imports): migrate @old/pkg → @new/pkg
Affects N files across apps/api, apps/frontend, packages/server.
All typechecks pass. Full test suite green.
Co-Authored-By: Claude Opus 4.6 <[email protected]>"
Stage only migrated files — never git add -A.
| Pattern | From | To |
|---------|------|----|
| Package rename | @company/old-pkg | @company/new-pkg |
| Path restructure | @app/shared/utils | @app/core/utils |
| Index consolidation | ./auth/helpers | ./auth/index |
| Framework alias | $lib/server/* | src/lib/server/* |
$ARGUMENTS: Migration description
"@old/pkg/utils → @new/pkg/utils" — import path migration"move packages/server/src/auth.ts to packages/server/src/auth/index.ts" — file move"rename @company/old-shared → @company/core" — package renamedevelopment
--- name: api-audit description: "Use when auditing API routes for schema drift, missing auth, or validation gaps. Scans routes against shared TypeScript types to find mismatches, missing middleware, and undocumented endpoints. Read-only — produces a severity-grouped report. Keywords: audit routes, schema drift, auth gaps, missing validation, type mismatch, orphaned schemas. Triggers on "audit API routes" or "find schema drift"." --- # API Route & Type Audit Skill ## When to Use Load this skil
development
Use when drafting, translating, polishing, or reviewing Swedish text so it sounds natural, fluent, contemporary, and appropriate for its audience. Triggers include "write better Swedish", "make this sound natural in Swedish", "translate into Swedish", "polish this Swedish", "tech company Swedish", "contemporary Swedish words", "Swedish developer docs", and "avoid Anglicisms".
development
Use when working with shadcn-svelte components, TanStack Table in Svelte 5, or Tailwind v4.1. Covers non-obvious reactivity bugs, library selection trade-offs, and migration pitfalls not in the official docs. Keywords: shadcn-svelte, TanStack Table, Tailwind v4.1, Svelte 5 runes, bits-ui, superforms, data table, svelte-check.
data-ai
Use when mapping IDCS claims to org membership after OAuth login succeeds. Covers mapProfileToUser, session.create.before, session.create.after hooks, MERGE INTO upserts, tenant-org mapping, and first-admin bootstrap. Keywords: IDCS groups, org_members, provisioning, session hooks, tenant map, MERGE INTO.