---
name: codemod-generator-52fa4e433151
description: Generate automated code migration scripts (codemods)
allowed-tools:
  - Read
  - Write
  - Edit
  - Glob
  - Grep
  - Bash
graph:
  domains: [domain:software-engineering]
  specializations: [specialization:sdk-platform-development]
  skillAreas: [skill-area:sdk-codegen, skill-area:breaking-change-management]
  roles: [role:platform-engineer]
  topics: [topic:api-design, topic:developer-experience]
---

# Codemod Generator Skill

## Overview

This skill generates automated code migration scripts (codemods) that transform consumer code to use new API versions, reducing the burden of SDK upgrades on developers.

## Capabilities

- Create AST-based code transformations
- Support multiple languages (JavaScript, TypeScript, Python, Go)
- Provide dry-run mode with change preview
- Implement safe rollback mechanisms
- Generate detailed migration reports
- Handle edge cases and partial migrations
- Support interactive migration modes
- Validate transformations with tests

## Target Processes

- Backward Compatibility Management
- Package Distribution
- SDK Versioning and Release Management

## Integration Points

- jscodeshift for JavaScript/TypeScript
- libcst for Python
- go-codemod for Go
- Rector for PHP
- Custom AST transformers

## Input Requirements

- Source and target API versions
- Transformation rules specification
- Test cases for validation
- Edge case handling requirements
- Rollback strategy

## Output Artifacts

- Codemod scripts per language
- Dry-run reports
- Migration validation tests
- Edge case documentation
- CLI wrapper for execution
- Rollback scripts

## Usage Example

```yaml
skill:
  name: codemod-generator
  context:
    sourceVersion: "1.x"
    targetVersion: "2.0"
    languages:
      - typescript
      - python
    transformations:
      - type: methodRename
        from: oldMethod
        to: newMethod
      - type: parameterChange
        method: createResource
        changes:
          - name: config
            wrap: options
    dryRun: true
    generateTests: true
```

## Best Practices

1. Always provide dry-run mode first
2. Generate comprehensive change reports
3. Handle partial migrations gracefully
4. Include rollback capabilities
5. Test codemods against real codebases
6. Document manual intervention cases


---
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, Growth Product Manager, Product Manager, Technical Product Manager
Specialties: API, Backend, Cross Platform
Tools: Go Codemod, Jscodeshift, Libcst, Rector
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 6ee376e7ccbbdcdd501455b852dc1e94b37c89e47d2379bf221e5a72a86dde33
