Generate a defmacro form that transforms code like this:
(define-class some-class (some super classes) ((slot1 42 :documentation "zork") (slot2 :unbound :accessor slot2-custom) (slot3 :unbound :accessor nil :export :accessor)) (:export-accessor-names-p t) (:export-class-name-p t) (:export-slot-names-p t))

Pattern to recognize: Macro call that should be transformed by define-class

Macro definition:
(defmacro define-class (name supers slots &rest options)
  "Convenience wrapper of `defclass'.

It automates a lot of boilerplate (like exporting all the accessors of a class)
plus adds some new features.



Slot options:

- The initform can be specified as the second value.

- `:accessor', `:reader' and `:writer' can be set to either a name, NIL or T.
  If NIL, the method is not generated.
  If T, the method is generated using the `:accessor-name-transformer' class option value.

- The `:export' option allows to control the slot-name export on a per-slot basis.



New class options (defaults are NIL unless specified):

- `:slot-definition-transformer' (default: `default-slot-definition-transformer').
  A function that takes a SLOT-DEFINITION and returns a new one.

- `:accessor-name-package': The package of the generated accessors.  See
  `:accessor-name-transformer'.  Some special values are accepted:
  - `:slot-name': The package of the slot-name.
  - `:default': The current package.

- `:accessor-name-transformer' (default `default-accessor-name-transformer').

  A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the accessor
  name (a symbol).  Other transformer: `dwim-accessor-name-transformer'.

- `:automatic-accessors-p': Whether to generate accessor names automatically for
  all slots.

  As a special case, the accessor is not generated if all following conditions are met:
  - `:accessor-name-package' is `:slot-name',
  - slot name package is different from current package,
  - if the `:accessor' slot option is not provided,


- `:initarg-name-transformer' (default: `default-initarg-name-transformer'.)

  A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the accessor
  name (a symbol.

- `:automatic-initargs-p' (default: T): Whether to generate accessor names
  automatically for all slots.

- `:predicate-name-transformer' (default: `default-predicate-name-transformer').

  A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the predicate
  name (a symbol).

- `:automatic-predicates-p' (default: T): Whether to generate a predicate
  for the class.

- `:type-inference' (default: `default-type-inference').

  Function that returns the type of a slot definition (with an initform).  It
  takes 3 arguments:

  - The initform.
  - The slot name.
  - The rest of the slot definition.

- `:automatic-types-p': Whether to generate the type automatically for all
  slots.  The type can still be specified manually with the `:type' slot option.

- Self-explanatory export options (all NIL by default):
  - `:export-class-name-p'
  - `:export-accessor-names-p'
  - `:export-slot-names-p'
  - `:export-predicate-name'"
  (build-defclass-like-expansion
   name supers slots options
   (lambda (processed-slots clean-options)
     `(defclass ,name ,supers
        ,processed-slots
        ,@clean-options))))

Macroexpansion:
(progn (defclass some-class (some super classes) ((slot1 :initform 42 :accessor slot1 :initarg :slot1 :documentation "zork") (slot2 :accessor slot2-custom :initarg :slot2) (slot3 :initarg :slot3))) (unless (fboundp (quote some-class-p)) (define-generic some-class-p (object) #A((75) base-char . "Auto-generated predicate for whether OBJECT is an instance of `some-class'.") (declare (sb-ext:muffle-conditions style-warning)) (typep object (quote some-class)))) (eval-when (:compile-toplevel :load-toplevel :execute) (export (quote (some-class slot2 slot2-custom slot1 slot1)) #A((8) base-char . "NCLASSES"))) (setf (documentation (quote slot2-custom) (quote function)) #A((48) base-char . "Auto-generated accessor function for slot SLOT2.")) (ignore-errors (setf (documentation (fdefinition (quote slot2-custom)) (quote function)) #A((48) base-char . "Auto-generated accessor function for slot SLOT2."))) (ignore-errors (setf (documentation (fdefinition (quote (setf slot2-custom))) (quote function)) #A((48) base-char . "Auto-generated accessor function for slot SLOT2."))) (setf (documentation (quote slot1) (quote function)) #A((53) base-char . "Auto-generated accessor function for slot SLOT1.
zork")) (ignore-errors (setf (documentation (fdefinition (quote slot1)) (quote function)) #A((53) base-char . "Auto-generated accessor function for slot SLOT1.
zork"))) (ignore-errors (setf (documentation (fdefinition (quote (setf slot1))) (quote function)) #A((53) base-char . "Auto-generated accessor function for slot SLOT1.
zork"))) (find-class (quote some-class) nil))