@adobe/design-data-spec 1.4.0 → 2.0.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.
- package/conformance/invalid/SPEC-009/expected-errors.json +1 -1
- package/conformance/invalid/SPEC-018/dataset.json +8 -1
- package/conformance/invalid/SPEC-034/expected-errors.json +1 -1
- package/conformance/invalid/SPEC-035/expected-errors.json +1 -1
- package/package.json +5 -6
- package/rules/rules.yaml +14 -10
- package/schemas/component.schema.json +1 -1
- package/schemas/manifest.schema.json +1 -22
- package/schemas/platform-extension.json +79 -0
- package/schemas/registry-value.json +230 -0
- package/schemas/token.schema.json +1 -1
- package/spec/agent-surface.md +16 -14
- package/spec/anatomy-format.md +1 -1
- package/spec/cascade.md +1 -1
- package/spec/index.md +5 -5
- package/spec/mode-sets.md +1 -1
- package/spec/registry.md +6 -8
- package/spec/taxonomy.md +96 -30
- package/spec/token-format.md +11 -3
- package/components/accordion.json +0 -557
- package/components/action-bar.json +0 -214
- package/components/action-button.json +0 -522
- package/components/action-group.json +0 -134
- package/components/alert-banner.json +0 -134
- package/components/alert-dialog.json +0 -180
- package/components/avatar-group.json +0 -166
- package/components/avatar.json +0 -246
- package/components/badge.json +0 -594
- package/components/body.json +0 -54
- package/components/bottom-navigation-android.json +0 -72
- package/components/breadcrumbs.json +0 -307
- package/components/button-group.json +0 -86
- package/components/button.json +0 -586
- package/components/calendar.json +0 -133
- package/components/cards.json +0 -541
- package/components/checkbox-group.json +0 -91
- package/components/checkbox.json +0 -339
- package/components/close-button.json +0 -208
- package/components/coach-indicator.json +0 -105
- package/components/coach-mark.json +0 -169
- package/components/code.json +0 -44
- package/components/color-area.json +0 -138
- package/components/color-handle.json +0 -111
- package/components/color-loupe.json +0 -77
- package/components/color-slider.json +0 -165
- package/components/color-wheel.json +0 -117
- package/components/combo-box.json +0 -543
- package/components/contextual-help.json +0 -230
- package/components/date-picker.json +0 -471
- package/components/detail.json +0 -53
- package/components/divider.json +0 -93
- package/components/drop-zone.json +0 -238
- package/components/field-label.json +0 -219
- package/components/heading.json +0 -68
- package/components/help-text.json +0 -209
- package/components/illustrated-message.json +0 -175
- package/components/in-field-progress-button.json +0 -88
- package/components/in-field-progress-circle.json +0 -116
- package/components/in-line-alert.json +0 -233
- package/components/link.json +0 -167
- package/components/list-view.json +0 -382
- package/components/menu.json +0 -597
- package/components/meter.json +0 -199
- package/components/number-field.json +0 -518
- package/components/opacity-checkerboard.json +0 -69
- package/components/picker.json +0 -579
- package/components/popover.json +0 -174
- package/components/progress-bar.json +0 -229
- package/components/progress-circle.json +0 -132
- package/components/radio-button.json +0 -308
- package/components/radio-group.json +0 -113
- package/components/rating.json +0 -168
- package/components/scroll-zoom-bar.json +0 -82
- package/components/search-field.json +0 -346
- package/components/segmented-control.json +0 -248
- package/components/select-box.json +0 -272
- package/components/side-navigation.json +0 -320
- package/components/slider.json +0 -407
- package/components/standard-dialog.json +0 -179
- package/components/standard-panel.json +0 -83
- package/components/status-light.json +0 -334
- package/components/steplist.json +0 -294
- package/components/swatch-group.json +0 -114
- package/components/swatch.json +0 -240
- package/components/switch.json +0 -336
- package/components/tab-bar-ios.json +0 -72
- package/components/table.json +0 -435
- package/components/tabs.json +0 -253
- package/components/tag-field.json +0 -243
- package/components/tag-group.json +0 -87
- package/components/tag.json +0 -393
- package/components/takeover-dialog.json +0 -117
- package/components/text-area.json +0 -555
- package/components/text-field.json +0 -555
- package/components/thumbnail.json +0 -149
- package/components/title.json +0 -91
- package/components/toast.json +0 -156
- package/components/tooltip.json +0 -179
- package/components/tray.json +0 -32
- package/components/tree-view.json +0 -393
- package/fields/anatomy.json +0 -15
- package/fields/color-scheme.json +0 -15
- package/fields/colorFamily.json +0 -15
- package/fields/component.json +0 -15
- package/fields/contrast.json +0 -15
- package/fields/density.json +0 -15
- package/fields/easing.json +0 -15
- package/fields/family.json +0 -15
- package/fields/motionRole.json +0 -15
- package/fields/object.json +0 -15
- package/fields/orientation.json +0 -15
- package/fields/position.json +0 -15
- package/fields/property.json +0 -15
- package/fields/scale.json +0 -15
- package/fields/scaleIndex.json +0 -15
- package/fields/shape.json +0 -15
- package/fields/size.json +0 -15
- package/fields/state.json +0 -15
- package/fields/structure.json +0 -15
- package/fields/style.json +0 -15
- package/fields/substructure.json +0 -15
- package/fields/variant.json +0 -15
- package/fields/weight.json +0 -15
|
@@ -5,5 +5,12 @@
|
|
|
5
5
|
"value": "#ff0000"
|
|
6
6
|
}
|
|
7
7
|
],
|
|
8
|
-
"components": [
|
|
8
|
+
"components": [
|
|
9
|
+
{
|
|
10
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/components/button.json",
|
|
11
|
+
"name": "button",
|
|
12
|
+
"displayName": "Button",
|
|
13
|
+
"meta": { "category": "actions" }
|
|
14
|
+
}
|
|
15
|
+
]
|
|
9
16
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/design-data-spec",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Design Data Specification — prose, JSON Schemas, rule catalog, and conformance fixtures for
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Design Data Specification — prose, JSON Schemas, rule catalog, and conformance fixtures for the design data format",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
"./package.json": "./package.json",
|
|
23
|
-
"./components/*.json": "./components/*.json",
|
|
24
23
|
"./schemas/token.schema.json": "./schemas/token.schema.json",
|
|
25
24
|
"./schemas/mode-set.schema.json": "./schemas/mode-set.schema.json",
|
|
26
25
|
"./schemas/field.schema.json": "./schemas/field.schema.json",
|
|
@@ -29,12 +28,12 @@
|
|
|
29
28
|
"./schemas/component.schema.json": "./schemas/component.schema.json",
|
|
30
29
|
"./schemas/anatomy-part.schema.json": "./schemas/anatomy-part.schema.json",
|
|
31
30
|
"./schemas/state-declaration.schema.json": "./schemas/state-declaration.schema.json",
|
|
32
|
-
"./rules/rules.yaml": "./rules/rules.yaml"
|
|
31
|
+
"./rules/rules.yaml": "./rules/rules.yaml",
|
|
32
|
+
"./schemas/registry-value.json": "./schemas/registry-value.json",
|
|
33
|
+
"./schemas/platform-extension.json": "./schemas/platform-extension.json"
|
|
33
34
|
},
|
|
34
35
|
"files": [
|
|
35
|
-
"components",
|
|
36
36
|
"conformance",
|
|
37
|
-
"fields",
|
|
38
37
|
"rules",
|
|
39
38
|
"schemas",
|
|
40
39
|
"spec",
|
package/rules/rules.yaml
CHANGED
|
@@ -78,8 +78,8 @@ rules:
|
|
|
78
78
|
name: name-field-enum-sync
|
|
79
79
|
severity: warning
|
|
80
80
|
category: naming-consistency
|
|
81
|
-
assert: Recognized name object fields (component, state, variant, etc.) SHOULD use values drawn from the corresponding design-
|
|
82
|
-
message: "Token name field '{field}' value '{value}' is not in the design-
|
|
81
|
+
assert: Recognized name object fields (component, state, variant, etc.) SHOULD use values drawn from the corresponding spectrum-design-data registry when those enums are available.
|
|
82
|
+
message: "Token name field '{field}' value '{value}' is not in the spectrum-design-data registry for '{field}'"
|
|
83
83
|
spec_ref: spec/token-format.md#name-object
|
|
84
84
|
introduced_in: "1.0.0-draft"
|
|
85
85
|
|
|
@@ -161,6 +161,7 @@ rules:
|
|
|
161
161
|
category: reference-integrity
|
|
162
162
|
assert: Token name-object 'component' field value MUST match the 'name' of a declared component in the dataset.
|
|
163
163
|
message: "Token '{token}' references undeclared component '{component}'"
|
|
164
|
+
note: "Skipped when no component catalog is loaded (empty components list). Token-only validation runs that omit component declarations will not trigger this rule."
|
|
164
165
|
spec_ref: spec/component-format.md#name
|
|
165
166
|
introduced_in: "1.0.0-draft"
|
|
166
167
|
|
|
@@ -327,9 +328,9 @@ rules:
|
|
|
327
328
|
category: naming-consistency
|
|
328
329
|
assert: >
|
|
329
330
|
A component's meta.category SHOULD reference an id from the categories registry in
|
|
330
|
-
@adobe/design-
|
|
331
|
+
@adobe/spectrum-design-data registry/categories.json. Unknown values are reported as
|
|
331
332
|
warnings; the registry is the authoritative vocabulary.
|
|
332
|
-
message: "Component '{entity}' meta.category value '{value}' is not in the design-
|
|
333
|
+
message: "Component '{entity}' meta.category value '{value}' is not in the spectrum-design-data registry/categories vocabulary"
|
|
333
334
|
spec_ref: spec/registry.md#categories
|
|
334
335
|
introduced_in: "1.0.0-draft"
|
|
335
336
|
- id: SPEC-035
|
|
@@ -338,9 +339,9 @@ rules:
|
|
|
338
339
|
category: naming-consistency
|
|
339
340
|
assert: >
|
|
340
341
|
A component anatomy part's name SHOULD reference an id from the anatomy-terms registry in
|
|
341
|
-
@adobe/design-
|
|
342
|
+
@adobe/spectrum-design-data registry/anatomy-terms.json. Unknown values are reported as
|
|
342
343
|
warnings; custom names remain permitted but the registry is the authoritative vocabulary.
|
|
343
|
-
message: "Component '{entity}' anatomy part name '{value}' is not in the design-
|
|
344
|
+
message: "Component '{entity}' anatomy part name '{value}' is not in the spectrum-design-data registry/anatomy-terms vocabulary"
|
|
344
345
|
spec_ref: spec/anatomy-format.md#canonical-anatomy-vocabulary
|
|
345
346
|
introduced_in: "1.0.0-draft"
|
|
346
347
|
|
|
@@ -445,13 +446,16 @@ rules:
|
|
|
445
446
|
rfc: "#806"
|
|
446
447
|
assert: >
|
|
447
448
|
When a token's name object contains a domain-scoped field (e.g. `colorFamily`,
|
|
448
|
-
`weight`, `motionRole`), the token's
|
|
449
|
-
|
|
449
|
+
`weight`, `motionRole`), the token's effective domain schema MUST be compatible
|
|
450
|
+
with that field's scope. For alias tokens (`alias.json`), the rule follows the
|
|
451
|
+
`alias_target` chain to the terminal non-alias schema before checking domain
|
|
452
|
+
compatibility — a color alias may carry `colorFamily` when its target is a
|
|
453
|
+
color-domain token. Using a color-scoped field on a typography token, or a
|
|
450
454
|
typography-scoped field on a color token, is a taxonomy violation. The set of
|
|
451
455
|
domain-scoped fields and their valid schema URL suffixes is declared in the field
|
|
452
|
-
catalog under `packages/design-data
|
|
456
|
+
catalog under `packages/design-data/fields/` via the `scope` property.
|
|
453
457
|
Tokens without a `$schema` are skipped (domain cannot be determined).
|
|
454
|
-
message: "name.{field} is a {scope}-scoped field but token schema '{
|
|
458
|
+
message: "name.{field} is a {scope}-scoped field but token schema '{effective_schema}' is not a {scope} token type"
|
|
455
459
|
spec_ref: spec/taxonomy.md#token-type-taxonomies
|
|
456
460
|
introduced_in: "1.0.0-draft"
|
|
457
461
|
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"category": {
|
|
90
90
|
"type": "string",
|
|
91
91
|
"minLength": 1,
|
|
92
|
-
"description": "Category id from @adobe/design-
|
|
92
|
+
"description": "Category id from @adobe/spectrum-design-data registry/categories.json. Advisory validation via SPEC-034."
|
|
93
93
|
},
|
|
94
94
|
"documentationUrl": {
|
|
95
95
|
"type": "string",
|
|
@@ -94,28 +94,7 @@
|
|
|
94
94
|
"conceptOrder": {
|
|
95
95
|
"type": "array",
|
|
96
96
|
"items": {
|
|
97
|
-
"type": "string"
|
|
98
|
-
"enum": [
|
|
99
|
-
"variant",
|
|
100
|
-
"component",
|
|
101
|
-
"structure",
|
|
102
|
-
"substructure",
|
|
103
|
-
"anatomy",
|
|
104
|
-
"object",
|
|
105
|
-
"property",
|
|
106
|
-
"orientation",
|
|
107
|
-
"position",
|
|
108
|
-
"size",
|
|
109
|
-
"density",
|
|
110
|
-
"shape",
|
|
111
|
-
"state",
|
|
112
|
-
"colorFamily",
|
|
113
|
-
"family",
|
|
114
|
-
"weight",
|
|
115
|
-
"style",
|
|
116
|
-
"motionRole",
|
|
117
|
-
"easing"
|
|
118
|
-
]
|
|
97
|
+
"type": "string"
|
|
119
98
|
},
|
|
120
99
|
"uniqueItems": true,
|
|
121
100
|
"description": "Ordered list of field names for serialization. Values must match declared field names from the design system's field catalog (field.schema.json declarations). Replaces the default serialization.position order from each field declaration."
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/platform-extension.json",
|
|
4
|
+
"title": "Platform Extension",
|
|
5
|
+
"description": "Schema for platform-specific terminology extensions",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["platform", "extends", "extensions"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uri"
|
|
12
|
+
},
|
|
13
|
+
"platform": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "The platform this extension is for (e.g., iOS, Android, Web Components, Qt)"
|
|
16
|
+
},
|
|
17
|
+
"platformVersion": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Optional platform version or framework version"
|
|
20
|
+
},
|
|
21
|
+
"description": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Description of what this extension provides"
|
|
24
|
+
},
|
|
25
|
+
"extends": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Which registry this extends (sizes, states, variants, etc.)"
|
|
28
|
+
},
|
|
29
|
+
"extensions": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"description": "Array of term extensions",
|
|
32
|
+
"items": {
|
|
33
|
+
"$ref": "#/$defs/extension"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"$defs": {
|
|
38
|
+
"extension": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": ["termId"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"termId": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "The ID of the term being extended (must exist in the base registry)"
|
|
45
|
+
},
|
|
46
|
+
"platformTerm": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "Platform-specific term or name"
|
|
49
|
+
},
|
|
50
|
+
"platformAliases": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"description": "Platform-specific aliases",
|
|
53
|
+
"items": {
|
|
54
|
+
"type": "string"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"notes": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "Platform-specific implementation notes"
|
|
60
|
+
},
|
|
61
|
+
"reference": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "Platform documentation reference or API name"
|
|
64
|
+
},
|
|
65
|
+
"codeExample": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "Code example showing platform usage"
|
|
68
|
+
},
|
|
69
|
+
"differences": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"description": "Key differences from the base term",
|
|
72
|
+
"items": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
|
|
4
|
+
"title": "Registry Value",
|
|
5
|
+
"description": "Schema for design system registry value entries",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["type", "description", "values"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uri"
|
|
12
|
+
},
|
|
13
|
+
"type": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "The type of registry (size, state, variant, etc.)"
|
|
16
|
+
},
|
|
17
|
+
"description": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Description of what this registry contains"
|
|
20
|
+
},
|
|
21
|
+
"allowCustom": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"description": "Whether custom values are allowed beyond the registry"
|
|
24
|
+
},
|
|
25
|
+
"customPattern": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Regex pattern for validating custom values"
|
|
28
|
+
},
|
|
29
|
+
"values": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"description": "Array of registry values",
|
|
32
|
+
"items": {
|
|
33
|
+
"$ref": "#/$defs/value"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"$defs": {
|
|
38
|
+
"value": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": ["id", "label"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"id": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "Unique identifier for this value"
|
|
45
|
+
},
|
|
46
|
+
"label": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "Human-readable label"
|
|
49
|
+
},
|
|
50
|
+
"aliases": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"description": "Alternative names or spellings",
|
|
53
|
+
"items": {
|
|
54
|
+
"type": "string"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"description": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "Detailed description of this value"
|
|
60
|
+
},
|
|
61
|
+
"default": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"description": "Whether this is the default value"
|
|
64
|
+
},
|
|
65
|
+
"deprecated": {
|
|
66
|
+
"type": "boolean",
|
|
67
|
+
"description": "Whether this value is deprecated"
|
|
68
|
+
},
|
|
69
|
+
"usedIn": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"description": "Where this value is used (tokens, component-schemas, etc.)",
|
|
72
|
+
"items": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"category": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "Category or grouping for this value"
|
|
79
|
+
},
|
|
80
|
+
"value": {
|
|
81
|
+
"type": ["string", "number", "boolean"],
|
|
82
|
+
"description": "Actual value (if different from id)"
|
|
83
|
+
},
|
|
84
|
+
"documentationUrl": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"format": "uri",
|
|
87
|
+
"description": "URL to documentation"
|
|
88
|
+
},
|
|
89
|
+
"definition": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"description": "Structured definition following Spectrum naming methodology",
|
|
92
|
+
"properties": {
|
|
93
|
+
"superordinate": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"description": "The higher-level category or class this term belongs to"
|
|
96
|
+
},
|
|
97
|
+
"description": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"description": "Core definition explaining what it is and how it differs"
|
|
100
|
+
},
|
|
101
|
+
"essentialCharacteristics": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"description": "Key characteristics that distinguish this term",
|
|
104
|
+
"items": {
|
|
105
|
+
"type": "string"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"platforms": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"description": "Platform-specific terminology and notes",
|
|
113
|
+
"patternProperties": {
|
|
114
|
+
".*": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"properties": {
|
|
117
|
+
"term": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"description": "Platform-specific term or name"
|
|
120
|
+
},
|
|
121
|
+
"notes": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"description": "Platform-specific implementation notes"
|
|
124
|
+
},
|
|
125
|
+
"reference": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"description": "Platform documentation reference"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"terminology": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"description": "Terminology metadata and classification",
|
|
136
|
+
"properties": {
|
|
137
|
+
"conceptType": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"enum": ["word", "term", "name", "concept"],
|
|
140
|
+
"description": "Classification per Spectrum naming guide"
|
|
141
|
+
},
|
|
142
|
+
"namingRationale": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"description": "Why this name was chosen"
|
|
145
|
+
},
|
|
146
|
+
"alternatives": {
|
|
147
|
+
"type": "array",
|
|
148
|
+
"description": "Alternative terms considered but not used",
|
|
149
|
+
"items": {
|
|
150
|
+
"type": "string"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"sources": {
|
|
156
|
+
"type": "array",
|
|
157
|
+
"description": "References to source documentation",
|
|
158
|
+
"items": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"required": ["type"],
|
|
161
|
+
"properties": {
|
|
162
|
+
"type": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"enum": [
|
|
165
|
+
"wiki",
|
|
166
|
+
"industry-standard",
|
|
167
|
+
"platform-standard",
|
|
168
|
+
"internal-doc",
|
|
169
|
+
"research"
|
|
170
|
+
],
|
|
171
|
+
"description": "Type of source"
|
|
172
|
+
},
|
|
173
|
+
"url": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"format": "uri",
|
|
176
|
+
"description": "URL to source"
|
|
177
|
+
},
|
|
178
|
+
"reference": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"description": "Text reference or citation"
|
|
181
|
+
},
|
|
182
|
+
"date": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"format": "date",
|
|
185
|
+
"description": "Date of source or last update"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"governance": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"description": "Governance and ownership metadata",
|
|
193
|
+
"properties": {
|
|
194
|
+
"owner": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"description": "Team or person responsible for this term"
|
|
197
|
+
},
|
|
198
|
+
"reviewDate": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"format": "date",
|
|
201
|
+
"description": "Last review date"
|
|
202
|
+
},
|
|
203
|
+
"nextReviewDate": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"format": "date",
|
|
206
|
+
"description": "Scheduled next review date"
|
|
207
|
+
},
|
|
208
|
+
"status": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"enum": ["draft", "review", "approved", "deprecated"],
|
|
211
|
+
"description": "Current status of this term"
|
|
212
|
+
},
|
|
213
|
+
"replacedBy": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"description": "If deprecated, the term that replaces this one"
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"relatedTerms": {
|
|
220
|
+
"type": "array",
|
|
221
|
+
"description": "Related or cross-referenced terms",
|
|
222
|
+
"items": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"description": "ID of related term"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
"$ref": {
|
|
219
219
|
"type": "string",
|
|
220
220
|
"minLength": 1,
|
|
221
|
-
"description": "Alias target
|
|
221
|
+
"description": "Alias target. In cascade format: the target token's UUID (canonical, rename-proof, resolved via uuid_index — Layer 2). In the legacy transition format: the target's kebab-case name slug."
|
|
222
222
|
},
|
|
223
223
|
"uuid": {
|
|
224
224
|
"type": "string",
|
package/spec/agent-surface.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent-readable surface
|
|
2
2
|
|
|
3
3
|
**Spec version:** `1.0.0-draft` (see [Overview](index.md))\
|
|
4
|
-
**Status:**
|
|
4
|
+
**Status:** Implemented — RFC-C / Phase 8 (epic [#830](https://github.com/adobe/spectrum-design-data/issues/830)). Core read/validate/write surface shipped. `write_component` and `explain` deferred (no CLI subcommand or MCP tool yet).
|
|
5
5
|
|
|
6
6
|
This document defines the **agent-readable surface**: the contract an external AI agent uses to consume design data conformant with this specification. It standardizes a small set of operations exposed through three transports — a CLI, a Model Context Protocol (MCP) server, and a Claude Code Agent Skill — all backed by the same resolver, validator, and query implementations that power the rest of the SDK.
|
|
7
7
|
|
|
@@ -25,19 +25,19 @@ The surface targets three consumer shapes:
|
|
|
25
25
|
|
|
26
26
|
**NORMATIVE:** A conforming implementation MUST expose the following operations. Transport-specific naming (CLI subcommand vs MCP tool name vs skill action) MAY differ; the semantics MUST NOT.
|
|
27
27
|
|
|
28
|
-
| Operation | Reads | Returns | Backed by
|
|
29
|
-
| -------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
30
|
-
| `resolve_token` | property + mode set context | winning token (literal or resolved alias) with file/UUID/specificity | `cascade::resolve`
|
|
31
|
-
| `query_tokens` | filter expression (see [Query](query.md)) | matching token list | `query::filter`
|
|
32
|
-
| `validate_usage` | candidate token document or fragment | `ValidationReport` (Layer 1 + Layer 2 diagnostics) | `validate::validate_*`
|
|
33
|
-
| `describe_component` | component identifier | component contract (anatomy, options, states, tokenBindings); see [#832](https://github.com/adobe/spectrum-design-data/discussions/832) and [Phase 6.7](#describe_component-return-shape) | (Phase 6 contract)
|
|
34
|
-
| `suggest_token` | natural-language intent + optional property hint | ranked candidate tokens with rationale (RECOMMENDED, not NORMATIVE in v1) | registry + query
|
|
35
|
-
| `get_guidance` | token UUID, component identifier, or anatomy reference | attached document blocks (Phase 9 / RFC-D); falls back to empty list pre-RFC-D | document blocks
|
|
36
|
-
| `diff_datasets` | two dataset roots | `DiffReport` per [Diff](diff.md) | `diff::semantic_diff`
|
|
37
|
-
| `write_token` | token object + optional rationale string | updated product-layer token file + `product-context.json` (RECOMMENDED, not NORMATIVE in v1) | `write::write_token` (
|
|
38
|
-
| `write_component` | component object + optional rationale string | updated product-layer component file + `product-context.json` (RECOMMENDED, not NORMATIVE in v1) | `write::write_component`
|
|
28
|
+
| Operation | Reads | Returns | Backed by |
|
|
29
|
+
| -------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| `resolve_token` | property + mode set context | winning token (literal or resolved alias) with file/UUID/specificity | `cascade::resolve` |
|
|
31
|
+
| `query_tokens` | filter expression (see [Query](query.md)) | matching token list | `query::filter` |
|
|
32
|
+
| `validate_usage` | candidate token document or fragment | `ValidationReport` (Layer 1 + Layer 2 diagnostics) | `validate::validate_*` |
|
|
33
|
+
| `describe_component` | component identifier | component contract (anatomy, options, states, tokenBindings); see [#832](https://github.com/adobe/spectrum-design-data/discussions/832) and [Phase 6.7](#describe_component-return-shape) | (Phase 6 contract) |
|
|
34
|
+
| `suggest_token` | natural-language intent + optional property hint | ranked candidate tokens with rationale (RECOMMENDED, not NORMATIVE in v1) | registry + query |
|
|
35
|
+
| `get_guidance` | token UUID, component identifier, or anatomy reference | attached document blocks (Phase 9 / RFC-D); falls back to empty list pre-RFC-D | document blocks |
|
|
36
|
+
| `diff_datasets` | two dataset roots | `DiffReport` per [Diff](diff.md) | `diff::semantic_diff` |
|
|
37
|
+
| `write_token` | token object + optional rationale string | updated product-layer token file + `product-context.json` (RECOMMENDED, not NORMATIVE in v1) | `write::write_token` — shipped: `design-data write-token` (CLI) / `authoring_session_commit` (MCP) |
|
|
38
|
+
| `write_component` | component object + optional rationale string | updated product-layer component file + `product-context.json` (RECOMMENDED, not NORMATIVE in v1) | `write::write_component` — deferred; no CLI subcommand or MCP tool yet |
|
|
39
39
|
|
|
40
|
-
**NORMATIVE:** `validate_usage`, `resolve_token`, `query_tokens`, and `
|
|
40
|
+
**NORMATIVE:** `validate_usage`, `resolve_token`, `query_tokens`, `diff_datasets`, and `describe_component` MUST be implemented in a conforming agent surface. `suggest_token`, `get_guidance`, `write_token`, and `write_component` are RECOMMENDED.
|
|
41
41
|
|
|
42
42
|
**RECOMMENDED:** When `write_token` or `write_component` is invoked, the implementation SHOULD capture a `rationale` argument from the agent session context and record it in both the token's inline `rationale` field and the product context document's `overrides[].rationale` or `extensions.tokens[].rationale`. See [Product context — Agent capture behavior](product-context.md#agent-capture-behavior).
|
|
43
43
|
|
|
@@ -70,7 +70,7 @@ The reference CLI is `design-data` (see [`sdk/cli/`](../../../sdk/cli/)). RFC-C
|
|
|
70
70
|
|
|
71
71
|
* `design-data primer [PATH]` — emit the [Session primer](#session-primer) payload.
|
|
72
72
|
* `design-data suggest "<intent>" [--property <hint>]` — invoke `suggest_token`.
|
|
73
|
-
* `design-data explain <token-uuid|component-id>` — invoke `get_guidance`.
|
|
73
|
+
* `design-data explain <token-uuid|component-id>` — invoke `get_guidance`. (Deferred — not yet shipped; pending `get_guidance` wire-up.)
|
|
74
74
|
|
|
75
75
|
**NORMATIVE:** All RFC-C CLI output MUST default to JSON when stdout is not a TTY, and MUST emit human-friendly output when stdout is a TTY. This makes the CLI directly composable from agent shells without per-call format flags.
|
|
76
76
|
|
|
@@ -84,6 +84,8 @@ A reference MCP server is RECOMMENDED to ship as `@adobe/design-data-agent-mcp`
|
|
|
84
84
|
|
|
85
85
|
A reference Claude Code Agent Skill is RECOMMENDED at `tools/design-data-agent-mcp/skills/design-data/SKILL.md`. The skill SHOULD trigger on intent words covering all three [Goals](#goals) — for example "design system", "design tokens", "drift", "spec-conformant", and explicit Spectrum mentions when the active manifest binds Spectrum.
|
|
86
86
|
|
|
87
|
+
A separate Spectrum-oriented skill (embedded snapshot, zero config) lives at `tools/design-data-skill/skills/design-data/SKILL.md`. Install both via the `spectrum-design-data` Claude Code marketplace as `design-data-agent@spectrum-design-data` and `design-data@spectrum-design-data` respectively.
|
|
88
|
+
|
|
87
89
|
**RECOMMENDED:** The skill SHOULD shell out to the CLI rather than embedding tool calls, so its description (the only persistent context cost) stays small and the heavy lifting happens out-of-band.
|
|
88
90
|
|
|
89
91
|
## `describe_component` return shape
|
package/spec/anatomy-format.md
CHANGED
|
@@ -99,7 +99,7 @@ The following anatomy part names are defined by the cross-platform design audit
|
|
|
99
99
|
|
|
100
100
|
Custom part names are permitted. When a custom name is used, the anatomy part object **SHOULD** include a `description` field explaining its visual role (rule SPEC-023).
|
|
101
101
|
|
|
102
|
-
The table above is informative; the authoritative vocabulary is `@adobe/design-
|
|
102
|
+
The table above is informative; the authoritative vocabulary is `@adobe/spectrum-design-data/registry/anatomy-terms.json` (119 entries). SPEC-035 fires advisory warnings when a declared anatomy part `name` is not in that registry, pointing authors at the canonical list. Custom names remain valid — SPEC-035 is advisory, not an error.
|
|
103
103
|
|
|
104
104
|
## Cross-reference with token name objects
|
|
105
105
|
|
package/spec/cascade.md
CHANGED
|
@@ -55,7 +55,7 @@ Exact matching rules for omitted mode sets are defined alongside mode set declar
|
|
|
55
55
|
|
|
56
56
|
**NORMATIVE:** Alias (`$ref`) resolution **MUST** occur **after** cascade selection. The resolution algorithm selects the winning candidate using layer, specificity, and tie-breaking rules before any alias chain is followed.
|
|
57
57
|
|
|
58
|
-
**NORMATIVE:** If the winning candidate is an alias, its `$ref` chain **MUST** be resolved to a literal value using the standard alias-resolution rules (SPEC-001 through SPEC-003 in `rules/rules.yaml`). The alias target is resolved within the same dataset (i.e. the same merged layer stack), not relative to any single layer.
|
|
58
|
+
**NORMATIVE:** If the winning candidate is an alias, its `$ref` chain **MUST** be resolved to a literal value using the standard alias-resolution rules (SPEC-001 through SPEC-003 in `rules/rules.yaml`). The alias target is resolved within the same dataset (i.e. the same merged layer stack), not relative to any single layer. In cascade format, `$ref` holds the **UUID** of the target token (see [`token-format.md` §Alias](token-format.md#alias-ref)); resolution proceeds UUID-first, then direct graph key (legacy slug), then serialised name.
|
|
59
59
|
|
|
60
60
|
**RATIONALE:** Aliases participate in cascade as opaque references — their target values are not examined during specificity calculation or layer comparison. This keeps resolution deterministic and allows aliases to be valid candidates at any specificity level.
|
|
61
61
|
|
package/spec/index.md
CHANGED
|
@@ -93,11 +93,11 @@ Packaged copies in this repository live under `packages/design-data-spec/schemas
|
|
|
93
93
|
|
|
94
94
|
## Relationship to existing Adobe packages
|
|
95
95
|
|
|
96
|
-
| Package / area | Relationship
|
|
97
|
-
| --------------------------------------- |
|
|
98
|
-
| `@adobe/spectrum-tokens` | **Current** token JSON under `packages/tokens/` is the **legacy** shape (e.g. `color-set`, `scale-set`). This spec defines the **target** format; backward-compat schemas and migration are Phase 1 ([#723](https://github.com/adobe/spectrum-design-data/issues/723)).
|
|
99
|
-
| `@adobe/design-
|
|
100
|
-
| `@adobe/spectrum-component-api-schemas` | Will become a thin adapter over component declarations in `packages/design-data
|
|
96
|
+
| Package / area | Relationship |
|
|
97
|
+
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
98
|
+
| `@adobe/spectrum-tokens` | **Current** token JSON under `packages/tokens/` is the **legacy** shape (e.g. `color-set`, `scale-set`). This spec defines the **target** format; backward-compat schemas and migration are Phase 1 ([#723](https://github.com/adobe/spectrum-design-data/issues/723)). |
|
|
99
|
+
| `@adobe/spectrum-design-data` | Registry enums (under `registry/`) and component metadata MAY be referenced by validation rules (e.g. component association); exact coupling is Layer 2. |
|
|
100
|
+
| `@adobe/spectrum-component-api-schemas` | Will become a thin adapter over component declarations in `packages/design-data/components/` (Phase 6.5). Until migration, existing schemas remain authoritative. Cross-reference rules SPEC-018–SPEC-020 apply when component declarations are present in the dataset. |
|
|
101
101
|
|
|
102
102
|
## Umbrella discussions
|
|
103
103
|
|
package/spec/mode-sets.md
CHANGED
|
@@ -35,7 +35,7 @@ These mode sets are declared in the `mode-sets/` catalog (see [Mode Set catalog]
|
|
|
35
35
|
|
|
36
36
|
## Mode Set catalog
|
|
37
37
|
|
|
38
|
-
The Spectrum foundation publishes mode set declarations as JSON files under `packages/design-data
|
|
38
|
+
The Spectrum foundation publishes mode set declarations as JSON files under `packages/design-data/mode-sets/`. Each file conforms to [`mode-set.schema.json`](../schemas/mode-set.schema.json).
|
|
39
39
|
|
|
40
40
|
**NORMATIVE:** Tooling (validators, resolution engine) **MUST** load mode set declarations from the dataset's mode set catalog before performing specificity calculations or coverage validation.
|
|
41
41
|
|