Are there any attributes to create game objects in the hierarchy?

I want to make an Editor Script that help me right-click in the hierarchy to create a prefab game object just like how we create empty game objects(and that option would be listed in the menu like below the empty game object option in the pic below). I know there’s [CreateAssetMenu] attribute for creating assets. Are there any attributes for create game object in the hierarchy or any tools like that? Any help is appreciated!

Drag and drop your object from the hierarchy to your project panel.Prefab will automatically get created of your selected object.