Previously Ajax commands were shared across all Ajax objects causing problems when users relied on the behavior described in the documentation.
The code has been corrected to conform to the documentation and a new object holding all Ajax commands has been declared: Drupal.AjaxCommands
To implement a custom Ajax command:
Drupal 7
Drupal.ajax.prototype.commands.customCommand = function () {};
Drupal 8
Drupal.AjaxCommands.prototype.customCommand = function () {};
See #2019481: JavaScript AJAX commands object is borked: it is shared among all Drupal.ajax instances, preventing scoped overrides for a detailed description of the problems in Drupal 7.