codemod/migrations-template/sample-codemod
Claude Code and agent skill by codemod/migrations-template
- community
Checking that the SKILL.md file is still in the repository.
Move React components defined inside other components to module scope to prevent state resets and re-render bugs
Install
npx vskill@latest install codemod/migrations-template/sample-codemodSKILL.md
Operational Instructions for sample-codemod
Instructions for AI agents to read, adapt, run, and execute this codemod workflow safely.
Reading the Workflow Graph
Parse workflow.yaml. The execution graph is:
- apply-transforms — AST transformations via
scripts/codemod.ts - ai-tricky-cases —
depends_on: [apply-transforms]; AI step for closure-dependent cases - publish —
depends_on: [ai-tricky-cases]; push and create PR whenparams.publish_pris true
Run nodes in this topological order. Steps inside each node run sequentially.
Step-by-Step Execution
- Execute each node in topological order.
- After each change-producing step: Run validation before proceeding.
pnpm test— jssg testspnpm run check-types— typechecknpx codemod workflow validate workflow.yaml— workflow schema
- Review diffs. Proceed only when validation passes and changes look correct.
- If validation fails or diffs are wrong, fix and retry before continuing.
AI Steps
When params.run_ai_step is true, the ai-tricky-cases node runs an AI step. Treat the AI step prompt (in workflow.yaml) as context for edge cases that the AST codemod cannot safely handle—e.g. closure-dependent nested components.
- Apply AI changes only where the workflow indicates (inside ai-tricky-cases).
- Keep AI edits localized and reviewable. Add TODOs if unsure.
- Do not re-describe the migration; the prompt already covers the goal and constraints.
Adapting the Workflow and Scripts
To adapt for user code patterns:
- Include/exclude globs — Adjust
includeandexcludein the js-ast-grep step to match the target project layout. - Script logic — Modify
scripts/codemod.tsto add or refine patterns. Run tests after changes. - Params — Use
run_ai_step=truewhen the codebase has closure-dependent nested components that need manual/AI resolution.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcodemods/sample-codemod/SKILL.md
Popularity
- Repository stars
- 7
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/codemod/migrations-template/sample-codemod)