I try to use aliases typically, to designate pins. Provided that proposed "Code Libraries" use aliases as a rule of thumb (instead of specific pins), this would alleviate much of the "broad range" issue, would it not? Each user could then have their own specific alias definitions for assigning pins/ports. Data direction registers, Port and pin assignments, etc. would all be up to the user to define, so that the aliases within the "Library" are adapted to his/her PIC of choice. If requirements are documented within each Library, then users can ensure they allocate resources accordingly.
I realize that it's far from perfect, but in the interest of evolution toward standardized code snippets, doesn't it seem like something worth starting?
Bookmarks