first of all: I'm on the other end than usual, means I'm implementing an application that receives G-Codes to control a device - so my question is not done from a G-Code-users point of view.
I know the standard G-Codes like they are described e.g. at https://en.wikipedia.org/wiki/G-code#Specific_codes . For most applications they are complete and provide all parameters that are imaginable. Now the device I have and which needs to be controlled by G-Codes has some additional parameters beside the usual speed, power and so on. These parameters are things like frequencies, delays that have to be applied at specific contexts of the operation, tool-type descriptions and other device dependent things more.
My question: how can I extend the standard G-Code command set by these parameters in an compatible way? Is there a specification how new commands/parameters shall be added without breaking the design and backward compatibility of G-Code?
G, M, and other codes outside of the normal generic codes are normally machine specific and issued in the post processor for that machine. That really means that you can do anything that will work for your system. M codes for instance that are numbered greater than 100 are user (machine builder) defined and could be defined to do anything. Many machines have special codes that are only applicable to that machine.