Individual skill
design-to-react-algorithms
Reverse-engineering a Sketch file (or Figma export with similar shape) into pixel-perfect React + CSS — the iteration mental model, tree reconstruction, layout inference algorithms, geometry math, visual-regression diffing, and the style/typography/path conversions that make "improvement without regression" enforceable. Trigger even if the user doesn't explicitly mention "algorithms" but is converting a design source into web code, building a design-to-code pipeline, or struggling to make incremental fidelity improvements without breaking previously-converted output.
skills/.experimental/design-to-react-algorithms/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Instructions only
- Last checked
- Nov 5, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 221
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: codex
- design Derived category
- engineering Derived category
- design-interface Derived category
- engineering-web Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
AGENTS.mddoc · 13,892 bytesSKILL.mdcore · 11,782 bytesSKILL.mdcore · 11,782 bytesSKILL.mdcore · 11,782 bytesSKILL.mdcore · 11,782 bytesassets/templates/_template.mddoc · 3,839 bytesmetadata.jsonasset · 1,573 bytesreferences/_sections.mddoc · 3,527 bytesreferences/diff-antialias-aware-pixelmatch-threshold.mddoc · 2,987 bytesreferences/diff-baseline-per-component-not-per-page.mddoc · 3,116 bytesreferences/diff-perceptual-hash-for-wrong-component-detection.mddoc · 3,209 bytesreferences/diff-region-budgeted-tolerances.mddoc · 3,146 bytesreferences/diff-subtree-bisection-to-localize-regression.mddoc · 3,519 bytesreferences/diff-use-ssim-for-aa-content.mddoc · 3,170 bytesreferences/geom-clipping-bounds-intersect-not-union.mddoc · 3,925 bytesreferences/geom-compose-parent-transforms-before-emit.mddoc · 3,298 bytesreferences/geom-rotation-is-css-transform.mddoc · 2,932 bytesreferences/geom-round-only-at-leaves.mddoc · 2,836 bytesreferences/geom-shape-group-bounds-via-union.mddoc · 3,395 bytesreferences/iter-baseline-snapshot-gate.mddoc · 2,078 bytesreferences/iter-bisect-from-root.mddoc · 2,266 bytesreferences/iter-convert-symbols-before-instances.mddoc · 2,513 bytesreferences/iter-freeze-design-tokens-first.mddoc · 2,550 bytesreferences/iter-keep-known-good-branch.mddoc · 2,139 bytesreferences/iter-one-family-per-pr.mddoc · 2,319 bytesreferences/layout-detect-grid-via-2d-coordinate-clustering.mddoc · 3,753 bytesreferences/layout-flex-group-enum-mapping.mddoc · 3,491 bytesreferences/layout-ignore-layout-is-absolute-escape.mddoc · 3,289 bytesreferences/layout-infer-flex-from-axis-projection-overlap.mddoc · 3,934 bytesreferences/layout-preserve-wrapping-enabled.mddoc · 2,660 bytesreferences/layout-promote-freeform-when-equal-gaps.mddoc · 3,208 bytesreferences/layout-reverse-engineer-padding-not-margin.mddoc · 3,276 bytesreferences/path-apple-smooth-corners-via-superellipse.mddoc · 4,261 bytesreferences/path-curve-point-to-svg-cubic-bezier.mddoc · 3,885 bytesreferences/path-flatten-boolean-ops-at-parse-time.mddoc · 3,265 bytesreferences/path-honor-winding-rule.mddoc · 3,427 bytesreferences/path-rectangle-with-fixed-radius-is-css.mddoc · 3,954 bytesreferences/style-gradient-angle-via-atan2.mddoc · 3,475 bytesreferences/style-per-corner-radii-shorthand.mddoc · 3,500 bytesreferences/style-preserve-display-p3.mddoc · 3,347 bytesreferences/style-reconcile-border-position.mddoc · 3,853 bytesreferences/style-srgb-float-to-hex-via-gamma-correct-path.mddoc · 3,034 bytesreferences/style-stack-multi-shadow-in-paint-order.mddoc · 3,464 bytesreferences/tree-clipping-mask-is-stacking-context.mddoc · 3,070 bytesreferences/tree-collapse-passthrough-groups.mddoc · 2,895 bytesreferences/tree-foreign-symbols-become-library-imports.mddoc · 3,306 bytesreferences/tree-hash-subtrees-for-componentization.mddoc · 2,895 bytesreferences/tree-hoist-shared-style-via-subtree-equivalence.mddoc · 2,859 bytesreferences/tree-resolve-overrides-before-emit.mddoc · 3,061 bytesreferences/type-build-font-fallback-ladder.mddoc · 4,018 bytesreferences/type-kerning-pt-to-em-letter-spacing.mddoc · 2,718 bytesreferences/type-paragraph-spacing-between-not-after.mddoc · 3,051 bytesreferences/type-pt-lineheight-to-unitless.mddoc · 2,899 bytesreferences/type-split-attributed-string-runs-only-when-differ.mddoc · 3,593 bytes
Read excerpt
# dot-skills Design-to-React Conversion Best Practices
The reverse-engineering pipeline that converts Sketch files into pixel-perfect React + CSS, **with regression-safe iteration as the load-bearing constraint**. The skill is organized around the cascade effect of design-to-code conversion: a wrong call in stage N corrupts every output from stage N+1 onward, so categories are ordered by how much downstream they own.
The user's primary requirement — *"each improvement doesn't cause regressions"* — is enforceable only if the iteration loop, the layer tree, and the layout solver are correct *before* you start polishing styles. Read the rules in priority order.
## When to Apply
- Building a converter that ingests a `.sketch` file (or equivalent design source) and emits React + CSS
- Iterating on an existing converter where each improvement risks breaking other components
- Diagnosing why a converted component "almost matches" the design but visual-regression fails
- Designing the snapshot-gate / baseline strategy for a design-to-code pipeline
- Choosing between flexbox vs grid vs absolute positioning when the source is freeform geometry
- Translating Sketch-specific primitives (`MSImmutableFlexGroupLayout`, `attributedString`, `curvePoint`, `MSImmutableStyleCorners`) into idiomatic CSS