From sdd
Automates batch file migrations from one pattern to another. Language and framework agnostic. Use when user says "migrate files", "batch migration", "convert all files from X to Y", "replace pattern across files", "mass refactor", or "migrate codebase". Do NOT use for single-file changes or non-migration refactors.
npx claudepluginhub robertraf/rob-agent-workflow --plugin sddThis skill is limited to using the following tools:
You are executing a batch migration: **Transform multiple files from one pattern to another systematically.**
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
You are executing a batch migration: Transform multiple files from one pattern to another systematically.
The user will specify:
$ARGUMENTS
If $ARGUMENTS is empty, ask the user to provide:
Identify all files containing the source pattern. Run the bundled scan script:
bash ${CLAUDE_SKILL_DIR}/scripts/scan-pattern.sh "<source-pattern>" "<scope>" "<ext>"
If the script is not available, fall back to:
grep -rl "<source-pattern>" --include="*.<ext>" <scope>/
Report findings:
Found N files matching source pattern:
1. path/to/FileA.ext (N occurrences)
2. path/to/FileB.ext (N occurrences)
...
If zero files found, report and stop.
Order files by dependency graph:
Present the migration order to the user.
Create a list tracking every file to migrate. Present to the user for approval before proceeding.
For each file in priority order:
Read the entire file. Understand its structure, imports, and usage of the source pattern.
Apply the migration:
grep -n "<source-pattern>" <migrated-file>
If any matches remain, fix them.
# Use the project's test command targeting the affected file/module
If tests fail:
After every 5 files, run the bundled validation script:
bash ${CLAUDE_SKILL_DIR}/scripts/validate-migration.sh "<old-pattern>" "<scope>" "<ext>"
This runs a residual check, build, and full test suite. If any step fails, stop and fix before continuing.
Migration Report: [source] → [target]
═══════════════════════════════════════
Total files: N
Migrated: N ✓
Failed: 0
Remaining: 0
Build: ✓ passing
Tests: ✓ passing (N tests)
Residual check:
grep -r "<source-pattern>" <scope>/ → 0 matches ✓
These are common failure modes during batch migrations. Watch for them:
OldClass.method() might be called with different argument patterns in different files. Read each file — the old pattern may be used in subtly different ways that require different transformations.import { OldName } to import { NewName } but didn't check re-exports, type references, or string literals that reference the old name (e.g., in error messages, logging, or serialization).grep for the exact old pattern but missing variations (e.g., aliased imports, dynamic references, comments that document the old API). Cast a wider net in the residual check.After the migration is complete, validate with:
/review-migration