This is the reverse question of How to find out where a macro is defined? (and Where do I find out how a command/environment is defined? and How to find a package name by a command name?) and is inspired by the fact that the resolution of Error with cleveref + enumerate + tikz-qtree turned out to be a name clash between two packages.
I can see the use of a script that would take a package (for some variant of TeX) and produce a list of all the stuff it defines, with the idea that comparing two of these would help in the hunt for namespace collisions.
First Question: Does such a script exist?
If the answer to that is "No", then it shouldn't be too hard to write such a script; the key is to figure out where things are defined.
Second Question: What are the main ways in which assignments are made?
(Note that this could easily be specific to flavour of TeX used.) The word "main" is there because the purpose of such a script is not to be a necessary and sufficient test but a quick test to eliminate obvious possibilities. In particular, a package author who does something like \let\mydef\def \mydef\something{else}
is probably knowledgeable enough that they are aware of the potential for namespace collisions and know how to avoid them. But \expandafter\def\csname s()mewe1rd c()mm@nd\endcsname
should probably be allowed for.
trace
package useful? BTW, tokens, dimensions, boxes, etc. are registers.