Creating Subcircuits

Let's use a basic discrete Class A operational amplifier for our subcircuit:

gschem Screenshot

The filename is sirius-purple-a-mk-2.sch, so the terminal command is:
gnetlist -g spice-sdb sirius-purple-a-mk-2.sch -o sirius-purple-a-mk-2.cir

Then open the .cir file in a text editor:

Pluma Screenshot 1

Change the last line from ".end" to ".ends".
Then add the .SUBCKT directive, the subcircuit name (i used sirius-purple-a for my subcircuit) and the connections (vpos is pin 1, vneg is pin 2, vcc is pin 3, vee is pin 4 and output is pin 5):

Pluma Screenshot 2

To include the subcircuit in your schematics, see the Using Subcircuits tutorial.