본문으로 건너뛰기
cccskills
무료GitHub에 공개

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md2.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

trace-mcp

무료

Use trace-mcp tools for code navigation, impact analysis, and framework-aware queries instead of Read/Grep/Glob/Bash. Activate whenever the agent needs to explore, understand, or modify a codebase that has trace-mcp indexed.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

nikolai-vysotskyi/trace-mcp1932026년 10월 18일 업데이트

trace-mcp

무료

Use trace-mcp through bb to search indexed code and recall project decisions with compact context.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

nikolai-vysotskyi/trace-mcp1932026년 10월 18일 업데이트

Run trace-mcp security, quality-gate, and antipattern checks before committing or opening a PR. Activate when the agent is about to create a commit or pull request in a project indexed by trace-mcp.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

nikolai-vysotskyi/trace-mcp1932026년 10월 18일 업데이트

Safe refactoring workflow using trace-mcp — assess risk, find candidates, check impact, and rename symbols across all files without missing import sites or cross-file references.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

nikolai-vysotskyi/trace-mcp1932026년 10월 18일 업데이트

nikolai-vysotskyi의 스킬 모두 보기

이 스킬의 문제 신고