jscodeshift

Guide jscodeshift codemod development for AST traversal and transformation.

193|17|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/pproenca/dot-skills --skill jscodeshift
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jscodeshift
Source: https://github.com/pproenca/dot-skills/tree/main/skills/.experimental/jscodeshift
Command: npx skills add https://github.com/pproenca/dot-skills --skill jscodeshift

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to writing effective, performant, and safe jscodeshift codemods, preventing common pitfalls and ensuring reliable code transformations.

Core Features & Use Cases

  • Best Practices: Covers parser configuration, AST traversal, node filtering, transformation, and code generation.
  • Performance Optimization: Rules to ensure codemods run efficiently on large codebases.
  • Correctness & Safety: Guidelines to prevent unintended code modifications and runtime errors.
  • Use Case: When developing a codemod to migrate a large React codebase from class components to functional components, use this Skill to ensure the codemod is robust, efficient, and doesn't break existing functionality.

Quick Start

Apply the jscodeshift skill to review the best practices for writing a codemod to refactor React component imports.

Frequently Asked Questions about jscodeshift

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

FAQPage Schema
How do I write a codemod to automate code refactoring across a large codebase?

To write a codemod for code refactoring, configure the parser, traverse the AST, filter nodes, apply transformations, and generate code. This Skill provides best practices to ensure your codemod is robust, performant, and safe for large codebases.

What are the best practices for AST traversal and node filtering in code transformations?

Best practices for AST traversal and node filtering in code transformations involve strict parser configuration and targeted node selection. This Skill guides you through safe AST manipulation patterns to prevent unintended modifications and runtime errors during automated refactoring.

How do I optimize codemod performance for large scale React migrations?

Optimizing codemod performance for large scale React migrations requires adhering to specific performance rules during AST manipulation. This Skill outlines strategies to ensure your code transformations run efficiently without breaking existing functionality.

Can I use jscodeshift to migrate React class components to functional components safely?

Yes, you can use jscodeshift to safely migrate React class components to functional components. This Skill ensures your automated code transformation adheres to established patterns for correctness, preventing unintended code modifications during the refactoring process.

Why does my automated code transformation result in unintended code modifications?

Automated code transformations often result in unintended modifications due to incorrect AST traversal or node filtering. This Skill provides safety guidelines and established patterns to prevent runtime errors and ensure reliable code generation during refactoring.

Do I need to configure a specific parser for jscodeshift code transformations?

Yes, configuring the correct parser is essential for jscodeshift code transformations. This Skill covers parser configuration and AST manipulation techniques to ensure your codemod accurately processes and transforms target code.