@canonical/design-system 0.1.2 → 0.2.1
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.
- package/.github/PULL_REQUEST_TEMPLATE.md +15 -6
- package/.github/workflows/ci.yml +14 -4
- package/.github/workflows/sync-coda-manual.yml +13 -0
- package/.github/workflows/sync-coda-scheduled.yml +9 -0
- package/.github/workflows/sync-coda.yml +65 -1
- package/README.md +132 -79
- package/bun.lock +51 -12
- package/data/apps/component/file_tree.ttl +6 -1
- package/data/apps/component/key_value_pair.ttl +5 -1
- package/data/apps/component/navigation.ttl +5 -1
- package/data/apps/component/notification.ttl +5 -1
- package/data/apps/component/side_navigation.ttl +11 -0
- package/data/apps/component/skeleton_loading.ttl +5 -1
- package/data/apps/component/status_bar.ttl +5 -1
- package/data/apps/component/toolbar.ttl +5 -1
- package/data/apps/group/key_value_pairs.ttl +11 -0
- package/data/apps/group/notifications.ttl +5 -1
- package/data/apps/layout/application_layout.ttl +4 -0
- package/data/apps/layout/content_layout.ttl +11 -1
- package/data/apps/layout/empty_layout.ttl +5 -1
- package/data/apps/layout/list_page_layout.ttl +5 -1
- package/data/apps/layout/settings_page_layout.ttl +5 -1
- package/data/apps/layout/view_layout.ttl +4 -0
- package/data/apps/pattern/action_bar.ttl +11 -0
- package/data/apps/pattern/code_diff.ttl +5 -1
- package/data/apps/pattern/data_table.ttl +205 -2
- package/data/apps/pattern/destructive_modal.ttl +5 -1
- package/data/apps/pattern/drawer.ttl +12 -0
- package/data/apps/pattern/keyboard_shortcuts.ttl +5 -1
- package/data/apps/pattern/notification_center.ttl +19 -1
- package/data/apps/pattern/side_panel.ttl +6 -1
- package/data/apps/pattern/sidepanel_stacked.ttl +5 -1
- package/data/apps/subcomponent/data_table-action_bar.ttl +27 -0
- package/data/apps/subcomponent/data_table-body_cell.ttl +106 -0
- package/data/apps/subcomponent/data_table-group_header_row.ttl +58 -0
- package/data/apps/subcomponent/data_table-header_cell.ttl +73 -0
- package/data/apps/subcomponent/data_table-pagination_bar.ttl +44 -0
- package/data/apps/subcomponent/data_table-persistent_selection.ttl +50 -0
- package/data/apps/subcomponent/data_table-settings_menu.ttl +63 -0
- package/data/apps/subcomponent/drawer-content.ttl +12 -0
- package/data/apps/subcomponent/drawer-footer.ttl +12 -0
- package/data/apps/subcomponent/drawer-header.ttl +12 -0
- package/data/apps/subcomponent/file_tree-node.ttl +5 -1
- package/data/apps/subcomponent/log.ttl +11 -0
- package/data/apps/subcomponent/side_panel-content.ttl +12 -0
- package/data/apps/subcomponent/side_panel-footer.ttl +12 -0
- package/data/apps/subcomponent/side_panel-header.ttl +12 -0
- package/data/apps_anbox/component/theme_switcher.ttl +10 -0
- package/data/apps_anbox/pattern/side_menu.ttl +11 -1
- package/data/apps_debcrafters/component/example.ttl +10 -0
- package/data/apps_debcrafters/component/my_fancy_component.ttl +11 -0
- package/data/apps_debcrafters.ttl +4 -0
- package/data/apps_juju/pattern/single_select_multi_layered.ttl +4 -1
- package/data/apps_landscape/component/password_constraints.ttl +4 -1
- package/data/apps_landscape/component/truncated_cell.ttl +38 -0
- package/data/apps_launchpad/component/avatar.ttl +31 -0
- package/data/apps_launchpad/component/badge.ttl +11 -9
- package/data/apps_launchpad/component/breadcrumbs.ttl +5 -2
- package/data/apps_launchpad/component/button.ttl +11 -9
- package/data/apps_launchpad/component/checkbox_input.ttl +31 -0
- package/data/apps_launchpad/component/chip.ttl +11 -8
- package/data/apps_launchpad/component/combobox.ttl +16 -11
- package/data/apps_launchpad/component/description_list.ttl +8 -3
- package/data/apps_launchpad/component/drawer.ttl +38 -0
- package/data/apps_launchpad/component/log.ttl +58 -0
- package/data/apps_launchpad/component/modal.ttl +44 -0
- package/data/apps_launchpad/component/radio_input.ttl +37 -0
- package/data/apps_launchpad/component/select_input.ttl +38 -0
- package/data/apps_launchpad/component/switch.ttl +8 -4
- package/data/apps_launchpad/component/text_input.ttl +13 -9
- package/data/apps_launchpad/component/textarea_input.ttl +39 -0
- package/data/apps_launchpad/component/tooltip.ttl +12 -8
- package/data/apps_launchpad/subcomponent/combobox-checkbox_option.ttl +11 -9
- package/data/apps_launchpad/subcomponent/combobox-footer.ttl +8 -3
- package/data/apps_launchpad/subcomponent/combobox-group.ttl +10 -6
- package/data/apps_launchpad/subcomponent/combobox-helper.ttl +11 -6
- package/data/apps_launchpad/subcomponent/combobox-loading.ttl +9 -3
- package/data/apps_launchpad/subcomponent/combobox-no_results.ttl +8 -3
- package/data/apps_launchpad/subcomponent/combobox-radio_option.ttl +12 -10
- package/data/apps_launchpad/subcomponent/combobox-search.ttl +10 -6
- package/data/apps_launchpad/subcomponent/description_list-item.ttl +8 -3
- package/data/apps_launchpad/subcomponent/log-line.ttl +38 -0
- package/data/apps_launchpad/subcomponent/modal-content-body.ttl +18 -0
- package/data/apps_launchpad/subcomponent/modal-content-footer.ttl +18 -0
- package/data/apps_launchpad/subcomponent/modal-content-header-close_button.ttl +11 -0
- package/data/apps_launchpad/subcomponent/modal-content-header.ttl +19 -0
- package/data/apps_launchpad/subcomponent/modal-content.ttl +20 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-body.ttl +11 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-footer.ttl +11 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-header-close_button.ttl +11 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-header.ttl +12 -0
- package/data/apps_launchpad/subcomponent/side_panel-content.ttl +12 -0
- package/data/apps_lxd/component/back_link.ttl +29 -0
- package/data/apps_lxd/component/code_snippet_with_copy_button.ttl +54 -0
- package/data/apps_lxd/component/confirmation_checkbox.ttl +19 -3
- package/data/apps_lxd/component/doc_link.ttl +45 -0
- package/data/apps_lxd/component/meter.ttl +37 -0
- package/data/apps_lxd/component/output_field.ttl +48 -0
- package/data/apps_lxd/component/rename_header.ttl +74 -0
- package/data/apps_lxd/component/tab_links.ttl +35 -0
- package/data/apps_lxd/subcomponent/copy_to_clipboard.ttl +39 -0
- package/data/apps_lxd/view/network_topology.ttl +16 -2
- package/data/apps_notary.ttl +4 -0
- package/data/apps_portal/component/badge.ttl +3 -0
- package/data/apps_portal/component/credit_card_input.ttl +10 -0
- package/data/apps_portal/component/key_value_pair.ttl +10 -0
- package/data/apps_portal/pattern/purchase_summary.ttl +10 -0
- package/data/apps_portal/subcomponent/read_only_modal.ttl +10 -0
- package/data/apps_workplaceengineering/component/label-highlight.ttl +18 -0
- package/data/apps_workplaceengineering/component/rule.ttl +11 -0
- package/data/apps_workplaceengineering/component/skip_link.ttl +10 -0
- package/data/apps_workplaceengineering/component/theme_switcher.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/callout_numbers_card.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/event_timeline.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/group_card.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/travel_provider_card.ttl +12 -0
- package/data/apps_workplaceengineering.ttl +4 -0
- package/data/documentation/layout/documentation_layout.ttl +5 -1
- package/data/documentation/pattern/library_side_navigation.ttl +6 -2
- package/data/global/component/accordion.ttl +61 -2
- package/data/global/component/announcement.ttl +12 -2
- package/data/global/component/avatar.ttl +11 -0
- package/data/global/component/badge.ttl +42 -1
- package/data/global/component/breadcrumbs.ttl +18 -2
- package/data/global/component/button.ttl +36 -8
- package/data/global/component/button_link.ttl +5 -1
- package/data/global/component/card.ttl +33 -2
- package/data/global/component/checkbox_field.ttl +11 -0
- package/data/global/component/chip.ttl +74 -2
- package/data/global/component/choices_field.ttl +11 -0
- package/data/global/component/code_snippet-content.ttl +6 -2
- package/data/global/component/code_snippet-header.ttl +6 -2
- package/data/global/component/code_snippet.ttl +13 -2
- package/data/global/component/color_field.ttl +11 -0
- package/data/global/component/combobox_field.ttl +11 -0
- package/data/global/component/contextual_menu.ttl +22 -2
- package/data/global/component/data_tooltip.ttl +84 -0
- package/data/global/component/date_field.ttl +11 -0
- package/data/global/component/date_time_field.ttl +11 -0
- package/data/global/component/dropdown_button.ttl +18 -0
- package/data/global/component/file_upload_field.ttl +11 -0
- package/data/global/component/heading.ttl +5 -1
- package/data/global/component/hidden_field.ttl +11 -0
- package/data/global/component/icon.ttl +6 -2
- package/data/global/component/icon_in_container.ttl +5 -1
- package/data/global/component/inline_code.ttl +11 -0
- package/data/global/component/keyboard_key.ttl +7 -3
- package/data/global/component/markdown_field.ttl +11 -0
- package/data/global/component/mode_switcher.ttl +11 -0
- package/data/global/component/month_field.ttl +11 -0
- package/data/global/component/notification_inline.ttl +5 -1
- package/data/global/component/notification_toast.ttl +5 -1
- package/data/global/component/number_field.ttl +11 -0
- package/data/global/component/pagination.ttl +6 -2
- package/data/global/component/password_field.ttl +11 -0
- package/data/global/component/phone_field.ttl +11 -0
- package/data/global/component/popover.ttl +5 -1
- package/data/global/component/range_field.ttl +11 -0
- package/data/global/component/rating_field.ttl +11 -0
- package/data/global/component/relative_timestamp.ttl +10 -0
- package/data/global/component/rich_choices_field.ttl +11 -0
- package/data/global/component/rich_text_field.ttl +11 -0
- package/data/global/component/search_field.ttl +11 -0
- package/data/global/component/segmented_control_field.ttl +11 -0
- package/data/global/component/select_field.ttl +11 -0
- package/data/global/component/switch_field.ttl +11 -0
- package/data/global/component/table.ttl +7 -2
- package/data/global/component/tabs.ttl +7 -3
- package/data/global/component/tag.ttl +18 -0
- package/data/global/component/text_field.ttl +11 -0
- package/data/global/component/textarea_field.ttl +11 -0
- package/data/global/component/tile.ttl +24 -3
- package/data/global/component/time_field.ttl +11 -0
- package/data/global/component/timestamp.ttl +10 -0
- package/data/global/component/tooltip.ttl +75 -56
- package/data/global/component/tooltip_wrapper.ttl +81 -0
- package/data/global/group/buttons.ttl +12 -1
- package/data/global/group/cards.ttl +9 -1
- package/data/global/group/code_snippets.ttl +5 -1
- package/data/global/group/keyboard_keys.ttl +7 -3
- package/data/global/group/tiles.ttl +5 -1
- package/data/global/layout/error_layout.ttl +5 -1
- package/data/global/layout/form_layout.ttl +5 -1
- package/data/global/layout/identity_page_form.ttl +5 -1
- package/data/global/modifier/dark.ttl +1 -1
- package/data/global/modifier/information.ttl +1 -1
- package/data/global/modifier/light.ttl +1 -1
- package/data/global/modifier/modal.ttl +6 -0
- package/data/global/modifier/surface1.ttl +6 -0
- package/data/global/modifier/surface2.ttl +6 -0
- package/data/global/modifier/surface3.ttl +6 -0
- package/data/global/modifier_family/_emphasis.ttl +2 -1
- package/data/global/modifier_family/_other.ttl +2 -1
- package/data/global/modifier_family/anticipation.ttl +2 -1
- package/data/global/modifier_family/criticality.ttl +2 -1
- package/data/global/modifier_family/density.ttl +2 -1
- package/data/global/modifier_family/importance.ttl +2 -1
- package/data/global/modifier_family/lifecycle.ttl +2 -1
- package/data/global/modifier_family/mode.ttl +7 -0
- package/data/global/modifier_family/release.ttl +2 -1
- package/data/global/modifier_family/surface.ttl +7 -0
- package/data/global/pattern/description_list.ttl +11 -0
- package/data/global/pattern/field.ttl +11 -0
- package/data/global/pattern/form.ttl +10 -0
- package/data/global/pattern/form_login.ttl +10 -0
- package/data/global/pattern/info_table.ttl +5 -1
- package/data/global/pattern/modal.ttl +7 -2
- package/data/global/pattern/navigation.ttl +5 -1
- package/data/global/pattern/stepper.ttl +5 -1
- package/data/global/pattern/table_of_contents.ttl +5 -1
- package/data/global/pattern/timeline.ttl +33 -2
- package/data/global/subcomponent/accordion-item.ttl +10 -5
- package/data/global/subcomponent/breadcrumbs-item.ttl +7 -3
- package/data/global/subcomponent/card-content.ttl +8 -3
- package/data/global/subcomponent/card-footer.ttl +12 -0
- package/data/global/subcomponent/card-header.ttl +8 -3
- package/data/global/subcomponent/card-image.ttl +8 -3
- package/data/global/subcomponent/card-thumbnail.ttl +6 -1
- package/data/global/subcomponent/chart_legend.ttl +11 -0
- package/data/global/subcomponent/chart_legend_item.ttl +11 -0
- package/data/global/subcomponent/checkbox_input.ttl +11 -0
- package/data/global/subcomponent/color_input.ttl +11 -0
- package/data/global/subcomponent/combobox_input.ttl +11 -0
- package/data/global/subcomponent/date_input.ttl +11 -0
- package/data/global/subcomponent/date_time_input.ttl +11 -0
- package/data/global/subcomponent/field-description.ttl +11 -0
- package/data/global/subcomponent/field-label.ttl +11 -0
- package/data/global/subcomponent/file_upload_input.ttl +11 -0
- package/data/global/subcomponent/hidden_input.ttl +11 -0
- package/data/global/subcomponent/kvp_container.ttl +11 -0
- package/data/global/subcomponent/kvpitem_base.ttl +11 -0
- package/data/global/subcomponent/markdown_input.ttl +11 -0
- package/data/global/subcomponent/modal-content.ttl +5 -1
- package/data/global/subcomponent/modal-footer.ttl +5 -1
- package/data/global/subcomponent/modal-header.ttl +5 -1
- package/data/global/subcomponent/month_input.ttl +11 -0
- package/data/global/subcomponent/number_input.ttl +11 -0
- package/data/global/subcomponent/password_input.ttl +11 -0
- package/data/global/subcomponent/phone_input.ttl +11 -0
- package/data/global/subcomponent/radio_input.ttl +11 -0
- package/data/global/subcomponent/range_input.ttl +11 -0
- package/data/global/subcomponent/rating_input.ttl +11 -0
- package/data/global/subcomponent/rich_text_input.ttl +11 -0
- package/data/global/subcomponent/search_input.ttl +26 -0
- package/data/global/subcomponent/segmented_control_input.ttl +11 -0
- package/data/global/subcomponent/select_input.ttl +11 -0
- package/data/global/subcomponent/spin_button.ttl +11 -0
- package/data/global/subcomponent/spinner.ttl +7 -3
- package/data/global/subcomponent/switch_input.ttl +11 -0
- package/data/global/subcomponent/table-cell.ttl +5 -1
- package/data/global/subcomponent/table-row.ttl +5 -1
- package/data/global/subcomponent/text_input.ttl +11 -0
- package/data/global/subcomponent/textarea_input.ttl +33 -0
- package/data/global/subcomponent/tile-content.ttl +7 -3
- package/data/global/subcomponent/tile-header.ttl +13 -4
- package/data/global/subcomponent/time_input.ttl +11 -0
- package/data/global/subcomponent/timeline-content.ttl +7 -2
- package/data/global/subcomponent/timeline-event.ttl +8 -3
- package/data/global/subcomponent/timeline-expansion_indicator.ttl +6 -1
- package/data/global/subcomponent/timeline-header.ttl +6 -1
- package/data/global/variant/tooltip_dense.ttl +14 -0
- package/data/global/view/settings_view.ttl +5 -1
- package/data/sites/component/blog_card.ttl +11 -0
- package/data/sites/component/quote.ttl +11 -0
- package/data/sites/component/rule.ttl +11 -0
- package/data/sites/component/section.ttl +11 -0
- package/data/sites/group/blog_cards.ttl +11 -0
- package/data/sites/group/xblog_elements.ttl +10 -0
- package/data/sites/layout/blog_page_layout.ttl +11 -0
- package/data/{site → sites}/layout/case_study_layout.ttl +6 -2
- package/data/sites/layout/site_layout.ttl +11 -0
- package/data/sites/pattern/hero-github.ttl +11 -0
- package/data/sites/pattern/hero.ttl +11 -0
- package/data/sites/pattern/info_table.ttl +11 -0
- package/data/sites/pattern/pricing_section.ttl +11 -0
- package/data/sites/pattern/pricing_table.ttl +11 -0
- package/data/sites/pattern/read_more_section.ttl +11 -0
- package/data/sites/pattern/skip_link.ttl +11 -0
- package/data/{site.ttl → sites.ttl} +2 -2
- package/data/sites_webcomponentsprototype/component/blog_cards.ttl +4 -1
- package/data/sites_webcomponentsprototype/component/ctablock.ttl +4 -1
- package/data/sites_webcomponentsprototype/component/list.ttl +5 -2
- package/data/sites_webcomponentsprototype/component/tabs.ttl +5 -2
- package/data/sites_webcomponentsprototype/layout/site_layout.ttl +3 -0
- package/data/sites_webcomponentsprototype/pattern/basic_section.ttl +4 -1
- package/data/sites_webcomponentsprototype/pattern/blog_section.ttl +4 -1
- package/data/sites_webcomponentsprototype/pattern/ctasection.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/equal_heights.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/hero.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/logo_section.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/quote_wrapper.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/tiered_list.ttl +5 -2
- package/data/tag/allgood.ttl +7 -0
- package/data/tag/beta.ttl +7 -0
- package/data/tag/candidate.ttl +7 -0
- package/data/tag/devbatch1.ttl +7 -0
- package/data/tag/devbatch2.ttl +7 -0
- package/data/tag/devexternal.ttl +7 -0
- package/data/tag/devreactapproved.ttl +7 -0
- package/data/tag/devreactbase.ttl +7 -0
- package/data/tag/devreactpreapproved.ttl +7 -0
- package/data/tag/devspecial.ttl +7 -0
- package/data/tag/devsveltedone.ttl +7 -0
- package/data/tag/devsveltein-progress.ttl +7 -0
- package/data/tag/divergent.ttl +7 -0
- package/data/tag/docscomplete.ttl +7 -0
- package/data/tag/draft.ttl +7 -0
- package/data/tag/edge.ttl +7 -0
- package/data/tag/global-docs-missing.ttl +7 -0
- package/data/tag/has-no-global-entry.ttl +7 -0
- package/data/tag/lpto-be-upstreamed.ttl +7 -0
- package/data/tag/lptriageblocked-reqs-design.ttl +7 -0
- package/data/tag/lptriageno-upstream.ttl +7 -0
- package/data/tag/lptriagereimplement-and-deprecate.ttl +7 -0
- package/data/tag/lptriagereimplement-and-keep.ttl +7 -0
- package/data/tag/lptriageupstream-and-deprecate.ttl +7 -0
- package/data/tag/minimal.ttl +7 -0
- package/data/tag/needsdefinition.ttl +7 -0
- package/data/tag/needsdiscussion.ttl +7 -0
- package/data/tag/needsdocumentation.ttl +7 -0
- package/data/tag/needsreview.ttl +7 -0
- package/data/tag/needstriage.ttl +7 -0
- package/data/tag/needsupdate.ttl +7 -0
- package/data/tag/notstarted.ttl +7 -0
- package/data/tag/specialadoption-docs.ttl +7 -0
- package/data/tag/stable.ttl +7 -0
- package/data/tag/stylesready.ttl +7 -0
- package/data/tag/triagedbacklog.ttl +7 -0
- package/data/tag/triagedrejected.ttl +7 -0
- package/data/tag/upstream-candidate.ttl +7 -0
- package/data/tag/upstream-compliant.ttl +7 -0
- package/data/tag/upstreamcandidate.ttl +7 -0
- package/data/tag/waiting-for-delta-review.ttl +7 -0
- package/data/tag/wpeinital-implementation.ttl +7 -0
- package/data/tag/wpetriageupstream-and-deprecate.ttl +6 -0
- package/data/tagcategory/channel.ttl +4 -0
- package/data/tagcategory/concept-status.ttl +4 -0
- package/data/tagcategory/concept-type.ttl +4 -0
- package/data/tagcategory/documentation-stage.ttl +4 -0
- package/data/tagcategory/implementation-status.ttl +4 -0
- package/data/tagcategory/lpupstream.ttl +4 -0
- package/data/tagcategory/review-status.ttl +4 -0
- package/data/tagcategory/tmp.ttl +4 -0
- package/definitions/ontology.ttl +133 -14
- package/examples/form-roster.target.json +550 -0
- package/package.json +5 -2
- package/skills/adoption-a1-styles/SKILL.md +159 -0
- package/skills/adoption-a2-components/SKILL.md +186 -0
- package/skills/adoption-a3-forms/SKILL.md +155 -0
- package/skills/anatomy-author/ANATOMY_DSL_SPEC.md +89 -106
- package/skills/anatomy-author/SKILL.md +350 -141
- package/skills/design-auditor/SKILL.md +197 -274
- package/skills/implement-component/SKILL.md +244 -0
- package/skills/specify-component/SKILL.md +232 -0
- package/skills/specify-pattern/SKILL.md +192 -0
- package/source.json +64 -2
- package/specs/README.md +17 -0
- package/src/cli.ts +23 -10
- package/src/commands/index.ts +1 -0
- package/src/commands/sync.tests.ts +430 -0
- package/src/commands/sync.ts +418 -0
- package/src/commands/transform.tests.ts +190 -5
- package/src/commands/transform.ts +163 -67
- package/src/constants.ts +1 -0
- package/src/providers/CodaProvider.tests.ts +94 -0
- package/src/providers/CodaProvider.ts +211 -1
- package/src/providers/detectSmartChips.tests.ts +42 -0
- package/src/providers/detectSmartChips.ts +60 -0
- package/src/scripts/checkDataDeletion.ts +68 -0
- package/src/scripts/evaluateDataDeletion.tests.ts +100 -0
- package/src/scripts/evaluateDataDeletion.ts +100 -0
- package/src/sync/constants.ts +52 -0
- package/src/sync/diffRoster.tests.ts +455 -0
- package/src/sync/diffRoster.ts +241 -0
- package/src/sync/loadTargetSpec.tests.ts +208 -0
- package/src/sync/loadTargetSpec.ts +139 -0
- package/src/sync/renderPlan.tests.ts +144 -0
- package/src/sync/renderPlan.ts +88 -0
- package/src/sync/snapshotTable.tests.ts +31 -0
- package/src/sync/snapshotTable.ts +20 -0
- package/src/sync/toLiveEntries.tests.ts +76 -0
- package/src/sync/toLiveEntries.ts +55 -0
- package/src/sync/types.ts +101 -0
- package/src/transform/collectDataMetrics.tests.ts +108 -0
- package/src/transform/collectDataMetrics.ts +114 -0
- package/src/transform/deltaGuards.tests.ts +136 -0
- package/src/transform/deltaGuards.ts +118 -0
- package/src/transform/expectedTables.tests.ts +99 -0
- package/src/transform/expectedTables.ts +34 -0
- package/src/transform/isValidReferenceUri.tests.ts +45 -0
- package/src/transform/isValidReferenceUri.ts +55 -0
- package/src/transform/materializeInverses.tests.ts +81 -0
- package/src/transform/materializeInverses.ts +78 -0
- package/src/transform/transform.tests.ts +22 -0
- package/src/transform/transform.ts +31 -3
- package/src/transform/transformRow.malformedRefs.tests.ts +127 -0
- package/src/transform/transformRow.tests.ts +82 -0
- package/src/transform/transformRow.ts +90 -7
- package/src/transform/types.ts +11 -0
- package/vitest.config.ts +29 -0
- package/data/apps/pattern/key_value_summary.ttl +0 -7
- package/data/apps_anbox/component/copy_to_clipboard.ttl +0 -7
- package/data/apps_launchpad/component/checkbox.ttl +0 -28
- package/data/apps_launchpad/component/radio.ttl +0 -34
- package/data/apps_launchpad/component/select.ttl +0 -34
- package/data/apps_launchpad/component/textarea.ttl +0 -35
- package/data/apps_launchpad/component/user_avatar.ttl +0 -25
- package/data/apps_lxd/component/copy_to_clipboard.ttl +0 -7
- package/data/apps_workplace/component/label-highlight.ttl +0 -7
- package/data/apps_workplace.ttl +0 -4
- package/data/apps_wpe.ttl +0 -4
- package/data/global/component/code.ttl +0 -7
- package/data/global/component/label.ttl +0 -14
- package/data/global/component/rich_text_editor.ttl +0 -7
- package/data/global/component/search_bar.ttl +0 -7
- package/data/global/component/theme_switcher.ttl +0 -7
- package/data/global/modifier/paper.ttl +0 -6
- package/data/global/pattern/dropdown_button.ttl +0 -7
- package/data/global/subcomponent/divider.ttl +0 -7
- package/data/global_form/component/checkbox_input.ttl +0 -7
- package/data/global_form/component/choices_input.ttl +0 -7
- package/data/global_form/component/combobox_input.ttl +0 -7
- package/data/global_form/component/custom_choices_input.ttl +0 -7
- package/data/global_form/component/datepicker_input.ttl +0 -7
- package/data/global_form/component/rating_input.ttl +0 -7
- package/data/global_form/component/rich_text_input.ttl +0 -7
- package/data/global_form/component/segmented_control_input.ttl +0 -7
- package/data/global_form/component/slider_input.ttl +0 -7
- package/data/global_form/component/switch_input.ttl +0 -7
- package/data/global_form/component/text_input.ttl +0 -7
- package/data/global_form/component/textarea_input.ttl +0 -7
- package/data/global_form/component/wysiwginput.ttl +0 -7
- package/data/global_form/pattern/field.ttl +0 -7
- package/data/global_form/pattern/form.ttl +0 -7
- package/data/global_form/subcomponent/field-description.ttl +0 -7
- package/data/global_form/subcomponent/field-label.ttl +0 -7
- package/data/global_form.ttl +0 -4
- package/data/site/component/blog_card.ttl +0 -7
- package/data/site/component/quote.ttl +0 -7
- package/data/site/component/rule.ttl +0 -7
- package/data/site/component/section.ttl +0 -7
- package/data/site/group/blog_cards.ttl +0 -7
- package/data/site/layout/blog_page_layout.ttl +0 -7
- package/data/site/layout/site_layout.ttl +0 -7
- package/data/site/pattern/hero-github.ttl +0 -7
- package/data/site/pattern/hero.ttl +0 -7
- package/data/site/pattern/info_table.ttl +0 -7
- package/data/site/pattern/pricing_section.ttl +0 -7
- package/data/site/pattern/pricing_table.ttl +0 -7
- package/data/site/pattern/read_more_section.ttl +0 -7
- package/data/site/pattern/skip_link.ttl +0 -7
- package/skills/component-specifier/SKILL.md +0 -412
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implement-component
|
|
3
|
+
description: Implement a specified design-system component with pragma create, following the live code standards
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Implement Component
|
|
7
|
+
|
|
8
|
+
Take an APPROVED spec — from `specify-component`, or an existing documented block — to
|
|
9
|
+
working code. The defining discipline: the applicable code standards are pulled and held
|
|
10
|
+
open DURING implementation, so they shape the code as it is written, not only in review.
|
|
11
|
+
|
|
12
|
+
## Working mode
|
|
13
|
+
|
|
14
|
+
This skill often runs alongside a senior engineer or designer. When it does, work as
|
|
15
|
+
their assistant: lay out where the flow stands, do the legwork (spec reads, standard
|
|
16
|
+
pulls, scaffolding), and surface decisions rather than absorbing them silently. The
|
|
17
|
+
points to raise with the person rather than decide alone: a thin or ambiguous spec
|
|
18
|
+
field, any deviation from a pulled standard, the target package for a tier outside the
|
|
19
|
+
naming convention, and API naming the spec does not fix. When running fully
|
|
20
|
+
autonomously (only on explicit request), list those judgment calls in the PR.
|
|
21
|
+
|
|
22
|
+
## When to Use
|
|
23
|
+
|
|
24
|
+
- An approved spec — from `specify-component`, or an existing documented block — needs
|
|
25
|
+
working code
|
|
26
|
+
- A scaffolded component needs to be implemented against the live code standards
|
|
27
|
+
|
|
28
|
+
## When NOT to Use
|
|
29
|
+
|
|
30
|
+
- No approved spec yet — run `specify-component` first (`specify-pattern` for a pattern)
|
|
31
|
+
- Only the anatomy is missing — that is `anatomy-author`
|
|
32
|
+
- Adopting existing components into an app — the `adoption-a1-styles` /
|
|
33
|
+
`adoption-a2-components` / `adoption-a3-forms` tracks, not this skill
|
|
34
|
+
|
|
35
|
+
## Pre-flight
|
|
36
|
+
|
|
37
|
+
1. **Read the spec.**
|
|
38
|
+
- Documented block: `pragma block lookup <Name>` — anatomy, modifiers, properties in
|
|
39
|
+
one read (MCP: block_lookup); `pragma graph inspect <uri>` for the full triple view.
|
|
40
|
+
A bare name can match blocks in several tiers, and `block lookup` silently picks
|
|
41
|
+
one — it resolves `ds:name` globally and cannot be steered to a tier. Take the
|
|
42
|
+
picked block's tier from the lookup's own `- Tier:` line, and check for other
|
|
43
|
+
tiers carrying the name with the name query below, then address the tier you
|
|
44
|
+
want by its IRI.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pragma graph query "SELECT ?b WHERE { ?b ds:name ?n . FILTER(LCASE(?n) = LCASE('<Name>')) }" # every tier carrying the name
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If the lookup picked the wrong tier's block, read the one you want with
|
|
51
|
+
`pragma graph inspect <IRI from that row>` instead — step 2 derives the package
|
|
52
|
+
from the tier of the block confirmed HERE.
|
|
53
|
+
|
|
54
|
+
**Check the entry is a spec before building on it — whatever class it is.**
|
|
55
|
+
A row resolving is not the same as a block being documented: many entries
|
|
56
|
+
across every class carry an empty `ds:summary`, `ds:usage` and `ds:anatomyDsl`,
|
|
57
|
+
and `block lookup <Name>` still answers for them with a heading, a blank line
|
|
58
|
+
and a `- Tier:` row. Judge the BASE DEFINITION: if `ds:summary`, `ds:usage` and
|
|
59
|
+
`ds:anatomyDsl` all came back filled, the block is documented — implement it,
|
|
60
|
+
and raise any single thin field (empty guidelines, say) as a gap rather than a
|
|
61
|
+
blocker. If all three came back empty, there is no spec here to implement: route
|
|
62
|
+
it to `specify-component`, per the When NOT to Use rules above.
|
|
63
|
+
|
|
64
|
+
Then read whatever `ds:documentationStage` tag came back. The tag vocabulary is
|
|
65
|
+
the graph's, not this skill's, so do not expect a fixed value list; **if the
|
|
66
|
+
predicate is absent, no stage is recorded for that block** — say so and carry on
|
|
67
|
+
with what the fields told you. The tag's MEANING is graph data too:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pragma graph inspect ds:tag.<name> # the tag the stage read returned; ds:whenToApply says what it means
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Split the action on what `ds:whenToApply` says. A tag meaning the block was
|
|
74
|
+
rejected or triaged out, or that it is only PROPOSED or postponed — not yet
|
|
75
|
+
accepted into the system: this is not an approved spec, route it to
|
|
76
|
+
`specify-component`. A tag meaning the documentation is UNFINISHED: proceed, and
|
|
77
|
+
say so in the PR — route to `anatomy-author` only the fields that actually came
|
|
78
|
+
back empty, not the whole block. A tag whose `ds:whenToApply` comes back blank:
|
|
79
|
+
the meaning is unrecorded — treat it as unknown, and say so.
|
|
80
|
+
|
|
81
|
+
If the name has no row and the lookup errors, the block may be a Group — `block list`/`block lookup` cover no groups; the name query above returns its IRI for `pragma graph inspect <IRI>`.
|
|
82
|
+
Groups are the one UIBlock class `block list` deliberately omits, so the graph
|
|
83
|
+
entry is their only documentation surface — but the check above is the same
|
|
84
|
+
check: read the base definition, then the stage.
|
|
85
|
+
|
|
86
|
+
The inspect renders `ds:hasProperty` only as opaque blank-node labels; for the
|
|
87
|
+
property content use the lookup's Properties section — only when the lookup
|
|
88
|
+
resolved the block you want — or bind the property query to the block confirmed
|
|
89
|
+
above. (A `block list` row prints the `ds:` form — `graph inspect` takes it
|
|
90
|
+
as-is, but a SPARQL body needs the full IRI: join `https://ds.canonical.com/`
|
|
91
|
+
with the row's dotted name, e.g. for the global Button,
|
|
92
|
+
`<https://ds.canonical.com/global.component.button>`; the name query above
|
|
93
|
+
prints that full form directly. The bracketed prefixed form `<ds:…>` silently
|
|
94
|
+
returns an EMPTY table, not an error.)
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pragma graph query "SELECT ?p ?v WHERE { <https://ds.canonical.com/<dotted name from that row>> ds:hasProperty ?x . ?x ?p ?v }"
|
|
98
|
+
```
|
|
99
|
+
- New block: the `specs/…` file its specify flow produced.
|
|
100
|
+
2. **Confirm the target package and tier.** The spec names its tier; `pragma tier list`
|
|
101
|
+
shows what exists. Where a package exists for the tier, its name follows a
|
|
102
|
+
convention — the graph carries no package field: `@canonical/<framework>-ds-global`
|
|
103
|
+
for the `global` tier, `@canonical/<framework>-ds-app` for the shared `apps` tier,
|
|
104
|
+
and `@canonical/<framework>-ds-app-<app>` for an app-specific tier
|
|
105
|
+
(`apps_lxd` → `@canonical/react-ds-app-lxd`). The `<app>` segment is the package's
|
|
106
|
+
own short name, not always the tier suffix (the `apps_workplaceengineering` tier's
|
|
107
|
+
package is `@canonical/svelte-ds-app-wpe`) — confirm the derived package actually
|
|
108
|
+
resolves in the workspace before installing or scaffolding into it. Tiers outside
|
|
109
|
+
`global`/`apps*` have no package convention today: there the target package is a
|
|
110
|
+
decision to raise, not to derive.
|
|
111
|
+
3. **Pull the applicable standards NOW.**
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
pragma standard categories # what categories exist today
|
|
115
|
+
pragma standard list --category react # swap react for the target framework category
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
> The covered set is whatever the graph answers today. Query it live — never copy its
|
|
119
|
+
> output into documentation, PRs, or this skill.
|
|
120
|
+
|
|
121
|
+
Repeat the `--category` listing for the testing, storybook, css, and styling
|
|
122
|
+
categories that apply to this component — take the category names from the
|
|
123
|
+
`standard categories` output, not from memory.
|
|
124
|
+
|
|
125
|
+
Then read the shortlisted standards' Do/Don't pairs — few-shot material to keep
|
|
126
|
+
open in the working context while writing. The pairs live in the graph; pull them
|
|
127
|
+
per category:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
pragma graph query "SELECT ?s ?kind ?caption ?code WHERE { ?s cs:hasCategory cs:react . { ?s cs:do ?x . BIND('do' AS ?kind) } UNION { ?s cs:dont ?x . BIND('dont' AS ?kind) } ?x cs:description ?caption . OPTIONAL { ?x cs:code ?code } }"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Keep `cs:code` OPTIONAL as written — some pairs carry a caption and no code
|
|
134
|
+
snippet, and requiring the code triple silently drops those standards from the
|
|
135
|
+
result.
|
|
136
|
+
|
|
137
|
+
For ONE standard, bind the same query to its IRI. (`pragma graph inspect cs:<id>`
|
|
138
|
+
shows which predicates a standard carries, but renders `cs:do`/`cs:dont` only as
|
|
139
|
+
opaque blank-node labels — the pairs come back through the query, not the
|
|
140
|
+
inspect):
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
pragma graph query "SELECT ?kind ?caption ?code WHERE { BIND(<http://pragma.canonical.com/codestandards#react.component.barrel_exports> AS ?s) { ?s cs:do ?x . BIND('do' AS ?kind) } UNION { ?s cs:dont ?x . BIND('dont' AS ?kind) } ?x cs:description ?caption . OPTIONAL { ?x cs:code ?code } }"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Swap `cs:react` for each shortlisted category, using the category's GRAPH ID — not
|
|
147
|
+
its display name. `standard categories` prints display names (`testing-coverage`);
|
|
148
|
+
the graph ids differ (`testing.coverage`), and a display name pasted into the
|
|
149
|
+
query returns an empty table, not an error. List the exact IRIs with
|
|
150
|
+
`pragma graph query "SELECT DISTINCT ?c WHERE { ?s cs:hasCategory ?c }"` and paste
|
|
151
|
+
one in full `<…>` form, e.g.:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
pragma graph query "SELECT ?s ?kind ?caption ?code WHERE { ?s cs:hasCategory <http://pragma.canonical.com/codestandards#testing.coverage> . { ?s cs:do ?x . BIND('do' AS ?kind) } UNION { ?s cs:dont ?x . BIND('dont' AS ?kind) } ?x cs:description ?caption . OPTIONAL { ?x cs:code ?code } }"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
(Inside a SPARQL body a local name with more than one dot does not parse; a
|
|
158
|
+
single dot — `cs:testing.unit` — is fine.) `pragma standard lookup <name>` and
|
|
159
|
+
`pragma standard sample` resolve only the standards that carry a `cs:name`
|
|
160
|
+
title — today only a few do — so for the rest the graph query above is the read
|
|
161
|
+
path. (MCP: standard_categories / standard_list / graph_query / graph_inspect.)
|
|
162
|
+
|
|
163
|
+
## Scaffold
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
pragma create component react src/components/Button
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
- The framework is a tree segment — `pragma create component <framework> <path>` with
|
|
170
|
+
`react`, `svelte`, or `lit` as the segment; the path's final segment is the
|
|
171
|
+
PascalCase component name.
|
|
172
|
+
- Run it from inside the target package confirmed in pre-flight step 2 — the path is
|
|
173
|
+
package-relative (in the ds packages, components live at `src/lib/component/<Name>`,
|
|
174
|
+
so the path there is `src/lib/component/Button`, not the generic example above).
|
|
175
|
+
- Plan-first: preview with `--dry-run`, apply non-interactively with `--yes`, reverse
|
|
176
|
+
with `--undo`. Run without `--yes` to answer the generator's prompts interactively.
|
|
177
|
+
- The scaffold's include options (styles, stories, SSR tests) are prompt-derived and
|
|
178
|
+
discoverable — read them from the leaf's own help, never from a copied table:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
pragma create component react --help
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
- MCP: the `create_component` tool ({framework, componentPath, …}); it returns a plan
|
|
185
|
+
unless `confirm: true`.
|
|
186
|
+
|
|
187
|
+
The same generator is available as `summon component react src/components/Button` —
|
|
188
|
+
`pragma create <args…>` and `summon <args…>` are one machine in two binaries, identical
|
|
189
|
+
grammar. Teach and use the pragma spelling.
|
|
190
|
+
|
|
191
|
+
## Implement following the pulled standards
|
|
192
|
+
|
|
193
|
+
Write the component against the open Do/Don't pairs from pre-flight. When a case comes
|
|
194
|
+
up that the shortlist does not cover, widen before improvising: re-run
|
|
195
|
+
`pragma standard categories`, list the further categories that could apply
|
|
196
|
+
(`pragma standard list --category <c>`), and pull their Do/Don't pairs with the same
|
|
197
|
+
graph query as pre-flight. Each surface takes its own spelling: `--category` takes the
|
|
198
|
+
DISPLAY name `standard categories` prints (`testing-coverage`); the SPARQL body takes
|
|
199
|
+
the category's graph id from the `SELECT DISTINCT ?c` read there (`testing.coverage`) —
|
|
200
|
+
never the other way around. An empty pair table has two causes: a display name pasted
|
|
201
|
+
into the query, or a category that records standards but no Do/Don't pairs at all —
|
|
202
|
+
`pragma standard list --category <c>` distinguishes them (it lists the category's
|
|
203
|
+
standards either way; when no pairs exist, work from those standards' descriptions).
|
|
204
|
+
|
|
205
|
+
A standard you disagree with is feedback for the standards repo, not a license to
|
|
206
|
+
deviate silently.
|
|
207
|
+
|
|
208
|
+
## Post-flight
|
|
209
|
+
|
|
210
|
+
- Fill in the stories and tests the scaffold stubbed — the spec's properties, modifiers,
|
|
211
|
+
and states each get exercised.
|
|
212
|
+
- Register the component per the package's convention (barrel/export registration).
|
|
213
|
+
- Run the package's own `bun run check` and `bun run test` (the repo-standard script
|
|
214
|
+
names) until green.
|
|
215
|
+
|
|
216
|
+
## Close: independent review
|
|
217
|
+
|
|
218
|
+
Finish by invoking the `standards-review` skill as the independent quality gate over the
|
|
219
|
+
diff:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
pragma skill lookup standards-review
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
It ships from canonical/web-code-standards once that skill lands; until then the
|
|
226
|
+
lookup will not resolve. Fall back to re-reading the pre-flight Do/Don't material
|
|
227
|
+
against the diff yourself, and say in the PR that the independent gate was
|
|
228
|
+
unavailable.
|
|
229
|
+
|
|
230
|
+
## Related skills
|
|
231
|
+
|
|
232
|
+
- `specify-component` — upstream: produces the spec this skill implements
|
|
233
|
+
- `anatomy-author` — the structure contract the implementation must honor
|
|
234
|
+
|
|
235
|
+
## Support
|
|
236
|
+
|
|
237
|
+
If this skill leads somewhere broken — a command that errors, guidance that
|
|
238
|
+
contradicts what the live system answers, a gap the flow cannot cover — you are not
|
|
239
|
+
stuck:
|
|
240
|
+
|
|
241
|
+
- Raise an issue in the pragma repo: https://github.com/canonical/pragma/issues —
|
|
242
|
+
include the skill name, what was run, and expected vs. actual outcome.
|
|
243
|
+
- Or contact the design-system team owners directly through your organization's
|
|
244
|
+
professional messaging channels for assistance.
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specify-component
|
|
3
|
+
description: Specify a new design-system component with the knowledge graph, from graph search to a sync-safe spec file
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Specify Component
|
|
7
|
+
|
|
8
|
+
Create a NEW component on the design/spec side, using the full power of the knowledge
|
|
9
|
+
graph. This skill supersedes the retired component-specifier skill (a name that no
|
|
10
|
+
longer resolves) with an eight-step flow: nothing is invented before the graph has been
|
|
11
|
+
searched, the entry shape comes from the ontology, and the output is a standalone spec
|
|
12
|
+
file the data sync cannot destroy.
|
|
13
|
+
|
|
14
|
+
In a fresh session, orient first:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pragma capabilities
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Working mode: assistant to a design authority
|
|
21
|
+
|
|
22
|
+
Most of the time this skill runs in collaboration with a senior designer or engineer —
|
|
23
|
+
they are the design authority, you are the assistant whose job is to make them
|
|
24
|
+
successful. Default to that mode:
|
|
25
|
+
|
|
26
|
+
- Lay out the workflow direction: say which step comes next and why, so the person
|
|
27
|
+
always knows where the flow stands.
|
|
28
|
+
- Do the legwork yourself — graph searches, ontology reads, benchmark research — and
|
|
29
|
+
bring back digestible findings, not raw dumps.
|
|
30
|
+
- Bring each decision to the person as a recommendation plus a question, never as a
|
|
31
|
+
fait accompli. They hold context the graph does not — history, intent, naming
|
|
32
|
+
precedent, roadmap — so ask the questions that draw that knowledge out, and use it.
|
|
33
|
+
|
|
34
|
+
Full autonomy is the exception, not the default: run the whole flow alone only when
|
|
35
|
+
explicitly asked to. Even then, list every judgment call made unilaterally in the
|
|
36
|
+
final report so a human can revisit them.
|
|
37
|
+
|
|
38
|
+
Decision gates — in collaboration, pause at each and resolve it WITH the person:
|
|
39
|
+
|
|
40
|
+
1. The step-1 verdict: exists/extend vs. a named gap.
|
|
41
|
+
2. The step-2 category choice (which `ds:UIBlock` subclass the entry is).
|
|
42
|
+
3. The step-3 boundary: how the definition disambiguates from its neighbors.
|
|
43
|
+
4. The step-4 adopt/reject decisions from the benchmark.
|
|
44
|
+
5. Whether the step-5 state gate fires, and the state model when it does.
|
|
45
|
+
|
|
46
|
+
## When to Use
|
|
47
|
+
|
|
48
|
+
- A component is proposed that the design system may not cover yet
|
|
49
|
+
- An existing component needs a formally specified sibling or replacement
|
|
50
|
+
- A gap found during adoption or implementation needs to become a real spec
|
|
51
|
+
|
|
52
|
+
## When NOT to Use
|
|
53
|
+
|
|
54
|
+
- Implementing an already-specified component — use `implement-component`
|
|
55
|
+
- Specifying a pattern (a recurring arrangement of components) — use `specify-pattern`
|
|
56
|
+
- Writing only the anatomy for an existing block — use `anatomy-author`
|
|
57
|
+
|
|
58
|
+
## The eight steps
|
|
59
|
+
|
|
60
|
+
### 1. Search the graph
|
|
61
|
+
|
|
62
|
+
Before anything is invented, find what already exists:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pragma block list # every component, pattern, layout and subcomponent, with its type and tier
|
|
66
|
+
pragma block lookup <Name-or-glob> # full spec of candidates: anatomy, modifiers, properties (MCP: block_lookup); a glob repeats a multi-tier name once per IRI and every repeat is the SAME block — the fragment query below lists the tiers
|
|
67
|
+
pragma block sample # real entry shapes — read these BEFORE writing queries
|
|
68
|
+
pragma modifier list # the modifier families blocks draw from
|
|
69
|
+
pragma tier list # the tiers a block can live in
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Search by name fragment when the naming is uncertain:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pragma graph query "SELECT ?b ?name WHERE { ?b ds:name ?name . FILTER(CONTAINS(LCASE(?name), 'crumb')) }"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> The covered set is whatever the graph answers today. Query it live — never copy its
|
|
79
|
+
> output into documentation, PRs, or this skill.
|
|
80
|
+
|
|
81
|
+
Outcome gate: **either "exists — stop or extend it" or a NAMED gap.** No spec is written
|
|
82
|
+
without one of those two sentences, naming the blocks that were checked.
|
|
83
|
+
|
|
84
|
+
### 2. Understand the ontology
|
|
85
|
+
|
|
86
|
+
Read the shape the entry must satisfy:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pragma ontology lookup ds # the design-system vocabulary
|
|
90
|
+
pragma ontology lookup ds --class UIBlock # the block-level properties every entry carries
|
|
91
|
+
pragma ontology lookup ds --class Component # what Component itself declares
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`--class` shows only what a class declares itself — usage, guidelines, properties,
|
|
95
|
+
and tier are declared on `ds:UIBlock` and inherited by its subclasses; `summary` and
|
|
96
|
+
`name` sit further up the chain on `ds:Entity`
|
|
97
|
+
(`pragma ontology lookup ds --class Entity`).
|
|
98
|
+
|
|
99
|
+
The documented conventions the entry follows:
|
|
100
|
+
|
|
101
|
+
- `ds:summary` — what the component is, in one or two sentences
|
|
102
|
+
- `ds:usage` — markdown with `### When to use` and `### When not to use` sections
|
|
103
|
+
- `ds:guidelines` — markdown; Accessibility material lives here by convention
|
|
104
|
+
(contrast, alternative text, keyboard and focus behavior)
|
|
105
|
+
- `ds:hasProperty` — one entry per property: name, type, summary, optional, default,
|
|
106
|
+
constraints
|
|
107
|
+
- Modifier families the component participates in
|
|
108
|
+
- The tier it belongs to
|
|
109
|
+
- The category definitions — `pragma ontology lookup ds` above lists every `ds:UIBlock` subclass; read what each one means with `pragma graph inspect ds:<Subclass>`
|
|
110
|
+
(each prints its `skos:definition`; `--class` prints declared properties, not
|
|
111
|
+
definitions), and state which category the entry belongs to BEFORE writing
|
|
112
|
+
|
|
113
|
+
Each field's acceptance criteria live on the property itself —
|
|
114
|
+
`pragma graph inspect ds:usage` / `ds:guidelines` print the `ds:acceptanceCriteria`
|
|
115
|
+
the content must satisfy; read them before writing the field.
|
|
116
|
+
|
|
117
|
+
Do not trust this list over the data: run `pragma block sample` and mirror what real
|
|
118
|
+
entries carry today. The draw is RANDOM and many blocks are near-empty, so a sample can come back content-free and teach you nothing: re-run it until it lands on a filled entry, or inspect a block you already know is documented.
|
|
119
|
+
|
|
120
|
+
### 3. Define the principles
|
|
121
|
+
|
|
122
|
+
Write the component's main definition — and write it to DISAMBIGUATE. Name the closest
|
|
123
|
+
existing blocks found in step 1 and state the boundary explicitly: "unlike X, this …".
|
|
124
|
+
A definition that could equally describe a step-1 neighbor is not done.
|
|
125
|
+
|
|
126
|
+
### 4. Research & benchmark
|
|
127
|
+
|
|
128
|
+
Study the same affordance or role in other design systems — React Aria, Carbon,
|
|
129
|
+
Material, shadcn (list extensible). Compare:
|
|
130
|
+
|
|
131
|
+
- API shape
|
|
132
|
+
- Accessibility pattern
|
|
133
|
+
- Naming
|
|
134
|
+
- State model
|
|
135
|
+
- Composition
|
|
136
|
+
|
|
137
|
+
Output: a short comparison table plus an explicit statement of what pragma adopts, what
|
|
138
|
+
it rejects, and why.
|
|
139
|
+
|
|
140
|
+
### 5. State-complexity gate
|
|
141
|
+
|
|
142
|
+
Decide whether the component carries complex, state-machine-like state: many interacting
|
|
143
|
+
modes, async transitions, orchestration across parts.
|
|
144
|
+
|
|
145
|
+
Calibration: a Button — hover, active, disabled visual states — does NOT fire this
|
|
146
|
+
gate; a Combobox — open/closed, filtering, async loading, selection moving between
|
|
147
|
+
input and list — does.
|
|
148
|
+
|
|
149
|
+
If YES, write a **"States & interaction"** section INSIDE the guidelines content of the
|
|
150
|
+
spec (the v0 home for the state spec), covering:
|
|
151
|
+
|
|
152
|
+
- The states
|
|
153
|
+
- Events and transitions between them
|
|
154
|
+
- The initial state
|
|
155
|
+
- Error states
|
|
156
|
+
- Keyboard interactions per state
|
|
157
|
+
|
|
158
|
+
If NO, say so in the spec and move on.
|
|
159
|
+
|
|
160
|
+
### 6. Write the documentation (without the anatomy)
|
|
161
|
+
|
|
162
|
+
Write the spec in markdown or Turtle following the step-2 structure: definition, usage,
|
|
163
|
+
guidelines (including the step-5 section when it fired), properties. The anatomy is
|
|
164
|
+
step 7, not here.
|
|
165
|
+
|
|
166
|
+
**Output location (hard rule)**: a standalone spec file the sync cannot destroy.
|
|
167
|
+
|
|
168
|
+
- In canonical/design-system: `specs/<tier>.<type>.<snake_name>.{md,ttl}`
|
|
169
|
+
(e.g. `specs/global.component.carousel.md` — step 1 must have shown the name to be
|
|
170
|
+
a genuine gap first)
|
|
171
|
+
- In any other repo: that repo's design-docs location
|
|
172
|
+
|
|
173
|
+
NEVER write into design-system `data/` — it is regenerated destructively from Coda by
|
|
174
|
+
CI, and hand edits are overwritten by the next sync. Database entry is a separate,
|
|
175
|
+
currently-human step: a person pastes the spec content into Coda.
|
|
176
|
+
|
|
177
|
+
### 7. Write the anatomy DSL
|
|
178
|
+
|
|
179
|
+
Delegate to the `anatomy-author` skill:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
pragma skill lookup anatomy-author
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The skill covers named and anonymous nodes, edges with cardinality, slot names, and
|
|
186
|
+
CTI-inspired style keys; the full ANATOMY_DSL_SPEC ships beside it as
|
|
187
|
+
`ANATOMY_DSL_SPEC.md` in the installed `anatomy-author` skill folder (the lookup
|
|
188
|
+
renders SKILL.md only — open that file directly for the complete spec). The produced
|
|
189
|
+
DSL lands in the step-6 spec file
|
|
190
|
+
under `specs/` — in a `.md` spec as its anatomy section, in a `.ttl` spec as the
|
|
191
|
+
block's `ds:anatomyDsl` string literal — never under `data/`; entry into Coda stays
|
|
192
|
+
the human step.
|
|
193
|
+
|
|
194
|
+
### 8. Pair with tokens — placeholder
|
|
195
|
+
|
|
196
|
+
**Left blank for now** — token pairing content lands with the token work. Do not invent
|
|
197
|
+
token guidance.
|
|
198
|
+
|
|
199
|
+
## Response format
|
|
200
|
+
|
|
201
|
+
Report the spec-file path, then the eight step outcomes as a checklist (the reported
|
|
202
|
+
path ends in `.ttl` instead when step 6 took the Turtle branch):
|
|
203
|
+
|
|
204
|
+
```markdown
|
|
205
|
+
Spec: specs/<tier>.<type>.<snake_name>.md
|
|
206
|
+
|
|
207
|
+
- [ ] 1. Graph searched — verdict: exists/extend OR named gap (blocks checked: …)
|
|
208
|
+
- [ ] 2. Ontology shape read (classes and conventions applied)
|
|
209
|
+
- [ ] 3. Principles defined, disambiguated from: …
|
|
210
|
+
- [ ] 4. Benchmarked against: … (adopt/reject decisions stated)
|
|
211
|
+
- [ ] 5. State gate: fired/not fired (States & interaction section: yes/no)
|
|
212
|
+
- [ ] 6. Documentation written to the sync-safe location
|
|
213
|
+
- [ ] 7. Anatomy DSL written via anatomy-author
|
|
214
|
+
- [ ] 8. Token pairing: placeholder (deferred)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Related skills
|
|
218
|
+
|
|
219
|
+
- `anatomy-author` — the step-7 engine
|
|
220
|
+
- `specify-pattern` — the same skeleton, context-first, for recurring arrangements
|
|
221
|
+
- `implement-component` — what happens after the spec is approved
|
|
222
|
+
|
|
223
|
+
## Support
|
|
224
|
+
|
|
225
|
+
If this skill leads somewhere broken — a command that errors, guidance that
|
|
226
|
+
contradicts what the live system answers, a gap the flow cannot cover — you are not
|
|
227
|
+
stuck:
|
|
228
|
+
|
|
229
|
+
- Raise an issue in the pragma repo: https://github.com/canonical/pragma/issues —
|
|
230
|
+
include the skill name, what was run, and expected vs. actual outcome.
|
|
231
|
+
- Or contact the design-system team owners directly through your organization's
|
|
232
|
+
professional messaging channels for assistance.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specify-pattern
|
|
3
|
+
description: Specify a new design-system pattern from the repeatable user context it serves
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Specify Pattern
|
|
7
|
+
|
|
8
|
+
Create a NEW pattern on the design/spec side. The skeleton is the same eight steps as
|
|
9
|
+
`specify-component`, with the emphasis inverted by the defining principle:
|
|
10
|
+
|
|
11
|
+
**A pattern is defined by the repeatable USER CONTEXT it serves — the situation, the
|
|
12
|
+
job, the flow it recurs in — more than by the atomicity of the element itself.**
|
|
13
|
+
|
|
14
|
+
A component earns its place by being a distinct element; a pattern earns its place by a
|
|
15
|
+
situation that keeps coming back and an arrangement that keeps answering it. Every step
|
|
16
|
+
below is aimed at that context.
|
|
17
|
+
|
|
18
|
+
In a fresh session, orient first:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pragma capabilities
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Working mode: assistant to a design authority
|
|
25
|
+
|
|
26
|
+
Most of the time this skill runs in collaboration with a senior designer or engineer —
|
|
27
|
+
they are the design authority, you are the assistant whose job is to make them
|
|
28
|
+
successful. Default to that mode: lay out the workflow direction step by step, do the
|
|
29
|
+
legwork (graph searches, ontology reads, benchmark research) and return digestible
|
|
30
|
+
findings, and bring each decision to the person as a recommendation plus a question
|
|
31
|
+
rather than a fait accompli. They hold context the graph does not — which situations
|
|
32
|
+
actually recur across products, history, naming precedent — so ask the questions that
|
|
33
|
+
draw that knowledge out; for patterns especially, the recurring CONTEXT often lives in
|
|
34
|
+
the person's experience before it lives in any data.
|
|
35
|
+
|
|
36
|
+
Full autonomy is the exception, not the default: run the whole flow alone only when
|
|
37
|
+
explicitly asked to. Even then, list every judgment call made unilaterally in the
|
|
38
|
+
final report so a human can revisit them.
|
|
39
|
+
|
|
40
|
+
Decision gates — in collaboration, pause at each and resolve it WITH the person:
|
|
41
|
+
|
|
42
|
+
1. The step-1 verdicts: for the pattern AND for each composed component.
|
|
43
|
+
2. Whether the entry IS a pattern (a recurring arrangement, not a component or layout).
|
|
44
|
+
3. The step-3 context definition and composition rule — what is fixed, what varies.
|
|
45
|
+
4. The step-4 adopt/reject decisions from the benchmark.
|
|
46
|
+
5. The step-5 state model spanning the composed components.
|
|
47
|
+
|
|
48
|
+
## When to Use
|
|
49
|
+
|
|
50
|
+
- A recurring arrangement of components (a flow, a page region, a repeated pairing)
|
|
51
|
+
needs a formal specification
|
|
52
|
+
- The same ad-hoc composition keeps being rebuilt across apps and should be named
|
|
53
|
+
|
|
54
|
+
## When NOT to Use
|
|
55
|
+
|
|
56
|
+
- Specifying a single element — use `specify-component`
|
|
57
|
+
- Implementing an already-specified block — use `implement-component`
|
|
58
|
+
- Writing only the anatomy — use `anatomy-author`
|
|
59
|
+
|
|
60
|
+
## The eight steps
|
|
61
|
+
|
|
62
|
+
### 1. Search the graph — patterns AND their parts
|
|
63
|
+
|
|
64
|
+
Search twice: for existing patterns near the candidate, and for the components the
|
|
65
|
+
candidate pattern composes.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pragma block list # patterns are blocks — the list covers them, with tiers
|
|
69
|
+
pragma block lookup <Name-or-glob> # the closest existing patterns, in full (MCP: block_lookup); a glob repeats a multi-tier name once per IRI and every repeat is the SAME block — the fragment query below lists the tiers
|
|
70
|
+
pragma block sample # real entry shapes before writing queries
|
|
71
|
+
pragma modifier list # the modifier families blocks draw from
|
|
72
|
+
pragma tier list # the tiers a block can live in
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Search by name fragment when the naming is uncertain:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pragma graph query "SELECT ?b ?name WHERE { ?b ds:name ?name . FILTER(CONTAINS(LCASE(?name), 'nav')) }"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Then look up EACH component the candidate arrangement composes
|
|
82
|
+
(`pragma block lookup <Name>` per component) — a pattern spec over parts the system does
|
|
83
|
+
not cover is really a component gap plus a pattern gap; name both.
|
|
84
|
+
|
|
85
|
+
> The covered set is whatever the graph answers today. Query it live — never copy its
|
|
86
|
+
> output into documentation, PRs, or this skill.
|
|
87
|
+
|
|
88
|
+
Outcome gate: **either "exists — stop or extend it" or a NAMED gap**, for the pattern
|
|
89
|
+
and for each composed component.
|
|
90
|
+
|
|
91
|
+
### 2. Understand the ontology
|
|
92
|
+
|
|
93
|
+
Same read as specify-component:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
pragma ontology lookup ds
|
|
97
|
+
pragma ontology lookup ds --class UIBlock # the block-level properties every entry carries
|
|
98
|
+
pragma ontology lookup ds --class Pattern # what Pattern itself declares
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`--class` shows only what a class declares itself — Pattern declares nothing of its
|
|
102
|
+
own today; usage, guidelines, properties, and tier come from `ds:UIBlock`, and
|
|
103
|
+
`summary`/`name` from `ds:Entity`, further up the chain (`--class Entity`).
|
|
104
|
+
|
|
105
|
+
The entry follows the documented conventions — `ds:summary`; `ds:usage` with
|
|
106
|
+
`### When to use` / `### When not to use`; `ds:guidelines` with Accessibility as a
|
|
107
|
+
convention; `ds:hasProperty`; modifier families; tier — and `pragma block sample`
|
|
108
|
+
overrules this list wherever real entries differ. The draw is RANDOM and many blocks are near-empty, so a sample can come back content-free and teach you nothing: re-run it until it lands on a filled entry, or inspect a block you already know is documented. Each field's acceptance criteria
|
|
109
|
+
are on the property itself: `pragma graph inspect ds:usage` / `ds:guidelines` print
|
|
110
|
+
the `ds:acceptanceCriteria` the content must satisfy. Read the category definitions
|
|
111
|
+
too — `pragma ontology lookup ds` above lists every `ds:UIBlock` subclass; read what each one means with `pragma graph inspect ds:<Subclass>`
|
|
112
|
+
(each prints its `skos:definition`) — and confirm the entry IS a pattern — a recurring
|
|
113
|
+
arrangement, not a single element or a space-dividing layout — BEFORE writing.
|
|
114
|
+
|
|
115
|
+
### 3. Define the context and the composition rule
|
|
116
|
+
|
|
117
|
+
The main definition names the RECURRING CONTEXT, not just the shape:
|
|
118
|
+
|
|
119
|
+
- When does this arrangement apply — the situation, the job, the flow it recurs in
|
|
120
|
+
- Which components does it orchestrate
|
|
121
|
+
- What varies per use, and what is fixed (the composition rule)
|
|
122
|
+
|
|
123
|
+
Disambiguate from the step-1 neighbors explicitly ("unlike X, this …") — for a pattern
|
|
124
|
+
that includes naming the contexts the neighbors serve.
|
|
125
|
+
|
|
126
|
+
### 4. Research & benchmark pattern catalogs
|
|
127
|
+
|
|
128
|
+
Benchmark against the pattern sections of other systems — React Aria, Carbon, Material,
|
|
129
|
+
shadcn (list extensible): how they frame the same context, what they compose, the
|
|
130
|
+
accessibility pattern, the naming, the state model. Output: a short comparison table
|
|
131
|
+
plus what pragma adopts, what it rejects, and why.
|
|
132
|
+
|
|
133
|
+
### 5. State-complexity gate — expect it to fire
|
|
134
|
+
|
|
135
|
+
Patterns orchestrate state ACROSS components, so this gate fires more often than for a
|
|
136
|
+
single component: selection flowing between parts, async steps, wizard-like progressions.
|
|
137
|
+
|
|
138
|
+
When it fires, write the **"States & interaction"** section inside the guidelines
|
|
139
|
+
content of the spec, same as specify-component: states, events and transitions, initial
|
|
140
|
+
state, error states, keyboard interactions per state — here spanning the composed
|
|
141
|
+
components, not just one.
|
|
142
|
+
|
|
143
|
+
### 6. Write the documentation (without the anatomy)
|
|
144
|
+
|
|
145
|
+
Markdown or Turtle following the step-2 structure; category = pattern.
|
|
146
|
+
|
|
147
|
+
**Output location (hard rule)**: a standalone spec file the sync cannot destroy.
|
|
148
|
+
|
|
149
|
+
- In canonical/design-system: `specs/<tier>.pattern.<snake_name>.{md,ttl}`
|
|
150
|
+
- In any other repo: that repo's design-docs location
|
|
151
|
+
|
|
152
|
+
NEVER write into design-system `data/` — it is regenerated destructively from Coda by
|
|
153
|
+
CI, and hand edits are overwritten by the next sync. Database entry is a separate,
|
|
154
|
+
currently-human step: a person pastes the spec content into Coda.
|
|
155
|
+
|
|
156
|
+
### 7. Write the anatomy DSL — where the skeleton is stable
|
|
157
|
+
|
|
158
|
+
Where the pattern has a stable structural skeleton, write its anatomy via the
|
|
159
|
+
`anatomy-author` skill (`pragma skill lookup anatomy-author`). A pattern whose whole
|
|
160
|
+
point is a varying arrangement may carry only the invariant frame; say which parts are
|
|
161
|
+
anatomy and which are composition rule. The produced DSL lands in the step-6 spec file
|
|
162
|
+
under `specs/` — in a `.md` spec as its anatomy section, in a `.ttl` spec as the
|
|
163
|
+
block's `ds:anatomyDsl` string literal — never under `data/`; entry into Coda stays
|
|
164
|
+
the human step.
|
|
165
|
+
|
|
166
|
+
### 8. Pair with tokens — placeholder
|
|
167
|
+
|
|
168
|
+
**Left blank for now** — token pairing content lands with the token work. Do not invent
|
|
169
|
+
token guidance.
|
|
170
|
+
|
|
171
|
+
## Response format
|
|
172
|
+
|
|
173
|
+
Report the spec-file path, then the eight step outcomes as a checklist (pattern AND
|
|
174
|
+
composed components named in step 1; the composition rule stated in step 3).
|
|
175
|
+
|
|
176
|
+
## Related skills
|
|
177
|
+
|
|
178
|
+
- `specify-component` — the sibling flow for single elements (and for component gaps
|
|
179
|
+
step 1 uncovers)
|
|
180
|
+
- `anatomy-author` — the step-7 engine
|
|
181
|
+
- `implement-component` — after the spec is approved
|
|
182
|
+
|
|
183
|
+
## Support
|
|
184
|
+
|
|
185
|
+
If this skill leads somewhere broken — a command that errors, guidance that
|
|
186
|
+
contradicts what the live system answers, a gap the flow cannot cover — you are not
|
|
187
|
+
stuck:
|
|
188
|
+
|
|
189
|
+
- Raise an issue in the pragma repo: https://github.com/canonical/pragma/issues —
|
|
190
|
+
include the skill name, what was run, and expected vs. actual outcome.
|
|
191
|
+
- Or contact the design-system team owners directly through your organization's
|
|
192
|
+
professional messaging channels for assistance.
|