Skip to content

rupaku/legacy-code-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Legacy Code Explainer & Modernization Assistant

A hackathon prototype: paste in legacy COBOL, JCL, or aging Java, and get back (per logical chunk of code):

  • a plain-English business logic explanation
  • dead-code / risk flags (unreachable branches, stale flags, discontinued products)
  • a first-draft modernized translation (Java or Python)
  • an honest confidence score
  • a list of open questions a human reviewer must verify before trusting the translation

This is a copilot, not an autopilot. The tool is explicitly designed to surface uncertainty rather than hide it — that's the whole point of the "open questions" and confidence score fields.


Project structure

legacy-code-assistant/
├── backend/              FastAPI + Claude API
│   ├── main.py            API endpoints
│   ├── chunker.py         splits legacy source into paragraphs/methods/steps
│   ├── claude_service.py  prompt design + Claude API calls
│   └── requirements.txt
├── frontend/             React (Vite)
│   └── src/
│       ├── App.jsx
│       ├── App.css        design system (legacy phosphor -> modern editor)
│       └── components/
└── sample_data/          synthetic COBOL + Java files for the demo

Running it locally

1. Backend

cd backend
cp .env.example .env
# edit .env and set ANTHROPIC_API_KEY=sk-ant-...

python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate
pip install -r requirements.txt

uvicorn main:app --reload --port 8000

The API will be live at http://localhost:8000. Check http://localhost:8000/api/health.

2. Frontend

cd frontend
npm install
npm run dev

Open http://localhost:5173. The Vite dev server proxies /api requests to the backend on port 8000 (see vite.config.js), so no CORS setup is needed beyond what's already in main.py.

3. Demo flow

  1. Click Load sample → Premium Calc (or Proration Utils).
  2. Click Analyze legacy code.
  3. Expand a chunk to see the explanation, any risk flags, the legacy/modern split view, the confidence badge, and open questions.

Design notes

The UI's split-panel layout is intentional, not decorative: the left panel uses an amber-phosphor terminal palette (legacy), the right panel uses a clean dark-editor palette (modern), and a gradient "migration rail" literally connects the two — visually staging the transformation the tool performs.

Extending this for a real hackathon submission

Ideas if you have extra time:

  • Jira integration: auto-file a modernization ticket per chunk via Atlassian Rovo, pre-filled with the explanation + open questions.
  • Repo-wide scan: accept a zipped repo, chunk every file, and produce a prioritized "riskiest modules first" report.
  • "Explain like I'm new here" toggle: adjust explanation depth for a new hire vs. a senior engineer.

About

Legacy Code Explainer & Modernization Assistant — paste COBOL/JCL/Java and get explanations, risk flags, and modernized translations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors