Skip to content

kelaiya/AI-Debugging-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

AI Debugging Assistant

A developer tool that takes a ZIP of your codebase and an error message, finds the most relevant code snippets, and generates a clean debugging prompt you can paste directly into an LLM (Claude, ChatGPT, etc.).


How It Works

Upload ZIP  →  Paste Error  →  Copy Prompt  →  Paste into LLM
  1. Upload your project as a ZIP file
  2. Paste the error message or stack trace
  3. The system finds the most relevant code using layered keyword scoring
  4. A structured prompt is generated — error + code snippets + task instructions
  5. Copy the prompt and paste it into any LLM for an instant explanation

Tech Stack

Layer Technology
Frontend React + Vite
Backend Node.js + Express
File upload Multer (memory storage)
ZIP extraction adm-zip
Search Keyword scoring (no embeddings)

Project Structure

ai-debugging-assistant/
├── backend/
│   ├── package.json
│   └── src/
│       ├── index.js               # Express entry point
│       ├── routes/
│       │   ├── upload.js          # POST /api/upload
│       │   └── analyze.js         # POST /api/analyze
│       ├── services/
│       │   ├── zipService.js      # ZIP extraction + chunking
│       │   ├── searchService.js   # Keyword-based retrieval
│       │   └── promptService.js   # Prompt assembly
│       └── store/
│           └── codeStore.js       # In-memory session store
└── frontend/
    ├── package.json
    └── src/
        ├── App.jsx
        ├── index.css
        ├── api.js
        └── components/
            ├── UploadZone.jsx
            ├── ErrorInput.jsx
            ├── SnippetList.jsx
            └── PromptOutput.jsx

API Endpoints

POST /api/upload

Upload a ZIP file containing your codebase.

Request: multipart/form-data with field codezip

Response:

{
  "sessionId": "uuid",
  "fileCount": 12,
  "chunkCount": 47
}

POST /api/analyze

Search the uploaded codebase and generate a debugging prompt.

Request:

{
  "sessionId": "uuid",
  "errorText": "TypeError: Cannot read properties of undefined..."
}

Response:

{
  "snippets": [
    {
      "fileName": "src/auth.js",
      "content": "...",
      "startLine": 35,
      "endLine": 74,
      "score": 150
    }
  ],
  "prompt": "## Error Message\n..."
}

Search Scoring

Snippets are ranked using layered scoring so the most relevant code always rises to the top:

Signal Score
Exact file + line from stack trace +100
File name mentioned in error +50
Function/class name match +30
Keyword frequency +1 per hit

Generated Prompt Format

## Error Message

<your error / stack trace>

---

## Relevant Code Snippets

### File: src/auth.js (lines 35–74)
```js
<code>

Task

You are a senior software engineer. Using the error message and code snippets above:

  1. Identify the root cause of the error.
  2. Point to the specific file and line where the bug originates.
  3. Suggest a concrete fix with corrected code.
  4. Note any related issues in the surrounding code.

---

## Running Locally

**Backend**
```bash
cd backend
npm install
npm run dev      # starts on http://localhost:3001

Frontend

cd frontend
npm install
npm run dev      # starts on http://localhost:5173

Open http://localhost:5173 in your browser.


Supported File Types

.js .ts .jsx .tsx .py .java .go .rb .cpp .c .cs .php .html .css .json .yaml .yml .md

Binary files, node_modules, .git, and __MACOSX entries are automatically skipped.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors