You may refer to capabilities.json of Dual KPI and view its source code at https://github.com/Microsoft/powerbi-visuals-dualkpi. As for the spec, see https://github.com/Microsoft/PowerBI-visuals-tools/blob/164f80e7e269f56dbbfd8009e4d860c7c03b4f07/templates/visuals/.api/v1.6.0/schema.capabilities.json.