How do I make sure I get strong recommendation letters for faculty positions? I would like to ask Prof. X, a distinguished scholar at a top school, for a recommendation for a tenure-track academic position. However, I only want him to write me a recommendation if he is going to write a good one. If he will write me a mediocre or just insufficiently positive recommendation, I would prefer to have someone less famous than X but more positive about me write the letter.

If I simply ask Prof. X for a letter, there is the possibility that he will agree and  then  write something that is not as positive as I would like. I want to avoid this. 

One way to solve this problem would be for me to ask Prof. X if he is sufficiently familiar with my work to write me a strong letter. If he does not wish to write me a strong letter, he can simply reply that he is not that familiar with the whole body of my work. By giving him an easy way to decline, this makes it more likely that he will write a strong letter if he accepts.

Unfortunately, in this case this little strategem will not work, as Prof. X and I have been working on the same questions for years, so there is little question of him being unfamiliar with my results. 

Another possible solution would be to have someone else approach him to ask whether he can write me a strong letter. Sadly I have no one who could do this for me. 

What would be a good strategy to use in this situation? More broadly, what are some general tips for asking people for recommendation letters which ensure you only get strong letters, besides the two I mentioned above?

Edited: Maybe I should mention a couple of other strategies that crossed my mind:

A. Mention to Prof. X that I'm going on the job market in unrelated conversation and see if he volunteers to write me a letter. 

B. Ask him for a letter in an email and see how he responds. If he responds enthusiastically, e.g., "It would be my pleasure to write you a letter..." or "I'd be extremely happy to..." this is good. If he only responds neutrally, e.g., "Sure, I can write you a letter" then simply neglect to follow up with him and ask someone else for the letter. 

Both of these strategies are decent, but they are not perfect. They might work, but they also might cause me to miss out on a good letter from a well-known scholar. Anyway, I'd welcome thoughts, corrections, additional strategies to use that I haven't thought of, etc.
One way to solve this problem would be for me to ask Prof. X if he is sufficiently familiar with my work to write me a strong letter. 


No.  Do not play mind games.  The best approach is to be completely straightforward.

If you already know that he is familiar with your work, suggesting otherwise is dishonest and potentially insulting.  What you really want to know is whether he's impressed by your work.  The only way to find out is to ask directly.  If possible, ask in person, preferably over coffee/beer or in some other informal neutral setting; conferences are really good for this.  Be straightforward about your desire for a strong letter, but use the opportunity to develop a stronger collaborative relationship.  Ask for honest feedback on your work.  Ask about future opportunities to work together.  Ask where he thinks you should apply.  Be sincere in asking whether he can write you a strong recommendation letter; he knows what that means.  Be sincerely ready to be turned down.  Listen.

If you're not comfortable asking him directly, or you think that he might not be comfortable answering you, ask your advisor to informally sound out Prof X's opinion of you first.  (Ideally, your advisor already has some idea what Prof X will say.)  But the actual letter request must come directly from you.


  If he only responds neutrally, e.g., "Sure, I can write you a letter" then simply neglect to follow up with him and ask someone else for the letter.


No.  Do not play mind games.

First, unless you already know Prof X extremely well, you should not attempt to read his mind through email.  "Sure, I can write you a letter" says nothing about his level of enthusiasm.  If his response to your request makes you hesitant to use his letter, ask him again.  Second, if you decide, for whatever reason, that you don't need his letter after you've asked for it, you must tell him directly, so that he doesn't waste his time.