Tagline: Diagnose. Repair. Verify. Improve.
Code Doctor is a platform-independent intelligent coding diagnosis, prediction, repair, verification, and developer learning ecosystem.
- Platform Independence: Core diagnosis engine (
Code Doctor Core Engine) is completely decoupled from VS Code or any specific IDE. - Universal Error Model: Standardized diagnostic schema categorizing errors into
SYNTAX,TYPE,LOGIC,RUNTIME,MEMORY,SECURITY,PERFORMANCE,STYLE,DEPENDENCY, andCONFIGURATION. - Cascading Root Cause Analysis: Identifies primary root cause among dependent error chains (e.g. missing import causing undefined function causing runtime failure).
- Predictive Static Analysis: Detects out-of-bounds array access, null pointer hazards, and infinite loops prior to runtime execution with confidence scores.
- Code Surgery & Fix Generator: Generates minimal patch diffs and preview fixes without overwriting user files blindly.
- Safe Fix Verification Engine: Safely re-evaluates syntax, AST structure, and rules before marking fixes as
VERIFIED. - Transparent Code Health Score: Calculates overall health (0-100) using weighted sub-scores: Correctness (30%), Security (20%), Maintainability (20%), Performance (15%), Quality (15%).
- Developer Error DNA: Tracks recurring error categories, improvement trends, and language weaknesses over time.
- Multi-Level Learning Mode: Tailors diagnostic explanations to
Beginner,Intermediate, andAdvancedskill tiers. - Offline-First Architecture: Operates 100% offline using AST, Ruff, and Bandit rules, with optional Google Gemini AI enhancement.
- Backend: Python 3.12+, FastAPI, Pydantic, SQLAlchemy, SQLite/PostgreSQL, Pytest
- Frontend: React, TypeScript, Vite, CSS, Lucide Icons
- CLI: Python
codedoctorCLI tool (pip install -e cli/) - Adapters: REST API (
/api/v1), VS Code Extension (adapters/vscode), GitHub Actions CI/CD (.github/workflows/code-doctor.yml)
cd backend
python -m uvicorn app.main:app --reload --host 127.0.0.1 --port 8000Open API docs at http://127.0.0.1:8000/docs.
cd backend
python -m pytest tests/python -m pip install -e cli/
codedoctor scan examples/python/cascading_errors.py
codedoctor scan examples/python/cascading_errors.py --format json
codedoctor fix examples/python/index_error.pycd frontend
npm install
npm run devOpen Web Dashboard at http://127.0.0.1:5173.