definitionLines function
The signature lines of vocabulary's definitions, with their purposes,
as the taught prompt lists a design system's components.
Implementation
List<String> definitionLines(NotationVocabulary vocabulary) => [
for (final defs in vocabulary.definitions.values)
for (final d in defs) '${d.signature.replaceFirstMapped(RegExp(r'^([A-Z][A-Za-z0-9.]*)#[A-Za-z_][A-Za-z0-9_]*(?:-[A-Za-z0-9_]+)*'), (m) => m[1]!)}${d.slots.isEmpty ? '' : ' (children${d.slots.where((s) => s.isNotEmpty).map((s) => ': $s').join()})'}${d.doc.isEmpty ? '' : ' : ${d.doc}'}',
];