codemod
Skill2 starsChanged 5 months agoMITView on GitHub
Large-scale refactor via AST-aware transforms — jscodeshift (JS/TS), ts-morph (TS), comby (any language), bowler (Python). Dry-run → review → apply loop. Use for React 18→19, Node 22→24, or any change touching 50+ call sites.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- codemod/skillstheir own version, first seen Oct 20, 2026
- codemod/codemodtheir own version, first seen Oct 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- codemod/codemod★ 1.1ksame name
- codemod/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository60 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- analyzeSkill
- animation-disciplineSkill
- api-versioningSkill
- autopilotSkill
- browser-e2eSkill
- characterizeSkill
- clarifySkill
- constitution-compactSkill
- constitutionSkill
- context-budgetSkill
- creative-webSkill
- db-migrationSkill
- debugSkill
- detect-stackSkill
- dispatch-criteriaSkill
- dreamSkill
- experimentSkill
- fastapiSkill
- flag-cleanupSkill
- flag-rolloutSkill
- flask-realtimeSkill
- framework-detectorSkill
- front-end-designSkill
- grill-meSkill
- handoffSkill
- image-generationSkill
- implementSkill
- initiativeSkill
- instinctSkill
- loopSkill
- nextjsSkill
- observabilitySkill
- okr-alignSkill
- parallel-swarmSkill
- pivotSkill
- planSkill
- pr-bodySkill
- prime-disciplineSkill
- prod-observabilitySkill
- react-nodeSkill
- react-viteSkill
- release-trainSkill
- researchSkill
- reviewSkill
- security-guardSkill
- self-healSkill
- shipSkill
- skill-creatorSkill
- specifySkill
- tailwind-disciplineSkill
- tasksSkill
- tdd-loopSkill
- token-budgetSkill
- typographySkill
- verify-loopSkill
- verifySkill
- wip-checkpointSkill
- <kebab-case-skill-name>Skill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 78
Dry run before write: Always preview the diff.
- Distinctive: line 79
One transform per PR: Don't combine codemods with feature work.
- Very specific: line 86
When /upgrade <pkg> --major is invoked, this skill is the first call:
- Distinctive: line 87
Read the upgrade guide
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codemod — refactor at scale
50+ call sites of the same change is a codemod, not 50 manual edits.
Tools
| Tool | Languages | When to use |
| jscodeshift | JS/TS via Babel AST | React's official codemod tool; large ecosystem of community codemods |
| ts-morph | TypeScript with type info | Type-aware refactors; renames; signature changes |
| comby | Any language via pattern matching | Cross-language; no AST setup; quick one-shot |
| bowler | Python via LibCST | Type-aware Python; preserves comments |
| ast-grep | Any language via TreeSitter | Pattern matching with structural awareness |
| Semgrep autofix | Any | When you already have a Semgrep rule |
Process
- Define the transform — write or find a codemod. Express as: "for every
<pattern>, replace with<replacement>". - Dry run on a few files — verify the transform does what you expect.
- Dry run on the whole codebase — generates a diff but doesn't write.
- Review the diff — visual review of the proposed changes. Look for false positives.
- Apply — run with
--write. Commit the diff with a "codemod:" prefix. - Verify — tests + typecheck + lint pass.
- Open the PR — descriptive title + body explaining the codemod source.
Example: jscodeshift for a React API rename
// codemods/rename-useLayoutEffect.js
module.exports = function(fileInfo, api) {
const j = api.jscodeshift;
return j(fileInfo.source)
.find(j.CallExpression, { callee: { name: 'useLayoutEffect' } })
.replaceWith(p => j.callExpression(j.identifier('useInsertionEffect'), p.value.arguments))
.toSource();
};Run:
npx jscodeshift -t codemods/rename-useLayoutEffect.js src/ --dry --print # preview
npx jscodeshift -t codemods/rename-useLayoutEffect.js src/ # applyExample: ts-morph for type-aware rename
// codemods/rename-method.ts
import { Project } from "ts-morph";
const project = new Project({ tsConfigFilePath: "tsconfig.json" });
project.getSourceFiles().forEach(sf => {
sf.forEachDescendant(node => {
if (node.getKindName() === 'MethodDeclaration' && node.getName() === 'oldName') {
node.rename('newName'); // type-aware; updates all call sites
}
});
});
project.save();Example: comby (language-agnostic)
# Rename all `foo(:[args])` to `bar(:[args])` across all .ts files
comby 'foo(:[args])' 'bar(:[args])' -d src -extensions ts -in-placeHard rules
- Dry run before write. Always preview the diff.
- One transform per PR. Don't combine codemods with feature work.
- Verify with tests + typecheck. A codemod that breaks the type checker is a codemod that introduced a bug.
- Save the codemod script in
codemods/for future re-runs and as historical record. - Document false positives in the PR description if you had to skip files.
Integration with /upgrade
When /upgrade <pkg> --major is invoked, this skill is the first call:
- Read the upgrade guide
- Find or write the matching codemods
- Dry-run → review → apply per codemod
- Then run the test suite + ship
References
- jscodeshift: https://github.com/facebook/jscodeshift
- ts-morph: https://ts-morph.com/
- comby: https://comby.dev/
- bowler: https://pybowler.io/
- ast-grep: https://ast-grep.github.io/
- React codemod registry: https://github.com/reactjs/react-codemod
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

