A systematic methodology for refactoring AI-generated code (Vibe Coding). Helps you discover duplicate implementations, unused resources, and inconsistent patterns.
概览
A systematic methodology for refactoring AI-generated code (Vibe Coding). Helps you discover duplicate implementations, unused resources, and inconsistent patterns.
README
Vibe Coding Refactor
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)
- Copy this folder to
~/.cursor/skills/vibecoding-refactor/ - Cursor will automatically detect and use the skill when you ask to:
- “Refactor this codebase”
- “Clean up the code”
- “Analyze the architecture”
- “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
- Copy the content from
SKILL.mdto your project’sAGENTS.mdfile - 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
- Phase 0: Project Partition - Inventory all reusable resources
- Phase 1: Key Identification - Identify core features to analyze
- Phase 2: Architecture Analysis - Detect global architecture problems
- Phase 3: Module Analysis - Deep dive into each feature module
- Phase 4: Execute Refactoring - Systematic refactoring by layer
- Phase 5: Finalize & Verify - Verification and cleanup
Core Principles
- Functionality Unchanged - All functionality remains exactly the same
- UI Unchanged - Visual appearance and interaction preserved
- Rollbackable - Each change can be independently rolled back
- 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:
- Read
.refactor/README.mdfor overall status - Read
master-plan.mdto understand task progress - 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.
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add gcwing/vibecoding-refactor-skill