I am genuinely sorry to hear you are going through this. Is the spasms painful, or would you describe them as uncomfortable? Have you had any changes in medications in the past three months? I would look into the phrenic nerve and ask your doctor about the possibility of injury to it. This can lead to problems sleeping, which leads me to think it could be a possibility for what you are experiencing. Many people discuss the ribs and diaphragm in our forums but typically mention pain or pressure. Strenuous exercise can also cause the diaphragm to spasm (https://my.clevelandclinic.org/health/body/21578-diaphragm).
Jodi, Team Member