codemod-gen

Generate jscodeshift codemods for codebase-wide transformations.

1|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/jieni777/opencode-config-backup --skill codemod-gen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codemod-gen
Source: https://github.com/jieni777/opencode-config-backup/tree/main/skills/codemod-gen
Command: npx skills add https://github.com/jieni777/opencode-config-backup --skill codemod-gen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Codemod-gen helps teams automate large-scale code transformations, eliminating manual edits across many files.

Core Features & Use Cases

  • Generates jscodeshift codemods for your specific transformation
  • Handles complex patterns like class to function conversions
  • Preserves formatting and comments
  • Works across entire codebases

Quick Start

Run npx ai-codemod 'convert class components to functional' to generate the codemod for your project.

Frequently Asked Questions about codemod-gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate javascript code migration across an entire codebase?

To automate javascript code migration, you can generate a jscodeshift codemod to perform a described code transformation across your entire codebase. This eliminates manual edits by producing a ready-to-run script for large-scale changes.

Can I convert class components to functional components using a codemod?

Yes, you can convert class components to functional components by generating a targeted jscodeshift codemod. This handles complex patterns like class-to-function conversions and modernization tasks across many files automatically.

How do I generate a jscodemod that preserves formatting and comments?

To generate a codemod that preserves formatting and comments, request a jscodeshift or babel compatible script for your transformation. The generated codemod ensures original code formatting and comments are maintained during refactoring.

What is the best way to refactor an API across many files?

The best way to refactor an API across many files is generating a codemod script. This creates an automated AST-based transformation to execute API migrations uniformly across an entire codebase, preventing manual errors.

Do I need jscodeshift to run the generated code migration script?

Yes, you need jscodeshift or babel to run the generated code migration script. The tool produces a ready-to-run codemod that is fully compatible with these frameworks to execute the AST transformations.

Why use a codemod for javascript refactoring instead of manual find and replace?

You use a codemod for javascript refactoring because it uses AST manipulation to handle complex pattern changes like API migrations across an entire codebase. This scales accurately where manual find and replace fails.