Skip to content
Development
Skill

/trace-mcp-codemod

Use trace-mcp apply_codemod for any bulk mechanical change instead of repeated Edit calls. Activate whenever the same edit pattern would be applied 2+ times, across one file or many.

From plugin
trace-mcp
2034 skills14 hooks

Claude Code

$ npx -y skills add nikolai-vysotskyi/trace-mcp --skill trace-mcp-codemod --agent claude-code

SKILL.md

trace-mcp-codemod.SKILL.md
name: trace-mcp-codemod
description: Use trace-mcp apply_codemod for any bulk mechanical change instead of repeated Edit calls. Activate whenever the same edit pattern would be applied 2+ times, across one file or many.

trace-mcp — Codemod Workflow

`apply_codemod` is the correct tool for any repeated mechanical change. Using `Edit` for the same pattern twice or more is a waste of tokens and is error-prone.

When to Use — HARD RULE

If you are about to make the **same kind of change 2 or more times** — whether in one file or across many — stop and use `apply_codemod`. This includes:

  • Adding `async`/`await` to a set of functions
  • Updating a function signature everywhere it is called
  • Fixing import paths after a move
  • Adding or removing keywords/decorators
  • Wrapping calls in a logger, try/catch, or feature flag
  • Replacing a deprecated API usage
  • Any regex-replaceable refactor

No exceptions. "It's just three edits" is still a violation — use `apply_codemod`.

Standard Workflow

1. Preview with dry run (default)

apply_codemod({
  pattern: "oldFunction\\(",
  replacement: "newFunction(",
  file_pattern: "src/**/*.ts",
  dry_run: true        // default
})

Review the preview: matched files, context lines, and replacement correctness. Look for false positives.

2. Narrow scope when needed

Use `filter_content` to only touch files that also contain a second marker:

apply_codemod({
  pattern:        "extractNodes\\(",
  replacement:    "extractNodes(ctx, ",
  file_pattern:   "src/**/*.ts",
  filter_content: "import.*extractNodes",
  dry_run:        true
})

For patterns that cross line boundaries, enable multiline mode:

apply_codemod({
  pattern:     "function\\s+foo\\([^)]*\\)\\s*\\{",
  replacement: "async function foo() {",
  multiline:   true,
  dry_run:     true
})

3. Apply the change

apply_codemod({ ..., dry_run: false })

If more than 20 files are affected, add `confirm_large: true`.

4. Reindex and verify

  • `register_edit` is not needed for codemods — `apply_codemod` handles reindexing internally.
  • Run the test suite or `check_quality_gates` with `scope: "changed"`.

Planning Larger Changes

For changes that span packages or require version awareness (e.g. upgrading a dependency), use `plan_batch_change` first:

plan_batch_change({
  package:      "lodash",
  from_version: "4.17.0",
  to_version:   "5.0.0"
})

This returns an impact report with all affected files and import references. Combine it with `apply_codemod` for the actual rewrite.

Anti-Patterns to Avoid

  • Using `Edit` with `replace_all` for renames — use `apply_rename` (see `trace-mcp-refactoring`).
  • Chaining 3–10 `Edit` calls with the same `old_string` pattern shape — use `apply_codemod`.
  • Skipping the dry-run preview — always review matches first.
  • Forgetting `confirm_large: true` on changes >20 files.
Read more
@nikolai-vysotskyi
Ships withtrace-mcp

Framework-aware code intelligence MCP server — 91 framework integrations, 81 languages, 72.7% fewer input tokens to review a pull request, comprehension at parity

Stars on GitHub

Momentum

stars in total
203
Star history of nikolai-vysotskyi/trace-mcp on GitHub, a chart by star-history.com

Other skills on trace-mcp.

trace-mcp

trace-mcp

Use trace-mcp tools for code navigation, impact analysis, and framework-aware queries instead of Read/Grep/Glob/Bash. Activate…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about trace-mcp-codemod.

Which coding agents can use trace-mcp-codemod?
trace-mcp-codemod installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.