I'd start with Shadowdark or Knave, and build from there.
Before SD dropped, I was using Knave as the basis of some hacks and it was incredibly powerful and streamlined, making it really easy to do so. The compatibility with B/X-era D&D means you open up so much content for direct use that it's...