Hello, I hope you're doing well!
To create a custom cluster you need to define each of the ZCL structures. These structures contain endpoint definitions, cluster definitions, attribute definitions, addresses, attribute reporting configuration, response configurations and cluster instance data, as well as other configurations.
For further information about the ZCL structures, please take a look at chapter 6 of this document right here.
For reference, you can check the JN-AN-1229 Application note, as it contains an instance of a custom cluster.
If you have any further questions, please let me know.
Best regards,
Sebastian