codemod

Guide AI agents in writing, reviewing, and debugging codemods with AST transformations.

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

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 set of best practices for writing, reviewing, and debugging codemods, AST transformations, and automated refactoring tools, ensuring efficiency, safety, and maintainability.

Core Features & Use Cases

  • AST Understanding: Rules for correctly interpreting Abstract Syntax Trees.
  • Pattern Efficiency: Guidelines for writing performant and precise matching patterns.
  • Workflow Design: Best practices for orchestrating complex code migrations.
  • Use Case: When developing a codemod to upgrade a large codebase to a new framework version, use this Skill to ensure your transformations are robust, efficient, and safe.

Quick Start

Apply the codemod skill to review the AST pattern for matching React components.

Frequently Asked Questions about codemod

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

FAQPage Schema
How do I write safe AST transformations for large codebase migrations?

Safe AST transformations require correct Abstract Syntax Tree interpretation, precise matching patterns, and semantic analysis. This Skill provides 48 rules across 11 categories to ensure efficient, maintainable code transformations without breaking existing functionality.

What is the best way to automate code refactoring using ast-grep?

Automated refactoring with ast-grep requires optimized pattern matching and strategic node traversal. This Skill guides writing performant JSSG patterns, handling edit operations, and managing state to execute reliable code transformations across complex projects.

How do I debug a codemod that is not matching the correct syntax nodes?

Debugging unmatched syntax nodes involves reviewing AST traversal strategies and verifying pattern efficiency. This Skill offers rules for correct AST understanding, parsing strategy validation, and semantic analysis to identify why pattern matching fails.

Can I use this codemod Skill to review and test automated refactoring workflows?

Yes, this Skill encompasses workflow design, testing, and state management rules for automated refactoring. It guides AI agents in reviewing codemod logic, validating edit operations, and ensuring package structure maintains security and maintainability.

When do I need to use JSSG patterns for code transformations?

JSSG patterns are needed when performing structural code transformations that require precise Abstract Syntax Tree matching. This Skill provides guidelines for writing efficient patterns, handling node traversal, and executing accurate edit operations.

Why does my ast-grep codemod produce inconsistent results across different files?

Inconsistent results stem from flawed parsing strategies, inefficient pattern matching, or improper state management. This Skill provides rules for semantic analysis, node traversal, and workflow design to ensure consistent, safe code transformations.