Whatever you do, don’t EAT there (exception, there is reportedly one decent ramen shop, but I don’t know which one). It was mediocre before Covid, now it’s disgusting, and not even remotely Japanese. The bookstore is called Kinokuniya, and if you have any interest in Japanese stationery/pens, stop by Maido across from it.
Alcatraz: it may be different now with Covid but I would check for reservations before you come to SF, sometimes the tours sell out well before.
Twin Peaks is a spectacular view and nothing else except a lot of wind. You need a car to get there. Also recommended for a different view: Telegraph Hill, which also has Coit Tower.
GG Park is huge and there are enough things in it to keep you busy for at least a day, including the botanical garden, huge greenhouse, and arboretum, Cal. Acad. of Sciences museum, DeYoung (art) museum, and a whole lot of beautiful trails and open spaces.
You might want to see how the other half lives in Presidio Heights and Pacific Heights. Walking here is recommended to get the full flavor of the residential magnificence of the filthy rich.
If you’re there on a Sunday and in summer (you didn’t say when you were coming) there’s a great outdoor performance venue called Stern Grove, entrance at 19th Ave. and Sloat Blvd. Bring a coat and a picnic lunch. Nothing for this year is posted yet, go to sterngrove.org for more info.
There is also, of course, the beach (called, cleverly, Ocean Beach), at least 5-6 miles of it, on the west end of town. It’s worth a walk up and down, if not on the sand then on the concrete boardwalk alongside. There are two windmills at that end of GG Park. Again, bring a coat.
You didn’t ask, and it really is variable, but the climate here is often quite cool even in the summer (please no Mark Twain quotes!) The usual advice is to dress in layers (and to carry something like a backpack to hold the layers you may take off).