Fine-tuned LLM agents for detecting and remediating technical debt in Java. This repo combines two delivery surfaces that share the same classify → refactor idea:
| Component | Path | Role |
|---|---|---|
| MCP server | codedebt-mcp/ |
IDE tools (td_analyze, td_refactor, td_auto_fix) for VS Code / Copilot |
| PR agent | Code_debt_agentic/ |
GitHub Actions bot that comments on labeled PRs (propose-only) |
Both use OpenAI fine-tuned models trained on SonarQube-style rules and real Java examples.
- OpenAI API key (required for either path)
- MCP: Node.js 18+, TypeScript 5.7+
- PR agent: Python 3.10+, repo secrets for GitHub Actions
cd codedebt-mcp
npm install && npm run build
export OPENAI_API_KEY="sk-..."
npm start # or ./start-server.shPoint VS Code at dist/index.js via MCP config (see codedebt-mcp/SETUP.md). Full tool docs: codedebt-mcp/README.md.
- Set secrets:
OPENAI_API_KEY,TD_CLASSIFICATION_MODEL_ID,TD_REFACTOR_MODEL_ID,TD_PLANNER_MODEL_ID. - Open a PR that touches
.javafiles and add thetd-agentlabel. - The workflow posts one aggregated comment + a passing Technical Debt Agent check (does not fail CI).
Local run:
cd Code_debt_agentic
pip install -r requirements.txt
python scripts/td_agent_pr.pyDetails: Code_debt_agentic/README.md.
- Detect — classify issues as smell / bug / vulnerability with severity
- Evaluate — prioritize (BLOCKER → CRITICAL → MAJOR → …)
- Refactor — suggest or generate patches (MCP can auto-fix; PR agent proposes only)
Validation corpus, metrics, and plot scripts live under codedebt-mcp/evaluation_artifacts/. See codedebt-mcp/SETUP.md.
MIT — GENAI-CODEDEBT / North Carolina State University