GCWing

vibecoding-refactor

200
32
# Install this skill:
npx skills add GCWing/vibecoding-refactor-skill

Or install specific skill: npx add-skill https://github.com/GCWing/vibecoding-refactor-skill

# Description

Vibe Coding Engineering Refactoring Methodology. Systematically refactor AI-generated code through architecture-layer and module-layer deep analysis, discovering duplicate implementations, unused resources, inconsistent patterns, and other typical problems. Supports persistent task management for incremental execution. Use when asked to refactor code, clean up patches, improve code quality, analyze architecture, or optimize codebase.

# SKILL.md


name: vibecoding-refactor
description: Vibe Coding Engineering Refactoring Methodology. Systematically refactor AI-generated code through architecture-layer and module-layer deep analysis, discovering duplicate implementations, unused resources, inconsistent patterns, and other typical problems. Supports persistent task management for incremental execution. Use when asked to refactor code, clean up patches, improve code quality, analyze architecture, or optimize codebase.


Vibe Coding Engineering Refactoring Methodology

A complete methodology for systematically refactoring AI-generated code, supporting task splitting, persistence, and incremental execution for large refactoring projects.


⚠️ Core Principle: Deep Analysis First

Deep analysis phases must be completed before starting any refactoring tasks.

Typical Vibe Coding problems require deep analysis to discover:
- Duplicate implementations (same functionality implemented in multiple places, unaware of each other)
- Unused component libraries (existing library but not used, reinventing the wheel)
- Inconsistent patterns (API calls, error handling, state management vary across modules)
- Mixed abstraction levels (business logic mixed with UI)

Skipping analysis to start refactoring directly is not allowed.


⚑ Quick Recovery Entry (New Agent Must Read)

When user says "continue refactoring" or .refactor/ directory exists, execute the following recovery flow:

Step 1: Read status summary
   β†’ Read .refactor/README.md (contains overall status and context)

Step 2: Read master plan
   β†’ Read .refactor/tasks/master-plan.md (task tree and progress)

Step 3: Read active tasks
   β†’ List and read task files in .refactor/tasks/active/

Step 4: Read recent logs (optional, if need to understand last interruption point)
   β†’ Read latest session log in .refactor/logs/

Step 5: Report status to user
   β†’ Use template below to report, confirm direction to continue

Report Template:

## Refactoring Status Recovery

### Overall Progress
- Project: {project_name}
- Total Progress: {X}%
- Current Phase: Phase {N} - {phase_name}

### Current Tasks
- πŸ”„ {task-xxx}: {task_name} ({completion}%)
  - Last progress: {what step was last completed}
  - Next step: {what to do next}

### Pending
- ⏳ {task-yyy}: {task_name}

### Blocked (if any)
- 🚫 {task-zzz}: {reason}

---
Continue with {task-xxx}? Or other arrangements?

Constitutional Principles

Bottom Line Principles (Absolutely Non-Violable)

  1. Functionality Unchanged: All functionality must remain exactly the same as before refactoring
  2. UI Unchanged: Visual appearance and interaction behavior remain unchanged
  3. API Compatible: External interfaces remain compatible
  4. Rollbackable: Each change can be independently rolled back
  5. Traceable: All operations are recorded

Quality Standards

Code after refactoring should achieve:
- Unified patterns (one functionality has only one implementation)
- Clear responsibilities (each module has single responsibility)
- Reasonable dependencies (no circular dependencies, clear hierarchy)
- Type safety (no any, complete error handling)


Workflow (Six Phases)

Phase 0         Phase 1          Phase 2            Phase 3            Phase 4          Phase 5
Partition   β†’   Key Identify  β†’  Architecture   β†’   Module Layer   β†’   Execute      β†’   Finalize
    β”‚              β”‚              Analysis            Analysis          Refactor         Verify
    β”‚              β”‚                 β”‚                   β”‚                 β”‚               β”‚
Domain         Core Feature      Layer Check       Per-module Deep    Execute by      Verify
Division       List              Dependency        Analysis           Layer           Compare
Boundary       High-freq Code    Direction         Vibe Problem       Arch First      Cleanup
Identify       Key Path          Circular Dep      Detection          Then Module     Archive
Resource                         Evaluate          Generate Report    Update Progress Document
Inventory

Refactoring executes in two layers:
1. Architecture Layer: Dependencies, directory structure, layering standards (global problems)
2. Module Layer: Vibe Coding problems for each key feature (local problems)


Phase 0: Project Partition (Required)

Goal: Establish macro understanding, inventory reusable resources

0.1 Directory Structure Scan

# Generate directory tree
tree -L 3 -d -I "node_modules|target|dist|.git"

# Count code lines per directory
fd -e ts -e tsx -e rs | xargs wc -l | sort -rn | head -30

0.2 Domain Division

Identify main domains and boundaries:

Project Domain Division
β”œβ”€β”€ Frontend Domain
β”‚   β”œβ”€β”€ Component Library (components/ui/)
β”‚   β”œβ”€β”€ Business Components (features/, modules/)
β”‚   β”œβ”€β”€ Infrastructure (infrastructure/, lib/)
β”‚   └── Shared Layer (shared/, common/)
β”‚
β”œβ”€β”€ Backend Domain
β”‚   β”œβ”€β”€ Core Library (core/, domain/)
β”‚   β”œβ”€β”€ API Layer (api/, handlers/)
β”‚   └── Application Layer (app/, cmd/)
β”‚
└── Common Domain
    β”œβ”€β”€ Type Definitions
    └── Configuration Files

0.3 Resource Inventory (Critical!)

Must thoroughly inventory all reusable resources and infrastructure in the project.

Inventory uses heuristic approach, not limited to categories below. Discover all reusable resources based on actual project:

UI Layer Resources

Resource Type Search Method Inventory Content
Component Library Search components/ui/, components/common/ List all exported components and their Props
Icon Library Search icons/, Icon components List all icons
Style System Search styles/, theme/, variables CSS variables, theme config

Utility Layer Resources

Resource Type Search Method Inventory Content
Utility Functions Search utils/, helpers/, lib/ List all exported functions
Custom Hooks Search hooks/, use*.ts List all hooks and purposes
Type Definitions Search types/, *.d.ts List core business types

Service Layer Resources

Resource Type Search Method Inventory Content
API Services Search services/, api/ List all service classes and methods
State Management Search store/, Store List all stores and states

Infrastructure (Often Overlooked!)

Resource Type Search Method Inventory Content
Logging System Search logger, log, console wrapper Logging tools and usage
Event System Search EventEmitter, eventBus, on/emit Event bus and event list
Internationalization Search i18n, locale, t(), useTranslation Translation functions and language packs
Theme System Search theme, ThemeProvider, useTheme Theme switching mechanism
Error Handling Search ErrorBoundary, error handler Unified error handling
Configuration Search config, settings, env Configuration reading method
Permission System Search permission, auth, role Permission check mechanism
Cache System Search cache, storage, localStorage wrapper Caching tools
Router System Search router, route, navigate Route config and navigation
Request Interceptor Search interceptor, middleware Request/response interception

Heuristic Discovery

Beyond above categories, also search for project-specific infrastructure:

# Search singleton pattern (usually infrastructure)
rg "getInstance|\.instance|static instance" --type ts

# Search Provider pattern
rg "Provider|Context" --type tsx

# Search exported classes and factory functions
rg "^export class|^export function create" --type ts

# Search shared/, common/, core/ directories
fd -t d "shared|common|core|infrastructure"

Output Format:

## Resource Inventory

### UI Layer
| Resource | Location | Exports |
|----------|----------|---------|
| Component Library | components/ui/ | Button, Card, Modal... |
| Icons | icons/ | IconXxx... |

### Utility Layer
| Resource | Location | Exports |
|----------|----------|---------|
| Date Utils | shared/utils/date | formatDate, parseDate... |
| Hooks | hooks/ | useXxx... |

### Infrastructure
| Resource | Location | Usage | Description |
|----------|----------|-------|-------------|
| Logger | infrastructure/logger | logger.info() | Unified logging |
| Event Bus | infrastructure/events | eventBus.emit() | Cross-component communication |
| i18n | locales/ + useI18n | t('key') | Multi-language |
| Theme | theme/ + useTheme | theme.colors.xxx | Theme switching |

⚠️ These resources will be used in module-layer analysis to check reuse. The more thorough the inventory, the more accurate the subsequent analysis.

0.4 Output

Create .refactor/analysis/project-partition.md


Phase 1: Key Identification (Required)

Goal: Identify core features and modules that need deep analysis

1.1 Core Feature List

List the project's core features (will be deeply analyzed one by one later):

## Core Feature List

### Feature 1: [Feature Name]
- User Story: User can...
- Entry Point: [file path:line number]
- Involved Modules: [module list]
- Complexity: High/Medium/Low

### Feature 2: [Feature Name]
...

1.2 High-Frequency Code Identification

# Most referenced modules
rg "^import|^from" --type ts | grep -oP "from ['\"].*?['\"]" | sort | uniq -c | sort -rn | head -30

1.3 Key Path Tracing

Trace complete call chain for each core feature, preparing for subsequent module-layer analysis.

1.4 Output

Create .refactor/analysis/key-identification.md


Phase 2: Architecture Layer Analysis (Required)

Goal: Discover global architecture problems

Architecture problems are module-independent and need to be resolved first.

2.1 Layering Structure Check

Check if correct layering dependencies are followed:

Correct dependency direction (can only depend downward):
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   UI Layer      β”‚  Components, Pages
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Application   β”‚  State Management, Business Services
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Infrastructure  β”‚  API, Storage, Utilities
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Core Layer    β”‚  Type Definitions, Constants
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Check Violations:

# Core layer should not depend on upper layers
rg "from ['\"].*(components|services|store)" core/ types/

# Infrastructure should not depend on UI
rg "from ['\"].*components" infrastructure/

# Component library should not depend on business code
rg "from ['\"].*(features|modules)" components/ui/

2.2 Circular Dependency Detection

# Check if circular dependencies exist between modules
# A -> B and B -> A

2.3 Directory Structure Evaluation

  • Is directory responsibility clear?
  • Are there misplaced files?
  • Are module boundaries clear?

2.4 Output: Architecture Layer Refactoring Report

Create .refactor/analysis/architecture-report.md:

# Architecture Layer Analysis Report

## Layering Violations
| Violation Location | Wrong Dependency | Severity | Fix Suggestion |
|--------------------|------------------|----------|----------------|
| core/utils.ts:15 | import from components/ | High | Remove dependency or adjust location |

## Circular Dependencies
| Module A | Module B | Files Involved | Fix Suggestion |
|----------|----------|----------------|----------------|
| moduleA | moduleB | a.ts, b.ts | Extract common part |

## Directory Structure Issues
| Issue | Location | Suggestion |
|-------|----------|------------|
| Unclear responsibility | features/utils/ | Move to shared/utils/ |

## Architecture Layer Refactoring Tasks
1. [A-001] Resolve core -> components violation
2. [A-002] Resolve moduleA <-> moduleB circular dependency
3. [A-003] Adjust features/utils/ location

Phase 3: Module Layer Analysis (Core!)

Goal: Deep analysis of each key feature, discovering Vibe Coding problems

⚠️ This is the most important phase, must go deep into implementation details of each module

3.1 Analysis Method

For each key feature identified in Phase 1, perform the following analysis:

## Feature Analysis: [Feature Name]

### Basic Information
- Entry: [file:line]
- Files Involved: [file list]
- Call Chain: [complete call path]

### Vibe Coding Problem Detection

#### 1. Duplicate Implementation Detection
- Is there same/similar functionality implemented elsewhere?
- Check method: Search similar function names, similar logic

#### 2. Resource Reuse Detection (Compare with Phase 0 inventory)
- Using component library components? Or self-made?
- Using utility function library? Or self-written?
- Using public types? Or self-defined?
- Using public services? Or direct API calls?

#### 3. Pattern Consistency Detection
- Is API call pattern consistent with other modules?
- Is error handling unified?
- Is state management unified?

#### 4. Code Quality Detection
- Excessive any types?
- Unhandled errors?
- Hardcoded values?

### Problem Summary
| Problem | Location | Severity | Fix Suggestion |
|---------|----------|----------|----------------|
| ... | ... | ... | ... |

### Refactoring Suggestions
1. ...
2. ...

3.2 Detection Checklist

Must check for each module:

## Module Layer Checklist

### Resource Reuse (Compare with Phase 0 inventory)
- [ ] Components: Using component-library? Self-made which?
- [ ] Utility Functions: Using shared/utils? Self-written which?
- [ ] Types: Using shared/types? Self-defined which?
- [ ] Services: Using public services? Direct API calls which?
- [ ] Hooks: Using public hooks? Self-written which?

### Infrastructure Usage (Compare with Phase 0 infrastructure inventory)
- [ ] Logging: Using logger? Or console.log?
- [ ] i18n: Using t()? Or hardcoded text?
- [ ] Theme: Using theme variables? Or hardcoded colors/sizes?
- [ ] Events: Using eventBus? Or props drilling?
- [ ] Error Handling: Using unified error handling?
- [ ] Config: Using config system? Or hardcoded values?

### Duplicate Implementation
- [ ] Other modules implementing same functionality?
- [ ] Similar components/functions that can be merged?

### Pattern Consistency
- [ ] API call pattern: invoke/fetch/service?
- [ ] Error handling: try-catch/Result?
- [ ] State management: useState/zustand/context?

3.3 Output: Module Layer Refactoring Report

Create analysis report for each key feature: .refactor/analysis/modules/[feature-name].md

Create summary .refactor/analysis/module-report.md:

# Module Layer Analysis Report

## Analysis Coverage
| Feature | Analysis Status | Problem Count | Report Location |
|---------|-----------------|---------------|-----------------|
| File Editor | βœ… Complete | 5 | modules/file-editor.md |
| Chat Feature | βœ… Complete | 8 | modules/chat.md |
| Terminal | βœ… Complete | 3 | modules/terminal.md |

## Problem Summary

### Resources Not Reused (P1)
| Module | Problem | Location | Should Use |
|--------|---------|----------|------------|
| File Editor | Self-made Button | Editor.tsx:45 | components/ui/Button |
| Chat | Self-made formatDate | utils.ts:12 | shared/utils/date |
| Chat | Self-made Card | ChatCard.tsx | components/ui/Card |

### Duplicate Implementations (P1)
| Functionality | Duplicate Locations | Suggestion |
|---------------|---------------------|------------|
| File Save | Editor.tsx, FilePanel.tsx | Merge to FileService |
| Config Read | config.ts, settings.ts | Unify to ConfigService |

### Inconsistent Patterns (P2)
| Module | Problem | Current | Should Unify To |
|--------|---------|---------|-----------------|
| File Editor | API Call | Direct invoke | FileService |
| Terminal | Error Handling | .catch | try-catch |

## Module Layer Refactoring Tasks
1. [M-001] File Editor: Migrate self-made Button to component library
2. [M-002] Chat: Migrate self-made formatDate to utility library
3. [M-003] Chat: Migrate self-made Card to component library
4. [M-004] Merge duplicate file save implementations
5. [M-005] Unify API call pattern to service layer

Phase 4: Execute Refactoring

Goal: Execute refactoring by layer

4.1 Execution Order

Must do architecture layer first, then module layer:

Phase 1: Architecture Layer Refactoring
β”œβ”€β”€ Resolve circular dependencies
β”œβ”€β”€ Fix layering violations
└── Adjust directory structure

Phase 2: Module Layer Refactoring
β”œβ”€β”€ Resource reuse migration (component library, utility library)
β”œβ”€β”€ Merge duplicate implementations
└── Unify patterns

4.2 Task Generation

Generate tasks based on Phase 2 and Phase 3 reports:

.refactor/tasks/master-plan.md

## Phase 1: Architecture Layer [Priority]
- task-A001: Resolve core -> components dependency [Architecture]
- task-A002: Resolve circular dependency [Architecture]

## Phase 2: Module Layer
- task-M001: File editor module refactoring [Module]
- task-M002: Chat feature module refactoring [Module]
- task-M003: Terminal module refactoring [Module]

4.3 Execution Flow for Each Task

1. Read task file
2. Execute refactoring operations
3. Verify (compile, test)
4. Update task progress
5. Record to session log
6. If phase complete, create checkpoint

See:
- workspace/task-lifecycle.md - Task Lifecycle
- workspace/session-management.md - Session Management


Phase 5: Finalize and Verify

Goal: Verify, compare, cleanup

  • Full compile and test verification
  • Generate before/after comparison document
  • Update architecture diagrams
  • Archive task files
  • Optional: Delete .refactor/ directory

Task Operations

Recover Session (Continue Refactoring)

Trigger: User says "continue refactoring", "pick up where we left off", or .refactor/ directory exists

Execute recovery flow (see "Quick Recovery Entry" above)

Key Principles:
- New Agent obtains all context by reading persisted files
- Do not rely on conversation history, rely entirely on state in .refactor/
- README.md is core entry point, must be kept up to date

Create Task

1. Generate task ID: task-{number}
2. Create task file: .refactor/tasks/active/task-xxx.md
3. Update master-plan.md task tree
4. Record to session log

Update Task Progress

1. Update task file:
   - Check off completed steps
   - Add progress record
   - Update timestamp
2. If task complete:
   - Move to tasks/completed/
   - Update master-plan.md progress percentage
   - If last task in phase, create checkpoint

Create Checkpoint

1. Create directory: checkpoints/checkpoint-{number}/
2. Record git ref: git rev-parse HEAD
3. Save state snapshot
4. Update master-plan.md checkpoint table

Session End

1. Save current session log
2. Update all active task states
3. Update master-plan.md
4. Report:
   - Tasks completed this session
   - Current progress
   - Next continuation point

Verification System

After Each Change

# Rust project
cargo check --workspace
cargo clippy --workspace  # Optional
cargo test --workspace    # If tests exist

# TypeScript project
npm run build
npm run lint              # Optional
npm run test              # If tests exist

After Phase Complete

  • Start application to verify main functionality
  • Visual comparison of key pages
  • Create checkpoint

After All Complete

  • Full functional testing
  • Before/after comparison document
  • Architecture diagram update

Analysis Methods (Core)

Strategy Library

Pattern Library

Workspace


Analysis Phase Checklist

Before starting refactoring, ensure the following analysis is complete:

## Phase 0: Project Partition
- [ ] Directory structure tree generated
- [ ] Domain boundaries identified
- [ ] UI layer resources inventoried (component library, icon library)
- [ ] Utility layer resources inventoried (utility functions, Hooks, type definitions)
- [ ] Service layer resources inventoried (API services, state management)
- [ ] Infrastructure inventoried (logging, events, i18n, theme, error handling, config, etc.)
- [ ] project-partition.md created

## Phase 1: Key Identification
- [ ] Core feature list completed (at least 5 main features)
- [ ] Entry point for each feature marked
- [ ] Key paths traced
- [ ] key-identification.md created

## Phase 2: Architecture Layer Analysis
- [ ] Layering dependency check complete (any upward dependencies)
- [ ] Circular dependency detection complete
- [ ] Directory structure evaluation complete
- [ ] architecture-report.md created (with specific problems and refactoring suggestions)

## Phase 3: Module Layer Analysis (Core!)
- [ ] Each key feature deeply analyzed
- [ ] Resource reuse detection complete (compare with Phase 0 inventory)
  - [ ] Component library usage
  - [ ] Utility function usage
  - [ ] Public type usage
  - [ ] Public service usage
  - [ ] Hooks usage
- [ ] Infrastructure usage detection complete (compare with Phase 0 infrastructure inventory)
  - [ ] Logging system usage
  - [ ] i18n usage
  - [ ] Theme system usage
  - [ ] Event system usage
  - [ ] Other infrastructure usage
- [ ] Duplicate implementation detection complete
- [ ] Pattern consistency detection complete
- [ ] Analysis report created for each module: modules/[feature-name].md
- [ ] module-report.md created (summarizing all problems and refactoring tasks)

## Task Planning
- [ ] Architecture layer tasks listed (A-xxx)
- [ ] Module layer tasks listed (M-xxx)
- [ ] Execution order determined (architecture first, then module)
- [ ] master-plan.md updated

Only after all checklist items are complete can Phase 4 (Execute Refactoring) begin.


Key Output Files

Analysis phases must produce the following files:

.refactor/
β”œβ”€β”€ analysis/
β”‚   β”œβ”€β”€ project-partition.md     # Phase 0: Project partition + resource inventory
β”‚   β”œβ”€β”€ key-identification.md    # Phase 1: Core feature list
β”‚   β”œβ”€β”€ architecture-report.md   # Phase 2: Architecture layer problems + suggestions
β”‚   β”œβ”€β”€ module-report.md         # Phase 3: Module layer problem summary + tasks
β”‚   └── modules/                 # Phase 3: Detailed analysis for each feature
β”‚       β”œβ”€β”€ file-editor.md
β”‚       β”œβ”€β”€ chat.md
β”‚       └── terminal.md
└── tasks/
    └── master-plan.md           # Task planning (Architecture layer + Module layer)

# README.md

Vibe Coding Refactor

License: MIT

English | δΈ­ζ–‡

A systematic methodology for refactoring AI-generated code (Vibe Coding). Helps you discover duplicate implementations, unused resources, and inconsistent patterns.

Features

  • Six-Phase Workflow - Structured approach from analysis to verification
  • Deep Analysis Methods - Architecture-layer and module-layer problem detection
  • Resource Inventory - Comprehensive discovery of reusable components and infrastructure
  • Task Persistence - All analysis results and progress saved to .refactor/ directory
  • Session Recovery - Supports incremental execution across sessions; new agents can resume exactly where left off

The Problem

In Vibe Coding mode, AI is limited by context windows and struggles to see the big picture of large projects. Cross-session development leads to fragmented context, and code evolves through incremental patches. Over time, projects accumulate problems: duplicate implementations, unused component libraries, pattern chaos, and skyrocketing maintenance costs.

How to Use

In Cursor

Method 1: As a Skill (Recommended)

  1. Copy this folder to ~/.cursor/skills/vibecoding-refactor/
  2. Cursor will automatically detect and use the skill when you ask to:
  3. "Refactor this codebase"
  4. "Clean up the code"
  5. "Analyze the architecture"
  6. "Improve code quality"

Method 2: Reference Directly

Simply reference SKILL.md in your prompt:

@SKILL.md Please analyze and refactor this project

In Claude Code (claude-code CLI)

Method 1: As AGENTS.md

  1. Copy the content from SKILL.md to your project's AGENTS.md file
  2. Claude Code will automatically follow the methodology

Method 2: Reference in Prompt

# Reference the skill file directly
claude "Read @SKILL.md and refactor this project following the methodology"

Method 3: Using /read Command

claude
> /read /path/to/vibecoding-refactor/SKILL.md
> Please refactor this codebase following the methodology

Quick Commands

Goal Prompt
Full refactor "Refactor this codebase following the Vibe Coding methodology"
Continue work "Continue refactoring" (if .refactor/ exists)
Architecture only "Analyze the architecture layer only"
Specific module "Analyze the [module-name] module"

Core Workflow

Phase 0         Phase 1          Phase 2            Phase 3            Phase 4          Phase 5
Partition   β†’   Key Identify  β†’  Architecture   β†’   Module Layer   β†’   Execute      β†’   Finalize
                                  Analysis            Analysis          Refactor         Verify
  1. Phase 0: Project Partition - Inventory all reusable resources
  2. Phase 1: Key Identification - Identify core features to analyze
  3. Phase 2: Architecture Analysis - Detect global architecture problems
  4. Phase 3: Module Analysis - Deep dive into each feature module
  5. Phase 4: Execute Refactoring - Systematic refactoring by layer
  6. Phase 5: Finalize & Verify - Verification and cleanup

Core Principles

  1. Functionality Unchanged - All functionality remains exactly the same
  2. UI Unchanged - Visual appearance and interaction preserved
  3. Rollbackable - Each change can be independently rolled back
  4. Traceable - All operations are recorded

Workspace Persistence

When refactoring begins, a .refactor/ workspace is created. All analysis results and progress are persisted:

.refactor/
β”œβ”€β”€ README.md                 # Status summary (recovery entry point)
β”œβ”€β”€ tasks/
β”‚   β”œβ”€β”€ master-plan.md        # Task tree and progress
β”‚   β”œβ”€β”€ active/               # Currently active tasks
β”‚   └── completed/            # Completed tasks
β”œβ”€β”€ logs/                     # Session logs
β”œβ”€β”€ checkpoints/              # Rollback points with git refs
└── analysis/                 # Analysis artifacts
    β”œβ”€β”€ project-partition.md  # Resource inventory
    β”œβ”€β”€ architecture-report.md
    └── modules/              # Per-feature analysis

Session Recovery

When you say "continue refactoring" or a .refactor/ directory exists, the agent will:

  1. Read .refactor/README.md for overall status
  2. Read master-plan.md to understand task progress
  3. Read active task files and resume from the interruption point

No re-analysis needed - all context is restored from persisted files.

Project Structure

vibecoding-refactor/
β”œβ”€β”€ SKILL.md                 # Main skill definition (entry point)
β”œβ”€β”€ analysis/                # Analysis methods
β”œβ”€β”€ patterns/                # Pattern library
β”œβ”€β”€ strategies/              # Execution strategies
└── workspace/               # Workspace management

Key Documents

Document Description
SKILL.md Start here - Complete workflow
Deep Analysis Core analysis methodology
Vibe Coding Problems Problem classification
Refactor Patterns Standard solutions

License

MIT License - see LICENSE file for details.

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.