@contentful/experience-design-system-generation 2.26.6-dev-build-ef7b167.0 → 2.26.6-dev-build-8dec003.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/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-generation",
|
|
3
|
-
"version": "2.26.6-dev-build-
|
|
3
|
+
"version": "2.26.6-dev-build-8dec003.0",
|
|
4
4
|
"description": "Agent-invocation and skill-prompt engine for the Contentful Experience Design System SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,6 +19,11 @@ export interface ClassifyPropCall {
|
|
|
19
19
|
/** Internal LLM rationale; not customer-facing. Persisted to raw_props.rationale. */
|
|
20
20
|
reason?: string;
|
|
21
21
|
}
|
|
22
|
+
export interface ExcludePropCall {
|
|
23
|
+
tool: 'exclude_prop';
|
|
24
|
+
prop: string;
|
|
25
|
+
reason: string;
|
|
26
|
+
}
|
|
22
27
|
export interface ClassifyComponentCall {
|
|
23
28
|
tool: 'classify_component';
|
|
24
29
|
description?: string;
|
|
@@ -42,7 +47,7 @@ export interface ClassifySlotCall {
|
|
|
42
47
|
/** Per-slot rationale; persisted to raw_slots.rationale. */
|
|
43
48
|
rationale?: string;
|
|
44
49
|
}
|
|
45
|
-
export type ToolCall = ClassifyPropCall | ClassifyComponentCall | ClassifySlotCall;
|
|
50
|
+
export type ToolCall = ClassifyPropCall | ExcludePropCall | ClassifyComponentCall | ClassifySlotCall;
|
|
46
51
|
export interface SelectComponentCall {
|
|
47
52
|
tool: 'select_component';
|
|
48
53
|
name: string;
|
package/dist/src/agent-runner.js
CHANGED
|
@@ -43,7 +43,7 @@ export function parseSelectToolCallLines(stdout) {
|
|
|
43
43
|
}
|
|
44
44
|
return { calls, warnings };
|
|
45
45
|
}
|
|
46
|
-
const VALID_TOOL_NAMES = new Set(['classify_prop', 'classify_component', 'classify_slot']);
|
|
46
|
+
const VALID_TOOL_NAMES = new Set(['classify_prop', 'exclude_prop', 'classify_component', 'classify_slot']);
|
|
47
47
|
const VALID_TOKEN_TOOL_NAMES = new Set(['set_token', 'set_group']);
|
|
48
48
|
const VALID_CDF_TYPES = new Set(['string', 'richtext', 'media', 'enum', 'token', 'boolean']);
|
|
49
49
|
const VALID_CATEGORIES = new Set(['content', 'design', 'state']);
|
|
@@ -104,6 +104,17 @@ export function parseToolCallLines(stdout) {
|
|
|
104
104
|
call.reason = rec.reason;
|
|
105
105
|
calls.push(call);
|
|
106
106
|
}
|
|
107
|
+
else if (tool === 'exclude_prop') {
|
|
108
|
+
if (typeof rec.prop !== 'string' || !rec.prop) {
|
|
109
|
+
warnings.push('exclude_prop missing prop name — skipped');
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
calls.push({
|
|
113
|
+
tool: 'exclude_prop',
|
|
114
|
+
prop: rec.prop,
|
|
115
|
+
reason: typeof rec.reason === 'string' ? rec.reason : '',
|
|
116
|
+
});
|
|
117
|
+
}
|
|
107
118
|
else if (tool === 'classify_component') {
|
|
108
119
|
const call = { tool: 'classify_component' };
|
|
109
120
|
if (typeof rec.description === 'string')
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { AGENT_NAMES, DEFAULT_AGENT_NAME, isAgentName } from './agent-names.js';
|
|
2
2
|
export type { AgentName } from './agent-names.js';
|
|
3
3
|
export { buildArgs, checkAgentAuth, describeAgentFailure, extractSentinelOutput, parseSelectToolCallLines, parseTokenToolCallLines, parseToolCallLines, resolveAgentModel, resolveBinary, runAgent, } from './agent-runner.js';
|
|
4
|
-
export type { AgentAuthStatus, AgentDebugEvent, AgentRunResult, ClassifyComponentCall, ClassifyPropCall, ClassifySlotCall, ParsedSelectToolCalls, ParsedTokenToolCalls, ParsedToolCalls, RejectComponentCall, SelectComponentCall, SelectToolCall, SetGroupCall, SetTokenCall, ToolCall, TokenToolCall, } from './agent-runner.js';
|
|
4
|
+
export type { AgentAuthStatus, AgentDebugEvent, AgentRunResult, ClassifyComponentCall, ClassifyPropCall, ClassifySlotCall, ExcludePropCall, ParsedSelectToolCalls, ParsedTokenToolCalls, ParsedToolCalls, RejectComponentCall, SelectComponentCall, SelectToolCall, SetGroupCall, SetTokenCall, ToolCall, TokenToolCall, } from './agent-runner.js';
|
|
5
5
|
export { createLocalCliAgentInvoker } from './agent-invoker.js';
|
|
6
6
|
export type { AgentInvoker, CreateLocalCliAgentInvokerOptions, InvokeAgentOptions } from './agent-invoker.js';
|
|
7
7
|
export { buildPrompt, formatCustomPromptBanner, resolveSkillPath } from './prompt-builder.js';
|
|
@@ -120,26 +120,28 @@ All input data is provided inline below — do not read any additional files.${i
|
|
|
120
120
|
|
|
121
121
|
Do NOT write any files or emit any JSON blobs. Instead, emit one JSON object per line to stdout for each classification decision. The CLI reads your stdout line by line and writes each decision directly to the pipeline database.
|
|
122
122
|
|
|
123
|
-
The
|
|
123
|
+
The four tool calls you may emit are:
|
|
124
124
|
|
|
125
125
|
\`\`\`
|
|
126
126
|
{"tool":"classify_component","description":"<optional component-level description>","rationale":{"description":"<why this component is classified the way it is>","props":"<why these props were chosen>","slots":"<why these slots were chosen>"}}
|
|
127
127
|
|
|
128
128
|
{"tool":"classify_prop","prop":"<propName>","cdf_type":"<type>","cdf_category":"<category>","required":<bool>,"description":"<short customer-facing description>","reason":"<full internal rationale; not customer-facing>","values":["a","b"],"token_kind":"color","default":"<value>"}
|
|
129
129
|
|
|
130
|
+
{"tool":"exclude_prop","prop":"<propName>","reason":"<why excluded>"}
|
|
131
|
+
|
|
130
132
|
{"tool":"classify_slot","slot":"<slotName>","required":<bool>,"allowed_components":["ComponentName"],"description":"<reason>","rationale":"<why this slot was kept in the catalog>"}
|
|
131
133
|
\`\`\`
|
|
132
134
|
|
|
133
135
|
Rules:
|
|
134
136
|
- Emit exactly one JSON object per line. No multi-line JSON. No markdown fences around the lines.
|
|
135
|
-
- Every prop in the input must have exactly one classify_prop
|
|
137
|
+
- Every prop in the input must have exactly one call: either classify_prop or exclude_prop.
|
|
136
138
|
- Every slot in the input must have exactly one classify_slot call.
|
|
137
139
|
- Valid cdf_type values: string, richtext, media, enum, token, boolean
|
|
138
140
|
- Valid cdf_category values: content, design, state
|
|
139
141
|
- For enum type, always include "values" (non-empty string array).
|
|
140
142
|
- For token type, always include "token_kind" (DTCG \$type, e.g. "color").
|
|
141
143
|
- href and URL props → cdf_type "string", cdf_category "content". Do NOT use cdf_type "link" — it is not valid.
|
|
142
|
-
- Framework internals (ref, event handlers, test IDs) →
|
|
144
|
+
- Framework internals (ref, event handlers, test IDs) → exclude_prop.
|
|
143
145
|
- CSS design props (className, style, styles, positional/geometric props: top, bottom, left, right, rotation, offset, etc.) → classify_prop, cdf_type: "string", cdf_category: "design".
|
|
144
146
|
- On classify_component, "rationale" fields are operator-facing (read-only) but may surface in customer-facing exports. The "rationale.description" field is subject to the description content rules in the skill prompt (no internal initiative names). "rationale.props" and "rationale.slots" describe your reasoning about scope; "classify_slot.rationale" explains why each slot was kept.
|
|
145
147
|
- On classify_prop, "reason" is REQUIRED and is the LLM's internal rationale — shown to the developer reviewing the import, never to end-users. "description" is the customer-facing copy and is subject to the description content rules in the skill prompt. Keep them distinct: "description" is short and customer-facing; "reason" explains your reasoning in detail.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-generation",
|
|
3
|
-
"version": "2.26.6-dev-build-
|
|
3
|
+
"version": "2.26.6-dev-build-8dec003.0",
|
|
4
4
|
"description": "Agent-invocation and skill-prompt engine for the Contentful Experience Design System SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"skills/"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@contentful/experience-design-system-types": "2.26.6-dev-build-
|
|
25
|
+
"@contentful/experience-design-system-types": "2.26.6-dev-build-8dec003.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@tsconfig/node24": "^24.0.4",
|
|
@@ -72,21 +72,21 @@ The CLI assembles your output into CDF (Component Definition Format), a JSON sch
|
|
|
72
72
|
|
|
73
73
|
Emit one JSON object per line. The CLI parses lines starting with `{`. Lines not starting with `{` are treated as prose and ignored by the parser — use them freely for reasoning.
|
|
74
74
|
|
|
75
|
-
**
|
|
75
|
+
**Four tool calls:**
|
|
76
76
|
|
|
77
77
|
```
|
|
78
|
-
{"tool":"classify_component","description":"<required: one-sentence description of the component>","rationale":{"description":"<why this component is classified this way>","props":"<why these props were
|
|
78
|
+
{"tool":"classify_component","description":"<required: one-sentence description of the component>","rationale":{"description":"<why this component is classified this way>","props":"<why these props were chosen / excluded>","slots":"<why these slots were chosen / excluded>"}}
|
|
79
79
|
|
|
80
80
|
{"tool":"classify_prop","prop":"<propName>","cdf_type":"<type>","cdf_category":"<category>","required":<bool>,"description":"<short customer-facing description>","reason":"<full internal rationale; not customer-facing>","values":["a","b"],"token_kind":"color","default":"<value>"}
|
|
81
81
|
|
|
82
|
+
{"tool":"exclude_prop","prop":"<propName>","reason":"<why excluded>"}
|
|
83
|
+
|
|
82
84
|
{"tool":"classify_slot","slot":"<slotName>","required":<bool>,"allowed_components":["ComponentName"],"description":"<short customer-facing description>","rationale":"<why this slot was kept / its role>"}
|
|
83
85
|
```
|
|
84
86
|
|
|
85
|
-
Every prop — including framework internals, DOM/accessibility pass-through, and props with no clean flat representation — must produce a `classify_prop` call. Props that are not marketer-configurable are classified with `cdf_category: "state"`: they still ship in the CDF (visible in review, editable if someone wants to override the category), but stay unattached from the content/design editing surfaces by default. See "Valid cdf_category values" below for exactly what falls into `state`.
|
|
86
|
-
|
|
87
87
|
**Rules:**
|
|
88
88
|
- Emit exactly one JSON object per line. No multi-line JSON.
|
|
89
|
-
- Every prop in the input must produce exactly one
|
|
89
|
+
- Every prop in the input must produce exactly one call: `classify_prop` OR `exclude_prop`.
|
|
90
90
|
- Every slot must produce exactly one `classify_slot` call.
|
|
91
91
|
- Emit `classify_component` once at the start (required). The `description` field is **required** — always provide a brief description of the component's purpose.
|
|
92
92
|
- `values` is required for `cdf_type: "enum"` — must be a non-empty string array.
|
|
@@ -135,7 +135,7 @@ Exactly **6** valid types:
|
|
|
135
135
|
|---|---|
|
|
136
136
|
| `content` | Data the component *displays* — what a copywriter or editor fills in: text, labels, headings, body copy, rich text, images, media, URLs, link targets, counts, locale |
|
|
137
137
|
| `design` | Values that control *how the component looks* — what a designer sets: color, size (sm/md/lg), variant (primary/secondary/ghost), layout orientation, alignment, background, visual toggles (imageOnLeft, enableEffect), design tokens |
|
|
138
|
-
| `state` |
|
|
138
|
+
| `state` | Runtime behavioral or interactive flags — not visible in the editor's design or content panel: disabled, loading, expanded, isOpen, isSearchVisible, preview, identifiers used for analytics/tracking (componentId, sectionKey, componentName) |
|
|
139
139
|
|
|
140
140
|
The pre-classified `category` in the raw input is a starting point — correct it when it is wrong. Contentful uses this category to decide where the property appears in the editor UI, so accuracy matters.
|
|
141
141
|
|
|
@@ -145,21 +145,21 @@ The pre-classified `category` in the raw input is a starting point — correct i
|
|
|
145
145
|
|
|
146
146
|
For each `RawPropDefinition`, apply in order:
|
|
147
147
|
|
|
148
|
-
1. **Framework / DOM / accessibility pass-through?** → `
|
|
148
|
+
1. **Framework / DOM / accessibility pass-through?** → `exclude_prop`. These are escape hatches for developers, not configurable surfaces for marketers. Exposing them in the ExO editor adds noise that obscures the props that actually carry intent. Always exclude:
|
|
149
149
|
- Framework internals: `ref`, `innerRef`, event handlers (any `onSomething`), `testId`, `data-testid`, `key`
|
|
150
150
|
- DOM pass-through: `className`, `class`, `classes`, `classNames`, `rootClassName`, `prefixCls`, `style`, `styles`, `id`, `role`, `tabIndex`, `htmlFor`, `for`, `slot`, `is`, `lang`, `dir`, `hidden`, `draggable`, `spellCheck`, `contentEditable`, `inputMode`, `autoComplete`, `autoFocus`, `translate`, `part`, `exportparts`
|
|
151
151
|
- Accessibility pass-through: any `aria-*` or `ariaSomething` prop (including bare `aria` as an aria-attributes object), `aria-label`, `aria-hidden`, `aria-describedby`, `aria-controls`
|
|
152
152
|
- Data attributes: any `data-*` prop
|
|
153
153
|
- **Polymorphic component props**: `as`, `element`, `component` (when typed as an HTML tag string or component reference) — these change rendered HTML, not marketer-visible behavior
|
|
154
154
|
- **Framework theming / pass-through escape hatches**: PrimeVue's `dt` / `pt` / `ptOptions` / `unstyled`, MUI/Chakra-style `sx`, anything explicitly typed as a developer "override" / "passthrough" object
|
|
155
|
-
- **Important caveat**: only
|
|
156
|
-
2. **Common semantic props — classify
|
|
155
|
+
- **Important caveat**: only exclude when the prop is one of these *as the bare HTML attribute or framework-internal pass-through*. Compound names like `fileName`, `displayName`, `dataset`, `dataSource`, `roleDescription`, `idLabel` are not pass-through — classify them normally.
|
|
156
|
+
2. **Common semantic props — DO classify, do not exclude.** The LLM has been over-excluding these because they sound like framework internals; they are not. Classify each per the rest of this tree:
|
|
157
157
|
- `icon` / `leftIcon` / `rightIcon` / `prefixIcon` / `suffixIcon` — slot or `string` (icon name); see slot guidance below
|
|
158
|
-
- `items` / `options` / `actions` / `links` — usually array content; if the element shape is simple, classify as `string` (comma-separated names/IDs) and note in `description`. Only
|
|
159
|
-
- `value` (the bare prop, not `modelValue`) — content prop, usually `string` (or `enum` if from a fixed set). Note: Vue's `modelValue` / `modelModifiers` are
|
|
158
|
+
- `items` / `options` / `actions` / `links` — usually array content; if the element shape is simple, classify as `string` (comma-separated names/IDs) and note in `description`. Only exclude when elements are deep nested objects with no flat representation.
|
|
159
|
+
- `value` (the bare prop, not `modelValue`) — content prop, usually `string` (or `enum` if from a fixed set). Note: Vue's `modelValue` / `modelModifiers` are excluded by pre-classify because they're v-model framework wiring.
|
|
160
160
|
- `name` — content prop, usually `string`. Treat it as semantic component data, not as a DOM pass-through.
|
|
161
161
|
- `form` (when not the literal `<form>` HTML attribute) — typically content; classify as `string` unless it's a complex form-config object
|
|
162
|
-
- `inputId` / `componentId` — these CAN be content (anchor IDs, marketer-set tracking refs). Classify as `string`, `cdf_category: "content"` when the type is a plain string. Only
|
|
162
|
+
- `inputId` / `componentId` — these CAN be content (anchor IDs, marketer-set tracking refs). Classify as `string`, `cdf_category: "content"` when the type is a plain string. Only exclude if the prop is clearly internal (e.g. typed as a generated React ID).
|
|
163
163
|
- `accessibleNameRef` / `accessibleDescriptionRef` (web components) — these are ID references for a11y wiring; classify as `string`, `cdf_category: "state"` (behavioral wiring, not design or content).
|
|
164
164
|
- `eventDetails` / similar telemetry props — `cdf_category: "state"`.
|
|
165
165
|
3. **Positional/geometric design prop?** (`top`, `bottom`, `left`, `right`, `rotation`, `offset`, `zIndex`) → `classify_prop`, `cdf_type: "string"`, `cdf_category: "design"`.
|
|
@@ -169,13 +169,13 @@ For each `RawPropDefinition`, apply in order:
|
|
|
169
169
|
7. **Raw type is `string` / `number` / `boolean`?** → For `boolean`, use `cdf_type: "boolean"` with `default: true` or `false` (native boolean). For `number`, use `cdf_type: "string"` with `default` as the numeric value as a string (e.g. `"0"`). For `string`, use `cdf_type: "string"`.
|
|
170
170
|
8. **Media/image type** (`ImageProps`, `MediaSource`, asset types)? → `cdf_type: "media"`.
|
|
171
171
|
9. **Rich text / markup** (`ReactNode` used as content, HTML string)? → `cdf_type: "richtext"`.
|
|
172
|
-
10. **Complex type — resolve before
|
|
172
|
+
10. **Complex type — resolve before excluding** (see below).
|
|
173
173
|
|
|
174
174
|
---
|
|
175
175
|
|
|
176
|
-
## Resolving complex types — do not
|
|
176
|
+
## Resolving complex types — do not exclude without reasoning
|
|
177
177
|
|
|
178
|
-
A prop with a complex TypeScript type is **not automatically
|
|
178
|
+
A prop with a complex TypeScript type is **not automatically excluded**. Many props that appear complex carry real marketer-configurable information. Before excluding, ask: *"Could a marketer set this value in Contentful?"* If yes, classify it.
|
|
179
179
|
|
|
180
180
|
**Common resolvable patterns:**
|
|
181
181
|
|
|
@@ -184,25 +184,25 @@ A prop with a complex TypeScript type is **not automatically unattached**. Many
|
|
|
184
184
|
| `'primary' \| 'secondary' \| 'ghost'` (union of literals) | → `enum`, extract `values` |
|
|
185
185
|
| `HeadingSize` / `ButtonVariant` / any named type that is clearly a finite set of visual options | → `enum`, infer likely values from the prop name and context (e.g. `['sm', 'md', 'lg']` for size, `['primary', 'secondary']` for variant). Document your inference in `description`. |
|
|
186
186
|
| `Variant` / `variant` prop | Usually a visual design variant. → `enum`, `cdf_category: "design"`. Infer values from context. |
|
|
187
|
-
| `Section[]` / array of custom items where the structure is unclear | → `
|
|
188
|
-
| `ExperienceConfiguration<Variant>` / deep generic | Personalization config — → `
|
|
189
|
-
| `React.Dispatch<...>` / setter | State setter — → `
|
|
190
|
-
| `React.RefObject<...>` / `ref` | → `
|
|
191
|
-
| `() => void` / callback | → `
|
|
187
|
+
| `Section[]` / array of custom items where the structure is unclear | → `exclude_prop` only if the array elements are complex objects with no obvious flat representation. If items are simple (title, label, id), consider representing as `string` (a comma-separated IDs or keys) or note in `description` why. |
|
|
188
|
+
| `ExperienceConfiguration<Variant>` / deep generic | Personalization config — → `exclude_prop`, reason: `"personalization configuration — framework internal"` |
|
|
189
|
+
| `React.Dispatch<...>` / setter | State setter — → `exclude_prop`, reason: `"React state setter — framework internal"` |
|
|
190
|
+
| `React.RefObject<...>` / `ref` | → `exclude_prop`, reason: `"ref — framework internal"` |
|
|
191
|
+
| `() => void` / callback | → `exclude_prop`, reason: `"callback function — framework internal"` |
|
|
192
192
|
| `ReactNode` used as a slot-like prop (children, `icon`, `footer`) | → classify as a `slot` if it represents an injectable area, or `richtext` if it is inline markup content |
|
|
193
193
|
| `boolean` with a name like `hideChevron`, `imageOnLeft`, `enableBackgroundColorEffect` | → `boolean`, `cdf_category: "design"`, `default: true` or `false` — these control visual appearance |
|
|
194
194
|
| `boolean` with a name like `preview`, `hideContentForPersonalization` | → `boolean`, `cdf_category: "state"`, `default: false` — these control behavior |
|
|
195
195
|
| `string` used as a `componentId`, `sectionKey`, `componentName` | → `string`, `cdf_category: "state"` — these are identifiers for tracking/lookup |
|
|
196
196
|
| `string` locale (e.g. `locale: string`) | → `string`, `cdf_category: "state"` — locale is a behavioral/routing value |
|
|
197
197
|
|
|
198
|
-
**When to
|
|
198
|
+
**When to finally exclude:**
|
|
199
199
|
- The type is a callback signature or event handler
|
|
200
200
|
- The type is a React ref
|
|
201
201
|
- The type is a React state setter (`Dispatch`)
|
|
202
202
|
- The type is a deep generic used for personalization/A-B testing platform config (e.g. `ExperienceConfiguration<T>`)
|
|
203
203
|
- The type is an array of rich objects where no flat representation makes sense for a marketer
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
If you exclude a prop that could have been classified, the marketer loses the ability to configure it in Contentful. Prefer classifying with a reasonable inference over excluding.
|
|
206
206
|
|
|
207
207
|
---
|
|
208
208
|
|
|
@@ -228,8 +228,8 @@ Rules for nested objects:
|
|
|
228
228
|
- Flatten to max depth 2 (e.g., `item_nested_deep` is acceptable, deeper is not)
|
|
229
229
|
- Each leaf field gets its own classify_prop call with underscore-joined name
|
|
230
230
|
- Apply the same classification rules as top-level props
|
|
231
|
-
- If the object has > 10 fields, classify the most important 10
|
|
232
|
-
- If the object type cannot be resolved (opaque generic, imported interface without visible fields),
|
|
231
|
+
- If the object has > 10 fields, classify the most important 10 and exclude the rest
|
|
232
|
+
- If the object type cannot be resolved (opaque generic, imported interface without visible fields), exclude the parent prop with reason "opaque nested type"
|
|
233
233
|
|
|
234
234
|
---
|
|
235
235
|
|
|
@@ -307,17 +307,17 @@ Input:
|
|
|
307
307
|
Output:
|
|
308
308
|
```
|
|
309
309
|
Starting Button classification — 5 props, 1 slot
|
|
310
|
-
{"tool":"classify_component","description":"Primary action button with variant and state support","rationale":{"description":"Button is an atom — a single interactive control that triggers an action. It carries a label, a small set of visual variants, and a disabled flag, which is the minimal surface a marketer needs to configure a call-to-action.","props":"Kept label (content), variant (enum, design), disabled (boolean, state), and className (string, design escape hatch).
|
|
310
|
+
{"tool":"classify_component","description":"Primary action button with variant and state support","rationale":{"description":"Button is an atom — a single interactive control that triggers an action. It carries a label, a small set of visual variants, and a disabled flag, which is the minimal surface a marketer needs to configure a call-to-action.","props":"Kept label (content), variant (enum, design), disabled (boolean, state), and className (string, design escape hatch). Excluded onClick because it is an event handler — framework-internal and not configurable in Contentful.","slots":"Kept the icon slot as optional because the button renders correctly without it and the icon is purely decorative."}}
|
|
311
311
|
label is a required string content prop
|
|
312
312
|
{"tool":"classify_prop","prop":"label","cdf_type":"string","cdf_category":"content","required":true,"description":"Button label text"}
|
|
313
313
|
variant is a string union — enum type, category design
|
|
314
314
|
{"tool":"classify_prop","prop":"variant","cdf_type":"enum","cdf_category":"design","required":false,"values":["primary","secondary","ghost"],"default":"primary","description":"Visual variant"}
|
|
315
315
|
disabled is a boolean state prop — raw category says design, correcting to state
|
|
316
316
|
{"tool":"classify_prop","prop":"disabled","cdf_type":"boolean","cdf_category":"state","required":false,"default":false,"description":"Disables the button"}
|
|
317
|
-
onClick is an event handler — framework internal
|
|
318
|
-
{"tool":"
|
|
317
|
+
onClick is an event handler — framework internal
|
|
318
|
+
{"tool":"exclude_prop","prop":"onClick","reason":"event handler — framework internal"}
|
|
319
319
|
className is a DOM pass-through — developers wire CSS, marketers never set this
|
|
320
|
-
{"tool":"
|
|
320
|
+
{"tool":"exclude_prop","prop":"className","reason":"DOM pass-through — not a marketer-configurable surface"}
|
|
321
321
|
icon slot is clearly optional (decorative leading icon)
|
|
322
322
|
{"tool":"classify_slot","slot":"icon","required":false,"description":"Optional leading icon","rationale":"Icon is a decorative leading glyph — optional because the button reads cleanly without it, but kept as a slot so marketers can inject a brand-specific icon component when desired."}
|
|
323
323
|
```
|
|
@@ -381,8 +381,8 @@ href is a URL string — cdf_type string (not link), category content
|
|
|
381
381
|
|
|
382
382
|
## Edge cases
|
|
383
383
|
|
|
384
|
-
- **Prop with unresolvable type** (generics, intersection, callback) → `
|
|
385
|
-
- **Component with zero
|
|
384
|
+
- **Prop with unresolvable type** (generics, intersection, callback) → `exclude_prop` with reason `"complex type — not representable in CDF"`.
|
|
385
|
+
- **Component with zero classified props after exclusions** → still emit `classify_component`. The DB entry will have an empty `$properties` object.
|
|
386
386
|
- **tokenReference present but not in sidecar** → `cdf_type: "token"`, omit `token_kind`, add `description` warning.
|
|
387
387
|
- **Slot not in DB** → skipped with a warning; does not abort the run.
|
|
388
388
|
- **Prop not in DB** → skipped with a warning; does not abort the run.
|
|
@@ -391,14 +391,14 @@ href is a URL string — cdf_type string (not link), category content
|
|
|
391
391
|
|
|
392
392
|
Before emitting any tool calls, verify:
|
|
393
393
|
|
|
394
|
-
1. Every prop in the input has exactly one `classify_prop` call
|
|
394
|
+
1. Every prop in the input has exactly one `classify_prop` or `exclude_prop` call
|
|
395
395
|
2. Every slot has exactly one `classify_slot` call
|
|
396
396
|
3. `classify_component` is emitted exactly once
|
|
397
397
|
4. Every `cdf_type: "enum"` has a non-empty `values` array
|
|
398
398
|
5. Every `cdf_type: "token"` has `token_kind` (or a warning in `description` if lookup failed)
|
|
399
399
|
6. No `cdf_type: "link"` — all href/url props use `string`
|
|
400
400
|
7. `required` values are JSON booleans, not strings
|
|
401
|
-
8. Framework, DOM, accessibility, and data-* pass-through props are
|
|
401
|
+
8. Framework, DOM, accessibility, and data-* pass-through props are excluded — `className`/`classes`/`classNames`/`rootClassName`/`prefixCls`, `style`, `id`, `role`, `tabIndex`, `aria-*` (and bare `aria`), `data-*`, polymorphic `as`/`element`/`component`, framework theming `dt`/`pt`/`ptOptions`/`unstyled`/`sx`. Discrete positional/geometric props (`top`, `bottom`, `left`, `right`, `rotation`, etc.) ARE classified as `string` design props. Common semantic props (`icon`, `items`, `actions`, `options`, `value`, `name`, `form`, `inputId`, `componentId`) are NOT excluded — classify them per their content/design/state nature.
|
|
402
402
|
9. No `cdf_type: "link"` used — `link` is reserved and rejected by the CLI parser
|
|
403
403
|
10. No `cdf_type: "number"` used — this is not a supported type; use `"string"` with numeric defaults. `cdf_type: "boolean"` IS valid — use it for boolean toggle props.
|
|
404
404
|
11. `classify_component` includes a `rationale` object with all three sub-fields (`rationale.description`, `rationale.props`, `rationale.slots`) populated as non-empty strings.
|
|
@@ -417,9 +417,9 @@ Re-run or re-iterate on any components flagged by warnings until the output pass
|
|
|
417
417
|
|
|
418
418
|
## CRITICAL: Zero-output is a failure
|
|
419
419
|
|
|
420
|
-
You MUST produce
|
|
421
|
-
|
|
422
|
-
this is never acceptable.
|
|
420
|
+
You MUST produce at least one classify_prop call for this component. A response with zero
|
|
421
|
+
classify_prop/exclude_prop calls means the component will be pushed with no configurable
|
|
422
|
+
properties — this is never acceptable.
|
|
423
423
|
|
|
424
424
|
If you are genuinely uncertain about every prop, classify each as:
|
|
425
425
|
{"tool":"classify_prop","prop":"<name>","cdf_type":"string","cdf_category":"content","required":false,"description":"Uncertain classification — review recommended"}
|