@canonical/design-system 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/.mcp.json +8 -0
  2. package/README.md +438 -0
  3. package/biome.json +6 -0
  4. package/bun.lock +349 -0
  5. package/data/apps/component/file_tree.ttl +8 -0
  6. package/data/apps/component/key_value_pair.ttl +8 -0
  7. package/data/apps/component/navigation.ttl +8 -0
  8. package/data/apps/component/skeleton_loading.ttl +8 -0
  9. package/data/apps/component/status_bar.ttl +8 -0
  10. package/data/apps/component/toolbar.ttl +8 -0
  11. package/data/apps/layout/application_layout.ttl +8 -0
  12. package/data/apps/layout/empty_layout.ttl +8 -0
  13. package/data/apps/layout/list_page_layout.ttl +8 -0
  14. package/data/apps/layout/settings_page_layout.ttl +8 -0
  15. package/data/apps/pattern/code_diff.ttl +8 -0
  16. package/data/apps/pattern/data_table.ttl +8 -0
  17. package/data/apps/pattern/destructive_modal.ttl +8 -0
  18. package/data/apps/pattern/key_value_summary.ttl +8 -0
  19. package/data/apps/pattern/keyboard_shortcuts.ttl +8 -0
  20. package/data/apps/pattern/notification_center.ttl +8 -0
  21. package/data/apps/pattern/side_panel.ttl +8 -0
  22. package/data/apps/pattern/sidepanel_stacked.ttl +8 -0
  23. package/data/apps.ttl +5 -0
  24. package/data/apps_wpe.ttl +5 -0
  25. package/data/documentation/layout/documentation_layout.ttl +8 -0
  26. package/data/documentation.ttl +5 -0
  27. package/data/global/component/accordion.ttl +14 -0
  28. package/data/global/component/announcement.ttl +8 -0
  29. package/data/global/component/badge.ttl +9 -0
  30. package/data/global/component/button.ttl +20 -0
  31. package/data/global/component/card.ttl +8 -0
  32. package/data/global/component/chip.ttl +8 -0
  33. package/data/global/component/code_snippet.ttl +8 -0
  34. package/data/global/component/contextual_menu.ttl +8 -0
  35. package/data/global/component/heading.ttl +14 -0
  36. package/data/global/component/icon.ttl +14 -0
  37. package/data/global/component/icon_in_container.ttl +8 -0
  38. package/data/global/component/keyboard_key.ttl +8 -0
  39. package/data/global/component/label.ttl +15 -0
  40. package/data/global/component/link.ttl +8 -0
  41. package/data/global/component/notification_inline.ttl +8 -0
  42. package/data/global/component/notification_toast.ttl +8 -0
  43. package/data/global/component/pagination.ttl +8 -0
  44. package/data/global/component/popover.ttl +8 -0
  45. package/data/global/component/rich_text_editor.ttl +8 -0
  46. package/data/global/component/search_bar.ttl +8 -0
  47. package/data/global/component/table.ttl +8 -0
  48. package/data/global/component/tabs.ttl +8 -0
  49. package/data/global/component/theme_switcher.ttl +8 -0
  50. package/data/global/component/tile.ttl +14 -0
  51. package/data/global/component/tooltip.ttl +8 -0
  52. package/data/global/group/buttons.ttl +8 -0
  53. package/data/global/group/cards.ttl +8 -0
  54. package/data/global/group/tiles.ttl +8 -0
  55. package/data/global/layout/error_layout.ttl +8 -0
  56. package/data/global/layout/form_layout.ttl +8 -0
  57. package/data/global/layout/identity_page_form.ttl +8 -0
  58. package/data/global/modifier/alpha.ttl +6 -0
  59. package/data/global/modifier/beta.ttl +6 -0
  60. package/data/global/modifier/caution.ttl +6 -0
  61. package/data/global/modifier/comfortable.ttl +6 -0
  62. package/data/global/modifier/completed.ttl +6 -0
  63. package/data/global/modifier/constructive.ttl +6 -0
  64. package/data/global/modifier/dark.ttl +6 -0
  65. package/data/global/modifier/dense.ttl +6 -0
  66. package/data/global/modifier/destructive.ttl +6 -0
  67. package/data/global/modifier/editable.ttl +6 -0
  68. package/data/global/modifier/elevated.ttl +6 -0
  69. package/data/global/modifier/error.ttl +6 -0
  70. package/data/global/modifier/experimental.ttl +6 -0
  71. package/data/global/modifier/failed.ttl +6 -0
  72. package/data/global/modifier/focused.ttl +6 -0
  73. package/data/global/modifier/highlighted.ttl +6 -0
  74. package/data/global/modifier/in_progress.ttl +6 -0
  75. package/data/global/modifier/information.ttl +6 -0
  76. package/data/global/modifier/light.ttl +6 -0
  77. package/data/global/modifier/loading.ttl +6 -0
  78. package/data/global/modifier/muted.ttl +6 -0
  79. package/data/global/modifier/paper.ttl +6 -0
  80. package/data/global/modifier/planned.ttl +6 -0
  81. package/data/global/modifier/primary.ttl +6 -0
  82. package/data/global/modifier/secondary.ttl +6 -0
  83. package/data/global/modifier/stable.ttl +6 -0
  84. package/data/global/modifier/success.ttl +6 -0
  85. package/data/global/modifier/tertiary.ttl +6 -0
  86. package/data/global/modifier/warning.ttl +6 -0
  87. package/data/global/modifier/wireframe.ttl +6 -0
  88. package/data/global/modifier_family/_color_luminosity.ttl +7 -0
  89. package/data/global/modifier_family/_emphasis.ttl +7 -0
  90. package/data/global/modifier_family/_other.ttl +7 -0
  91. package/data/global/modifier_family/anticipation.ttl +7 -0
  92. package/data/global/modifier_family/criticality.ttl +7 -0
  93. package/data/global/modifier_family/density.ttl +7 -0
  94. package/data/global/modifier_family/importance.ttl +7 -0
  95. package/data/global/modifier_family/lifecycle.ttl +7 -0
  96. package/data/global/modifier_family/release.ttl +7 -0
  97. package/data/global/pattern/breadcrumbs.ttl +14 -0
  98. package/data/global/pattern/info_table.ttl +8 -0
  99. package/data/global/pattern/modal.ttl +8 -0
  100. package/data/global/pattern/navigation.ttl +8 -0
  101. package/data/global/pattern/select_button.ttl +8 -0
  102. package/data/global/pattern/stepper.ttl +8 -0
  103. package/data/global/pattern/table_of_contents.ttl +8 -0
  104. package/data/global/pattern/timeline.ttl +14 -0
  105. package/data/global/subcomponent/accordion-item.ttl +19 -0
  106. package/data/global/subcomponent/breadcrumbs-item.ttl +19 -0
  107. package/data/global/subcomponent/card-content.ttl +14 -0
  108. package/data/global/subcomponent/card-header.ttl +14 -0
  109. package/data/global/subcomponent/card-image.ttl +20 -0
  110. package/data/global/subcomponent/divider.ttl +8 -0
  111. package/data/global/subcomponent/modal-content.ttl +8 -0
  112. package/data/global/subcomponent/modal-footer.ttl +8 -0
  113. package/data/global/subcomponent/modal-header.ttl +8 -0
  114. package/data/global/subcomponent/spinner.ttl +8 -0
  115. package/data/global/subcomponent/table-cell.ttl +8 -0
  116. package/data/global/subcomponent/table-row.ttl +8 -0
  117. package/data/global/subcomponent/tile-content.ttl +14 -0
  118. package/data/global/subcomponent/tile-header.ttl +14 -0
  119. package/data/global/subcomponent/timeline-content.ttl +14 -0
  120. package/data/global/subcomponent/timeline-event.ttl +31 -0
  121. package/data/global/subcomponent/timeline-footer.ttl +8 -0
  122. package/data/global/subcomponent/timeline-header.ttl +8 -0
  123. package/data/global.ttl +5 -0
  124. package/data/global_form/component/checkbox_input.ttl +8 -0
  125. package/data/global_form/component/choices_input.ttl +8 -0
  126. package/data/global_form/component/combobox_input.ttl +8 -0
  127. package/data/global_form/component/custom_choices_input.ttl +8 -0
  128. package/data/global_form/component/datepicker_input.ttl +8 -0
  129. package/data/global_form/component/rating_input.ttl +8 -0
  130. package/data/global_form/component/segmented_control_input.ttl +8 -0
  131. package/data/global_form/component/slider_input.ttl +8 -0
  132. package/data/global_form/component/switch_input.ttl +8 -0
  133. package/data/global_form/component/text_input.ttl +8 -0
  134. package/data/global_form/component/textarea_input.ttl +8 -0
  135. package/data/global_form/component/wysiwginput.ttl +8 -0
  136. package/data/global_form/pattern/field.ttl +8 -0
  137. package/data/global_form/pattern/form.ttl +8 -0
  138. package/data/global_form/subcomponent/field-description.ttl +8 -0
  139. package/data/global_form/subcomponent/field-label.ttl +8 -0
  140. package/data/global_form.ttl +5 -0
  141. package/data/site/component/quote.ttl +8 -0
  142. package/data/site/component/rule.ttl +8 -0
  143. package/data/site/component/section.ttl +8 -0
  144. package/data/site/layout/site_layout.ttl +8 -0
  145. package/data/site/pattern/hero-github.ttl +8 -0
  146. package/data/site/pattern/hero.ttl +8 -0
  147. package/data/site/pattern/info_table.ttl +8 -0
  148. package/data/site/pattern/skip_link.ttl +8 -0
  149. package/data/site.ttl +5 -0
  150. package/data/stores.ttl +5 -0
  151. package/definitions/ontology.ttl +498 -0
  152. package/package.json +42 -0
  153. package/session/A.DSL.md +429 -0
  154. package/session/B.NOTES.md +84 -0
  155. package/session/global.component.accordion.yaml +13 -0
  156. package/session/global.component.button.yaml +26 -0
  157. package/session/global.component.card.yaml +24 -0
  158. package/session/global.component.icon.yaml +7 -0
  159. package/session/global.component.label.yaml +7 -0
  160. package/session/global.component.tile.yaml +21 -0
  161. package/session/global.component.timeline.yaml +20 -0
  162. package/session/global.pattern.breadcrumbs.yaml +13 -0
  163. package/session/global.subcomponent.accordion-item.yaml +37 -0
  164. package/session/global.subcomponent.breadcrumbs-item.yaml +21 -0
  165. package/session/global.subcomponent.card-content.yaml +7 -0
  166. package/session/global.subcomponent.card-header.yaml +22 -0
  167. package/session/global.subcomponent.card-image.yaml +7 -0
  168. package/session/global.subcomponent.tile-content.yaml +7 -0
  169. package/session/global.subcomponent.tile-header.yaml +8 -0
  170. package/session/global.subcomponent.timeline-content.yaml +13 -0
  171. package/session/global.subcomponent.timeline-event.yaml +20 -0
  172. package/session/global.subcomponent.timeline-footer.yaml +9 -0
  173. package/session/global.subcomponent.timeline-header.yaml +18 -0
  174. package/skills/anatomy-author/ANATOMY_DSL_SPEC.md +423 -0
  175. package/skills/anatomy-author/SKILL.md +911 -0
  176. package/skills/component-specifier/SKILL.md +413 -0
  177. package/skills/design-auditor/SKILL.md +428 -0
  178. package/source.json +101 -0
  179. package/src/cli.ts +45 -0
  180. package/src/collect/generateTurtle.tests.ts +200 -0
  181. package/src/collect/generateTurtle.ts +187 -0
  182. package/src/collect/index.ts +4 -0
  183. package/src/collect/scanAnnotations.tests.ts +138 -0
  184. package/src/collect/scanAnnotations.ts +78 -0
  185. package/src/collect/types.ts +57 -0
  186. package/src/collect/validateCollectConfig.tests.ts +116 -0
  187. package/src/collect/validateCollectConfig.ts +74 -0
  188. package/src/collect-implementations.ts +99 -0
  189. package/src/commands/extract.tests.ts +41 -0
  190. package/src/commands/extract.ts +48 -0
  191. package/src/commands/index.ts +3 -0
  192. package/src/commands/list.tests.ts +26 -0
  193. package/src/commands/list.ts +26 -0
  194. package/src/commands/transform.tests.ts +28 -0
  195. package/src/commands/transform.ts +133 -0
  196. package/src/config/index.ts +2 -0
  197. package/src/config/source.schema.json +110 -0
  198. package/src/config/types.ts +97 -0
  199. package/src/config/validateConfig.tests.ts +46 -0
  200. package/src/config/validateConfig.ts +21 -0
  201. package/src/constants.ts +20 -0
  202. package/src/graph/GraphStore.tests.ts +157 -0
  203. package/src/graph/GraphStore.ts +200 -0
  204. package/src/graph/PrefixMap.tests.ts +129 -0
  205. package/src/graph/PrefixMap.ts +95 -0
  206. package/src/graph/buildUri.tests.ts +158 -0
  207. package/src/graph/buildUri.ts +69 -0
  208. package/src/graph/index.ts +4 -0
  209. package/src/graph/types.ts +20 -0
  210. package/src/providers/CodaProvider.tests.ts +241 -0
  211. package/src/providers/CodaProvider.ts +174 -0
  212. package/src/providers/CodaProvider.types.generated.ts +12236 -0
  213. package/src/providers/index.ts +18 -0
  214. package/src/serializers/JSONSerializer.tests.ts +79 -0
  215. package/src/serializers/JSONSerializer.ts +87 -0
  216. package/src/serializers/TTLSerializer.tests.ts +75 -0
  217. package/src/serializers/TTLSerializer.ts +99 -0
  218. package/src/serializers/index.ts +3 -0
  219. package/src/serializers/types.ts +16 -0
  220. package/src/transform/resolveReferences.tests.ts +63 -0
  221. package/src/transform/resolveReferences.ts +36 -0
  222. package/src/transform/resolveValue.tests.ts +76 -0
  223. package/src/transform/resolveValue.ts +87 -0
  224. package/src/transform/transform.tests.ts +99 -0
  225. package/src/transform/transform.ts +109 -0
  226. package/src/transform/transformRow.tests.ts +269 -0
  227. package/src/transform/transformRow.ts +220 -0
  228. package/src/transform/types.ts +26 -0
  229. package/tsconfig.json +8 -0
  230. package/vite.config.ts +11 -0
  231. package/vitest.config.ts +21 -0
@@ -0,0 +1,413 @@
1
+ # Component Specifier
2
+
3
+ Specify new UI components with full ontological structure, ensuring consistency with existing design system patterns. This skill combines semantic discovery (understanding what exists) with procedural authoring (creating well-formed specifications).
4
+
5
+ ## When to Use
6
+
7
+ - Specifying a new component for the design system
8
+ - Adding a pattern or layout to an existing tier
9
+ - Ensuring a new component follows design system conventions
10
+ - Understanding which modifier families apply to a component type
11
+
12
+ ## Discovery Flow
13
+
14
+ Before creating a component, understand the context:
15
+
16
+ 1. **Identify the tier**: Call `sem_lookup(type: "dso:Tier")` to see available tiers
17
+ 2. **Check existing components**: Call `sem_lookup(type: "dso:Component", filters: {"dso:tier": "{tier-uri}"})` to see siblings
18
+ 3. **Understand modifier families**: Call `sem_lookup(type: "dso:ModifierFamily")` to see available variant axes
19
+ 4. **Check for similar components**: Call `sem_sparql` to search by name patterns
20
+
21
+ ```
22
+ sem_lookup(type: "dso:Tier")
23
+ → Choose tier based on scope (global, apps, site, etc.)
24
+
25
+ sem_lookup(type: "dso:Component", filters: {"dso:tier": "ds:global"})
26
+ → See existing components in that tier
27
+
28
+ sem_lookup(type: "dso:ModifierFamily")
29
+ → Identify which modifier families apply
30
+ ```
31
+
32
+ ## Tier Selection Guide
33
+
34
+ | Tier | When to Use | Examples |
35
+ |------|-------------|----------|
36
+ | `ds:global` | Universal, used everywhere | Button, Card, Badge |
37
+ | `ds:global_form` | Form inputs and controls | Input, Select, Checkbox |
38
+ | `ds:apps` | Application-specific UI | Navigation, Toolbar, FileTree |
39
+ | `ds:apps_wpe` | WordPress/WPE specific | WPE variants |
40
+ | `ds:site` | Marketing/website | Hero, Footer, CTA |
41
+ | `ds:stores` | E-commerce | ProductCard, Cart |
42
+ | `ds:documentation` | Documentation sites | CodeBlock, APIRef |
43
+
44
+ **Decision tree:**
45
+ ```
46
+ Is it used in forms specifically?
47
+ → Yes: global_form
48
+ → No: Continue
49
+
50
+ Is it universal across all contexts?
51
+ → Yes: global
52
+ → No: Continue
53
+
54
+ Is it for applications (dashboards, tools)?
55
+ → Yes: apps (or apps_wpe for WordPress)
56
+ → No: Continue
57
+
58
+ Is it for marketing/website pages?
59
+ → Yes: site
60
+ → No: Continue
61
+
62
+ Is it for e-commerce?
63
+ → Yes: stores
64
+ → No: documentation or create new tier
65
+ ```
66
+
67
+ ## Modifier Family Selection
68
+
69
+ Query existing modifier families and their usage:
70
+
71
+ ```sparql
72
+ PREFIX dso: <https://ds.canonical.com/ontology#>
73
+ PREFIX ds: <https://ds.canonical.com/data/>
74
+
75
+ SELECT ?family ?familyName (COUNT(?component) as ?usage) WHERE {
76
+ ?family a dso:ModifierFamily ;
77
+ dso:name ?familyName .
78
+ OPTIONAL {
79
+ ?component dso:hasModifierFamily ?family .
80
+ }
81
+ } GROUP BY ?family ?familyName
82
+ ORDER BY DESC(?usage)
83
+ ```
84
+
85
+ ### Common Modifier Families
86
+
87
+ | Family | Apply When | Example Usage |
88
+ |--------|------------|---------------|
89
+ | `importance` | Component has visual hierarchy variants | Button (primary/secondary) |
90
+ | `criticality` | Component conveys severity/status | Badge (success/warning/error) |
91
+ | `density` | Component has spacing variants | Table (compact/default/comfortable) |
92
+ | `anticipation` | Component indicates expected action type | Button (constructive/destructive) |
93
+ | `lifecycle` | Component shows state progression | Status indicators |
94
+
95
+ ## Component Specification Workflow
96
+
97
+ ### 1. Gather Requirements
98
+
99
+ Ask the user:
100
+ - **Name**: What is the component called?
101
+ - **Purpose**: What problem does it solve?
102
+ - **Tier**: Where will it be used? (use tier selection guide)
103
+ - **Variants**: What variations are needed? (map to modifier families)
104
+ - **Composition**: Does it contain subcomponents?
105
+ - **Usage**: When should it be used? When not?
106
+
107
+ ### 2. Check for Conflicts
108
+
109
+ Before creating, verify uniqueness:
110
+
111
+ ```sparql
112
+ PREFIX dso: <https://ds.canonical.com/ontology#>
113
+
114
+ SELECT ?existing ?name ?tier WHERE {
115
+ ?existing a dso:Component ;
116
+ dso:name ?name ;
117
+ dso:tier ?tier .
118
+ FILTER(CONTAINS(LCASE(?name), "{search-term}"))
119
+ }
120
+ ```
121
+
122
+ ### 3. Generate Specification
123
+
124
+ Use the templates below based on gathered information.
125
+
126
+ ## Templates
127
+
128
+ ### Component Template (Turtle)
129
+
130
+ ```turtle
131
+ @prefix dso: <https://ds.canonical.com/ontology#> .
132
+ @prefix ds: <https://ds.canonical.com/data/> .
133
+
134
+ ds:{tier}.component.{snake_case_name} a dso:Component ;
135
+ dso:name "{DisplayName}" ;
136
+ dso:description """{
137
+ One-paragraph description of what the component is and does.
138
+ Focus on the problem it solves, not implementation details.
139
+ }""" ;
140
+ dso:tier ds:{tier} ;
141
+
142
+ # Modifier families (remove if not applicable)
143
+ dso:hasModifierFamily ds:global.modifier_family.{family1} ;
144
+ dso:hasModifierFamily ds:global.modifier_family.{family2} ;
145
+
146
+ # Usage guidance
147
+ dso:whenToUse """{
148
+ - Scenario 1 when this component is appropriate
149
+ - Scenario 2
150
+ - Scenario 3
151
+ }""" ;
152
+ dso:whenNotToUse """{
153
+ - Anti-pattern 1: use {alternative} instead
154
+ - Anti-pattern 2
155
+ }""" ;
156
+
157
+ # Design links (add when available)
158
+ # dso:figmaLink <https://figma.com/file/...> ;
159
+ # dso:wireframeLink <https://...> ;
160
+ # dso:anatomy <https://...> ;
161
+
162
+ # Guidelines
163
+ dso:guidelines """{
164
+ ## Anatomy
165
+ - Part 1: description
166
+ - Part 2: description
167
+
168
+ ## Behavior
169
+ - Interaction 1
170
+ - Interaction 2
171
+
172
+ ## Accessibility
173
+ - ARIA considerations
174
+ - Keyboard navigation
175
+ }""" .
176
+ ```
177
+
178
+ ### Component Template (JSON-LD)
179
+
180
+ ```json
181
+ {
182
+ "@context": {
183
+ "dso": "https://ds.canonical.com/ontology#",
184
+ "ds": "https://ds.canonical.com/data/"
185
+ },
186
+ "@id": "ds:{tier}.component.{snake_case_name}",
187
+ "@type": "dso:Component",
188
+ "dso:name": "{DisplayName}",
189
+ "dso:description": "{description}",
190
+ "dso:tier": { "@id": "ds:{tier}" },
191
+ "dso:hasModifierFamily": [
192
+ { "@id": "ds:global.modifier_family.{family1}" }
193
+ ],
194
+ "dso:whenToUse": "{usage guidance}",
195
+ "dso:whenNotToUse": "{anti-patterns}",
196
+ "dso:guidelines": "{guidelines}"
197
+ }
198
+ ```
199
+
200
+ ### Subcomponent Template
201
+
202
+ ```turtle
203
+ ds:{tier}.subcomponent.{parent}_{part} a dso:Subcomponent ;
204
+ dso:name "{PartName}" ;
205
+ dso:description "{What this part does}" ;
206
+ dso:tier ds:{tier} ;
207
+ dso:parentComponent ds:{tier}.component.{parent} ;
208
+ dso:standalone false . # true if can be used independently
209
+ ```
210
+
211
+ ### Pattern Template
212
+
213
+ ```turtle
214
+ ds:{tier}.pattern.{snake_case_name} a dso:Pattern ;
215
+ dso:name "{PatternName}" ;
216
+ dso:description """{
217
+ Description of the UX problem this pattern solves.
218
+ }""" ;
219
+ dso:tier ds:{tier} ;
220
+ dso:whenToUse """{
221
+ - User scenario 1
222
+ - User scenario 2
223
+ }""" ;
224
+ dso:guidelines """{
225
+ ## Structure
226
+ - Required elements
227
+ - Optional elements
228
+
229
+ ## Variations
230
+ - Variation 1: when to use
231
+ - Variation 2: when to use
232
+ }""" .
233
+ ```
234
+
235
+ ### Layout Template
236
+
237
+ ```turtle
238
+ ds:{tier}.layout.{snake_case_name} a dso:Layout ;
239
+ dso:name "{LayoutName}" ;
240
+ dso:description "{Purpose of this layout}" ;
241
+ dso:tier ds:{tier} ;
242
+ dso:domain "{information domain}" ;
243
+ dso:grid "{css grid definition}" ;
244
+ dso:gridAreas "{named areas}" ;
245
+ dso:targetDevices "{desktop, tablet, mobile}" .
246
+ ```
247
+
248
+ ## File Placement
249
+
250
+ ```
251
+ data/
252
+ └── {tier}/
253
+ └── component/
254
+ ├── {name}.ttl # Turtle format
255
+ └── {name}.jsonld # JSON-LD format (optional)
256
+ ```
257
+
258
+ **Naming conventions:**
259
+ - Directory: `{tier}/component/`
260
+ - File: `{snake_case_name}.ttl`
261
+ - URI: `ds:{tier}.component.{snake_case_name}`
262
+
263
+ ## Validation
264
+
265
+ After creating, validate the component:
266
+
267
+ ```
268
+ sem_validate(data: {component-json-ld})
269
+ ```
270
+
271
+ Check for:
272
+ - Required properties: name, description, tier
273
+ - Valid tier reference
274
+ - Modifier families exist
275
+ - No naming conflicts
276
+
277
+ ## Complete Example
278
+
279
+ ### User Request
280
+ "I need a Breadcrumb component for navigation hierarchy in apps"
281
+
282
+ ### Discovery Phase
283
+
284
+ ```
285
+ sem_lookup(type: "dso:Tier")
286
+ → apps tier is appropriate for application navigation
287
+
288
+ sem_lookup(type: "dso:Component", filters: {"dso:tier": "ds:apps"})
289
+ → See existing: Navigation, Toolbar, StatusBar
290
+ → Breadcrumb would complement Navigation
291
+
292
+ sem_lookup(type: "dso:ModifierFamily")
293
+ → density might apply (compact breadcrumbs)
294
+ ```
295
+
296
+ ### Generated Specification
297
+
298
+ **File:** `data/apps/component/breadcrumb.ttl`
299
+
300
+ ```turtle
301
+ @prefix dso: <https://ds.canonical.com/ontology#> .
302
+ @prefix ds: <https://ds.canonical.com/data/> .
303
+
304
+ ds:apps.component.breadcrumb a dso:Component ;
305
+ dso:name "Breadcrumb" ;
306
+ dso:description """Breadcrumbs display the user's current location within a hierarchical navigation structure, enabling quick traversal back to parent pages.""" ;
307
+ dso:tier ds:apps ;
308
+
309
+ dso:hasModifierFamily ds:global.modifier_family.density ;
310
+
311
+ dso:whenToUse """
312
+ - When users need to understand their location in a hierarchy
313
+ - When quick navigation to parent levels is valuable
314
+ - In applications with deep navigation structures (3+ levels)
315
+ """ ;
316
+ dso:whenNotToUse """
317
+ - For flat navigation structures (use tabs instead)
318
+ - As the primary navigation method (supplement, don't replace)
319
+ - When hierarchy is only 1-2 levels deep
320
+ """ ;
321
+
322
+ dso:guidelines """
323
+ ## Anatomy
324
+ - Container: horizontal list of links
325
+ - Separator: visual divider between items (typically "/" or ">")
326
+ - Current page: final item, not clickable
327
+ - Overflow: ellipsis for long paths
328
+
329
+ ## Behavior
330
+ - All items except current are clickable links
331
+ - Current page is visually distinct (bold or different color)
332
+ - Truncate middle items if path exceeds available width
333
+
334
+ ## Accessibility
335
+ - Use nav element with aria-label="Breadcrumb"
336
+ - Current page marked with aria-current="page"
337
+ - Separator is decorative (aria-hidden)
338
+ """ .
339
+
340
+ ds:apps.subcomponent.breadcrumb_item a dso:Subcomponent ;
341
+ dso:name "BreadcrumbItem" ;
342
+ dso:description "Individual item in the breadcrumb trail" ;
343
+ dso:tier ds:apps ;
344
+ dso:parentComponent ds:apps.component.breadcrumb ;
345
+ dso:standalone false .
346
+
347
+ ds:apps.subcomponent.breadcrumb_separator a dso:Subcomponent ;
348
+ dso:name "BreadcrumbSeparator" ;
349
+ dso:description "Visual separator between breadcrumb items" ;
350
+ dso:tier ds:apps ;
351
+ dso:parentComponent ds:apps.component.breadcrumb ;
352
+ dso:standalone false .
353
+ ```
354
+
355
+ ## Response Format
356
+
357
+ When specifying a component, respond with:
358
+
359
+ ```
360
+ ## Component Specified: {Name}
361
+
362
+ **Tier:** {tier} ({rationale})
363
+ **Modifier Families:** {list with rationale}
364
+ **File:** `data/{tier}/component/{name}.ttl`
365
+
366
+ ### Specification
367
+
368
+ {turtle content}
369
+
370
+ ### Validation
371
+ - [x] Required properties present
372
+ - [x] Tier exists
373
+ - [x] No naming conflicts
374
+ - [x] Modifier families valid
375
+
376
+ ### Next Steps
377
+ 1. Add to version control
378
+ 2. Link Figma designs when available
379
+ 3. **Author anatomy specification** using the `anatomy-author` skill to document component structure
380
+ 4. Create implementation in target libraries
381
+ ```
382
+
383
+ ## Tips
384
+
385
+ 1. **Start with discovery**: Always check existing components first
386
+ 2. **Be specific with whenToUse/whenNotToUse**: These are the most valuable fields
387
+ 3. **Include accessibility in guidelines**: It's easy to forget but critical
388
+ 4. **Create subcomponents for complex components**: Aids composition and documentation
389
+ 5. **Use existing modifier families**: Don't create new ones unless absolutely necessary
390
+ 6. **Validate before committing**: Use sem_validate to catch issues early
391
+
392
+ ## Related Skills
393
+
394
+ ### Anatomy Author (Next Step)
395
+
396
+ After specifying a component, use the **anatomy-author** skill to create a detailed structural specification. While this skill defines the component's metadata (tier, modifiers, usage guidance), the anatomy specification defines:
397
+
398
+ - **Node tree**: The hierarchical structure of DOM elements
399
+ - **Named vs anonymous nodes**: Which parts have design system identity
400
+ - **Cardinality**: Required vs optional parts, repeating elements
401
+ - **Styles**: Platform-agnostic style properties using CTI-inspired keys
402
+ - **Slots**: Content projection points (header, footer, default, etc.)
403
+
404
+ **Workflow integration:**
405
+ ```
406
+ component-specifier → anatomy-author → implementation
407
+ (what) (how) (code)
408
+ ```
409
+
410
+ The anatomy bridges specification and implementation by providing an unambiguous structural contract that can be:
411
+ - Discussed with designers ("these should be siblings, not nested")
412
+ - Used to audit existing implementations
413
+ - Referenced during code generation