Frontend Implementation Skill
Trigger conditions (when to apply)
- Apply when the request is "UI implementation," "design to implementation," "Figma to implementation," "Pencil to implementation," "component implementation," "style adjustment," "responsive support," or "fixing broken existing UI."
- Leave technology (React/Next/Svelte/Tailwind, etc.) to another skill. This Skill focuses on "reinterpretation" and "implementation judgment criteria."
- The type of design tool does not matter (Figma/Pencil/Canva/hand-drawn sketches, etc.).
Common prerequisites (reference)
- Implementation conventions, tone, TDD, Doc comments, etc. follow
CLAUDE.md CLAUDE.md
Basic policy of this Skill (organizing axes)
- Basic policy: The goal is not "tracing details" but "overall ratios, consistency, breakage resistance, and coherence."
- Translation: Numeric values (px) from design tools are reference values. Implementation converts them to scale/ratio/structure .
- Exception management: Fixed values are exceptions. If adopting them, verbalize "why fixing is necessary" (specifications, media, tap areas, etc.).
Philosophy (judgment rules)
- UI is not a "picture" but a "set of constraints." Complete it including states (loading/error/empty/disabled).
- "Alignment" is not created by fine-tuning margin. Arrange it with structure (flex/grid) and
gap gap
- Avoid fixed heights; consider
min/max/overflow min-height
- Typography is role-based. Do not proliferate it by copying and pasting numeric values.
- Exceptions (long text/zero items/failure/delay) must not be added later. Handle them from the start.
- Verbalize the design intent first (what to make stand out, how to guide the viewer's gaze), and reduce it to a structure that does not break that.
- Do not "cut out" the horizontal width. For the design's reference viewport (the RDD target display environment), in principle make the UI "follow the screen width" (prioritize the intent of SCALE/FILL).
- Creating only the "visible range" from the left (cutting out part of the screen and stopping there) is prohibited.
- Separate full-bleed (background extends to the edges) from content (maximum width of the body text); express the background with
w-fullw-full max-width + margin-inline: auto and the body text with
Reinterpretation procedure (design tool → implementation)
1) Read before numeric values (what to extract)
- Purpose (what you want the user to first understand/do on this screen)
- Gaze guidance (the order of look first → look next → look last)
- Strength (main emphasis/semi-main/supporting)
- Hierarchy (what is the parent and what is the group)
- Stretch intent/states (reinterpret tool-specific expressions such as Auto Layout / Constraints / Variants)
- Whitespace rules (the laws of gap/padding)
- Alignment (what is aligned, and against what reference)
- Variable elements (text length, list count, image aspect ratio, input values)
2) Convert to implementation (rules)
- px → Round to the scale(e.g., 4/8/12/16/24/32/40/48)
- font-size → Map to roles(heading/body/supplementary)
- Local adjustment of margin → Convert to layout structure(flex/grid/gap, organize parent-child responsibilities)
- Fixed width/height → Convert to constraints(min/max, wrapping, ellipsis, overflow)
- Width design → Convert to responsibilities of background/container/content(Background covers screen width; content is ensured by max width and whitespace rules)
2.5) Decide whether to "align or not align" (ratio, visual guidance)
- When to align
- You want repeated elements (cards/lists/forms) to be "compared"
- You want to create a visual path for the main column (body text/primary input/primary CTA)
- The goal is to reduce hesitation (admin screens/settings/many inputs)
- When to allow breaking alignment
- You want to intentionally make the "star" stand out (hero/primary CTA/important notification)
- You want to break information grouping (emphasize section boundaries)
- Decoration or media is the star, and impression takes priority over rules (but robustness against breakage must be ensured)
- Rules when not aligning (accident prevention)
- Leave at least one "reference line" somewhere (e.g., only the left edge of headings is aligned)
- Limit offset patterns to 1-2 types (consistency dies when offset patterns increase)
- At responsive sizes, lean toward the "aligned side" (reduce offsets at narrow widths)
2.6) Preserve the "width distribution (weight)" of horizontal arrangements (prevent equal-division accidents)
- Width distribution is visual guidance itself. Treating a "weight" such as making the 1st and 2nd columns wider and the 3rd column supplementary... as intent.
- Things you must not do (common accidents)
- Carelessly equalizing horizontal arrangements so that supporting roles have the same presence as the star (e.g.,
flex: 1 applying to all elements)
- Creating a state where "the edges are aligned, but the importance levels have become aligned"
- Judgments to preserve
- First decide the columns (or blocks) for "star/semi-star/supporting role," and leave the **ratio (width step)** as a specification
- "Aligning" should be treated separately from reference-line alignment と width distribution (alignment may be aligned, but widths may not be aligned)
- Guidelines for translating into implementation (technology-agnostic)
- If it can be expressed as a ratio, ratio (e.g., 2 : 2 : 1 / 5 : 3 : 2) Prioritize
- If it breaks with variable length, minimum width (min) と wrapping/packing decide first
- For narrow widths, allow changing the column layout (vertical stacking), and maintain the order of importance
A memo on "expressing ratios" premised on flex / grid (CSS concepts)
- Express ratios (weights) through "growth"
- flex: Express ratios through each element's "growth (grow weight)" (beware the equalization trap)
- grid: Express ratios through the "ratio (weight such as fr)" of columns (makes column roles easier to specify)
- Since ratios alone will break, always hold constraints as a set
- Design minimum width (not becoming too small) / maximum width (not becoming too fat) / wrapping (wrap/line breaks) / omission (ellipsis) as a set
- Make explicit the conditions under which ratios break
- Example: For narrow widths, "drop supporting columns below," and maintain the order of protagonist → supporting lead → supporting role
Judgment by typical pattern (general-purpose)
- (a) List/card columns (want to compare)
- Intent: Since you are comparing "the same type," basically align them (baseline, card height, position of main information).
- Width allocation: Break the ratio only when there is a card you want to make stand out (favorite/recommended) (otherwise lean toward equal).
- Narrow width: Even when making it one column (vertical stacking), maintain the order of main information → auxiliary information.
- (b) Form row (want to improve input efficiency)
- Intent: Align to reduce hesitation (create baselines for label column/input column/auxiliary column).
- Width allocation: The protagonist is the input field, and the supporting roles are auxiliary (e.g., unit/hint/action), so make the auxiliary column small and reduce its presence (do not divide equally).
- Narrow width: Put the label on top, the input below, and the auxiliary below that (maintain the order).
- (c) Header (search + button + auxiliary)
- Intent: Focus on exactly one protagonist among search/title/main CTA, and drop the others to auxiliary (do not create two protagonists).
- Width allocation: Make the protagonist (e.g., search) thick and the auxiliary (e.g., filter/help/count) thin to express weight (do not divide equally).
- Narrow width: Allow auxiliary elements to wrap/become a menu/be omitted, and prioritize the operability of the protagonist.
3) Handling unknowns (order of short questions)
- Input/output (display/operation/result)
- State transitions (when it becomes loading/error/disabled)
- Constraints (responsive/variable length/max lines/wrapping rules)
- Edge cases (0 items/long text/communication failure/delay/slow device)
Implementation conventions (rules for robustness)
Typography (ratio and readability)
- Units are in principle
rem(if necessary, clamp())。em is used only in situations where you want to align by the parent's ratio (do not abuse it).
line-height is in principle unitless (e.g., 1.5–1.7).
- The text prioritizes readability (guideline:
max-width: 60ch)。
Spacing (scale and responsibilities)
- Round whitespace to the scale (do not increase "fractional values").
- Do not scatter margins to child elements; prioritize the parent's
gap/padding .
Maintain ratios (proportions)
- "The overall look" is ensured by ratios, not by matching numbers (column width ratios, spacing step differences, typography step differences).
- Prioritize "max width + whitespace rules" over fixed widths (less likely to break at narrow/wide widths).
- When there is a "column that should not stand out" in a horizontal arrangement, do not equalize its presence by dividing equally (preserve the intent of the width allocation).
Layout (create alignment through structure)
- Make flex the basis for one-directional arrangement, grid for two-dimensional placement, and gap for spacing.
position: absolute only when there is a purpose such as overlap/decoration.
- For images, maintain the ratio as the basis, and if necessary,
aspect-ratio incorporate an equivalent design.
Conditions under which fixed values are allowed (exceptions)
- Media such as icons/thumbnails, tap areas, header heights determined by specifications, etc.
- Even if the purpose is preventing breakage, first
min/max consider, then fall back to fixing.
States and resilience (required)
- Include default/hover/active/focus/disabled/loading/error/empty in the implementation specifications.
- Handle long text, zero items, communication failures, and delays from the start (no adding later).
Output format (always in this order)
- Purpose (what this UI achieves)
- Assumptions (types of design input / existing conventions / constraints)
- Interpretation results (hierarchy/alignment/whitespace rules/variable elements)
- Implementation policy (layout structure / scale / exception conditions)
- State design (default/hover/active/focus/disabled/loading/error/empty)
- Checklist self-assessment (OK/needs action)
Checklist (finishing quality)
- empty / loading / error are present
- disabled conditions are present (prevention of repeated clicks/invalid input)
- Does not break with long text (wrap/ellipsis/max width/overflow)
- Keyboard operation and focus are present
- Does not break at narrow widths/mobile
- Whitespace/text/color align with the conventions (tokens/scale)
Common pitfalls
- Copying px from design data breaks exceptional states and responsiveness
- Fine-tuning margins multiplies and becomes unmaintainable
- Prioritizing "visual matching" causes states (loading/error/empty) to be added later