Frequent Upper Back Pain

I wanted to see if anyone had a similar problem to mine or any ideas on what it is or how to best deal with it.

I pull a muscle in my back, just to the right of my spine between my scapula. I’ve tried to figure out which muscle it is but there are varying layers of muscles. Perhaps it’s the rhomboideus major, the trap, or the spinalis. I can “pull” it doing a variety of things I would not think would injure it such as sleeping on it funny or turning my head in an odd way but I more often injure it doing shrugs or shoulder presses. I was recommended by a friend to try shrugs (when I wasn’t doing them) to strengthen the traps.

Any ideas on what this could be or how to prevent it. It happens at least once every couple of months and can cause very intense, sharp pain and can slow my training down for at least a couple of days. The pain typically lasts about a week or so.

Thanks in advance for any advice or info!