How can anyone assess their own Phd application prior to actually applying to determine its weaknesses and figure out what to do next? How can an undergraduate student self-assess his/her PhD application prior to actually applying for PhD programs?

As prospective PhD students, we can generally compare ourselves to other students at our own school using our grades. We may also apply to internships or awards and, by acceptance rates of such programs, we may begin to understand how "good" we are as a possible Phd student candidate. In addition, we might try discussing our potential application with a professor, but even though we might be really good, the professor might be too busy or otherwise not give great feedback. In such a case, how can one self-assess himself/herself on how good is his s/he perceived as a prospective Phd student, determine his/her weaknesses, and figure out what to do next ?
Since students are admitted to such programs by people, and not by algorithms, you probably can't do it with any assurance. But note that the number of programs you target is very small and the number of potential applicants is very large. Thus, the competition is fierce. So, it doesn't depend on just you, but on the perceived quality of the others you compete with. 

As Solar Mike suggests, the only way to know is to apply.

But one good way to get a fairly valid assessment without applying is to put together the materials needed for an application and ask one or two of your current professors to give you feedback on it. Do they see any missing parts? Can they suggest better ways to present yourself to a committee of their peers? ...

Some students with perfect GPAs get rejected from some programs because there just isn't room for everyone or they have other things in their record that makes them less of a "sure bet" for the committee. 

On the other hand, there are plenty of other schools, not in your "top" category at which you can get a fine education and a firm foundation for a great academic career. Some schools have "niche" programs in certain sub fields that may be better suited to you and provide a better education that the top ten you suggest. You might also have a clearer path to completion at such schools.