I believe the issue here is that a noun or pronoun + a form of have can only be contracted if the noun or pronoun is the subject of this form of have. That means have has to be a finite verb, not an infinitive, for infinitives normally don't have a proper subject.
How could I've done this better?
In your first example, have is an infinitive; the finite verb is could.
"I had a great dinner today!" "Oh? What did you've?"
In your second example, it is also an infinitive; the finite verb is did. The reason is probably that a subject and its finite verb are closely connected grammatically; if you contract two words into one, this makes the words even more closely connected; but, if you contract a subject and an infinitive but leave out the subject's finite verb, then the wrong words are paired up, or so thinks our grammatical subconscious.
Another contraint here is that you normally can't contract a verb if it is stressed in pronunciation; when I pronounce what did you have?, emphasis lies on have, and the word is pronounced fully.
"I've seen it." "Oh, you've?"
Here have is a finite verb, not an infinitive; but you still can't contract it, because it is stressed.
how
from the first example, so it reads 'Could I've done this better'. Secondly, in your second example,you've
sound wrong because contractions usually can't end sentences, and it is a bad analogy to determine the correctness of the 1st one. You can say "I've cake", but when asked "Who has cake?", you'll have to say "I have", not "I've"have
in the sense of posession. So I don't think it's a duplicate.