Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

AI Agent–Based Code Debt Management

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.

Prerequisites

  • OpenAI API key (required for either path)
  • MCP: Node.js 18+, TypeScript 5.7+
  • PR agent: Python 3.10+, repo secrets for GitHub Actions

Quick start

MCP server (editor)

cd codedebt-mcp
npm install && npm run build
export OPENAI_API_KEY="sk-..."
npm start   # or ./start-server.sh

Point VS Code at dist/index.js via MCP config (see codedebt-mcp/SETUP.md). Full tool docs: codedebt-mcp/README.md.

PR agent (CI)

  1. Set secrets: OPENAI_API_KEY, TD_CLASSIFICATION_MODEL_ID, TD_REFACTOR_MODEL_ID, TD_PLANNER_MODEL_ID.
  2. Open a PR that touches .java files and add the td-agent label.
  3. 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.py

Details: Code_debt_agentic/README.md.

Workflow

  1. Detect — classify issues as smell / bug / vulnerability with severity
  2. Evaluate — prioritize (BLOCKER → CRITICAL → MAJOR → …)
  3. Refactor — suggest or generate patches (MCP can auto-fix; PR agent proposes only)

Experiments & paper artifacts

Validation corpus, metrics, and plot scripts live under codedebt-mcp/evaluation_artifacts/. See codedebt-mcp/SETUP.md.

License

MIT — GENAI-CODEDEBT / North Carolina State University

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages