Learn business as well as computer skills. We had several H1-B programmers at my previous employer, but they simply could not translate technical knowledge into effective business solutions. Just as with manufacturing, rote tasks can be done anywhere. But specialized work requires specialists. Become one.
Writing software is not a "rote task", nor will it ever be such. Software is very "specialist".