trace-mcp-codemod

Solid

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.

AI & Automation 80 stars 11 forks Updated today MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
64
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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: "f...

Details

Author
nikolai-vysotskyi
Repository
nikolai-vysotskyi/trace-mcp
Created
1 months ago
Last Updated
today
Language
TypeScript
License
MIT

Integrates with

Related Skills