Contributing to Codemod
December 24, 2025 Β· View on GitHub
Thank you for your interest in contributing to Codemod! This guide will help you get started.
This repository contains Codemod's open-source tooling: the CLI and core libraries that power code migrations, framework upgrades, and large-scale changes. We welcome contributions from the community to help make code modernization accessible to everyone.
Note: This repository focuses on the open-source CLI and core libraries. Codemod platform (web app) is part of Codemod's enterprise features and is maintained by the Codemod core team.
Table of Contents
- Code of Conduct
- Ways to Contribute
- Getting Started
- Development Setup
- Project Structure
- Making Changes
- Testing
- Submitting Changes
- Getting Help
Code of Conduct
This project follows our Code of Conduct. By participating, you are expected to uphold this code.
Ways to Contribute
We welcome contributions in several areas:
π Documentation
Help improve our documentation (docs/) to make Codemod more accessible:
- Documentation improvements β Fix typos & inaccuracies, clarify explanations, add examples
- Tutorials and guides β Share your knowledge with the community
π οΈ Tooling
We especially welcome bug fixes and moderate improvements to existing tooling. Drastic changes to user experience or major feature additions typically require broader alignment, as they affect many users and workflowsβthese are often discussed with the core team internally first.
If you have a cool new idea or want to explore bigger changes, please ping us in the community channel before submitting a PR. Weβd love to chat and help shape the direction together!
Help improve the core tools that power Codemod:
CLI (crates/cli/)
The Rust-based CLI is the heart of Codemod. Contributions welcome for:
- New features and commands
- Performance improvements
- Bug fixes
- Better error messages and user experience
JSSG & workflows (crates/core/, crates/codemod-sandbox/)
The workflow engine and JavaScript ast-grep execution:
- Workflow engine (
crates/core/) β Core execution engine improvements - JSSG execution (
crates/codemod-sandbox/) β JavaScript/TypeScript codemod execution - Workflow features β New step types, better error handling, performance optimizations
Codemod MCP (crates/mcp/)
The Model Context Protocol server for AI-powered codemod creation:
- MCP tools β New analysis and transformation tools
- AI improvements β Improvements to AI-powered codemod generation
- IDE support β Better integration with AI-powered IDEs
π¦ Registry
The best way to contribute to the registry is by publishing codemods:
- Publish codemods β Share your transformations with the community
- Improve existing codemods β Submit improvements to community codemods
- Document codemods β Help others discover and use codemods effectively
Learn more about publishing codemods in the Registry documentation.
Getting Started
Prerequisites
- Node.js >= 24.x
- pnpm >= 10.x
- Rust (latest stable) β for CLI and core development
Development Setup
Run Documentation Local Server
# Install Mintlify CLI
npm i -g mint
# Run documentation site (in docs/)
mint dev
Install Dependencies
# Install Node.js dependencies
pnpm install
# Rust dependencies are automatically managed by Cargo
# No separate installation needed
Build the Project
# Build the Rust CLI (from project root)
cargo build --release
# Or build specific crates
cargo build --release --package codemod
cargo build --release --package codemod-sandbox
Test the CLI
# Build the CLI
cargo build --release --package codemod --bin codemod
# Test CLI commands
./target/release/codemod --help
./target/release/codemod workflow --help
./target/release/codemod jssg --help
Project Structure
This monorepo contains the open-source Codemod CLI and core libraries:
Core Components
crates/cli/β Main Rust-based CLIcrates/core/β Workflow engine (butterflow-core)crates/codemod-sandbox/β JavaScript/TypeScript execution sandbox for JSSGcrates/mcp/β Model Context Protocol server for AI-powered codemod creationcrates/models/β Workflow models and data structurescrates/runners/β Container runners (Docker, Podman)crates/state/β Workflow state managementcrates/telemetry/β Telemetry and analytics
Semantic Analysis
crates/language-core/β Language provider core abstractionscrates/language-javascript/β JavaScript/TypeScript semantic analysiscrates/language-python/β Python semantic analysiscrates/semantic-factory/β Semantic analysis factorycrates/llrt-capabilities/β LLRT capabilities module
Testing
crates/testing-utils/β Shared testing utilities for Rust crates
Shared Packages
packages/jssg-types/β TypeScript types for JSSG codemodspackages/jssg-utils/β Utility functions for JSSG codemodspackages/tsconfig/β Shared TypeScript configurationpackages/codemod-utils/β Public utilities for codemod authorspackages/utilities/β Internal shared utilities
Applications
docs/β Documentation website (Mintlify)
Making Changes
Development Workflow
- Make your changes in the appropriate directory
- Write or update tests for your changes
- Run tests to ensure everything passes
- Lint your code:
# TypeScript/JavaScript pnpm lint pnpm format # Rust cargo fmt --check cargo clippy - Format your code:
# TypeScript/JavaScript pnpm lint:fix pnpm format:fix # Rust cargo fmt
Code Style
- TypeScript/JavaScript: We use oxlint for linting and oxfmt for formatting
- Rust: We use
rustfmt(configured inrustfmt.toml) andclippy - Documentation: Follow existing patterns and use clear, concise language
- Write clear, self-documenting code
- Add comments for complex logic
Testing
Run Tests
# Run all Rust tests
cargo test
# Run tests for a specific crate
cargo test --package codemod-sandbox
cargo test --package butterflow-core
Writing Tests
- Write tests for new features and bug fixes
- Aim for good test coverage
- Use descriptive test names
- Test both happy paths and edge cases
- For CLI changes, test the actual command execution
Testing CLI Changes
# Build the CLI
cargo build --release --package codemod --bin codemod
# Test a command
./target/release/codemod workflow validate -w path/to/workflow.yaml
./target/release/codemod jssg run script.js --target ./test-dir
Submitting Changes
Before Submitting
- Update documentation if you've changed functionality
- Add changelog entries if applicable
- Ensure all tests pass
- Ensure linting passes
- Rebase on latest main:
git fetch upstream git rebase upstream/main
Commit Messages
We use Conventional Commits:
feat:for new featuresfix:for bug fixesdocs:for documentation changesrefactor:for code refactoringtest:for test changeschore:for maintenance tasksperf:for performance improvements
Examples:
feat(cli): add support for custom workflow paths
fix(jssg): handle edge case in TypeScript parsing
docs: update CLI reference with new commands
Pull Request Process
-
Push your branch to your fork:
git push origin feature/your-feature-name -
Create a Pull Request on GitHub:
- Use a clear, descriptive title
- Fill out the PR template
- Link any related issues
- Describe what changes you made and why
-
Respond to feedback:
- Address review comments
- Make requested changes
- Keep the discussion constructive
-
Sign the CLA: You'll be asked to sign our Contributor License Agreement when you create your first PR.
PR Checklist
- Code follows the project's style guidelines
- Tests pass locally
- Documentation updated (if needed)
- Commit messages follow Conventional Commits
- Changes are focused and atomic
- No breaking changes (or clearly documented)
Contributing to Specific Areas
CLI Development
The CLI is written in Rust. Key areas:
- Commands (
crates/cli/src/commands/) β Add new commands or improve existing ones - Workflow execution (
crates/cli/src/workflow_runner.rs) β Workflow execution logic - Engine integration (
crates/cli/src/engine.rs) β Integration with execution engines
Workflow Engine
The workflow engine (crates/core/) orchestrates multi-step codemod execution:
- Execution logic β How workflows are parsed and executed
- Step types β Support for new step types
- Error handling β Better error messages and recovery
JSSG
JavaScript ast-grep execution (crates/codemod-sandbox/):
- Execution engine β JavaScript/TypeScript code execution
- Module resolution β Better handling of imports and dependencies
- TypeScript support β Enhanced TypeScript parsing and transformation
Documentation
Documentation is in docs/:
- MDX files β Documentation content
- Examples β Code examples and snippets
- Images β Screenshots and diagrams
Getting Help
- Documentation: docs.codemod.com
- Community Slack: codemod.com/community
- GitHub Issues: For bug reports and feature requests
License
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.
Thank You! π
Thank you for contributing to Codemod! Your contributions help make code modernization accessible to everyone. Whether you're fixing a typo, adding a feature, or publishing a codemod to the registry, every contribution makes a difference.