Creating a plugin structure with Plugin Builder
A QGIS plugin can be created manually with a simple editor, but the simplest and most complete way to start to create a plugin is to use another Python plugin called Plugin Builder.
Plugin Builder generates the file infrastructure of the plugin, thus avoiding writing repetitive code. Plugin Builder creates only a basic and generic plugin, which can be modified to add specific user functionalities.
It will generate a generic plugin with the following graphical user interface:
This is an almost empty dialog with two buttons. Every piece of this interface can be modified and customized to achieve the plugin's goal.
Installing Plugin Builder
The first step is to install Plugin Builder using the Plugin Manager by navigating to Plugins | Manage and Install Plugins....
Locating plugins
The Plugin Builder, as every third-party Python plugin is by default, is installed in your home directory at the following path:
<your home path>/.qgis2/python/plugins...