validate-codemod-recipe

Validate codemods against a real codebase and fix AST transform issues.

3|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/backstage/codemods --skill validate-codemod-recipe
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: validate-codemod-recipe
Source: https://github.com/backstage/codemods/tree/main/.agents/skills/validate-codemod-recipe
Command: npx skills add https://github.com/backstage/codemods --skill validate-codemod-recipe

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the validation of codemods and migration recipes, ensuring that code changes are consistent and free of errors, reducing the manual effort required for codebase maintenance.

Core Features & Use Cases

  • Automated Validation: Run codemods against a real codebase to validate their output and fix issues iteratively.
  • AST Transform Analysis: Inspect every diff and identify issues such as false positives, redundant transforms, and broken references.
  • Test Fixtures: Add and update test fixtures to ensure the codemod's correctness.
  • Use Case: When you need to validate a codemod or migration recipe for a real-world project to ensure it does not introduce errors or break the build.

Quick Start

Run the validate-codemod-recipe skill with the path to your codemod and the target directory: validate-codemod-recipe <codemod-path> <target-dir>

Frequently Asked Questions about validate-codemod-recipe

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate a codemod against a real codebase?

To validate a codemod, you run it against a target directory to inspect diffs and iteratively fix AST transform issues like false positives and broken references, ensuring consistent codebase maintenance.

What is AST transform analysis for migration recipes?

AST transform analysis inspects every diff produced by a migration recipe to identify issues such as false positives, redundant transforms, and broken references within the abstract syntax tree of a codebase.

How do I fix false positives and broken references in my codemod output?

You fix false positives and broken references in codemod output by running the recipe against a real codebase, inspecting the resulting diffs, and iteratively adjusting the AST transforms to correct the errors.

Do I need test fixtures to ensure my codemod works correctly?

Yes, adding and updating test fixtures is necessary to ensure your codemod's correctness, as they provide controlled inputs for validating AST transforms and preventing build-breaking code changes.

Can I automate iterative testing for codebase maintenance scripts?

Yes, you can automate iterative testing for codebase maintenance by running codemods against a real codebase, validating their output, and automatically fixing AST transform issues to reduce manual effort.

What are the limitations of running codemods against a target directory?

Running codemods against a target directory requires a valid codemod path and a real codebase to inspect diffs accurately; without proper test fixtures, iterative fixing of AST transforms may not prevent all build errors.