agents/projects/chrome-design-system/skills/figma-to-views-json/SKILL.md
//src/).When given a Figma design URL (e.g.,
https://www.figma.com/design/:fileKey/:fileName?node-id=:nodeId):
fileKey and the nodeId (replace
hyphens with colons, e.g., 128-1951 becomes 128:1951).get_design_context with fileKey and
nodeId to fetch the metadata, layout hierarchy, layer styles, and text
annotations of the frame.project-knowledge skill to map Figma
components to Chromium C++ Views components.project-knowledge skill to translate the variables from the Figma
design (e.g., desktop/sys/base-colors/base) to equivalent C++ identifiers
(ui::kColorSysBase).Before writing any code, first check if the user already did an audit of this Figma design against production coding standards within the current chat session's recent history (past 5 commands). If not, perform the audit. Incorporate the feedback from this audit into the following code implementation.
//ui/views/examples/json_view_builder_schema.ms
for the rules about which components/properties are available for use.ui::ColorId equivalents as documented in Chrome Design System token
mappings.BoxLayout, BoxLayoutView,
FlexLayout, FlexLayoutView, TableLayout or TableLayoutView for
structured horizontal and vertical stacking, or fully structured tables.
InsetsMetric: and
SetBetweenChildSpacing(...) and DistanceMetric: values for measurements.layout_flex pseudo-property on components in horizontal or vertical
layouts to distribute space proportionally.out/<out> directory. Ask the user if multiple are found.
Views Examples app bundle within the out/<out> directory. To run from
the command-line, the executable needs to be referenced within the bundle.--enable-examples="Views Canvas" switch and the --views-canvas-json-file
switch with the quoted path to the JSON file generated in the previous step
above. Be sure to launch the views_examples app onto the same GUI output
screen as the one the user is logged in with.<component_name>.json