batch-refactor

Automates batched file and symbol renames with ts-morph-based updates.

3|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/beorn/tools --skill batch-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: batch-refactor
Source: https://github.com/beorn/tools/tree/main/skills/batch-refactor
Command: npx skills add https://github.com/beorn/tools --skill batch-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ts-morph, ripgrep, ast-grep, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill enables safe, automated batch refactoring across a codebase, reducing manual edits and ensuring consistent changes across files.

Core Features & Use Cases

  • Batch file and symbol renames: Propagates changes across TypeScript/JavaScript sources, tests, and documentation with import path updates.
  • Terminology migrations: Coordinate renaming across code and docs to avoid drift.
  • Atomic, preview-driven workflow: Generate editsets, preview changes, and apply only after approval.

Quick Start

Use the batch-refactor skill to create a proposal for a project-wide rename, preview the editset, then apply after review.

Frequently Asked Questions about batch-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely rename symbols and update imports across a TypeScript codebase?

To safely rename symbols across a TypeScript codebase, you can use an automated batch refactoring workflow that leverages ts-morph for AST-based symbol updates and automatically propagates changes through import paths.

What is the best way to migrate terminology across code and markdown documentation without drift?

Migrating terminology without drift requires coordinating pattern-based text updates across both source code and markdown files simultaneously. A batch refactoring tool enforces this consistency by generating a previewable editset before application.

Can I preview codebase refactoring changes before applying them to ensure nothing breaks?

Yes, you can preview codebase refactoring changes before applying them. A safe batch refactoring workflow uses a preview-driven editset model, allowing you to review all proposed file updates and check for conflicts before final application.

Does batch refactoring support atomic updates across JavaScript sources and configuration files?

Batch refactoring supports atomic updates across JavaScript sources and configuration files. It applies changes consistently across TypeScript, JavaScript, markdown, and config formats to maintain project integrity during large migrations.

Why use ripgrep and ast-grep for a large scale codebase refactor?

Ripgrep and ast-grep are used in large scale codebase refactors to perform rapid pattern-based text searches and structural code matching. This enables precise identification of terminology and syntax targets before applying atomic updates.

When should I avoid automated codebase refactoring for renaming files?

You should avoid automated codebase refactoring for renaming files if your project lacks clear conflict checking mechanisms or if the proposed editset cannot be previewed, as applying changes without review risks breaking inconsistent imports.