Hello,
I am working on a large IBM i (AS400) ERP containing:
- RPG III
- RPG IV / RPGLE
- CLP / CLLE
- DDS
- SQLRPGLE
- DB2 for i
- Batch jobs
- Several decades of accumulated business logic
My objective is NOT code explanation.
My objective is to reconstruct the complete knowledge of the ERP, including:
- business processes
- business rules
- application architecture
- dependencies
- workflows
- hidden knowledge
- impact analysis
- functional cartography
Ideally, I would like an AI agent capable of progressively building and refining a knowledge base while analyzing additional source code.
I am looking for advice regarding:
- The best prompting strategy for Claude Opus / Sonnet.
- The best open-source models available on Hugging Face.
- Agentic architectures (LangGraph, CrewAI, OpenHands, etc.).
- Knowledge graph approaches.
- RAG architectures for large legacy codebases.
- Reverse-engineering workflows used successfully in the industry.
If you had to design the ultimate prompt to reconstruct the knowledge of retiring experts from a legacy ERP, what would it look like? Thank you.
I wouldn’t look for one perfect prompt. On code this size, a model guesses at links it can’t see. So get the map from the system first.
DSPPGMREF with OUTPUT(*OUTFILE) lists the files and programs each of your programs refers to, as recorded at compile time. I think calls through a variable program name won’t resolve there. DSPDBR shows which files depend on each physical file, and you can load both into a graph.
Then go bottom-up. The model sums up your leaf programs first, and each higher summary reads its own source plus the summaries below it. Ask it to cite the member and line for each business rule, so your retiring experts can check every rule fast.