foundry-design 0.2.0-beta.17 → 0.2.0-beta.18

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/README.md CHANGED
@@ -167,7 +167,7 @@ Foundry remains local-first. Installing the plugin does not create an account, e
167
167
  - A searchable, collapsible, virtualized live layer hierarchy with mapped-source context, Shadow DOM traversal, drag reordering, and selection persistence across HMR
168
168
  - Multi-selection, measured spacing annotations, sibling-aware resize snapping, keyboard nudging, alignment, distribution, and preview undo/redo
169
169
  - A revisioned local design graph for CSS tokens, components, Storybook variants, breakpoints, themes, states, and motion presets
170
- - A Design System workspace that traces native tokens from definition to indexed usages, previews source blast radius, detects near-duplicates and literal/component drift, and explains every recommendation without changing source automatically
170
+ - A Design System workspace that resolves semantic alias chains, surfaces broken and circular references, traces native tokens from definition to indexed usages, groups recurring literals into existing-token-first promotion plans, and sends exact source refactors through Review without changing source automatically
171
171
  - Semantic source-mapping choices that block ambiguous changes until the user selects the intended implementation
172
172
  - Fixed, hug, fill, and min/max sizing; flex and grid flow; linked spacing; aspect ratio; overflow; and positional controls
173
173
  - Project-native spacing, radius, typography, and color choices with token-only filtering, exact and nearest-token ranking, component variants, type presets, gradients, opacity, and live contrast guidance
@@ -176,7 +176,7 @@ Foundry remains local-first. Installing the plugin does not create an account, e
176
176
  - Design Health scans for contrast, overflow and clipping, touch targets, accessible names, reduced-motion coverage, and project spacing consistency, with evidence, intentional-issue ignores, and safe corrections routed into review
177
177
  - An in-app state workbench with real viewport frames, theme switching, forced interaction states, motion controls, and contextual verification
178
178
  - A dedicated Motion Studio for live CSS and Web Animation discovery, preview-only transport, timeline scrubbing, keyframe editing, complete timing controls, performance classification, and reduced-motion review
179
- - Isolated Design Branches with fixed-viewport comparison, selective composition, rejection notes, and explicit promotion into the source-ready review ledger
179
+ - Isolated Design Branches with fixed-viewport comparison, selective composition, rejection notes, explicit promotion into the source-ready review ledger, and portable chosen or rejected decision records with source-aware compatibility, import, export, restore, removal, and explicit Design Memory linkage
180
180
  - Persistent, coalescing change ledger with JSON and consolidated prompt export
181
181
  - Center-workspace review with editable approved batches, grouped targets, and unresolved-target blocking
182
182
  - Persistent Apply with agent runs across Codex, Cursor, and Claude Code through MCP
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../src/indexer.ts"],"names":[],"mappings":"AAGA,OAAO,EAQL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAuG3D,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,oBAAoB,GAAG,SAAS,EACxC,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,CAAC,CAqR7B"}
1
+ {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../src/indexer.ts"],"names":[],"mappings":"AAGA,OAAO,EAUL,KAAK,kBAAkB,EAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAqX3D,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,oBAAoB,GAAG,SAAS,EACxC,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,CAAC,CAyd7B"}
package/dist/indexer.js CHANGED
@@ -79,6 +79,250 @@ function closeNumericToken(value, tokens) {
79
79
  .filter((entry) => entry.distance > 0 && entry.distance <= Math.max(2, Math.abs(parsed.amount) * 0.25))
80
80
  .sort((a, b) => a.distance - b.distance)[0]?.token;
81
81
  }
82
+ function tokenComparableValue(token) {
83
+ return token.resolvedValue ?? token.value;
84
+ }
85
+ function aliasTarget(value) {
86
+ return /^var\(\s*(--[\w-]+)(?:\s*,[^)]*)?\s*\)$/.exec(value.trim())?.[1];
87
+ }
88
+ function resolveTokenAliases(tokens) {
89
+ const resolve = (token, trail = []) => {
90
+ const targetName = aliasTarget(token.value);
91
+ if (!targetName)
92
+ return { aliasChain: [token.name], aliasStatus: 'direct', resolvedValue: token.value };
93
+ if (trail.includes(token.name)) {
94
+ return { aliasChain: [...trail, token.name], aliasStatus: 'circular' };
95
+ }
96
+ const target = tokens.get(targetName);
97
+ if (!target)
98
+ return { aliasChain: [token.name, targetName], aliasStatus: 'broken' };
99
+ const resolved = resolve(target, [...trail, token.name]);
100
+ return {
101
+ aliasChain: [token.name, ...resolved.aliasChain.filter((name) => name !== token.name)],
102
+ aliasStatus: resolved.aliasStatus === 'direct' ? 'resolved' : resolved.aliasStatus,
103
+ resolvedValue: resolved.resolvedValue,
104
+ };
105
+ };
106
+ for (const token of tokens.values()) {
107
+ const targetName = aliasTarget(token.value);
108
+ if (targetName) {
109
+ token.aliasOfTokenName = targetName;
110
+ const target = tokens.get(targetName);
111
+ token.aliasOfTokenId = target?.id;
112
+ if (token.category === 'other' && target)
113
+ token.category = target.category;
114
+ }
115
+ Object.assign(token, resolve(token));
116
+ }
117
+ }
118
+ function promotionTokenName(category, property, value) {
119
+ const propertySlug = property
120
+ .toLowerCase()
121
+ .replace(/[^a-z0-9]+/g, '-')
122
+ .replace(/^-|-$/g, '');
123
+ const valueSlug = value
124
+ .toLowerCase()
125
+ .replace(/[^a-z0-9.]+/g, '-')
126
+ .replaceAll('.', '-')
127
+ .replace(/^-|-$/g, '')
128
+ .slice(0, 24);
129
+ return `--${category}-${propertySlug || 'value'}${valueSlug ? `-${valueSlug}` : ''}`;
130
+ }
131
+ function objectNumber(source, property) {
132
+ const match = new RegExp(`\\b${property}\\s*:\\s*(-?[\\d.]+)`).exec(source);
133
+ const value = Number(match?.[1]);
134
+ return Number.isFinite(value) ? value : undefined;
135
+ }
136
+ function objectString(source, property) {
137
+ const quoted = new RegExp(`\\b${property}\\s*:\\s*['\"]([^'\"]+)['\"]`).exec(source);
138
+ if (quoted?.[1])
139
+ return quoted[1];
140
+ const array = new RegExp(`\\b${property}\\s*:\\s*\\[([^\\]]+)\\]`).exec(source);
141
+ if (!array?.[1])
142
+ return undefined;
143
+ const values = array[1]
144
+ .split(',')
145
+ .map((value) => Number(value.trim()))
146
+ .filter(Number.isFinite);
147
+ return values.length === 4 ? `cubic-bezier(${values.join(', ')})` : undefined;
148
+ }
149
+ function nativeMotionPresets(file, content) {
150
+ const presets = [];
151
+ const push = (adapter, label, sourceProperty, index, body) => {
152
+ const seconds = adapter !== 'react-spring';
153
+ const duration = objectNumber(body, 'duration');
154
+ const delay = objectNumber(body, 'delay');
155
+ const easing = objectString(body, adapter === 'gsap' ? 'ease' : 'ease') ?? objectString(body, 'easing');
156
+ const configuration = Object.fromEntries([
157
+ 'type',
158
+ 'mass',
159
+ 'stiffness',
160
+ 'damping',
161
+ 'tension',
162
+ 'friction',
163
+ 'velocity',
164
+ 'repeat',
165
+ 'repeatType',
166
+ 'yoyo',
167
+ ]
168
+ .map((property) => [property, objectNumber(body, property) ?? objectString(body, property)])
169
+ .filter((entry) => entry[1] != null));
170
+ presets.push({
171
+ id: stableId('mot', `${file}:${index}:${adapter}`),
172
+ label,
173
+ duration: duration == null ? undefined : seconds ? duration * 1000 : duration,
174
+ delay: delay == null ? undefined : seconds ? delay * 1000 : delay,
175
+ easing,
176
+ adapter,
177
+ sourceProperty,
178
+ configuration,
179
+ source: { file, line: lineAt(content, index) },
180
+ evidence: [`${adapter} source import`, `${sourceProperty} authoring site`],
181
+ });
182
+ };
183
+ if (/from\s+['\"](?:motion\/react|framer-motion)['\"]/.test(content)) {
184
+ for (const match of content.matchAll(/<motion\.([A-Za-z][\w]*)\b([\s\S]*?)>/g)) {
185
+ const body = match[2] ?? '';
186
+ if (!/\b(?:animate|transition|variants)\s*=/.test(body))
187
+ continue;
188
+ push('motion', `Motion ${match[1]}`, 'transition', match.index ?? 0, body);
189
+ }
190
+ }
191
+ if (/from\s+['\"]gsap['\"]|require\(['\"]gsap['\"]\)/.test(content)) {
192
+ for (const match of content.matchAll(/gsap\.(to|from|fromTo|set)\s*\(([\s\S]{0,1200}?)\)\s*[;,]/g)) {
193
+ push('gsap', `GSAP ${match[1]} tween`, 'vars', match.index ?? 0, match[2] ?? '');
194
+ }
195
+ }
196
+ if (/from\s+['\"](?:@react-spring\/web|react-spring)['\"]/.test(content)) {
197
+ for (const match of content.matchAll(/\b(useSpring|useTransition|useTrail)\s*\(([\s\S]{0,1200}?)\)\s*[;,]/g)) {
198
+ push('react-spring', `React Spring ${match[1]}`, match[1] === 'useSpring' ? 'config' : (match[1] ?? 'config'), match.index ?? 0, match[2] ?? '');
199
+ }
200
+ }
201
+ return presets;
202
+ }
203
+ function balancedObject(content, openIndex) {
204
+ if (content[openIndex] !== '{')
205
+ return null;
206
+ let depth = 0;
207
+ let quote = '';
208
+ let escaped = false;
209
+ for (let index = openIndex; index < content.length; index += 1) {
210
+ const char = content[index];
211
+ if (quote) {
212
+ if (escaped)
213
+ escaped = false;
214
+ else if (char === '\\')
215
+ escaped = true;
216
+ else if (char === quote)
217
+ quote = '';
218
+ continue;
219
+ }
220
+ if (char === '"' || char === "'" || char === '`') {
221
+ quote = char;
222
+ continue;
223
+ }
224
+ if (char === '{')
225
+ depth += 1;
226
+ if (char === '}')
227
+ depth -= 1;
228
+ if (depth === 0)
229
+ return { body: content.slice(openIndex + 1, index), start: openIndex, end: index };
230
+ }
231
+ return null;
232
+ }
233
+ function objectProperty(content, property, offset = 0) {
234
+ const match = new RegExp(`(?:^|[,\\s])${property}\\s*:\\s*\\{`, 'm').exec(content.slice(offset));
235
+ if (!match)
236
+ return null;
237
+ const openIndex = offset + match.index + match[0].lastIndexOf('{');
238
+ return balancedObject(content, openIndex);
239
+ }
240
+ function topLevelObjectKeys(content) {
241
+ const keys = [];
242
+ let depth = 0;
243
+ let quote = '';
244
+ let escaped = false;
245
+ for (let index = 0; index < content.length; index += 1) {
246
+ const char = content[index];
247
+ if (quote) {
248
+ if (escaped)
249
+ escaped = false;
250
+ else if (char === '\\')
251
+ escaped = true;
252
+ else if (char === quote)
253
+ quote = '';
254
+ continue;
255
+ }
256
+ if (char === '"' || char === "'" || char === '`') {
257
+ quote = char;
258
+ continue;
259
+ }
260
+ if (char === '{' || char === '[' || char === '(')
261
+ depth += 1;
262
+ if (char === '}' || char === ']' || char === ')')
263
+ depth -= 1;
264
+ if (depth !== 0)
265
+ continue;
266
+ const match = /^\s*(?:['"]([^'"]+)['"]|([A-Za-z_$][\w$-]*))\s*:/.exec(content.slice(index));
267
+ const key = match?.[1] ?? match?.[2];
268
+ if (!key || keys.some((item) => item.key === key))
269
+ continue;
270
+ keys.push({ key, index });
271
+ index += (match?.[0].length ?? 1) - 1;
272
+ }
273
+ return keys;
274
+ }
275
+ function sourceVariantAxes(file, content) {
276
+ const axes = [];
277
+ for (const cva of content.matchAll(/\bcva\s*\(/g)) {
278
+ const configOpen = content.indexOf('{', cva.index ?? 0);
279
+ const config = configOpen >= 0 ? balancedObject(content, configOpen) : null;
280
+ if (!config)
281
+ continue;
282
+ const variants = objectProperty(config.body, 'variants');
283
+ if (!variants)
284
+ continue;
285
+ for (const axisKey of topLevelObjectKeys(variants.body)) {
286
+ const axisOpen = variants.body.indexOf('{', axisKey.index);
287
+ const axis = axisOpen >= 0 ? balancedObject(variants.body, axisOpen) : null;
288
+ if (!axis)
289
+ continue;
290
+ const values = topLevelObjectKeys(axis.body).map((item) => item.key);
291
+ if (!values.length)
292
+ continue;
293
+ const absolute = config.start + 1 + variants.start + 1 + axisOpen;
294
+ axes.push({
295
+ id: stableId('axis', `${file}:cva:${axisKey.key}`),
296
+ label: axisKey.key,
297
+ property: axisKey.key,
298
+ values,
299
+ adapter: 'cva',
300
+ source: { file, line: lineAt(content, absolute) },
301
+ sourceProperty: `variants.${axisKey.key}`,
302
+ canCreate: true,
303
+ evidence: ['CVA variants object', `Writable ${axisKey.key} option map`],
304
+ });
305
+ }
306
+ }
307
+ for (const match of content.matchAll(/\b([A-Za-z_$][\w$]*)\??\s*:\s*((?:['"][^'"]+['"]\s*\|\s*)+['"][^'"]+['"])/g)) {
308
+ const property = match[1];
309
+ const values = [...match[2].matchAll(/['"]([^'"]+)['"]/g)].map((item) => item[1]);
310
+ if (values.length < 2 || axes.some((axis) => axis.property === property))
311
+ continue;
312
+ axes.push({
313
+ id: stableId('axis', `${file}:typescript:${property}`),
314
+ label: property,
315
+ property,
316
+ values,
317
+ adapter: 'typescript',
318
+ source: { file, line: lineAt(content, match.index ?? 0) },
319
+ sourceProperty: property,
320
+ canCreate: true,
321
+ evidence: ['TypeScript string union', `Writable ${property} prop type`],
322
+ });
323
+ }
324
+ return axes;
325
+ }
82
326
  async function sourceFiles(root, exclusions) {
83
327
  const files = [];
84
328
  const excluded = new Set([
@@ -114,14 +358,18 @@ export async function indexProjectDesign(root, config, revision) {
114
358
  const tokens = new Map();
115
359
  const components = new Map();
116
360
  const breakpoints = new Map();
361
+ const containerQueries = new Map();
117
362
  const themes = new Set();
118
363
  const motion = new Map();
119
364
  const storyVariants = new Map();
365
+ const axesByFile = new Map();
120
366
  const documents = [];
121
367
  for (const path of files) {
122
368
  const content = await readFile(path, 'utf8').catch(() => '');
123
369
  const file = relative(root, path).replaceAll('\\', '/');
124
370
  documents.push({ file, content });
371
+ for (const preset of nativeMotionPresets(file, content))
372
+ motion.set(preset.id, preset);
125
373
  for (const match of content.matchAll(/(--[\w-]+)\s*:\s*([^;}\n]+)/g)) {
126
374
  const name = match[1];
127
375
  const value = match[2].trim();
@@ -141,7 +389,10 @@ export async function indexProjectDesign(root, config, revision) {
141
389
  id: stableId('mot', name),
142
390
  label: name.replace(/^--/, ''),
143
391
  duration: duration ? Number(duration[1]) * (value.includes('ms') ? 1 : 1000) : undefined,
392
+ adapter: 'css',
393
+ configuration: {},
144
394
  source: { file, line: lineAt(content, match.index ?? 0) },
395
+ evidence: ['CSS custom property'],
145
396
  });
146
397
  }
147
398
  }
@@ -152,12 +403,44 @@ export async function indexProjectDesign(root, config, revision) {
152
403
  source: { file, line: lineAt(content, match.index ?? 0) },
153
404
  });
154
405
  }
406
+ for (const match of content.matchAll(/@container(?:\s+([\w-]+))?\s*\(([^)]*)\)/g)) {
407
+ const name = match[1];
408
+ const condition = match[2].trim();
409
+ const min = /min-(?:width|inline-size)\s*:\s*([\d.]+)px/i.exec(condition)?.[1] ??
410
+ /(?:width|inline-size)\s*>=?\s*([\d.]+)px/i.exec(condition)?.[1];
411
+ const max = /max-(?:width|inline-size)\s*:\s*([\d.]+)px/i.exec(condition)?.[1] ??
412
+ /(?:width|inline-size)\s*<=?\s*([\d.]+)px/i.exec(condition)?.[1];
413
+ if (!min && !max)
414
+ continue;
415
+ const axis = /block-size|height/i.test(condition)
416
+ ? 'block-size'
417
+ : /\bsize\b/i.test(condition) && !/inline-size/i.test(condition)
418
+ ? 'size'
419
+ : 'inline-size';
420
+ const id = stableId('container', `${file}:${name ?? 'anonymous'}:${condition}`);
421
+ containerQueries.set(id, {
422
+ id,
423
+ label: `${name ?? 'Anonymous container'} · ${condition}`,
424
+ ...(name ? { name } : {}),
425
+ condition,
426
+ axis,
427
+ ...(min ? { minWidth: Number(min) } : {}),
428
+ ...(max ? { maxWidth: Number(max) } : {}),
429
+ source: { file, line: lineAt(content, match.index ?? 0) },
430
+ evidence: [
431
+ 'CSS @container rule',
432
+ ...(content.includes('container-type') ? ['CSS container-type declaration'] : []),
433
+ ...(name && content.includes('container-name') ? ['CSS container-name declaration'] : []),
434
+ ],
435
+ });
436
+ }
155
437
  for (const match of content.matchAll(/(?:data-theme=["']|\[data-theme=["'])([\w-]+)/g)) {
156
438
  themes.add(match[1]);
157
439
  }
158
440
  if (/(?:^|\s)\.dark(?:\s|[{,:])/.test(content))
159
441
  themes.add('dark');
160
442
  if (/\.(?:tsx?|jsx?|mjs|cjs)$/.test(path)) {
443
+ axesByFile.set(file, sourceVariantAxes(file, content));
161
444
  if (/\.stories\.[cm]?[jt]sx?$/.test(path)) {
162
445
  const componentName = basename(path).replace(/\.stories\.[cm]?[jt]sx?$/, '');
163
446
  const variants = [...content.matchAll(/export\s+const\s+([A-Z][A-Za-z0-9_]*)/g)].map((story) => ({
@@ -167,6 +450,8 @@ export async function indexProjectDesign(root, config, revision) {
167
450
  value: story[1],
168
451
  props: { story: story[1] },
169
452
  source: { file, line: lineAt(content, story.index ?? 0) },
453
+ adapter: 'storybook',
454
+ sourceProperty: story[1],
170
455
  }));
171
456
  storyVariants.set(componentName, variants);
172
457
  continue;
@@ -180,6 +465,7 @@ export async function indexProjectDesign(root, config, revision) {
180
465
  source: { file, line: lineAt(content, match.index ?? 0) },
181
466
  instances: 0,
182
467
  variants: [],
468
+ variantAxes: [],
183
469
  evidence: ['exported component'],
184
470
  };
185
471
  components.set(id, component);
@@ -190,6 +476,17 @@ export async function indexProjectDesign(root, config, revision) {
190
476
  const component = [...components.values()].find((item) => item.name === componentName);
191
477
  if (component) {
192
478
  component.variants = variants;
479
+ component.variantAxes.push({
480
+ id: stableId('axis', `${variants[0]?.source?.file}:storybook:story`),
481
+ label: 'Story',
482
+ property: 'story',
483
+ values: variants.map((variant) => variant.value),
484
+ adapter: 'storybook',
485
+ source: variants[0].source,
486
+ sourceProperty: 'named export',
487
+ canCreate: true,
488
+ evidence: ['Storybook named exports', 'Writable story definition'],
489
+ });
193
490
  component.evidence.push('Storybook story');
194
491
  }
195
492
  else if (variants[0]?.source) {
@@ -200,13 +497,52 @@ export async function indexProjectDesign(root, config, revision) {
200
497
  source: variants[0].source,
201
498
  instances: 0,
202
499
  variants,
500
+ variantAxes: [
501
+ {
502
+ id: stableId('axis', `${variants[0].source.file}:storybook:story`),
503
+ label: 'Story',
504
+ property: 'story',
505
+ values: variants.map((variant) => variant.value),
506
+ adapter: 'storybook',
507
+ source: variants[0].source,
508
+ sourceProperty: 'named export',
509
+ canCreate: true,
510
+ evidence: ['Storybook named exports', 'Writable story definition'],
511
+ },
512
+ ],
203
513
  evidence: ['Storybook story'],
204
514
  });
205
515
  }
206
516
  }
517
+ for (const component of components.values()) {
518
+ const nativeAxes = axesByFile.get(component.source?.file ?? '') ?? [];
519
+ const known = new Set(component.variantAxes.map((axis) => axis.property));
520
+ component.variantAxes.push(...nativeAxes.filter((axis) => !known.has(axis.property)));
521
+ for (const axis of nativeAxes) {
522
+ for (const value of axis.values) {
523
+ const id = stableId('var', `${component.id}:${axis.property}:${String(value)}`);
524
+ if (component.variants.some((variant) => variant.id === id))
525
+ continue;
526
+ component.variants.push({
527
+ id,
528
+ label: String(value),
529
+ property: axis.property,
530
+ value,
531
+ props: { [axis.property]: value },
532
+ source: axis.source,
533
+ adapter: axis.adapter,
534
+ sourceProperty: `${axis.sourceProperty}.${String(value)}`,
535
+ });
536
+ }
537
+ }
538
+ if (nativeAxes.length)
539
+ component.evidence.push('Source-backed variant axis');
540
+ }
541
+ resolveTokenAliases(tokens);
207
542
  const tokenList = [...tokens.values()];
208
543
  const tokenUsages = [];
209
544
  const findings = [];
545
+ const recurringLiterals = new Map();
210
546
  const componentForSource = (file, line) => [...components.values()]
211
547
  .filter((component) => component.source?.file === file && (component.source.line ?? 0) <= line)
212
548
  .sort((a, b) => (b.source?.line ?? 0) - (a.source?.line ?? 0))[0];
@@ -241,12 +577,29 @@ export async function indexProjectDesign(root, config, revision) {
241
577
  if (!category)
242
578
  continue;
243
579
  const categoryTokens = tokenList.filter((token) => token.category === category);
244
- const exact = categoryTokens.find((token) => comparable(token.value) === comparable(value));
245
- const suggested = exact ?? closeNumericToken(value, categoryTokens);
246
- if (!suggested)
247
- continue;
580
+ const exact = categoryTokens
581
+ .filter((token) => comparable(tokenComparableValue(token)) === comparable(value))
582
+ .sort((a, b) => (b.aliasChain?.length ?? 0) - (a.aliasChain?.length ?? 0) ||
583
+ a.name.localeCompare(b.name))[0];
584
+ const suggested = exact ??
585
+ closeNumericToken(value, categoryTokens.map((token) => ({ ...token, value: tokenComparableValue(token) })));
248
586
  const line = lineAt(content, match.index ?? 0);
249
587
  const component = componentForSource(file, line);
588
+ const recurringKey = `${category}:${comparable(value)}`;
589
+ const recurring = recurringLiterals.get(recurringKey) ?? {
590
+ value,
591
+ category,
592
+ properties: [],
593
+ sources: [],
594
+ componentIds: [],
595
+ };
596
+ recurring.properties.push(property);
597
+ recurring.sources.push({ file, line });
598
+ if (component?.id)
599
+ recurring.componentIds.push(component.id);
600
+ recurringLiterals.set(recurringKey, recurring);
601
+ if (!suggested)
602
+ continue;
250
603
  const usage = {
251
604
  id: stableId('use', `${file}:${match.index}:${suggested.id}:literal`),
252
605
  tokenId: suggested.id,
@@ -282,6 +635,59 @@ export async function indexProjectDesign(root, config, revision) {
282
635
  });
283
636
  }
284
637
  }
638
+ const tokenPromotions = [...recurringLiterals.entries()]
639
+ .filter(([, recurring]) => recurring.sources.length >= 2)
640
+ .map(([key, recurring]) => {
641
+ const categoryTokens = tokenList.filter((token) => token.category === recurring.category);
642
+ const exact = categoryTokens
643
+ .filter((token) => comparable(tokenComparableValue(token)) === comparable(recurring.value))
644
+ .sort((a, b) => (b.aliasChain?.length ?? 0) - (a.aliasChain?.length ?? 0) ||
645
+ a.name.localeCompare(b.name))[0];
646
+ const near = exact
647
+ ? undefined
648
+ : closeNumericToken(recurring.value, categoryTokens.map((token) => ({ ...token, value: tokenComparableValue(token) })));
649
+ const suggested = exact ?? near;
650
+ const property = [...recurring.properties].sort((a, b) => recurring.properties.filter((item) => item === b).length -
651
+ recurring.properties.filter((item) => item === a).length || a.localeCompare(b))[0];
652
+ const sources = recurring.sources.filter((source, index, all) => all.findIndex((candidate) => candidate.file === source.file && candidate.line === source.line) === index);
653
+ const relation = exact ? 'exact' : near ? 'near' : 'new';
654
+ const proposedTokenName = promotionTokenName(recurring.category, property, recurring.value);
655
+ const suggestedTokenName = suggested?.name ??
656
+ (tokens.has(proposedTokenName)
657
+ ? `${proposedTokenName}-${stableId('token-name', key).slice(-4)}`
658
+ : proposedTokenName);
659
+ return {
660
+ id: stableId('promotion', key),
661
+ value: recurring.value,
662
+ category: recurring.category,
663
+ property,
664
+ occurrenceCount: sources.length,
665
+ sources,
666
+ componentIds: [...new Set(recurring.componentIds)],
667
+ recommendation: suggested ? 'use-existing' : 'create-token',
668
+ relation,
669
+ suggestedTokenId: suggested?.id,
670
+ suggestedTokenName,
671
+ suggestedValue: suggested ? `var(${suggested.name})` : recurring.value,
672
+ aliasChain: suggested?.aliasChain ?? [],
673
+ canStage: sources.length > 0,
674
+ blockers: [],
675
+ evidence: [
676
+ `${sources.length} authored literal occurrences`,
677
+ ...(suggested
678
+ ? [
679
+ relation === 'exact'
680
+ ? 'Resolved value matches an existing project token'
681
+ : 'Nearest compatible project token requires explicit review',
682
+ ]
683
+ : ['No compatible project token exists; create one before replacing usages']),
684
+ ...(suggested?.aliasStatus === 'resolved'
685
+ ? [`Preserves alias chain ${(suggested.aliasChain ?? []).join(' → ')}`]
686
+ : []),
687
+ ],
688
+ };
689
+ })
690
+ .sort((a, b) => b.occurrenceCount - a.occurrenceCount || a.value.localeCompare(b.value));
285
691
  for (let index = 0; index < tokenList.length; index += 1) {
286
692
  const token = tokenList[index];
287
693
  const near = tokenList.slice(index + 1).find((candidate) => {
@@ -361,11 +767,13 @@ export async function indexProjectDesign(root, config, revision) {
361
767
  tokens: [...tokens.values()],
362
768
  components: [...components.values()],
363
769
  breakpoints: graphBreakpoints,
770
+ containerQueries: [...containerQueries.values()].sort((a, b) => (a.minWidth ?? a.maxWidth ?? 0) - (b.minWidth ?? b.maxWidth ?? 0)),
364
771
  themes: graphThemes,
365
772
  states: config?.design?.states ?? [],
366
773
  motionPresets: [...motion.values()],
367
774
  tokenUsages,
368
775
  designSystemFindings: findings,
776
+ tokenPromotions,
369
777
  indexedAt: new Date().toISOString(),
370
778
  });
371
779
  }
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.js","sourceRoot":"","sources":["../src/indexer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,QAAQ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AC;QACnC,WAAW;QACX,oBAAoB,EAAE,QAAQ;QAC9B,eAAe;QACf,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC,CAAC;AACL,CAAC"}
package/dist/release.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare const FOUNDRY_VERSION = "0.2.0-beta.17";
2
- export declare const FOUNDRY_PACKAGE_SPEC = "foundry-design@0.2.0-beta.17";
3
- export declare const FOUNDRY_MCP_PACKAGE_SPEC = "foundry-design-mcp-server@0.2.0-beta.17";
1
+ export declare const FOUNDRY_VERSION = "0.2.0-beta.18";
2
+ export declare const FOUNDRY_PACKAGE_SPEC = "foundry-design@0.2.0-beta.18";
3
+ export declare const FOUNDRY_MCP_PACKAGE_SPEC = "foundry-design-mcp-server@0.2.0-beta.18";
4
4
  export declare function releasePreflight(action: string): string;
5
5
  //# sourceMappingURL=release.d.ts.map
package/dist/release.js CHANGED
@@ -1,4 +1,4 @@
1
- export const FOUNDRY_VERSION = '0.2.0-beta.17';
1
+ export const FOUNDRY_VERSION = '0.2.0-beta.18';
2
2
  export const FOUNDRY_PACKAGE_SPEC = `foundry-design@${FOUNDRY_VERSION}`;
3
3
  export const FOUNDRY_MCP_PACKAGE_SPEC = `foundry-design-mcp-server@${FOUNDRY_VERSION}`;
4
4
  export function releasePreflight(action) {
@@ -14,10 +14,10 @@ Resolve `<skill-root>` to the directory containing this `SKILL.md` before runnin
14
14
  1. Inspect the project, current worktree, framework, development command, and existing Foundry configuration.
15
15
  2. Run `<skill-root>/scripts/foundry.sh doctor --project <root>`.
16
16
  3. If setup is absent, stale, or Doctor reports a missing or conflicting connection, read [platform-setup.md](references/platform-setup.md), then run `<skill-root>/scripts/foundry.sh doctor --project <root> --repair`. Repair refreshes both project-scoped and shared agent configuration to the same exact release. It is transactional, validates the project, and restores every touched file if Foundry introduces a failure.
17
- 4. Confirm that `foundry_design_wait_for_apply` is callable before promising Apply with agent. If setup just added MCP configuration but the tool is unavailable in the current process, stop and ask the user to restart their coding agent and reopen the same project root. Do not start a session or describe the connection as ready.
17
+ 4. Confirm that `foundry_design_wait_for_work` or the legacy `foundry_design_wait_for_apply` is callable before promising agent collaboration. If setup just added MCP configuration but neither tool is available in the current process, stop and ask the user to restart their coding agent and reopen the same project root. Do not start a session or describe the connection as ready.
18
18
  5. Run `<skill-root>/scripts/foundry.sh start --project <root>`. It may start the detected development command and resumes the most recent session for the same source revision. Use `--new` only when the user explicitly wants a clean ledger.
19
- 6. Read the project design graph, then immediately call `foundry_design_wait_for_apply` in bounded waits using the returned session credentials and current revisions. This call publishes the agent-listener heartbeat that unlocks Apply with agent in the browser. Repeat the wait while the session is active. Do not finish the turn merely because one wait returns `waiting`; the browser cannot initiate a new agent turn by itself.
20
- 7. Keep the Foundry runtime and apply listener alive while the user selects and refines elements. End the wait loop only when the user exits Foundry, cancels the workflow, or asks to stop.
19
+ 6. Read the project design graph, then immediately call `foundry_design_wait_for_work` in bounded waits using the returned session credentials and current revisions. This one listener receives reviewed Apply runs and grounded Visual Agent requests. Fall back to `foundry_design_wait_for_apply` only when the unified tool is unavailable. Repeat the wait while the session is active. Do not finish the turn merely because one wait returns `waiting`; the browser cannot initiate a new agent turn by itself.
20
+ 7. Keep the Foundry runtime and agent listener alive while the user selects, discusses, and refines elements. End the wait loop only when the user exits Foundry, cancels the workflow, or asks to stop.
21
21
 
22
22
  In web sessions, selection mode stays active so ordinary clicks can move continuously between elements. Inspector categories filter the selected element's controls without changing selection mode. Switch the pointer tool to interaction mode only when testing the underlying app; Option-click still makes a temporary selection there. Repeating a click cycles overlapping layers, and Option-click prioritizes the strongest mapped or semantic target. Use the Layers panel or the Parent and Child controls for obscured and nested targets. Shift-click builds a multi-selection and exposes measured gaps when the layers share a parent.
23
23
 
@@ -33,7 +33,7 @@ When the user asks to inspect, scrub, preview, or edit rendered motion, read [mo
33
33
 
34
34
  When the user asks to audit, preview, or change fonts, type rhythm, scale, or reusable type styles, read [typography-studio.md](references/typography-studio.md). Keep local fonts preview-only, require an explicit integration strategy for new Google Fonts, and validate reviewed typography across the recorded viewport, theme, and state contexts.
35
35
 
36
- When the user asks to explore, compare, combine, reject, or choose parallel visual directions, read [design-branches.md](references/design-branches.md). Keep every direction isolated from Main, switch preview values reversibly, and require explicit promotion before anything enters Review and apply.
36
+ When the user asks to explore, compare, combine, reject, choose, export, import, or restore parallel visual directions, read [design-branches.md](references/design-branches.md). For portable chosen and rejected outcomes, also read [portable-branch-records.md](references/portable-branch-records.md). Keep every direction isolated from Main, switch preview values reversibly, require explicit promotion before anything enters Review and apply, and never turn a portable record into Design Memory without a separate user action.
37
37
 
38
38
  When the user runs Design Health or asks to correct its findings, read [design-health.md](references/design-health.md). Preserve evidence-only findings when Foundry cannot propose a narrow, reversible preview.
39
39
 
@@ -52,13 +52,17 @@ Do not launch Foundry merely because a task contains design work. Require an exp
52
52
 
53
53
  Read [change-contract.md](references/change-contract.md) when interpreting or troubleshooting a change set.
54
54
 
55
+ ## Discuss a visual request
56
+
57
+ When `foundry_design_wait_for_work` returns `kind: visual_request`, read [visual-agent-conversation.md](references/visual-agent-conversation.md). Ground the response in the attached rendered targets or region, source locations, viewport, theme, state, measurements, project tokens, and contextual comments. Return concrete proposals through `foundry_design_respond_to_visual_request`, then resume the unified listener. Never edit source from a proposal. Only a proposal the user previews, promotes to Review, and applies through a reviewed Apply run authorizes source work.
58
+
55
59
  ## Apply the reviewed batch
56
60
 
57
61
  1. Read the project design graph with `foundry_design_get_project_design`.
58
- 2. For an interactive web session, keep calling `foundry_design_wait_for_apply` in bounded waits as soon as Foundry starts. Include the current source revision, design-graph revision, and agent identity. A reviewed run may already be queued while the agent was offline. A `waiting` result means poll again while the session remains active, not that the workflow is complete.
62
+ 2. For an interactive session, keep calling `foundry_design_wait_for_work` in bounded waits as soon as Foundry starts. Include the current source revision, design-graph revision, and agent identity. A reviewed run or visual request may already be queued while the agent was offline. A `waiting` result means poll again while the session remains active, not that the workflow is complete.
59
63
  3. If a run is claimed, retain its `claimAttemptId`, read [apply-run-contract.md](references/apply-run-contract.md), and follow its state transitions. Do not edit from an unreviewed draft ledger.
60
64
  4. Immediately report `applying` with the current `claimAttemptId`, then reinspect current source before editing. The MCP bridge automatically renews a fresh claim while this turn is inspecting prerequisites, but do not rely on that as a progress state. If a long prerequisite prevents the transition, explicitly extend the lease with `foundry_design_heartbeat_apply_run` while the run remains `claimed`.
61
- 5. Stop if the claim is no longer active or the source inspection finds a stale revision, stale graph, unresolved target, or unresolved operation. Return to `foundry_design_wait_for_apply` when Foundry has safely requeued an abandoned handoff.
65
+ 5. Stop if the claim is no longer active or the source inspection finds a stale revision, stale graph, unresolved target, or unresolved operation. Return to `foundry_design_wait_for_work` when Foundry has safely requeued an abandoned handoff.
62
66
  6. Implement the user's selected semantic mapping at the narrowest source of truth.
63
67
  7. Preserve existing tokens and component conventions. Prefer a matching token over a new literal. Do not invent a global token for an instance-scoped adjustment.
64
68
  8. Apply the batch as a normal, reviewable source diff. Never write generated preview styles into production code.
@@ -10,6 +10,20 @@ Use Component Workshop to inspect a project-native component as a connected syst
10
10
  4. Use the state controls to preview default, hover, focus, pressed, disabled, loading, empty, and error behavior.
11
11
  5. Use variants only when the project design graph provides variant properties. Storybook stories are indexed as variant properties.
12
12
 
13
+ ## Create a source-backed variant
14
+
15
+ 1. Use **Create source variant** only when Component Workshop exposes a writable Storybook, CVA, configured, or TypeScript union axis.
16
+ 2. Enter both the human label and the exact source value. Choose a mapped base variant when the new option should preserve its visual treatment.
17
+ 3. Stage the operation, then inspect its exact authoring file, adapter, source property, base variant, and preservation evidence in Review.
18
+ 4. During Apply, follow the recorded adapter rather than inventing a parallel API: create a named Storybook export, add the option to the existing CVA variant map, or extend the recorded TypeScript union and its existing implementation mapping.
19
+ 5. Re-index after the source edit. The new option must return as a mapped variant on the same axis before verification can pass.
20
+
21
+ `component.variant.create.<property>` is a source-authoring operation, not a CSS property. Never satisfy it with a preview attribute or generated stylesheet.
22
+
23
+ ## Repair cross-instance drift
24
+
25
+ After selecting a mapped variant, use **Cross-instance drift** to compare only explicitly instrumented instance properties. Missing properties are unknown, not mismatches. A repair stages one exact `variant.<property>` change for each differing instance and retains that instance's source reference. Apply each repair at the narrowest recorded call site, then verify every repaired instance against the selected variant.
26
+
13
27
  State previews are presentation state. They must never create a design change or enter the review ledger. Return to Default before measuring or applying unrelated changes.
14
28
 
15
29
  ## Choose scope safely
@@ -28,3 +42,5 @@ Do not promote an instance edit to variant or component scope by inference. If t
28
42
  4. For variant scope, verify every rendered instance of the selected variant that is available in the session.
29
43
  5. For component scope, verify every rendered instance of that component that is available in the session.
30
44
  6. Keep unavailable combinations explicit. Never claim coverage for a state, theme, or viewport that was not rendered and measured.
45
+ 7. For a newly created variant, confirm the indexed axis includes the exact new value and that the chosen base treatment was preserved.
46
+ 8. For drift repair, confirm the mismatch count returns to zero without changing instances that did not expose that property.
@@ -30,6 +30,12 @@ Choosing a direction is an explicit boundary:
30
30
 
31
31
  Never merge a direction directly into project files and never automatically retry or promote a rejected direction.
32
32
 
33
+ ## Preserve the outcome
34
+
35
+ Choosing or rejecting a direction creates a portable branch decision record. Read [portable-branch-records.md](portable-branch-records.md) before exporting, importing, restoring, or linking one of these records to Design Memory.
36
+
37
+ The record preserves evidence without becoming a permanent rule. Adding it to Design Memory is always a separate, explicit user action.
38
+
33
39
  ## Verification
34
40
 
35
41
  - Confirm edits recorded in one branch never appear in another branch or Main.
@@ -37,4 +43,5 @@ Never merge a direction directly into project files and never automatically retr
37
43
  - Compare at the recorded viewport and theme.
38
44
  - Combine decisions from at least two branches and verify only selected changes appear in the new direction.
39
45
  - Promote the combined direction and confirm Review and apply contains the expected draft changes.
46
+ - Export and re-import chosen and rejected records, verify compatibility evidence, and restore only a current record into a new isolated direction.
40
47
  - Verify Light and Dark Foundry interface themes without altering the product theme.
@@ -18,6 +18,17 @@ Use the Design System workspace to understand and extend the product's existing
18
18
 
19
19
  Recommendations explain the matching category, value relationship, and source evidence. Exact token matches rank first in Inspector menus, followed by the nearest compatible project values. Never recommend a token from an unrelated category merely because its serialized value matches.
20
20
 
21
+ ## Promote recurring values
22
+
23
+ 1. Open **Promote** in the Design System workspace.
24
+ 2. Select a recurring authored value and inspect every indexed source location.
25
+ 3. Prefer the recommended existing semantic token when its resolved value matches. Foundry ranks the deepest compatible alias chain ahead of a raw primitive so theme and component intent survive the refactor.
26
+ 4. When no compatible token exists, review the proposed project-native token name and value. Treat the generated name as a source plan, not an applied convention.
27
+ 5. Add the plan to Review. Foundry records the exact locations, resolved value, alias chain, source blast radius, and required rebuild checks in one `token-refactor` operation.
28
+ 6. Apply with the active coding agent, re-index the project, and verify every affected consumer before marking the operation complete.
29
+
30
+ Broken and circular aliases remain visible in the token detail view but never receive an invented resolved value. Dynamic and generated usages remain outside the indexed count and must be reported as unresolved.
31
+
21
32
  ## Change the system safely
22
33
 
23
34
  1. Inspect affected components and contexts before proposing a replacement or token edit.
@@ -26,4 +37,4 @@ Recommendations explain the matching category, value relationship, and source ev
26
37
  4. Require an exact source mapping and explicit component, theme, breakpoint, and state scope.
27
38
  5. Rebuild and verify every affected rendered context. A token definition change is complete only after its indexed consumers remain visually and functionally correct.
28
39
 
29
- The Design System workspace never applies source changes automatically. Its index, guidance, selection, and impact preview are presentation and evidence state.
40
+ The Design System workspace never applies source changes automatically. Token promotion creates a draft Review operation; only the normal reviewed Apply workflow may change source.
@@ -5,10 +5,47 @@ Use Motion Studio when a rendered interface contains motion that must be underst
5
5
  ## Discover rendered motion
6
6
 
7
7
  1. Select the animated target on the Canvas, then open **Motion studio** from the workspace menu or command palette.
8
- 2. Treat the live browser and timeline as views of the same registered CSS animation, CSS transition, or Web Animation.
8
+ 2. Treat the live browser and timeline as views of the same registered CSS animation, CSS transition, Web Animation, Motion for React animation, GSAP tween, or React Spring animation.
9
9
  3. Preserve the source type, duration, delay, easing, iterations, direction, fill mode, animated properties, and keyframes exactly as reported by the adapter.
10
10
  4. Use the performance tier and reduced-motion status as evidence. Do not infer compositor safety or accessibility coverage from an animation name alone.
11
11
 
12
+ ## Preserve project-native motion
13
+
14
+ Foundry indexes Motion for React, GSAP, and React Spring authoring sites and associates the nearest source-backed preset with an instrumented element. For the strongest runtime evidence, register the actual animation or an equivalent preview on the rendered element:
15
+
16
+ ```ts
17
+ import { registerNativeMotion } from 'foundry-design-web-adapter';
18
+
19
+ registerNativeMotion(element, {
20
+ adapter: 'motion',
21
+ from: { opacity: 0, y: 12 },
22
+ to: { opacity: 1, y: 0 },
23
+ transition: { duration: 0.48, ease: [0.16, 1, 0.3, 1] },
24
+ source: { file: 'src/PrimaryAction.tsx', line: 18 },
25
+ });
26
+
27
+ registerNativeMotion(element, {
28
+ adapter: 'gsap',
29
+ from: { x: -24, opacity: 0 },
30
+ to: { x: 0, opacity: 1 },
31
+ config: { duration: 0.6, ease: 'power2.out' },
32
+ source: { file: 'src/Panel.tsx', line: 32 },
33
+ });
34
+
35
+ registerNativeMotion(element, {
36
+ adapter: 'react-spring',
37
+ from: { y: 16, opacity: 0 },
38
+ to: { y: 0, opacity: 1 },
39
+ config: { mass: 1, tension: 210, friction: 24 },
40
+ source: { file: 'src/Notice.tsx', line: 14 },
41
+ });
42
+ ```
43
+
44
+ - Keep seconds in Motion and GSAP source. Foundry displays milliseconds but records the native `transition.duration` or `vars.duration` property path.
45
+ - Preserve React Spring's physical `mass`, `tension`, and `friction` values rather than flattening the source into a guessed duration.
46
+ - Keep Motion `animate` and `variants`, GSAP `vars`, and React Spring `from`/`to` semantics in Apply evidence.
47
+ - A runtime preview is presentation state. Source changes still enter the existing Review and Apply flow and require rendered verification.
48
+
12
49
  ## Preview without recording changes
13
50
 
14
51
  Play, pause, replay, loop, speed, and timeline scrubbing are presentation controls. They must never enter the change ledger, modify source, or become part of an Apply run. Keep the selected motion and playhead synchronized between Motion Studio and the Inspector.
@@ -21,6 +58,32 @@ Play, pause, replay, loop, speed, and timeline scrubbing are presentation contro
21
58
  - Require exact source mapping before promoting an edit beyond the selected instance.
22
59
  - Never replace a project easing token or motion convention with an unexplained literal when a matching native value exists.
23
60
 
61
+ ## Shape timing curves
62
+
63
+ - Use the dedicated **Bezier** editor for CSS cubic Bezier timing. Drag either control point, use its keyboard-accessible handle, enter exact X and Y values, or start from a preset.
64
+ - Preserve all four cubic Bezier coordinates. Preview the resulting travel independently, then record the exact `cubic-bezier(x1, y1, x2, y2)` value through Review.
65
+ - Use the dedicated **Spring** editor to tune mass, stiffness, damping, and initial velocity. Show settling duration and overshoot so the physical response is understandable before it is recorded.
66
+ - CSS has no portable `spring()` timing function. For web targets, keep the exact physical parameters in the live Foundry curve model and generate a deterministic CSS `linear()` approximation for preview, Review, apply, and rendered verification.
67
+ - Treat presets as starting points, not hidden tokens. Every preset must resolve to visible editable values.
68
+ - Curve playback is temporary presentation state. It must never create a design change until the user changes a curve value.
69
+ - Respect reduced-motion preferences in the curve preview while retaining the authored curve values for inspection.
70
+
71
+ ## Author motion paths
72
+
73
+ - Use the dedicated **Motion path** editor when at least two rendered transform keyframes expose pixel-based translation values.
74
+ - Drag a path point, use Arrow keys for one-pixel changes, hold Shift for eight-pixel changes, or enter exact X and Y coordinates.
75
+ - Preserve scale, rotation, and matrix coefficients when translation changes. Do not convert percentage or otherwise unresolved transforms into guessed pixels.
76
+ - Record path edits as the corresponding transform keyframe value so Review, source mapping, undo, and rebuilt verification keep using the existing keyframe contract.
77
+ - Show native path bounds and total travel distance as inspection evidence. Path geometry is not a new production artifact by itself.
78
+
79
+ ## Compare before and after in sync
80
+
81
+ - Capture the source baseline once, immediately before the first timing, curve, or keyframe preview change.
82
+ - Draw the source baseline and current preview in one coordinate system. Use one playhead for both paths and evaluate each animation with its own timing curve.
83
+ - Playback, replay, and comparison scrubbing are presentation state. They must not enter Review or mutate the live product animation.
84
+ - Report duration, travel-distance, and keyframe-count deltas without claiming that a larger or smaller value is automatically better.
85
+ - If either side lacks a resolvable path, retain the timing and keyframe editors and explain why path comparison is unavailable.
86
+
24
87
  ## Review motion health
25
88
 
26
89
  - Prefer transform and opacity when the intended effect can remain on the compositor.
@@ -0,0 +1,38 @@
1
+ # Portable branch decision records
2
+
3
+ Use portable branch records to carry the outcome and evidence of a Design Branch beyond its original session without turning that outcome into an automatic project rule.
4
+
5
+ ## Record contract
6
+
7
+ - Choosing or rejecting a direction creates or refreshes one canonical record for that branch.
8
+ - Preserve the outcome, rationale, exact changes and operations, session context, design-graph revision, and source relationships.
9
+ - Export records as a versioned `foundry.design-branch-records` JSON bundle.
10
+ - Import records as reference material. Importing must not change the canvas, Main, source files, or Design Memory.
11
+ - Reassess compatibility against the current session and design graph whenever records are read, imported, or the graph changes.
12
+ - Match source relationships by project-relative path so a project can move between machines without becoming stale solely because its root path changed.
13
+
14
+ ## Compatibility
15
+
16
+ - `current` means every recorded source relationship is present and the design-graph revision still matches. The direction may be restored for exploration.
17
+ - `stale` means the relevant source still exists but the graph revision or part of the recorded context changed. Show the evidence and require review or repair before restore.
18
+ - `missing` means the record has no recoverable source relationship or none of its source files exist in the current graph. Never guess a replacement.
19
+
20
+ Compatibility is evidence, not an edit. It must not create a design change or alter the record's original context.
21
+
22
+ ## Restore and memory boundaries
23
+
24
+ 1. Restore only a `current` record.
25
+ 2. Clone its changes and operations with fresh identifiers into a new exploring direction.
26
+ 3. Keep the restored direction isolated from Main until the user explicitly chooses it again.
27
+ 4. Add a record to Design Memory only after the user selects **Add to Memory**. Choosing, rejecting, importing, or restoring a record must never silently create permanent guidance.
28
+ 5. Let the user remove a record without deleting its original branch or changing source.
29
+
30
+ ## Verification
31
+
32
+ - Export chosen and rejected records and parse the bundle against the protocol schema.
33
+ - Import into the same project at a different root path and confirm source-relative matching remains current.
34
+ - Change the design-graph revision and confirm the record becomes stale.
35
+ - Remove its source from the graph and confirm the record becomes missing.
36
+ - Restore a current record and confirm a new isolated direction appears without changing Main.
37
+ - Confirm explicit Add to Memory is the only path that creates remembered guidance.
38
+ - Verify Light and Dark workspace states and the matching Figma components.
@@ -7,8 +7,12 @@ Use Responsive Design Lab when a change must remain correct across real running
7
7
  1. Select the target once on the Canvas, then open **Responsive design lab** from the workspace menu or command palette.
8
8
  2. Treat each iframe's declared width and height as the browser viewport. Foundry may scale the outer frame for presentation, but must never resize the document to fit the workspace.
9
9
  3. Check the linked selection in every configured breakpoint and the session's recorded Current viewport.
10
- 4. Scrub Custom width to reveal media-query and container-query transitions between named boundaries.
11
- 5. Treat horizontal overflow, clipping, awkward wrapping, and large geometry jumps as findings. Do not enlarge a viewport from `scrollWidth` to conceal overflow.
10
+ 4. Keep **Viewport** selected to scrub the browser viewport through indexed media-query boundaries.
11
+ 5. Switch to **Container** to resize the nearest authored query container around the selected element without changing the iframe viewport. Indexed `@container` conditions remain visible as exact, source-linked boundary shortcuts.
12
+ 6. Capture **Before** and **After** at meaningful widths. Foundry freezes viewport, container, selected-element, wrapping, and overflow measurements while the live preview remains free to move.
13
+ 7. Treat horizontal overflow, clipping, awkward wrapping, and large geometry jumps as findings. Do not enlarge a viewport from `scrollWidth` to conceal overflow.
14
+
15
+ Container and comparison previews are presentation state. They must not create design changes, alter source, or disguise the viewport used by screenshots and verification. Clearing the preview restores the container's exact prior inline styles.
12
16
 
13
17
  ## Use stress tests safely
14
18
 
@@ -25,6 +29,6 @@ Never infer a global responsive edit from a successful local preview. If a custo
25
29
 
26
30
  1. Rebuild the real application.
27
31
  2. Reopen the linked selection at every approved viewport using native iframe dimensions.
28
- 3. Compare before and after in the failing context.
32
+ 3. Compare the captured before and after measurements in the failing viewport or container context.
29
33
  4. Confirm the original passing contexts remain stable.
30
34
  5. Report unsupported, cross-origin, or unavailable contexts explicitly rather than substituting the current viewport.
@@ -0,0 +1,14 @@
1
+ # Visual Agent conversation
2
+
3
+ Use this workflow only for a request claimed through `foundry_design_wait_for_work` or `foundry_design_wait_for_visual_request`.
4
+
5
+ 1. Read every attached rendered target, drawn region, contextual comment, source location, viewport, breakpoint, theme, state, measurement, token, and design-graph revision before proposing a direction.
6
+ 2. Inspect the referenced source and project conventions. State when a source location, token mapping, responsive effect, or measurement is unresolved. Do not fill missing evidence with an approximation.
7
+ 3. Explain the visual cause in plain language. Connect each conclusion to the rendered or source evidence that supports it.
8
+ 4. Return one to three meaningfully different proposals. For each proposal include a concise name, summary, reasoning, exact values, affected source locations, responsive impact, a verification plan, and complete draft `DesignChange` records for previewable edits.
9
+ 5. Keep each proposal internally coherent and independently previewable. Do not mix competing directions into one change list.
10
+ 6. Do not edit source, approve changes, or choose a proposal for the user. `foundry_design_respond_to_visual_request` only returns isolated proposals to Foundry.
11
+ 7. If the context is insufficient, return a clear explanation with no speculative changes. Ask for a narrower selection, region, state, or source mapping.
12
+ 8. After responding, resume `foundry_design_wait_for_work`. The user may preview, reject, or promote a proposal. Only a later reviewed Apply run authorizes source edits.
13
+
14
+ If a claim expires, stop. Do not retry automatically. Foundry preserves the request and requires the user to authorize a retry. If an applied proposal fails rebuilt verification, report the exact requested and rendered values and wait for explicit retry authorization.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foundry-design",
3
- "version": "0.2.0-beta.17",
3
+ "version": "0.2.0-beta.18",
4
4
  "description": "Install and run the local-first Foundry visual design control plane",
5
5
  "type": "module",
6
6
  "files": [
@@ -34,8 +34,8 @@
34
34
  "inspector"
35
35
  ],
36
36
  "dependencies": {
37
- "foundry-design-protocol": "0.2.0-beta.17",
38
- "foundry-design-runtime": "0.2.0-beta.17"
37
+ "foundry-design-runtime": "0.2.0-beta.18",
38
+ "foundry-design-protocol": "0.2.0-beta.18"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsc -p tsconfig.json && node ../../scripts/copy-cli-skill.mjs",