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…
от pproenca★ 231 звезда на GitHubОб этом скилле
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
.sketchfile (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
Rule Categories by Priority
The ordering is the cascade — fix earlier stages first; later-stage fixes are wasted if the upstream tree is wrong.
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Reverse-Engineering Iteration Strategy | CRITICAL | iter- |
| 2 | Tree Reconstruction & Symbol Resolution | CRITICAL | tree- |
| 3 | Layout Algorithms (Flex/Freeform Inference) | CRITICAL | layout- |
| 4 | Coordinate & Geometry Math | HIGH | geom- |
| 5 | Visual Regression & Diff Algorithms | HIGH | diff- |
| 6 | Style Translation (Color, Gradient, Shadow, Border) | MEDIUM-HIGH | style- |
| 7 | Typography Math | MEDIUM | type- |
| 8 | Path & Shape Rendering | MEDIUM | path- |
Quick Reference
1. Reverse-Engineering Iteration Strategy (CRITICAL)
iter-bisect-from-root— Convert top-down, bisect bottom-up to localize regressions in O(log n)iter-baseline-snapshot-gate— Every change must pass committed baselines before mergeiter-convert-symbols-before-instances— Topologically sort symbols → instances; never inline duplicatesiter-freeze-design-tokens-first— Extract sharedSwatches/layerStyles to CSS variables BEFORE any componentiter-one-family-per-pr— Scope conversions to one component family per iterationiter-keep-known-good-branch— Maintain a baseline branch as a three-way regression triage anchor
2. Tree Reconstruction & Symbol Resolution (CRITICAL)
tree-resolve-overrides-before-emit— ApplyoverrideValuesagainst master into named propstree-hash-subtrees-for-componentization— Structural hashing finds repetition designers missedtree-collapse-passthrough-groups— Drop no-style single-child groups; preserve world coordstree-hoist-shared-style-via-subtree-equivalence— Subtree equivalence + modifier classes, not per-property deduptree-clipping-mask-is-stacking-context—hasClippingMaskrequiresisolation: isolate+ clip-pathtree-foreign-symbols-become-library-imports— Foreign symbols are package imports, not duplicates
3. Layout Algorithms (CRITICAL)
layout-flex-group-enum-mapping— MapMSImmutableFlexGroupLayoutenums 1:1 to CSS flex propertieslayout-infer-flex-from-axis-projection-overlap— 1D separating-axis test for freeform → flex row/columnlayout-detect-grid-via-2d-coordinate-clustering— Cluster edge coordinates with ε to detect CSS Gridlayout-promote-freeform-when-equal-gaps— Equal gaps within tolerance →display: flex; gap: Npxlayout-reverse-engineer-padding-not-margin— Insets become parent padding; rebase childrenlayout-preserve-wrapping-enabled—wrappingEnabledis the only way the source signals respon
Установить design-to-react-algorithms в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл 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.
Как установить скилл design-to-react-algorithms?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл design-to-react-algorithms запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic