TAP file format
From SpecNext official Wiki
It's a viable format and is easy to put together. Several tools support output to tap.
For BASIC portions of tap files, it's most common to use a tool like bas2tap that will convert an ASCII text file containing a basic program to tap fragment.
The next has dot commands like tapein to mount a tap and from BASIC you indicate you want to redirect LOAD, SAVE to the tap file with LOAD "t:". lstap will list the contents and position of each tap fragment in the tap file. extract can be used to pull out individual pieces of a tap file. In longer term there will probably be another dot command that can extract an entire tap file into individual files.
The esx api has a lot of support for tap files too, allowing you to seek in them, etc.