Zagiers Class Number Definition of Binary Quadratic Forms
the class number is always for primitive forms. Among other things, this allows Gauss composition to make the set of classes into a group.
For definite forms, the negative definite forms are just a copy of the positive definite forms, each negated. Furthermore, the composition of two positive forms is positive. So, we always take the positive definite forms.
He does automorphism group page 63. Finally he does reduction page 120, for indefinite forms 122 (6) (this is his version, different from Gauss/Lagrange).
I suggest you fill in with other sources for the quadratic form parts. From about 1929, Introduction to the Theory of Numbers by Leonard Eugene Dickson. For composition, genera, Primes of the Form $x^2 + n y^2$ by David A. Cox. This has a very clean presentation of Dirichlet's method of computing composition, which has the advantage of actually resembling a mulitplication