figma-cache-toolchain 2.0.2 → 2.0.4

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 (40) hide show
  1. package/README.md +201 -170
  2. package/cursor-bootstrap/AGENT-SETUP-PROMPT.md +34 -29
  3. package/cursor-bootstrap/examples/README.md +26 -11
  4. package/cursor-bootstrap/examples/generated-ui-reset.css.template +32 -0
  5. package/cursor-bootstrap/examples/ui-adapter.contract.template.json +90 -0
  6. package/cursor-bootstrap/examples/ui-execution-template.fast.md +11 -0
  7. package/cursor-bootstrap/examples/ui-execution-template.strict.md +13 -0
  8. package/cursor-bootstrap/examples/ui-override.template.json +26 -0
  9. package/cursor-bootstrap/figma-cache.config.example.js +51 -9
  10. package/cursor-bootstrap/managed-files.json +41 -0
  11. package/cursor-bootstrap/rules/02-figma-stack-adapter.mdc +15 -25
  12. package/cursor-bootstrap/rules/03-figma-ui-implementation-hard-constraints.mdc +58 -91
  13. package/cursor-bootstrap/rules/04-ui-baseline-governance.mdc +35 -86
  14. package/cursor-bootstrap/skills/figma-ui-dual-mode-execution/SKILL.md +13 -8
  15. package/figma-cache/adapters/recipes/button.recipe.json +24 -0
  16. package/figma-cache/adapters/recipes/card.recipe.json +24 -0
  17. package/figma-cache/adapters/recipes/checkbox.recipe.json +24 -0
  18. package/figma-cache/adapters/recipes/input.recipe.json +24 -0
  19. package/figma-cache/adapters/recipes/modal.recipe.json +25 -0
  20. package/figma-cache/adapters/recipes/radio.recipe.json +23 -0
  21. package/figma-cache/adapters/recipes/select.recipe.json +24 -0
  22. package/figma-cache/adapters/recipes/table.recipe.json +25 -0
  23. package/figma-cache/adapters/recipes/tabs.recipe.json +24 -0
  24. package/figma-cache/adapters/recipes/tooltip.recipe.json +24 -0
  25. package/figma-cache/docs/README.md +322 -237
  26. package/figma-cache/docs/p0-ui-preflight-handoff.md +207 -0
  27. package/figma-cache/docs/ui-1to1-optimization-roadmap.md +182 -0
  28. package/figma-cache/docs/ui-1to1-report.schema.json +104 -0
  29. package/figma-cache/figma-cache.js +639 -556
  30. package/figma-cache/js/contract-check-cli.js +466 -0
  31. package/figma-cache/js/cursor-bootstrap-cli.js +240 -202
  32. package/figma-cache/js/ui-facts-normalizer.js +233 -0
  33. package/package.json +95 -74
  34. package/scripts/cross-project-e2e.js +453 -0
  35. package/scripts/ui-1to1-audit.js +431 -0
  36. package/scripts/ui-auto-acceptance.js +248 -0
  37. package/scripts/ui-preflight.js +289 -0
  38. package/scripts/ui-profile.js +46 -0
  39. package/scripts/ui-report-aggregate.js +124 -0
  40. package/cursor-bootstrap/skills/ui-baseline-governance/SKILL.md +0 -51
@@ -0,0 +1,24 @@
1
+ {
2
+ "id": "input",
3
+ "description": "Generic text-input recipe for form controls",
4
+ "structureTemplate": [
5
+ "label",
6
+ "input-shell",
7
+ "prefix-or-suffix",
8
+ "helper-text"
9
+ ],
10
+ "stateMachine": {
11
+ "requiredStates": ["default", "focused", "error", "disabled"],
12
+ "optionalStates": ["readonly", "success"]
13
+ },
14
+ "tokenPriority": [
15
+ "border",
16
+ "text",
17
+ "placeholder",
18
+ "background"
19
+ ],
20
+ "pitfalls": [
21
+ "Do not merge error state into default style",
22
+ "Do not ignore focused outline or border token"
23
+ ]
24
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "id": "modal",
3
+ "description": "Generic modal/dialog recipe for overlay interactions",
4
+ "structureTemplate": [
5
+ "overlay",
6
+ "container",
7
+ "header",
8
+ "content",
9
+ "actions"
10
+ ],
11
+ "stateMachine": {
12
+ "requiredStates": ["closed", "open"],
13
+ "optionalStates": ["loading", "confirming"]
14
+ },
15
+ "tokenPriority": [
16
+ "overlay",
17
+ "surface",
18
+ "text",
19
+ "action"
20
+ ],
21
+ "pitfalls": [
22
+ "Do not remove overlay semantics when modal opens",
23
+ "Do not skip action button hierarchy in footer"
24
+ ]
25
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "id": "radio",
3
+ "description": "Generic radio recipe for single-select controls",
4
+ "structureTemplate": [
5
+ "control",
6
+ "dot-indicator",
7
+ "label"
8
+ ],
9
+ "stateMachine": {
10
+ "requiredStates": ["unselected", "selected", "disabled"],
11
+ "optionalStates": ["error"]
12
+ },
13
+ "tokenPriority": [
14
+ "control-border",
15
+ "control-fill",
16
+ "dot",
17
+ "label-text"
18
+ ],
19
+ "pitfalls": [
20
+ "Do not mix selected/unselected semantics",
21
+ "Do not remove keyboard focus style"
22
+ ]
23
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "id": "select",
3
+ "description": "Generic select/dropdown recipe for UI generation",
4
+ "structureTemplate": [
5
+ "trigger",
6
+ "panel",
7
+ "option",
8
+ "selected-indicator"
9
+ ],
10
+ "stateMachine": {
11
+ "requiredStates": ["default", "expanded", "selected", "unselected"],
12
+ "optionalStates": ["disabled", "loading"]
13
+ },
14
+ "tokenPriority": [
15
+ "background",
16
+ "text",
17
+ "icon",
18
+ "border"
19
+ ],
20
+ "pitfalls": [
21
+ "Do not hardcode selected style without state linkage",
22
+ "Do not drop unselected state when selected exists"
23
+ ]
24
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "id": "table",
3
+ "description": "Generic data-table recipe for tabular views",
4
+ "structureTemplate": [
5
+ "table-shell",
6
+ "header-row",
7
+ "body-rows",
8
+ "empty-state",
9
+ "pagination"
10
+ ],
11
+ "stateMachine": {
12
+ "requiredStates": ["default", "row-hover", "row-selected"],
13
+ "optionalStates": ["loading", "empty", "error"]
14
+ },
15
+ "tokenPriority": [
16
+ "header",
17
+ "row-bg",
18
+ "row-text",
19
+ "divider"
20
+ ],
21
+ "pitfalls": [
22
+ "Do not collapse row-selected and row-hover style",
23
+ "Do not remove empty-state when data is unavailable"
24
+ ]
25
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "id": "tabs",
3
+ "description": "Generic tabs recipe for segmented navigation",
4
+ "structureTemplate": [
5
+ "tab-list",
6
+ "tab-item",
7
+ "active-indicator",
8
+ "tab-panel"
9
+ ],
10
+ "stateMachine": {
11
+ "requiredStates": ["default", "active"],
12
+ "optionalStates": ["hover", "disabled"]
13
+ },
14
+ "tokenPriority": [
15
+ "active-text",
16
+ "inactive-text",
17
+ "indicator",
18
+ "panel-bg"
19
+ ],
20
+ "pitfalls": [
21
+ "Do not render tab-panel without matching active tab state",
22
+ "Do not drop active indicator for selected tab"
23
+ ]
24
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "id": "tooltip",
3
+ "description": "Generic tooltip recipe for contextual hints",
4
+ "structureTemplate": [
5
+ "trigger",
6
+ "bubble",
7
+ "arrow",
8
+ "content"
9
+ ],
10
+ "stateMachine": {
11
+ "requiredStates": ["hidden", "visible"],
12
+ "optionalStates": ["delayed", "pinned"]
13
+ },
14
+ "tokenPriority": [
15
+ "bubble-bg",
16
+ "text",
17
+ "shadow",
18
+ "arrow"
19
+ ],
20
+ "pitfalls": [
21
+ "Do not show tooltip persistently in hidden state",
22
+ "Do not detach arrow color from bubble color"
23
+ ]
24
+ }