AI-powered developer tools providing code search, bug detection, code explanation, and unit test generation — all inside VS Code.
Built with a FastAPI backend and a VS Code extension, using mock data so the entire system is runnable immediately without trained models or API keys.
cd backend
# Create and activate a virtual environment
python -m venv venv
# Windows:
.\venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start the server
uvicorn app.main:app --reloadThe API will be available at http://localhost:8000. Open http://localhost:8000/docs for interactive Swagger documentation.
cd extension
# Install dependencies
npm install
# Compile TypeScript
npm run compileThen:
- Open the
extension/folder in VS Code - Press F5 to launch the Extension Development Host
- Open any
.pyor.jsfile to activate the extension
| Feature | How to trigger | What happens |
|---|---|---|
| 🧠 Code Explanation | Hover over any word in a .py/.js file |
Tooltip with AI explanation |
| 🐛 Bug Detection | Save any .py/.js file |
Squiggly underlines + Problems panel |
| 🧪 Test Generation | Ctrl+Shift+P → "Code Assistant: Generate Tests" | New tab with generated tests |
DevMind/
├── backend/ ← FastAPI backend (Python)
│ ├── app/
│ │ ├── main.py ← App entry point + CORS + router wiring
│ │ ├── api/ ← HTTP endpoint routers
│ │ │ ├── search.py ← POST /search
│ │ │ ├── bugs.py ← POST /detect-bugs
│ │ │ ├── explain.py ← POST /explain + POST /generate-tests
│ │ │ └── health.py ← GET /health
│ │ ├── services/ ← Business logic (★ swap point for real ML)
│ │ │ ├── code_search.py ← Mock semantic code search
│ │ │ ├── bug_detector.py ← Mock bug detection
│ │ │ ├── llm_service.py ← Mock code explanation + test generation
│ │ │ └── auth.py ← Placeholder authentication
│ │ └── models/
│ │ └── schemas.py ← Pydantic request/response contracts
│ ├── tests/
│ │ └── test_endpoints.py ← Endpoint tests (pytest + httpx)
│ ├── requirements.txt
│ ├── Dockerfile
│ └── .env.example
│
├── notebooks/ ← Jupyter Notebooks for ML model training
│ ├── A_code-search.ipynb ← Code search embedding & indexing
│ ├── B_bug-detector.ipynb ← Bug detection model training
│ └── C_finetune-codet5.ipynb ← CodeT5+ fine-tuning
│
├── extension/ ← VS Code extension (TypeScript)
│ ├── src/
│ │ ├── extension.ts ← Entry point: activate() wires features
│ │ ├── hoverProvider.ts ← Hover → POST /explain
│ │ ├── diagnostics.ts ← On save → POST /detect-bugs
│ │ └── commands.ts ← Command → POST /generate-tests
│ ├── package.json
│ ├── tsconfig.json
│ └── README.md
│
├── .github/workflows/
│ └── ci.yml ← GitHub Actions: pytest + tsc
│
├── docs/
│ ├── api-contracts.md ← Exact JSON schemas for all endpoints
│ └── system-design.md ← Architecture description
│
└── README.md ← This file
cd backend
pip install anyio pytest-anyio # async test support
pytest tests/ -vcd extension
npm run compile# Build
docker build -t code-assistant-backend ./backend
# Run
docker run -p 8000:8000 code-assistant-backendThe extension's backend URL is configurable via VS Code settings:
| Setting | Default | Description |
|---|---|---|
codeAssistant.backendUrl |
http://localhost:8000 |
Backend server URL |
codeAssistant.enableHover |
true |
Enable/disable hover explanations |
codeAssistant.enableDiagnostics |
true |
Enable/disable bug detection |
The project is designed so that swapping mock → real is a single-file change per module. Each mock function in backend/app/services/ is marked with # TODO: replace with real model/API call.
| File | Function(s) | Replace with |
|---|---|---|
services/code_search.py |
search_code() |
CodeBERT embeddings + FAISS/Pinecone vector search |
services/bug_detector.py |
detect_bugs() |
Fine-tuned defect detection model or static analysis |
services/llm_service.py |
explain_code(), generate_tests() |
OpenAI / Anthropic / Gemini / local LLM API calls |
services/auth.py |
verify_api_key() |
Real API key or JWT validation |
- Keep the same function signatures — the API routers call these directly
- Return the same types — use the Pydantic models from
schemas.py - No changes needed in
api/*.py,schemas.py, or the VS Code extension
See docs/api-contracts.md for the exact JSON shapes your implementations must match.
| Method | Path | Description |
|---|---|---|
GET |
/health |
Health check |
POST |
/search |
Semantic code search |
POST |
/detect-bugs |
Bug / code smell detection |
POST |
/explain |
Code explanation |
POST |
/generate-tests |
Unit test generation |
Full API docs available at http://localhost:8000/docs when the backend is running.
MIT
