1. Set up Codemod in your coding agent
Start by installing Codemod Master Skill and Codemod MCP for your preferred coding agent:--project.
2. Scaffold and build your codemod
Create a dedicated folder or repo for your codemod work, then scaffold a starter package:Extract React components from inside other components to module scope to prevent re-creation on render.
Prompting best practices
Tips for writing effective prompts and getting the most out of building codemods with AI.
my-codemod
codemod.yaml
workflow.yaml
scripts
codemod.ts
tests
fixtures
input.tsx
expected.tsx
3. Validate and test
From your scaffolded codemod package directory, validate the workflow and run the generated tests. Validate the workflow schema:tests/ directory. You can use simple input.*/expected.* file pairs or input/ + expected/ directory snapshots when your codemod creates or deletes files. If MCP generated test fixtures, they will run automatically.
For test structure, CI integration, and debugging strategies, see Testing.
4. Run your codemod
From the same package directory, run your codemod on a target codebase:5. Publish
When you’re happy with the result, publish from the package directory: Share your codemod with your team or the community:npx codemod @your-scope/codemod-name.
For CI/CD automation, trusted publishers, and API keys, see the Publishing guide.
Next steps
Scale your migrations
Your migration experience does not stop here. When you’re managing migrations across large codebases or multiple teams, the same codemod package can power Campaigns for automated multi-repo rollouts and Insights for tracking adoption progress. See the Platform quickstart for the full enterprise workflow.Getting help
Join the community
Ask questions, get help, and connect with other codemod users on Slack.
Book a call
Schedule a demo or get hands-on help from the Codemod team.
Learn more
CLI reference
Full CLI command reference.
Workflow reference
Complete workflow.yaml specification.
JSSG
Learn the transformation engine in depth.
Publishing
Authentication methods and CI/CD setup.