Chapter 301 Section 40
A hat that has a hard straight brim that is a tefach wide is prohibited to be
worn on Shabbos as it is making a tent.
Chapter 301 Section 41
When you are wearing a hat on top of a yarmulka, you must be careful that the
hat fits on tight so that the wind will not blow it away, as you might come to
carrying.
Chapter 301 Section 42
If you find a kosher pair of tefillin in middle of the street on Shabbos, you
can put them on and wear them until you get home.