codemod-gen_skill

This skill generates AST-based codemods to safely refactor large codebases across files with minimal manual effort.
  • Python

2.5k

GitHub Stars

6

Bundled Files

3 weeks ago

Catalog Refreshed

2 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstart where the catalogue uses aiagentskills.

npx veilstart add skill openclaw/skills --skill codemod-gen

  • _meta.json286 B
  • package-lock.json30.2 KB
  • package.json601 B
  • README.md313 B
  • SKILL.md2.2 KB
  • tsconfig.json251 B

Overview

This skill generates AST-based codemods to apply large-scale, safe code transformations across many files. It produces jscodeshift-compatible scripts from a plain-English description so you can refactor patterns, migrate APIs, or modernize code with confidence. No configuration required — run a single command and review the generated diff.

How this skill works

You provide a short natural-language description of the desired transformation and the tool generates a jscodeshift codemod that performs AST-aware edits. The generated codemods preserve formatting and comments, handle complex pattern changes (for example class-to-function component conversions), and can be run across entire repositories using jscodeshift or a compatible runner. The tool is intended to be used via npx and expects an environment with Node.js and an API key for the underlying model.

When to use it

  • Refactoring the same pattern across hundreds of files (e.g., rename methods or replace APIs).
  • Upgrading frameworks or libraries that require structural changes (e.g., React Router v5 to v6).
  • Replacing deprecated APIs with modern equivalents (e.g., moment to date-fns).
  • Enforcing new code patterns or project-wide style adjustments.
  • Preparing large-scale automated migrations before or after a major release.

Best practices

  • Run codemods on a fresh branch and keep changes isolated for review.
  • Review diffs and spot-check transformed files before merging.
  • Run codemods incrementally by file type or module to limit blast radius.
  • Write or save the generated codemod for repeatability and CI automation.
  • Add tests or run existing test suites after transformations to catch regressions.

Example use cases

  • Convert React class components to functional components across the codebase.
  • Replace lodash.get calls with optional chaining syntax.
  • Migrate date handling from moment to date-fns with automated AST edits.
  • Update import paths and API calls during a library upgrade.
  • Standardize error handling patterns or logging calls across services.

FAQ

No install is required; run via npx. Node.js 18+ is recommended and the tool uses an API key for the model.

How do I verify changes before applying them?

Generate the codemod and run jscodeshift in dry-run or preview mode, then review diffs and run tests before merging.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational