AI-Powered Multi-Agent System for Autonomous Technical Debt Detection, Prioritization & Remediation
Built by Priyansh Jain | IIT Jodhpur β Applied AI & Data Science
Technical debt costs organizations $3.61 per line of code and consumes 40β60% of developer sprint time.
Traditional tools like SonarQube only detect problems. CodeDebt Guardian detects, prioritizes, AND autonomously fixes them by opening real GitHub Pull Requests.
| Feature | Description |
|---|---|
| π΅οΈ 3-Agent Pipeline | Detection β Ranking β Fix Proposal, orchestrated sequentially |
| π€ Auto-Fix PRs | Opens real GitHub PRs with code fixes applied autonomously |
| π RICE Scoring | Business-impact-weighted priority ranking |
| πΎ Persistent Memory | SQLite-backed cache β no re-analyzing the same repo |
| π Web UI | Streamlit dashboard with Plotly charts |
| π Observability | Span tracing + per-operation metrics for every agent call |
| β 40+ Tests | Full pytest suite with CI on Python 3.10/3.11/3.12 |
βββββββββββββββββββββββββββββββββββ
β Orchestrator Agent β
β Session Management β
β PersistentMemoryBank (SQLite) β
β ObservabilityLayer β
ββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββΌβββββββββββββββββββ
β β β
βΌ βΌ βΌ
Agent 1 Agent 2 Agent 3
Debt Detection Priority Ranking Fix Proposal
- Python AST β’ RICE Score β’ 6 Templates
- Gemini 2.0 β’ AI Impact β’ Gemini AI
- Regex rules β’ Sprint Plan β’ Before/After
β
βΌ
PRGenerator
Branch β Patch β Commit β Pull Request
- Python 3.10+
- Google AI Studio API Key (free)
- GitHub Personal Access Token
git clone https://github.com/Priyanshjain10/codedebt-guardian.git
cd codedebt-guardian
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # Add your API keys# Launch web UI
python main.py --ui
# CLI analysis
python main.py --repo https://github.com/owner/repo
# Auto-fix mode β creates real GitHub PRs
python main.py --repo https://github.com/owner/repo --auto-fix --max-prs 3from agents.orchestrator import CodeDebtOrchestrator
guardian = CodeDebtOrchestrator()
detection = guardian.detect_debt("https://github.com/owner/repo")
ranked = guardian.rank_debt(detection)
fixes = guardian.propose_fixes(ranked[:10])
# Auto-fix: create real PRs
prs = guardian.create_pull_requests(
repo_url="https://github.com/owner/repo",
fix_proposals=fixes,
ranked_issues=ranked,
max_prs=3,
)
for pr in prs:
print(f"#{pr['number']}: {pr['html_url']}")Security π΄ β Hardcoded passwords, API keys, bare except clauses Structure π β God classes, long functions, too many parameters Maintainability π‘ β Missing docstrings, no type hints, high cyclomatic complexity Project Health π’ β No tests, no CI/CD, unpinned dependencies, missing README
codedebt-guardian/
βββ agents/
β βββ orchestrator.py # Master coordinator
β βββ debt_detection_agent.py # AST + Gemini scanning
β βββ priority_ranking_agent.py # RICE scoring
β βββ fix_proposal_agent.py # Fix generator
βββ tools/
β βββ pr_generator.py # Autonomous GitHub PR creation
β βββ persistent_memory.py # SQLite-backed memory
β βββ github_tool.py # GitHub REST API
β βββ code_analyzer.py # AST metrics
β βββ observability.py # Span tracing
βββ models/
β βββ schemas.py # Pydantic v2 data models
βββ ui/app.py # Streamlit web UI
βββ tests/ # 40+ unit tests
βββ .github/workflows/ci.yml # GitHub Actions CI
βββ main.py # CLI entry point
pytest tests/ -v --cov=agents --cov=tools- 3-agent detection & fix pipeline
- RICE-based priority scoring
- Auto-Fix PR generation
- SQLite persistent memory
- Streamlit web UI
- GitHub Actions CI
- GitHub Action (auto-analyze on PR)
- Support for JavaScript/TypeScript
- Slack/Discord notifications
- VS Code extension
PRs welcome! Fork β Branch β Test β PR.
MIT β see LICENSE
β Star this repo if it helped you!
Priyansh Jain | IIT Jodhpur