Skip to content

DigitalApprentice/refactor_plan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RefactorPlan AI Generator

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.


Getting Started

  1. Navigate to the tools directory in your file explorer.
  2. Open refactor-plan.html in any modern web browser.
  3. The application runs locally and makes direct API calls to your chosen AI vendor.

Configuration Guide

To generate plans, you must configure your AI API credentials in the input panel:

1. Select AI Vendor

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).

2. Model Selection

Select a default model from the dropdown or type in a custom model name (especially useful for custom endpoints or newly released models).

3. API Key & Endpoint

  • 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/completions for Ollama) and select the authorization type (Bearer Token, x-api-key, Query Param, or None).

4. Advanced Settings (Optional)

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.

Generating a Plan

  1. 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").
  2. Include Code Context: Drag and drop code files directly into the text area or paste the code snippet you want to refactor.
  3. Click Generate Refactor Plan.
  4. The generation will stream in real time. Once finished, a structured refactoring roadmap will render on screen.

Interactive Plan Features

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.

Export Capabilities

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-formatted task.md file designed for direct integration with GSD (Goal-Driven Execution) agent environments.
  • Export to JSON: Downloads the plan as raw structured JSON data.

About

AI-powered refactoring planner

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors

Languages