I am totally new to developing an extension for Safari.
It says I should build extension with that so-called Safari extension builder,
Xcode is recommended.
I am totally confused. I used to develop Chrome extension before.
The first docs you linked are for the deprecated Safari extension framework (unavailable since Safari 13). You should use the docs in the second link. You can tell whether you are in old or new docs based on the layout of the docs (if you get there e.g. via a Google search).