The first tip for maintaining a mechanical groupset on a road bike so it always shifts perfectly is, don’t use Shimano’s 10-speed groupset as your example of perfect.
Campagnolo? Awesome. SRAM 10-speed? Fine and dandy. Shimano? Well…
I should know. My wife and I have four bikes in our stable with differing lines of Shimano 10-speed drivetrains. We’re in the process of acquiring a Campagnolo Record equipped 10-speed bike and have an 11-speed Shimano and 9-speed Shimano gravel bikes (one of which was upgraded from Shimano Claris 8-speed which was absolute garbage). In the 10-speed camp, at the top of the range, we have my Ultegra-equipped Specialized Venge, then my 105-equipped Trek 5200, my wife’s Specialized Secteur, and our Co-Motion tandem. My wife’s Specialized Alias has Shimano’s 105 line in 11-speed.
The key here is knowing the one problem with Shimano’s 10-speed line; if you know this problem, you can fix that when it rears its ugly head. Worry about the other minor problems as they arise. The main problem resides in a weak spring in the rear derailleur. This causes the derailleur’s performance to degrade long before its useful life should be over.
I chose the words in that last sentence very carefully, because they’re exceedingly important to how the drivetrain performs when that spring goes bad. It’ll operate like the shifting cable has drag in it, leading you on a wild goose chase for a phantom problem you’ll never be able to find. Oh, there will be signs that you’ve finally found the problem but your shifting will soon be pooched yet again… because you really just need a new rear derailleur.
Basically, you won’t be able to dial the rear derailleur in. It’ll shift well going up the cassette or it’ll shift well going down, never both as it should.
Unfortunately, that’s also a major clue for having drag in the shifting cable that’s preventing the derailleur from properly indexing. A little dirt or grime, some rust on the cable, grime in the connecting bits (ferrules and grommets and such), as well as grime in the cable guide under the bottom bracket… even grime in the shifters themselves – any of those issues will make your bike’s shifting go bad.
The simplest way to fix the rest is to pick up and install a shifting cable set from the manufacturer of your drivetrain. Even though you can technically use SRAM and Shimano interchangeably, I’ve taken to using only products that complete a line, with the exception of chains and cassettes. I use Ultegra chains and cassettes on all of the 105 bikes. They cost a little more, but the weight savings is worth it to me. New cables, housings and end caps (also referred to as ferrules) from the shifters to the rear derailleur, along with a shifter/hood cleaning will cure all ills if the derailleurs are in good working order.