The RefactorPlan AI Generator (refactor-plan.html) is an interactive, browser-based interface designed to generate, visualize, and track code refactoring tasks using modern Large Language Models (LLMs). It allows developers to outline a refactoring strategy, split it into clear phases, and track implementation progress.
- Navigate to the
toolsdirectory in your file explorer. - Open
refactor-plan.htmlin any modern web browser. - The application runs locally and makes direct API calls to your chosen AI vendor.
To generate plans, you must configure your AI API credentials in the input panel:
Choose your provider chip:
- Claude (Anthropic)
- ChatGPT (OpenAI)
- Gemini (Google)
- DeepSeek
- Qwen / GLM / Kimi
- Groq / Grok
- Custom: Configure any OpenAI-compatible API endpoint (e.g., Local Ollama server, corporate proxy).
Select a default model from the dropdown or type in a custom model name (especially useful for custom endpoints or newly released models).
- Enter your API key.
- Security Note: Your API key is stored only in the browser's temporary memory for the active session. It is never sent to any external server other than the official API endpoints.
- If using Custom, input the exact API completion URL (e.g.,
http://localhost:11434/v1/chat/completionsfor Ollama) and select the authorization type (Bearer Token,x-api-key,Query Param, orNone).
Click Advanced Settings to configure:
- Temperature: Control the randomness/creativity of the generation (lower is more deterministic and structured).
- System Prompt: Edit the default instructions given to the LLM to format the response as a structured plan.
- Describe the Refactoring Task: Write your objective in the prompt box (e.g. "Refactor effects.py to split large helper functions into a separate utils module and add unit tests").
- Include Code Context: Drag and drop code files directly into the text area or paste the code snippet you want to refactor.
- Click Generate Refactor Plan.
- The generation will stream in real time. Once finished, a structured refactoring roadmap will render on screen.
The generated roadmap has several built-in interactive features to help you track your refactoring work:
- Progress Bar: Automatically updates its percentage filled as you check off tasks.
- Toggleable Phases: Click on a Phase header to expand or collapse its task list.
- Task Lists with Priorities: Every task has a priority tag (
High,Medium,Low) and optional developer notes. - Risk Assessment Box: Highlights potential pitfalls, breaking changes, or code compatibility risks associated with the refactoring phase.
- Local History Sidebar: Click History in the top-right corner to review, load, or delete previous refactoring plans stored in your browser's local storage.
Once you have reviewed the plan, you can export it using the buttons at the bottom of the generated roadmap:
- Copy Markdown: Copies a formatted Markdown version of the checklist, perfect for sharing with team members or pasting into your code repository.
- Export to
task.md: Downloads a pre-formattedtask.mdfile designed for direct integration with GSD (Goal-Driven Execution) agent environments. - Export to JSON: Downloads the plan as raw structured JSON data.