code-refactoring

Coordinate multi-file structural refactors with ast-grep scope discovery and gritql dry-run previews.

8|2|Updated Jul 13, 2015
One-click install
npx skills add https://github.com/tstapler/dotfiles --skill code-refactoring-tstapler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-refactoring
Source: https://github.com/tstapler/dotfiles/tree/main/.claude/skills/code-refactoring
Command: npx skills add https://github.com/tstapler/dotfiles --skill code-refactoring-tstapler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Refactoring large codebases requires coordinated scope, safe transformations, and guardrails to prevent regressions across many files.

Core Features & Use Cases

  • Discover scope with ast-grep to identify affected sites across a multi-file project.
  • Preview transformations with gritql to validate changes before applying.
  • Enforce quality gates including formatting, tests, and Git-based review for safe deployments.
  • Use cases include API migrations, architectural migrations, and pattern modernization across modules.

Quick Start

Identify the scope with ast-grep, preview changes with gritql in dry-run, then apply safely and review the results.

Frequently Asked Questions about code-refactoring

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

FAQPage Schema
How do I coordinate multi-file codebase refactoring safely?

Multi-file codebase refactoring is coordinated safely by discovering scope with ast-grep, previewing transformations with gritql dry-runs, and enforcing formatting, tests, and Git reviews as mandatory quality gates.

Can I use ast-grep and gritql for API migration transformations?

Yes, ast-grep and gritql support API migrations by identifying affected code sites across multi-file projects and applying structural transformations validated through mandatory dry-run previews before final application.

What is the best way to modernize code patterns across multiple modules?

Modernizing code patterns across modules requires structural refactoring to discover scope via ast-grep, apply gritql transformations, and enforce quality gates including code formatting, tests, and Git-based review for safe deployments.

Do I need dry-run previews for structural codebase transformations?

Yes, dry-run previews are mandatory gate conditions for structural codebase transformations, ensuring you validate gritql pattern changes and check formatting and tests before safely applying them across multi-file projects.

Does this approach enforce quality gates during architectural migrations?

Yes, architectural migrations enforce explicit quality gate conditions including code formatting, tests, and Git-based review to prevent regressions and ensure safe deployments across multi-file codebases.

When should I not use automated structural refactoring?

Automated structural refactoring should be avoided when strong pre-flight checks, dry-run previews, or Git-based review workflows are unavailable, as these mandatory gate conditions prevent regressions across multi-file codebases.