---
name: codemod-executor-f0d0a231d1dd
description: Execute automated AST-based code transformations for large-scale refactoring and migration
allowed-tools: ["Bash", "Read", "Write", "Grep", "Glob", "Edit"]
graph:
  domains: [domain:software-engineering]
  specializations: [specialization:code-migration-modernization]
  skillAreas: [skill-area:dead-code-elimination, skill-area:dependency-upgrade-strategies]
  roles: [role:backend-engineer, role:refactor-bot]
  workflows: [workflow:technical-debt-reduction]
  topics: [topic:refactoring]
---

# Codemod Executor Skill

Executes automated code transformations using AST-based tools for large-scale refactoring, framework migrations, and language version upgrades.

## Purpose

Enable automated code transformations for:
- Framework migration (React, Angular, Vue)
- Language version upgrades
- API deprecation handling
- Pattern standardization
- Large-scale refactoring

## Capabilities

### 1. AST-Based Transformations
- Parse source code to AST
- Apply transformation rules
- Generate modified source
- Preserve code style

### 2. Pattern Matching and Replacement
- Define source patterns
- Specify target patterns
- Handle edge cases
- Support wildcards and captures

### 3. Multi-File Transformations
- Apply across entire codebase
- Handle import updates
- Coordinate cross-file changes
- Manage side effects

### 4. Dry-Run Preview
- Preview changes before applying
- Generate diff reports
- Estimate impact scope
- Identify risky transformations

### 5. Rollback Support
- Create transformation checkpoints
- Enable selective rollback
- Track applied codemods
- Maintain change history

### 6. Custom Codemod Creation
- Define new transformation rules
- Test codemods in isolation
- Document transformation logic
- Share across teams

## Tool Integrations

| Tool | Language | Integration Method |
|------|----------|-------------------|
| jscodeshift | JavaScript/TypeScript | CLI |
| ts-morph | TypeScript | Library |
| Rector | PHP | CLI |
| Scalafix | Scala | CLI |
| OpenRewrite | Java | CLI / Maven |
| Bowler | Python | CLI |
| ast-grep | Multi-language | CLI / MCP |
| gofmt -r | Go | CLI |

## Output Schema

```json
{
  "executionId": "string",
  "timestamp": "ISO8601",
  "codemod": {
    "name": "string",
    "version": "string",
    "description": "string"
  },
  "results": {
    "filesProcessed": "number",
    "filesModified": "number",
    "filesSkipped": "number",
    "transformations": "number"
  },
  "changes": [
    {
      "file": "string",
      "transformations": [
        {
          "type": "string",
          "line": "number",
          "before": "string",
          "after": "string"
        }
      ]
    }
  ],
  "errors": [],
  "warnings": []
}
```

## Integration with Migration Processes

- **code-refactoring**: Large-scale refactoring
- **framework-upgrade**: Framework migrations
- **language-version-migration**: Syntax upgrades
- **code-translation**: Language conversion assist

## Related Skills

- `refactoring-assistant`: Suggests transformations
- `static-code-analyzer`: Pre-transformation analysis

## Related Agents

- `code-transformation-executor`: Orchestrates codemods
- `framework-upgrade-specialist`: Framework-specific codemods


---
Source attribution: a5c-ai
Original project: https://github.com/a5c-ai/babysitter
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Gabriel Moreira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: a5c-ai
Original project: https://github.com/a5c-ai/babysitter
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Development & Engineering, Product Management
Roles: Backend Developer, DevOps / SRE, Frontend Developer, Full-Stack Developer, Product Manager
Specialties: API
Tools: Ast Grep, Bowler, Gofmt, Jscodeshift, Openrewrite, Rector, Scalafix, Ts Morph
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: baf8e06193bf9e1135317b896f6f88f827b1b0227a1a8ff6b4a763620e490d45
