The best way to define a framework is to start with a very specific set of requirements. For instance, look at two web applications which you want to take advantage of this framework and pick out the code that you feel is redundant and could be shared. Use the set of features in this code to drive your requirements.
My advice would be to start small with just a few very basic features. Factor them out into a library with a very well tested and defined API. Once you've verified this work, look for other areas or ways to increase the scope of the features you've already factored out. Or perhaps include a third web application and try to change it to use your library. Repeat this through several iterations and you should end up with the type of framework you're looking for.
It would also help to do some reading up on the subject of refactoring.