Agadir is a cosmopolitan tourist destination where there is no strict dress code although some consideration must be given to Moroccan culture.

The emphasis on dress code is dependent on where you are in Morocco;

In tourist resorts you can dress much as you would anywhere else when on holiday but with certain limitations; women should not go topless on the beach. T-shirts and shorts are acceptable as long as they are not too tight or revealing. If you are in places such as small villages, Moroccan homes, public events etc you must show some respect and keep most parts covered although this would not normally apply to having ones head covered. Tourists are not allowed into mosques (except in Casablanca) where you would remove shoes.

If you do not want unwanted attention from men and looks of disgust from women, it is best to not wear low cut vests and tops, mini-skirts should be avoid.

Many European women use lightweight scarves to cover their shoulders and mid-front when out and about around town. It will stop any stares. 

It would cause offence if you were shirtless in the town, so guys wear at least a t-shirt. 

The beach is a different matter, people go swimming so you will expect to wear swimwear and you will see Moroccan women bath in the sea covered.