You are a home buyer. In S.F. the seller pays commission to listing agent, and the listing agent will split the commission to the buyers agent as per MLS agreement (usually sellers want their home to be listed on MLS and commission offered to buyer agents so the house enjoys more exposure rather than letting listing agent has their house as 'pocket' listing).
So, as a buyer, you do not have to worry about paying commission.
I will not want to go with 'dual agency' (the agent who represents both seller and buyer), for the reason of unbiased negotiation and make sure my agent has my best interest in mind. Use 5% as total commission as an example, on a $1M house, you will probably not being able to save more than 1% fee, which is $10,000. However, if you have an agent who knows that they will be able to sell you a home that you like, whether it's this house or another one, they will get paid. They will work extra hard for you on negotiating the deal. You might be able to save 5-10% off the listing price if you find the right house, do the right negotiation. the 1% savings, if any, pales in that. This is just one example. There are many other variation on this scenario.
For closing cost, as a buyer, you will be paying for title company fee, title insurance fee, mortgage fee, points, if any, prorated property tax, insurance, mortgage, etc. The number also varies by the price point of the home / mortgage you are getting.
The best way to find out about the closing cost is to ask your agent give you an estimate on closing cost for your specific deal.
Purchasing directly from a developer or with a Realtor present, as a Realtor, i am going to say that it's best to be represented by your buyer Realtor. The reason is your agent can show you various homes, both new developments and resale homes in many areas to fit your criteria, they are not limited to one specific house or development. If the developer does pay commission to the agent (usually requires the agent to bring you in and sign you in the first time around), they will still allow you to negotiate rebates and upgrades just the same as when you are represented by the developer - they want the agents to bring buyers in. So, you will be getting the same incentive, deal, with the benefit of somebody else who represents you and watches over the whole deal with YOUR best interest in mind - and that's a really important part in buying or selling a home.
If you like, please give me a call (415) 717-0293 or email me and I can talk to you about the pros / cons and details of each and the process of buying a home. .