Skip to content

a5c-ai/babysitter / library/specializations/code-migration-modernization/skills/codemod-executor

codemod-executor

Verified

Execute automated AST-based code transformations for large-scale refactoring and migration

FileKindSize
README.mdmarkdown1.5 KB
SKILL.mdskill md3.2 KB
# Codemod Executor Skill

## Overview

The Codemod Executor skill runs automated AST-based code transformations. It enables large-scale refactoring, framework migrations, and consistent code pattern updates across entire codebases.

## Quick Start

### Prerequisites

- Node.js 18+ (for JavaScript codemods)
- Language-specific codemod tools
- Version control for safety

### Basic Usage

1. **Select codemod**
   ```bash
   # List available codemods
   npx jscodeshift --list
   ```

2. **Dry run**
   ```bash
   npx jscodeshift -t transform.js src/ --dry
   ```

3. **Execute**
   ```bash
   npx jscodeshift -t transform.js src/
   ```

## Features

### Transformation Types

| Type | Use Case | Example |
|------|----------|---------|
| API Migration | Update deprecated APIs | React lifecycle methods |
| Syntax Upgrade | Language version updates | async/await conversion |
| Pattern Replacement | Standardize patterns | Error handling |
| Import Updates | Module path changes | Package renames |

### Common Codemods

- React: `react-codemod`
- Next.js: `@next/codemod`
- TypeScript: `ts-morph` scripts
- Java: OpenRewrite recipes

## Configuration

```json
{
  "parser": "tsx",
  "extensions": ["ts", "tsx"],
  "ignorePattern": ["**/node_modules/**", "**/dist/**"],
  "dryRun": false,
  "verbose": true
}
```

## Related Documentation

- [SKILL.md](./SKILL.md) - Full skill specification
- [jscodeshift](https://github.com/facebook/jscodeshift)
- [OpenRewrite](https://docs.openrewrite.org/)
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall