"A permit is needed to replace windows regardless of their location on the building. Failure to obtain a building permit may result
in enforcement, fines and removal of windows installed without the benefit of permit.

THE PLANNER SAID THAT I HAVE TO REPLACE MY WINDOWS “IN-KIND.” WHAT DOES THAT MEAN?
If a Planner has stated that you should replace your windows “in-kind” this means that a wood doublehung window should be replaced with a wood doublehung window. All details must match, including muntin profiles and exterior millwork. Please note that replacing a double-hung wood window with a double-hung vinyl window is not “in-kind” replacement

If installing a new window on a portion of the building that is visible from the street is desired, and the plans and photos are adequate, a planner
will determine right away if the permit can be approved, or if it will require further design review. In some situations such as window replacement
on a historic building, further review may be required. The window replacement permit application will be reviewed at the Planning Information Center and may be referred upstairs to a Preservation Technical Specialist for review".

http://sf-planning.org/ftp/files/publications_reports/Standards_for_Window_Replacement.pdf