So speaketh the FAQ at roguebasin:
Can I use external libraries? Graphics files? Design Documents? Code I wrote in the past? Existing roguelikes?
This is entirely up to the developer.
It is recommended one has some design idea going into the project.
You should say what pre-existing code you used. The goal isn't to see who can retype existing algorithms the fastest. The goal is for people to write playable and complete roguelikes.
Remember: if you spend seven days patching NetHack, you likely will end up with something that looks a lot like NetHack, so it would thus not be considered very impressive. However, if you spend seven days patching NetHack and create an amazing new roguelike, you will be suitably honoured.
To be specific, writing a new ToME module in seven days would be a 7DRL.
Not from scratch? Then what's the point?
Life shows that the biggest challenge in making a roguelike is actually finishing it. 7drl is meant as a fun exercise in the very act of releasing a playable game. Using premade libraries does not make that part any easier, as proven by the yearly results.