a5c-ai/babysitter / library/specializations/code-migration-modernization/skills/codemod-executor
codemod-executor
VerifiedExecute automated AST-based code transformations for large-scale refactoring and migration
README.md
View on GitHub# 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/)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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 implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |