Thomas Shey
Legend
Then that's the die you're rolling.
Like I said before, you can do the math if you really want to in order determine what actually caused you to succeed or fail. The 5e books all put it in this order: d20 + your stat mod + PB + any other mods you have. So let's say you have a stat with a +3 mod and your PB is +2. If the DC is 13 and you roll a 10, then you succeed because of your raw ability (stat mod). If the DC is 15, you succeed because of your skill (skill + PB). If you rolled a 15, then you succeeded because of something outside your own abilities, since neither your stat mod nor your skill were needed here. Yes, you still need to figure out what form that "outside your own abilities" takes--luck, you found all the handholds, those meddling pixies, whatever, but, well, IMO it'd be kind of sad if the game didn't even let you figure out that much on your own.
Though I will point out there's ambiguity if you use your first example rolls a 12. Was that skill or basic ability? You at least have to establish an order-of-operations you're paying attention to in that case.