Install
openclaw skills install codemodUse Codemod CLI whenever the user wants to migrate, upgrade, update, or refactor a codebase in a repeatable way. This includes framework migrations, library upgrades, version bump migrations, API surface changes, deprecations, large-scale mechanical edits, codemod package authoring, AST inspection, tree-sitter node type lookup, and Codemod documentation lookup through `codemod ai` commands. First search the Codemod Registry for an existing package, prefer deterministic codemods before open-ended AI rewrites, run dry-runs before apply, and create a codemod package only when no suitable package exists.
openclaw skills install codemodcodemod-compatibility: mcs-v1 codemod-skill-version: 1.1.0
Use this skill to orchestrate migration execution, codemod package authoring, and Codemod CLI AI inspection.
Trigger this skill when the user asks to:
When the intent is migration/update/upgrade oriented, use Codemod first before defaulting to a fully open-ended AI rewrite.
Codemod AI tools must be usable without MCP. Prefer the CLI commands below when MCP tools/resources are missing, stale, blocked by the harness, or when you need a user-reproducible command:
echo 'const x = 23;' | npx codemod ai dump-ast --npx codemod ai dump-ast src/App.tsxnpx codemod ai node-types tsxnpx codemod ai docsnpx codemod ai docs codemod-creation-workflowIf MCP is available, direct MCP calls are acceptable. If MCP is unavailable, do not stop authoring only because MCP is missing; use the codemod ai CLI equivalents.
When the user:
codemod-creation-workflow-instructions first via MCP or npx codemod ai docs codemod-creation-workflow. Before writing source-transform code, read jssg-gotchas and ast-grep-gotchas via MCP or npx codemod ai docs jssg-gotchas / npx codemod ai docs ast-grep-gotchas. Read codemod-cli-instructions only when you need exact command syntax. Read jssg-instructions once a package exists and you are implementing the transform.validate_codemod_package or run npx codemod ai call validate_codemod_package --input '{"package_path":"."}' before stopping.jssg-runtime-capabilities-instructions via MCP or npx codemod ai docs jssg-runtime-capabilities.codemod-maintainer-monorepo-instructions via MCP or npx codemod ai docs codemod-maintainer-monorepo.codemod-cli-instructions via MCP or npx codemod ai docs codemod-cli.codemod-troubleshooting-instructions via MCP or npx codemod ai docs codemod-troubleshooting.jssg-utils-instructions via MCP or npx codemod ai docs jssg-utils.sharding-instructions via MCP or npx codemod ai docs sharding.codemod ai docs or MCP resources as the source of truth for CLI, workflow, and JSSG semantics.npx codemod ai dump-ast or MCP dump_ast before broadening heuristics.npx codemod ai node-types <language> or MCP get_node_types when node kinds or fields are unclear.from -> to migration as a single package unless the request is clearly open-ended or multi-hop.codemod init immediately instead of continuing broad research without a package. In headless/non-interactive flows, use the simplified codemod init <path> --no-interactive interface and pass only user- or task-provided flags; do not invent --author, --license, --description, or --git-repository-url.README.md, codemod.yaml, workflow.yaml, package.json scripts, tests/fixtures, and any renamed paths, ids, or references. Do not churn version numbers by default, but do not leave stale package metadata behind after a rename or material package-surface change.workflow.yaml, codemod.yaml, README, and package metadata must all describe the same codemod.base_path, include, and exclude globs that match the actual target file types and keep codemod.yaml targets.languages aligned with that scope.package.json scripts and package-local README/development commands. Infer it from the scaffold choice, lockfile, or existing package metadata; do not rewrite yarn/pnpm/bun packages to npx/npm unless the user explicitly asked.validate_codemod_package still reports starter scaffold markers, missing package surface updates, missing real test cases, or failing default tests.codemod search.codemod run --dry-run before apply.codemod <package-id> and accept the install prompt when a package exposes installable skill behavior.codemod search before proposing a manual migration plan.--dry-run before proposing bespoke manual or AI-only migration work.codemod search.codemod ai CLI equivalents.