typescript-refactor

Refactor TypeScript code while preserving type safety and test coverage.

Updated Jan 8, 2026
One-click install
npx skills add https://github.com/cpa03/blueprintify --skill typescript-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-refactor
Source: https://github.com/cpa03/blueprintify/tree/main/.opencode/skill/typescript-refactor
Command: npx skills add https://github.com/cpa03/blueprintify --skill typescript-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safely refactor TypeScript code while preserving type safety and maintaining test coverage, reducing risk of regressions.

Core Features & Use Cases

  • Extract Function: pull complex logic into a smaller, testable function while preserving types.
  • Extract Component (React): split large components into focused units with stable interfaces.
  • Rename Symbol: update all usages across the codebase without breaking builds.
  • Verification: automatically run type checks and tests before and after refactors.

Quick Start

Run the refactor workflow on your TypeScript project and confirm safety with typechecks and tests.

Frequently Asked Questions about typescript-refactor

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

FAQPage Schema
How do I safely refactor TypeScript code without breaking type safety or tests?

To safely refactor TypeScript code, you can run a workflow that enforces baseline type checks, lint rules, and tests before and after the refactor to ensure no behavioral changes occur. This verifies type safety and test coverage.

What is the best way to extract a React component from a large UI element without causing build errors?

The best way to extract a React component is to split the large component into focused units with stable interfaces while running type checks and tests automatically. This ensures the extraction maintains type safety without breaking the build.

Can I rename a symbol across an entire TypeScript codebase and automatically verify all usages?

Yes, you can rename a symbol and update all usages across the codebase without breaking builds. The process automatically validates the changes through enforced type checks, lint rules, and tests to prevent regressions.

How do I extract complex logic into a smaller testable TypeScript function?

You can extract complex logic into a smaller, testable function while preserving types by applying a targeted refactor workflow. The workflow validates the extraction by running baseline tests and type checks to ensure no behavioral changes.

Do I need existing tests and type checks to refactor my TypeScript project?

Yes, you need baseline tests, lint rules, and type checks configured in your TypeScript project. The refactoring process enforces these checks during and after the modifications to verify that no behavioral changes or regressions occur.