foundry-design 0.2.0-beta.2 → 0.2.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +164 -17
  2. package/dist/companion.d.ts +24 -0
  3. package/dist/companion.d.ts.map +1 -0
  4. package/dist/companion.js +89 -0
  5. package/dist/companion.js.map +1 -0
  6. package/dist/delivery-export.d.ts +27 -0
  7. package/dist/delivery-export.d.ts.map +1 -0
  8. package/dist/delivery-export.js +200 -0
  9. package/dist/delivery-export.js.map +1 -0
  10. package/dist/doctor.d.ts +24 -0
  11. package/dist/doctor.d.ts.map +1 -0
  12. package/dist/doctor.js +206 -0
  13. package/dist/doctor.js.map +1 -0
  14. package/dist/index.js +583 -124
  15. package/dist/index.js.map +1 -1
  16. package/dist/indexer.d.ts.map +1 -1
  17. package/dist/indexer.js +690 -30
  18. package/dist/indexer.js.map +1 -1
  19. package/dist/installer.d.ts +46 -0
  20. package/dist/installer.d.ts.map +1 -1
  21. package/dist/installer.js +551 -100
  22. package/dist/installer.js.map +1 -1
  23. package/dist/project.d.ts +9 -1
  24. package/dist/project.d.ts.map +1 -1
  25. package/dist/project.js +50 -2
  26. package/dist/project.js.map +1 -1
  27. package/dist/proxy.d.ts +7 -0
  28. package/dist/proxy.d.ts.map +1 -0
  29. package/dist/proxy.js +106 -0
  30. package/dist/proxy.js.map +1 -0
  31. package/dist/release.d.ts +5 -0
  32. package/dist/release.d.ts.map +1 -0
  33. package/dist/release.js +12 -0
  34. package/dist/release.js.map +1 -0
  35. package/dist/skill/foundry-design-control/SKILL.md +41 -15
  36. package/dist/skill/foundry-design-control/references/apply-run-contract.md +13 -7
  37. package/dist/skill/foundry-design-control/references/change-contract.md +9 -6
  38. package/dist/skill/foundry-design-control/references/component-workshop.md +46 -0
  39. package/dist/skill/foundry-design-control/references/design-branches.md +47 -0
  40. package/dist/skill/foundry-design-control/references/design-system-intelligence.md +40 -0
  41. package/dist/skill/foundry-design-control/references/motion-studio.md +101 -0
  42. package/dist/skill/foundry-design-control/references/portable-branch-records.md +38 -0
  43. package/dist/skill/foundry-design-control/references/responsive-design-lab.md +34 -0
  44. package/dist/skill/foundry-design-control/references/typography-studio.md +14 -0
  45. package/dist/skill/foundry-design-control/references/visual-agent-conversation.md +14 -0
  46. package/dist/skill/foundry-design-control/references/visual-workbench.md +27 -4
  47. package/dist/skill/foundry-design-control/scripts/foundry.sh +1 -5
  48. package/package.json +3 -3
@@ -0,0 +1,46 @@
1
+ # Component Workshop
2
+
3
+ Use Component Workshop to inspect a project-native component as a connected system rather than editing isolated screenshots.
4
+
5
+ ## Enter the workshop
6
+
7
+ 1. Open **Components** from the workspace menu, command palette, or Components tab in Structure.
8
+ 2. Choose an indexed component. Prefer one with a live instance on the current canvas.
9
+ 3. Select the exact live instance before changing a visual property.
10
+ 4. Use the state controls to preview default, hover, focus, pressed, disabled, loading, empty, and error behavior.
11
+ 5. Use variants only when the project design graph provides variant properties. Storybook stories are indexed as variant properties.
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
+
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.
28
+
29
+ ## Choose scope safely
30
+
31
+ - **Instance** changes the selected rendered instance and is available when that instance is live.
32
+ - **Variant** changes the selected mapped variant definition. Keep it disabled until the variant has an exact source reference.
33
+ - **Component** changes the component source for every instance. Keep it disabled until the component itself has an exact source reference.
34
+
35
+ Do not promote an instance edit to variant or component scope by inference. If the source target is missing or ambiguous, preserve the preview and ask the user to resolve the mapping.
36
+
37
+ ## Review and verify
38
+
39
+ 1. Review each recorded change with its component, selected variant, scope, viewport, theme, and state context.
40
+ 2. Apply the narrowest source edit that satisfies the reviewed scope.
41
+ 3. Rebuild and verify the selected state at its native artboard dimensions.
42
+ 4. For variant scope, verify every rendered instance of the selected variant that is available in the session.
43
+ 5. For component scope, verify every rendered instance of that component that is available in the session.
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.
@@ -0,0 +1,47 @@
1
+ # Design branches
2
+
3
+ Use Design branches when the user wants to explore materially different visual directions before choosing what should enter Review and apply.
4
+
5
+ ## Branch contract
6
+
7
+ - Main direction is the source-ready session change set.
8
+ - A branch owns an isolated list of design changes and direct-manipulation operations.
9
+ - Creating a direction from another direction copies its current decisions without linking future edits.
10
+ - Switching directions restores the previous preview values before applying the next direction.
11
+ - Branch navigation is presentation state. It must not edit source, create an Apply run, or mark changes applied.
12
+ - Keep no more than eight active directions in one session. Archive rejected or obsolete directions instead of deleting their rationale.
13
+
14
+ ## Compare and compose
15
+
16
+ 1. Compare two directions in fixed-size iframes using the recorded project viewport.
17
+ 2. Treat the branch ledgers as canonical. Never infer a viewport from overflowing content.
18
+ 3. Select individual decisions by branch and change identifier.
19
+ 4. Combine selections into a new isolated direction. Coalesce only changes with the same target, property, scope, breakpoint, theme, and state.
20
+ 5. Record a concise rejection note when a direction is rejected. Preserve that note with the session.
21
+
22
+ ## Promote a direction
23
+
24
+ Choosing a direction is an explicit boundary:
25
+
26
+ 1. Confirm there is no active Apply run.
27
+ 2. Copy the chosen direction into the main change set with fresh identifiers and draft statuses.
28
+ 3. Mark the direction as chosen and return the active editing direction to Main.
29
+ 4. Open Review and apply. The user must still approve exact changes before the agent edits source.
30
+
31
+ Never merge a direction directly into project files and never automatically retry or promote a rejected direction.
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
+
39
+ ## Verification
40
+
41
+ - Confirm edits recorded in one branch never appear in another branch or Main.
42
+ - Switch repeatedly and verify the rendered product restores exact before and after values.
43
+ - Compare at the recorded viewport and theme.
44
+ - Combine decisions from at least two branches and verify only selected changes appear in the new direction.
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.
47
+ - Verify Light and Dark Foundry interface themes without altering the product theme.
@@ -0,0 +1,40 @@
1
+ # Design System Intelligence
2
+
3
+ Use the Design System workspace to understand and extend the product's existing visual language without silently introducing new conventions.
4
+
5
+ ## Read the system map
6
+
7
+ 1. Open **Design system** from the workspace menu or command palette.
8
+ 2. Filter tokens by category and select the semantic token, not merely a matching raw value.
9
+ 3. Read its source of truth, aliases, indexed references, literal repetitions, component reach, and file reach.
10
+ 4. Treat impact counts as an indexed preview. Dynamic, generated, or runtime-only usage may remain outside the graph and must be reported as unavailable rather than inferred.
11
+
12
+ ## Interpret guidance
13
+
14
+ - **Literal drift** means an authored literal equals or sits close to a project token.
15
+ - **Component drift** is literal drift inside a source-mapped component.
16
+ - **Near duplicate** means two tokens in the same category fall inside the conservative numeric similarity threshold.
17
+ - **Unused token** means no indexed reference was found. It is evidence for review, not permission to delete the token.
18
+
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
+
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
+
32
+ ## Change the system safely
33
+
34
+ 1. Inspect affected components and contexts before proposing a replacement or token edit.
35
+ 2. Preserve semantic aliases when they encode intent across themes, states, or component roles.
36
+ 3. Route literal replacements, consolidation, new tokens, and token-value changes into the normal review ledger.
37
+ 4. Require an exact source mapping and explicit component, theme, breakpoint, and state scope.
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.
39
+
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.
@@ -0,0 +1,101 @@
1
+ # Motion Studio
2
+
3
+ Use Motion Studio when a rendered interface contains motion that must be understood, tuned, or verified against its source.
4
+
5
+ ## Discover rendered motion
6
+
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, Web Animation, Motion for React animation, GSAP tween, or React Spring animation.
9
+ 3. Preserve the source type, duration, delay, easing, iterations, direction, fill mode, animated properties, and keyframes exactly as reported by the adapter.
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
+
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
+
49
+ ## Preview without recording changes
50
+
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.
52
+
53
+ ## Edit timing and keyframes
54
+
55
+ - Timing edits may update duration, delay, easing, iterations, direction, and fill mode.
56
+ - Keyframe edits preserve the selected property, offset, value, and segment easing.
57
+ - Route edits through the normal bridge so they coalesce by target, property, scope, breakpoint, theme, and state.
58
+ - Require exact source mapping before promoting an edit beyond the selected instance.
59
+ - Never replace a project easing token or motion convention with an unexplained literal when a matching native value exists.
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
+
87
+ ## Review motion health
88
+
89
+ - Prefer transform and opacity when the intended effect can remain on the compositor.
90
+ - Flag layout- or paint-heavy properties as evidence, not as automatic rewrite instructions.
91
+ - Treat a matching `prefers-reduced-motion` rule or an intentionally short duration as reduced-motion coverage.
92
+ - Preserve unsupported or ambiguous motion as a finding and ask the user to choose the intended source behavior.
93
+
94
+ ## Verify after apply
95
+
96
+ 1. Rebuild the real application.
97
+ 2. Reopen the same target, viewport, theme, breakpoint, and state.
98
+ 3. Confirm the requested timing and keyframe values from the rendered animation snapshot.
99
+ 4. Replay the full motion and inspect the start, intermediate, and end states.
100
+ 5. Confirm transport and scrubbing still leave the change ledger untouched.
101
+ 6. Recheck performance classification and reduced-motion coverage, then report any mismatch instead of silently normalizing it.
@@ -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.
@@ -0,0 +1,34 @@
1
+ # Responsive Design Lab
2
+
3
+ Use Responsive Design Lab when a change must remain correct across real running viewport contexts.
4
+
5
+ ## Inspect across native viewports
6
+
7
+ 1. Select the target once on the Canvas, then open **Responsive design lab** from the workspace menu or command palette.
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
+ 3. Check the linked selection in every configured breakpoint and the session's recorded Current viewport.
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.
16
+
17
+ ## Use stress tests safely
18
+
19
+ Browser zoom, text scale, and long-content modes are temporary presentation tests. They must not record changes, alter product source, or persist after the preview frame closes. Use them to expose brittle layout behavior, then clear the stress mode before final measurement.
20
+
21
+ ## Choose responsive scope
22
+
23
+ - **This breakpoint** records the current configured breakpoint as the change context.
24
+ - **All breakpoints** is an explicit promotion. Keep it unavailable until the selected target has exact source mapping.
25
+
26
+ Never infer a global responsive edit from a successful local preview. If a custom-width failure does not map to a configured breakpoint or source boundary, preserve the evidence and ask the user to choose the intended source scope.
27
+
28
+ ## Verify after apply
29
+
30
+ 1. Rebuild the real application.
31
+ 2. Reopen the linked selection at every approved viewport using native iframe dimensions.
32
+ 3. Compare the captured before and after measurements in the failing viewport or container context.
33
+ 4. Confirm the original passing contexts remain stable.
34
+ 5. Report unsupported, cross-origin, or unavailable contexts explicitly rather than substituting the current viewport.
@@ -0,0 +1,14 @@
1
+ # Typography Studio
2
+
3
+ Typography Studio turns the selected rendered text into a source-accountable typography workspace.
4
+
5
+ 1. Select a text layer on Canvas, then open **Typography studio** from the workspace menu, command palette, or `0` shortcut.
6
+ 2. Use **Project** to review fonts already active or declared in the product. Choosing one creates a normal reviewed font-family change.
7
+ 3. Use **Google** to preview the live catalog. Before review, choose the project-appropriate integration strategy. Foundry records the exact family, weight, style, source actions, and verification plan as evidence.
8
+ 4. Use **Local** to preview fonts installed on the device when the browser supports local font access. Local fonts are never written to source without an explicit project asset or integration decision.
9
+ 5. Use the live specimen, rendered metrics, diagnostics, and project usage map to judge the change in context. Do not treat the specimen alone as proof that the rebuilt product is correct.
10
+ 6. Type treatments and modular or fluid scale values are temporary until added to review. Reset restores the original inline values without creating a change.
11
+ 7. Saved project styles are local design memory. Applying one still creates exact reviewed property changes; saving a style does not silently create source tokens.
12
+ 8. During apply, preserve the project-native font system, aliases, loading strategy, and framework conventions. Verify the rebuilt family, weight, style, axes, size, line height, tracking, wrapping, clipping, and load status across every recorded viewport, theme, and state.
13
+
14
+ Do not claim that a local preview is portable. Do not add a Google or self-hosted font without its recorded source plan. Do not hide overflow or clipping by changing the 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.
@@ -1,20 +1,37 @@
1
1
  # Visual workbench
2
2
 
3
- Foundry's browser UI records intent while keeping all preview changes temporary.
3
+ Foundry opens a dedicated local design workspace around the running product. The center canvas is
4
+ still the real application, and all visual overrides remain temporary until a reviewed batch is
5
+ applied in source.
6
+
7
+ ## Interface appearance
8
+
9
+ - Foundry follows the operating system light or dark appearance by default and updates live when that setting changes.
10
+ - The workspace menu can override this with Light or Dark. Store that preference locally for the user without changing the inspected product's Theme context.
11
+ - System, Light, and Dark affect Foundry's workspace surfaces only. They do not record a design change or alter rendered verification context.
4
12
 
5
13
  ## Selection and layers
6
14
 
7
15
  - Selection mode is persistent: click around the canvas to choose the exact visible layer under the pointer without reactivating the pointer tool.
8
- - Layout, Type, Color, Effects, and other category buttons only filter inspector controls. The chosen category persists as selection moves between compatible elements.
16
+ - The right Inspector shows one contextual hierarchy and hides categories that do not apply to the current element.
9
17
  - Toggle the pointer tool to interaction mode when the underlying product needs to receive clicks. Option-click temporarily selects the strongest target without leaving interaction mode.
10
18
  - Repeat a click to cycle overlaps.
11
19
  - Shift-click creates a multi-selection. Parent and Child traverse the composed tree.
12
- - Layers opens by default in a fresh browser session. If the user closes it, preserve that choice for the rest of the current tab session.
20
+ - Layers and Inspector open by default and can be hidden independently from the workspace header.
13
21
  - The same panel includes a Components view that combines rendered component instances with the indexed project graph. Live component cards select and cycle their rendered instances; indexed-only cards remain visible without pretending they are on the canvas.
14
22
  - Layers are searchable, collapsible, and virtualized for large documents. Open shadow roots are included.
15
23
  - Drag a layer onto a sibling to reorder it within the same parent. Cross-parent drops are blocked because they can change component structure.
16
24
  - Foundry restores the selected locator after HMR when the mapped element still exists.
17
25
 
26
+ ## Canvas navigation
27
+
28
+ - The embedded product is a fixed-size artboard. Its dimensions come from the selected project viewport, while Current uses the session viewport.
29
+ - Foundry opens the artboard at 100%. Dock and browser resizing never silently scales the product or changes its responsive breakpoint.
30
+ - Use Pan, Space-drag, or middle-drag to move around an oversized artboard. Trackpad scrolling pans the canvas in Select and Pan modes.
31
+ - Pinch or Command/Ctrl-wheel zooms around the pointer. The zoom menu provides Actual size, Fit, Fit width, and fixed percentage presets.
32
+ - Interact mode passes ordinary pointer and scroll input into the product. Space-drag and middle-drag still navigate the outer canvas.
33
+ - Pan and zoom are local presentation state. They never become design changes and never alter native rendered measurements.
34
+
18
35
  ## Layout and project intelligence
19
36
 
20
37
  - Width and height expose fixed, hug, fill, and min/max intent alongside exact dimensions.
@@ -26,12 +43,18 @@ Foundry's browser UI records intent while keeping all preview changes temporary.
26
43
 
27
44
  ## Comparison and recovery
28
45
 
46
+ - Review, State workbench, Design health, and Design memory occupy the center workspace one at a time. Layers and Inspector remain the persistent navigation and property surfaces.
29
47
  - Before and After replay the temporary preview ledger.
30
48
  - The scrubber interpolates numeric values and switches discrete values at the midpoint.
31
49
  - Side by side reloads a clean source baseline and applies the current preview ledger only to the After frame. If same-origin framing is blocked, keep comparison in the live page.
32
50
  - Isolate dims unrelated content. Reset element restores the selected element and rejects its recorded session changes.
33
51
  - Undo and redo include layer order. Command-K opens all major actions; Shift-L opens Layers; Shift-C opens comparison; brackets select parent and child.
52
+ - Design health and Design memory include explicit Close actions. Closing either returns to Canvas without discarding scan results, project memory, selection, or canvas position.
34
53
 
35
54
  ## Review boundary
36
55
 
37
- Preview accuracy does not authorize source edits. Review the recorded target, semantic mapping, scope, context, project token, and impact message before submitting Apply with agent. Literal values remain visible as warnings when a project-native value is not used.
56
+ Preview accuracy does not authorize source edits. A compact change summary stays centered near the top of the canvas after the first edit so it remains visible without competing with the canvas toolbar. Review becomes a focused center-workspace mode that preserves approvals and edited values across visits.
57
+
58
+ Review the recorded target, semantic mapping, scope, context, project token, and impact message before submitting Apply with agent. Literal values remain visible as warnings when a project-native value is not used. Locate, Preview, and Compare temporarily return to Canvas. Application, rebuild, verification, mismatches, and authorized retries remain in the Review workspace mode.
59
+
60
+ Deleting a reviewed change is destructive to the preview ledger but does not edit source. Foundry must first confirm that the target is currently rendered, remove the stored change, and restore that property to its recorded before value. Applied changes and changes already attached to an apply run cannot be deleted from Review.
@@ -9,8 +9,4 @@ if [[ -f "$foundry_design_home/package.json" && -f "$foundry_design_home/package
9
9
  exec pnpm --dir "$foundry_design_home" foundry "$@"
10
10
  fi
11
11
 
12
- if command -v foundry-design >/dev/null 2>&1; then
13
- exec foundry-design "$@"
14
- fi
15
-
16
- exec npx -y foundry-design@beta "$@"
12
+ exec npx -y --prefer-online --package=foundry-design@latest foundry-design "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foundry-design",
3
- "version": "0.2.0-beta.2",
3
+ "version": "0.2.0-beta.21",
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.2",
38
- "foundry-design-runtime": "0.2.0-beta.2"
37
+ "foundry-design-protocol": "0.2.0-beta.21",
38
+ "foundry-design-runtime": "0.2.0-beta.21"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsc -p tsconfig.json && node ../../scripts/copy-cli-skill.mjs",