vscode-extension-refactorer

Refactor VS Code extension code to reduce duplication and improve maintainability.

21|11|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/s-hiraoku/vscode-sidebar-terminal --skill vscode-extension-refactorer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vscode-extension-refactorer
Source: https://github.com/s-hiraoku/vscode-sidebar-terminal/tree/main/.claude/skills/vscode-extension-refactorer
Command: npx skills add https://github.com/s-hiraoku/vscode-sidebar-terminal --skill vscode-extension-refactorer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides expert-level guidance for refactoring VS Code extension code. It covers systematic refactoring workflows, code smell detection, safe transformation techniques, and VS Code-specific patterns.

Core Features & Use Cases

  • Refactoring workflow: Phase 1 analysis and safe Phase 2 techniques.
  • Code smells: Detect and address issues like God Class, Long Method, Data Clumps, etc.
  • Patterns & patterns: Use Design Patterns to restructure.

Quick Start

Identify a large module with long methods and plan an Extract Method refactor, e.g., extract TerminalManager responsibilities into a dedicated class.

Frequently Asked Questions about vscode-extension-refactorer

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

FAQPage Schema
How do I refactor VS Code extension code to reduce duplication and improve maintainability?

Refactoring VS Code extensions follows a two-phase workflow: Phase 1 analyzes code structure to detect smells like God Class and Long Method, then Phase 2 applies safe transformation techniques such as Extract Method or Extract Class while preserving existing functionality and VS Code-specific patterns.

What code smells should I look for when refactoring a VS Code extension?

Common code smells in VS Code extensions include God Class (oversized modules), Long Method (complex functions), and Data Clumps (repeated parameter groups). Detecting these issues guides safe restructuring using design patterns and module reorganization specific to extension architecture.

How do I safely extract functionality into separate classes or functions in a VS Code extension?

Extract Method and Extract Class transformations follow a structured workflow: identify responsibility boundaries, apply design patterns to reorganize module structure, verify type safety with TypeScript, and test to confirm existing functionality remains intact before deployment.

Can I improve type safety while refactoring my VS Code extension code?

Yes. Refactoring workflows address type safety by reorganizing module structure, applying design patterns, and leveraging TypeScript's type system. These changes eliminate ambiguous data flows and reduce duplication that often masks type vulnerabilities in extension code.

What's the best way to restructure a bloated VS Code extension module?

Systematic refactoring breaks down large modules by extracting responsibilities into dedicated classes, applying design patterns for cleaner architecture, and optimizing performance. Analysis identifies organizational weaknesses; safe transformation ensures the extension continues functioning correctly throughout restructuring.

Does refactoring help optimize performance in VS Code extensions?

Yes. Beyond improving maintainability, refactoring workflows include performance optimization by eliminating code duplication, improving module organization, and reducing unnecessary complexity that can slow extension initialization or command execution.