Agent skill

Codemod

by pmndrs in pmndrs/glyph

Author, archive, apply, and verify TypeScript codemods with ts-morph for APIs that have reached the remote default branch or external users.

MITAuto-check passedDevelopment

Install Codemod

skills CLI
$ npx skills add pmndrs/glyph --skill codemod -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pmndrs/glyph codemod --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pmndrs/glyph.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/codemod .claude/skills/codemod && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codemod
GitHub stars
393
Token cost
~1.2k tokens
SKILL.md length
559 words
Files
47 (incl. scripts, references)
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

Author, archive, apply, and verify TypeScript codemods with ts-morph for APIs that have reached the remote default branch or external users.

  • Works in 6 steps: Resolve the exact target root and… → Run the deterministic transform without… → Apply with --write only when the user… → …
  • Shipped public API migrations
  • SKILL.md covers Establish whether a migration…, Choose a mode, Apply safely and Archive rules
  • Runs JavaScript scripts from its folder; calls mise

What it does

Codemod is an agent skill from pmndrs/glyph. Author, archive, apply, and verify TypeScript codemods with ts-morph for APIs that have reached the remote default branch or external users. Use for shipped public API migrations, symbol renames, call-signature rewrites, import moves, or requests to preserve a dated migration recipe. Do not use for unmerged work-in-progress APIs or global text replacement.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 51 other files, including scripts and reference files (for example `agents/openai.yaml`, `codemods/2026-08-28-font-load-arguments/instructions.md` and `codemods/2026-08-28-font-load-arguments/project-js-tests.json`).

It sits in Development, covering Code migrations. It works with TypeScript. The repository describes itself as: ♠️ A typography engine for web graphics. The licence is MIT.

When your agent uses it

  • Shipped public API migrations
  • Call-signature rewrites
  • Requests to preserve a dated migration recipe
  • Unmerged work-in-progress APIs

Example prompts

  • “/codemod”

Requirements

  • Node.js

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Resolve the exact target root and tsconfig. Never target a broad home, workspace parent, dependency store, or
  2. Run the deterministic transform without --write first. Review every reported file and inspect the diff that would
  3. Apply with --write only when the user authorized mutation
  4. Follow instructions.md for semantic sites the transform deliberately leaves unresolved. Preserve the stated
  5. Use AST queries to enumerate remaining old imports, identifiers, property accesses, call shapes, comments, and string
  6. Run every recipe verification command plus the affected package checks. Generated JavaScript, declarations, digests,

What it can do on your machine

Read from SKILL.md and the folder at commit 51a1f34. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (JavaScript, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • mise

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codemod loads about 1.2k tokens when it runs, and up to ~2.1k if it reads all its reference files. Until then it costs about 92 tokens; SKILL.md has 559 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~92
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from pmndrs/glyph at commit 51a1f34, republished under its MIT licence (© pmndrs). 559 words, ~1,237 tokens.

Download SKILL.mdSave it as .claude/skills/codemod/SKILL.md (or your agent's skills folder). This skill also uses 46 other files; get the full folder from GitHub.
name
codemod
description
Author, archive, apply, and verify TypeScript codemods with ts-morph for APIs that have reached the remote default branch or external users. Use for shipped public API migrations, symbol renames, call-signature rewrites, import moves, or requests to preserve a dated migration recipe. Do not use for unmerged work-in-progress APIs or global text replacement.

Codemod

Use pinned ts-morph for TypeScript and TSX migrations. A codemod is a complete migration recipe, not merely a rename map: it combines deterministic AST transforms with enough semantic guidance for an agent to rewrite call sites that cannot be changed mechanically.

Establish whether a migration exists

Before authoring a recipe for repository-owned API work, determine whether the affected surface exists on the remote default branch, a released tag, or another externally consumed canary. If the symbol or call shape exists only in the current unmerged branch or worktree, there is no consumer migration to preserve: edit the source and its in-repository call sites directly, and do not create or archive a codemod. A public-looking declaration is not a migration surface until it has been merged or otherwise shared with consumers.

Use a codemod once compatibility evidence exists, or when the user explicitly asks to preserve a migration recipe. When history is ambiguous, inspect the remote default branch and release/canary history before choosing the heavier workflow.

Choose a mode

  • Apply an archived codemod: list the archive, select every recipe after the caller's current canary, and read each recipe's recipe.json and instructions.md completely before changing files.
  • Author a codemod: read references/recipe-format.md, create one dated recipe, test its automatic transform, and prove its agent-directed steps against real call sites.
  • Rename landed or externally consumed repository symbols: author the dated recipe first, then apply it to this repository. The recipe is the durable record and consumer migration aid; an ignored one-off script is not sufficient.
  • Rename unmerged work-in-progress symbols: update the source and current in-repository call sites directly. Do not manufacture a migration archive for an API no consumer could have used.

List archived recipes without loading their instructions:

bash
mise exec -- node .agents/skills/codemod/scripts/list-codemods.mjs

Verify that every archived migration is already applied, or apply the complete archive in lexical order:

bash
mise exec -- node .agents/skills/codemod/scripts/run-all-codemods.mjs \
  --project path/to/tsconfig.json --target path/to/project --check
mise exec -- node .agents/skills/codemod/scripts/run-all-codemods.mjs \
  --project path/to/tsconfig.json --target path/to/project --write
Show full SKILL.md (269 more words)Show less

Apply safely

  1. Resolve the exact target root and tsconfig. Never target a broad home, workspace parent, dependency store, or node_modules directory.

  2. Run the deterministic transform without --write first. Review every reported file and inspect the diff that would result.

  3. Apply with --write only when the user authorized mutation:

    bash
    mise exec -- node .agents/skills/codemod/scripts/run-codemod.mjs \
      --codemod .agents/skills/codemod/codemods/YYYY-MM-DD-name \
      --project path/to/tsconfig.json \
      --target path/to/project \
      --write
  4. Follow instructions.md for semantic sites the transform deliberately leaves unresolved. Preserve the stated ownership, ordering, error, and lifecycle invariants; stop for a real user decision instead of guessing.

  5. Use AST queries to enumerate remaining old imports, identifiers, property accesses, call shapes, comments, and string literals. Change human-facing strings deliberately; do not rename protocol values, persisted data, fixture identities, generated ABI names, or artifact paths because their spelling resembles an API symbol.

  6. Run every recipe verification command plus the affected package checks. Generated JavaScript, declarations, digests, and ABI files are regenerated through their owning workflow, never edited by the codemod.

For symbol renames, use the runner's renameSymbol() helper. It delegates identifiers to ts-morph's language service, scans actual comment trivia separately, and never renames string literals. A successful typecheck is necessary but does not prove semantic call sites were migrated; the recipe's behavioral postconditions remain required.

Archive rules

Recipes live under codemods/YYYY-MM-DD-slug/ and are applied in lexical date order. Once a recipe has been shared with canary users, do not rewrite its migration meaning. Add a later corrective recipe so users can apply an ordered chain. The archive is the canonical rename and call-site map; public prose links to it or is rendered from it.

© pmndrs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 46 other files (scripts, references) in .agents/skills/codemod of pmndrs/glyph.

  • SKILL.md
  • agents/openai.yaml
  • codemods/2026-08-28-font-load-arguments/instructions.md
  • codemods/2026-08-28-font-load-arguments/project-js-tests.json
  • codemods/2026-08-28-font-load-arguments/project.json
  • codemods/2026-08-28-font-load-arguments/recipe.json
  • codemods/2026-08-28-font-load-arguments/test.mjs
  • codemods/2026-08-28-font-load-arguments/transform.mjs
  • codemods/2026-08-28-id-factory/instructions.md
  • codemods/2026-08-28-id-factory/project-js-tests.json
  • codemods/2026-08-28-id-factory/project.json
  • codemods/2026-08-28-id-factory/recipe.json
  • codemods/2026-08-28-id-factory/test.mjs
  • codemods/2026-08-28-id-factory/transform.mjs
  • codemods/2026-08-28-paragraph-contract/instructions.md
  • codemods/2026-08-28-paragraph-contract/recipe.json
  • … and 31 more

Open the folder on GitHubat commit 51a1f34

Compare with similar skills

Codemod next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codemod compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codemod this skillpmndrs/glyph393—~1.2kAutomated safety check: PassMIT
Convert Internal Package to TypeScriptTryGhost/Ghost55k—~1.2kAutomated safety check: PassMIT
jscpd Code Migration Trackerkucherenko/jscpd6.4k—~5kAutomated safety check: PassMIT
ast-grep Codemod Referencewarp-drive-data/warp-drive3.2k—~2.6kAutomated safety check: PassMIT
Code Migrationanthropics/code-migration-kit-with-claude-code743—~983Automated safety check: PassCustom licence
AngularJS to Angular Migrationwshobson/agents40k11 repos~1.8kAutomated safety check: PassMIT

Similar skills

  • Moves a legacy internal Ghost package from JavaScript and CommonJS to TypeScript and ESM in three focused commits that keep git file history intact.

    55k GitHub stars~1.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Measures a code port between languages or frameworks with jscpd's function-level comparison, porting tests before code and tracking what is left unmatched.

    6.4k GitHub stars~5k tokensUpdated today
    DevelopmentAuto-check passed
  • ast-grep Codemod Reference

    warp-drive-data/warp-drive

    Reference for writing and debugging TypeScript and JavaScript codemods with @ast-grep/napi: parsing, node queries, meta-variables, rule objects and editing.

    3.2k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Migration

    anthropics/code-migration-kit-with-claude-code

    Official

    Run a large-scale language migration with the six-step process: create the map and the rules, stress-test the rules, translate everything, compile, run it, match behavior.

    743 GitHub stars~983 tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Guides migrating AngularJS 1.x apps to modern Angular: choosing a strategy, running a hybrid app with ngUpgrade, and converting controllers, directives and services.

    40k GitHub starsUsed in 11 repos~1.8k tokens
    DevelopmentAuto-check passed
  • An extremely strict maintainability review for abstraction quality, giant files, and spaghetti-condition growth.

    110 GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed

More from pmndrs/glyph

All 8 skills in this repo
  • Create, migrate, inspect, query, validate, or maintain Open Knowledge Format v0.2 bundles made from linked Markdown concepts with YAML provenance.

    393 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Tsl

    pmndrs/glyph

    Implement, migrate, review, debug, or verify Three.js Shading Language (TSL) materials, node graphs, WebGPU compute work, and post-processing.

    393 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Diataxis Docs

    pmndrs/glyph

    Design, classify, write, audit, or restructure technical documentation with the Diátaxis framework.

    393 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Audit and improve repository code milestone by milestone for correctness, clarity, local reasoning, DRY design, explicit state modeling, panic resistance, and trustworthy TypeScript boundaries.

    393 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Evidence First

    pmndrs/glyph

    Shape human-facing engineering communication—including chat updates and final answers, reports, reviews, handoffs, debugging or benchmark summaries, PR and issue prose, READMEs, and technical…

    393 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Gh Stack

    pmndrs/glyph

    Manage dependent branches and pull requests with the gh-stack GitHub CLI extension.

    393 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Codemod

What does Codemod do?

Author, archive, apply, and verify TypeScript codemods with ts-morph for APIs that have reached the remote default branch or external users. Codemod is an agent skill from pmndrs/glyph. Author, archive, apply, and verify TypeScript codemods with ts-morph for APIs that have reached the remote default branch or external users.

When should I use Codemod?

Codemod fits situations like: shipped public API migrations; call-signature rewrites; requests to preserve a dated migration recipe; unmerged work-in-progress APIs.

How do I install Codemod in Claude Code?

Run `npx skills add pmndrs/glyph --skill codemod -a claude-code`. Or copy the skill folder (.agents/skills/codemod in pmndrs/glyph) into .claude/skills/codemod in your project. Claude Code loads it when a task matches its description.

How do I install Codemod in Codex?

Run `npx skills add pmndrs/glyph --skill codemod -a codex`. Or copy the skill folder (.agents/skills/codemod in pmndrs/glyph) into .agents/skills/codemod in your project. Codex loads it when a task matches its description.

Can I use Codemod in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pmndrs/glyph --skill codemod -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codemod, .gemini/skills/codemod, .github/skills/codemod and .opencode/skills/codemod in your project.

What does Codemod need to run?

Going by SKILL.md and its folder, Codemod needs JavaScript for the scripts in its folder and the command-line tools its instructions call (mise). Our summary lists: Node.js.

Does Codemod access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Codemod safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Codemod use?

Codemod is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codemod use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 823 tokens, read only when the agent opens those files.

What are the alternatives to Codemod?

Skills that share tags, products or a category with Codemod: Convert Internal Package to TypeScript (TryGhost/Ghost, 55k stars), jscpd Code Migration Tracker (kucherenko/jscpd, 6.4k stars), ast-grep Codemod Reference (warp-drive-data/warp-drive, 3.2k stars) and Code Migration (anthropics/code-migration-kit-with-claude-code, 743 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codemod?

pmndrs (a GitHub organization) maintains it in pmndrs/glyph, which has 393 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 8, 2026.

Source: pmndrs/glyph on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.