@ryuxdsgn/design-intelligence 0.0.0-stage → 2.6.1

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.
@@ -0,0 +1,140 @@
1
+ import { CAPTURE_TABLE } from "./capture.js";
2
+ // RYUX Analyze: understand an existing interface before changing it. Source of truth for
3
+ // skills/ryux-analyze/SKILL.md, rendered by render.ts and installed by the CLI (group "analyze").
4
+ export const ANALYZE_DESCRIPTION = "RYUX Analyze - understand an existing interface before you change or rebuild it. Extracts layout, type, spacing, color roles, components, hierarchy, navigation, interaction, imagery, motion, and design language from a Figma link, pen.dev design, website URL, screenshot, or code, each labeled measured, observed, or inferred. Use when asked to analyze, reverse-engineer, document, or learn from an existing design.";
5
+ export const ANALYZE_BODY = `# RYUX Analyze
6
+
7
+ > What is actually in this interface?
8
+
9
+ Analyze answers "what exists?" and nothing more: it describes an existing design so that the next
10
+ decision (design, build, or critique) starts from facts. It is not screenshot-to-code, and it does not judge quality; that is
11
+ \`ryux-critique\`. When the ryux MCP is connected, comparable Indonesian screens back the patterns
12
+ you name (\`search_screens\`, \`get_local_pattern\`).
13
+
14
+ ## When to use it
15
+
16
+ - Before changing or extending a product you did not design.
17
+ - When asked to analyze, reverse-engineer, document, or learn from a design or a competitor.
18
+ - To turn an existing design into a \`DESIGN.md\` that Build can follow.
19
+
20
+ ## Steps
21
+
22
+ ### 1. Capture the design
23
+
24
+ ${CAPTURE_TABLE}
25
+
26
+ ### 2. Label every observation
27
+
28
+ | Label | Meaning | Example |
29
+ | --- | --- | --- |
30
+ | **Measured** | Read from the source: Figma variables, CSS, pen.dev node properties | body 16px / 24px, from CSS |
31
+ | **Observed** | Clearly visible in a capture, not measured | two-column layout at 1440 |
32
+ | **Inferred** | A reasonable guess | probably an 8px spacing scale |
33
+
34
+ Never present an inferred value as measured. When only a screenshot is available, most values are
35
+ Observed or Inferred; say so.
36
+
37
+ Then list what is **Unknown**: what matters for the next decision and the input cannot answer, such
38
+ as what an action does on tap, the business priority behind an order, a fact's source, or a rule
39
+ nobody gave. Never fill an unknown with a guess. List meaningful unknowns, not mandatory ones: if
40
+ the input answers something, it is not unknown, and a short list is fine.
41
+
42
+ ### 3. Inventory
43
+
44
+ Cover what the captures show; skip what they do not, and say it was not visible.
45
+
46
+ | Group | What to record |
47
+ | --- | --- |
48
+ | **Structure** | page and sections, containers and max width, grid (columns, gutters), navigation model and depth, content hierarchy (the order the eye follows, the primary action) |
49
+ | **Visual** | typography (families, size and weight scale, line heights), spacing scale and where it breaks, color roles (surface, text, accent, status, with values when measured), radius, border, shadow, density, alignment |
50
+ | **Components** | each component seen (button, input, select, table, card, modal, tabs, navigation, others), its variants, and the states seen (default, hover, focus, disabled, error, loading) |
51
+ | **Behavior** | interaction and feedback, loading, error, and empty states, confirmation and undo, responsive behavior (only when more than one width was captured) |
52
+ | **Imagery and motion** | art direction (product UI, photography, illustration, 3D) and its style; each visual's job; composition (where the focal point sits, the space kept for copy); motion character and level (L1 to L5) when motion was captured |
53
+ | **Design language** | the visual language in 3 to 5 traits, each tied to evidence; component patterns; the spacing and typography systems; interaction patterns |
54
+
55
+ Also note content and tone (natural Indonesian or translated, how money and dates are written) and
56
+ local patterns (QRIS, virtual accounts, OTP, addresses, paylater, e-KYC).
57
+
58
+ ### 4. Patterns and evidence
59
+
60
+ Name the recurring patterns and where they appear. With the ryux MCP connected, cite comparable
61
+ screens by \`screen_id\`; without it, say the patterns come from this design alone. A pattern seen in
62
+ real apps is an **observed pattern**, not a best practice: say where it was observed, when it is
63
+ useful, and its risk. Popular apps can be wrong. Keep three sources apart: what you **observed**
64
+ in this design, what you **inferred**, and what is **knowledge** (a known pattern or standard,
65
+ cited).
66
+
67
+ ### 5. Report
68
+
69
+ Structured, not an essay. This report is the input for \`ryux-critique\` and for a \`DESIGN.md\`.
70
+
71
+ \`\`\`
72
+ # RYUX Design Analysis
73
+
74
+ ## Context
75
+ Source: Figma frame "Checkout" (node 1:2) / https://... / pen.dev frame "..."
76
+ Viewport: 1440 desktop, 390 mobile
77
+ Captured with: Figma MCP / Playwright / pencil MCP
78
+ Not visible: hover and focus states, empty and error states
79
+ Assumptions: ...
80
+
81
+ ## Layout
82
+ Container: 1200 max width, 24px side padding (Measured)
83
+ Grid: 12 columns, 24 gutter (Inferred)
84
+ Spacing: 8px scale; one 20px gap breaks it (Observed)
85
+ Density: compact, ledger-like (Observed)
86
+ Alignment: left-aligned text, numbers right-aligned (Observed)
87
+
88
+ ## Typography
89
+ Font: Inter; JetBrains Mono for amounts (Measured)
90
+ Scale: 14 / 16 / 20 / 32 / 56 (Measured)
91
+ Hierarchy: headline, amount, label, helper (Observed)
92
+
93
+ ## Visual
94
+ Color roles: surface #F6F3EC, text #1C1B18, accent #0F6B4B (Measured)
95
+ Radius / Border / Shadow: ...
96
+
97
+ ## Components
98
+ Primary: button (filled, 48 tall), payment method row
99
+ Secondary: text link, tag
100
+ States seen: default, selected
101
+
102
+ ## Interaction
103
+ Navigation: top nav, 3 items
104
+ Actions: one primary action per screen
105
+ States: ...
106
+ Feedback: ...
107
+
108
+ ## Design Language
109
+ - Dense and ledger-like: monospaced amounts, thin row dividers
110
+
111
+ ## Patterns Detected
112
+ - Payment method picker with QRIS first (scr_...)
113
+
114
+ ## Evidence
115
+ Each item above carries its label and source; RYUX Knowledge screen_ids where used.
116
+
117
+ ## Unknown
118
+ - What the primary action does on tap: loading, result, failure
119
+ - Why QRIS is first: business priority or habit
120
+ - Whether the amounts are real data or examples
121
+ \`\`\`
122
+
123
+ ### 6. Optional: a visual direction, not a copy
124
+
125
+ When asked to make something "with the same visual language", extract the direction (traits, art
126
+ direction, composition habits, motion personality) and write it as a Visual Brief for the new
127
+ product (see ryux-ui). Never reproduce the reference's images, layout, or brand assets.
128
+
129
+ ### 7. Optional: a DESIGN.md draft
130
+
131
+ When the next step is Build, turn the inventory into a short \`DESIGN.md\`: tokens (color roles,
132
+ type scale, spacing, radius), principles (the design-language traits), and patterns, each with its
133
+ source and confidence. Keep Inferred values marked so the builder can confirm them.
134
+
135
+ ## Don'ts
136
+
137
+ - Don't edit the source while analyzing.
138
+ - Don't generate code from the screenshot as the analysis.
139
+ - Don't judge good or bad; list open questions and hand off to \`ryux-critique\`.
140
+ - Don't fill gaps with typical values and present them as found.`;
@@ -0,0 +1,12 @@
1
+ // The read-only capture step shared by RYUX Analyze and RYUX Critique: how to see the real design
2
+ // before saying anything about it. Embedded in both skills by analyze.ts and critique.ts.
3
+ export const CAPTURE_TABLE = `| Source | How to capture | If it is not available |
4
+ | --- | --- | --- |
5
+ | Figma link (\`figma.com/design/<fileKey>/...?node-id=1-2\`) | Figma MCP: \`get_screenshot\` with the file key and node id (turn \`1-2\` into \`1:2\`) for the image; \`get_metadata\` for the frame tree; \`get_design_context\` and \`get_variable_defs\` for text, components, and variables (measured values) | Ask for a PNG export of the frames, or for the Figma MCP to be connected |
6
+ | pen.dev design | pencil MCP: \`get_app_state\` to list frames; \`execute\` with \`TakeScreenshot([frameId])\` for the image, and a \`Get\` visitor that prints text nodes, node properties (fonts, sizes, fills, gaps), and any \`ctx.problems\` (clipped content) | Ask for an exported PNG |
7
+ | Website URL | \`npx playwright screenshot --full-page --viewport-size=1440,900 <url> desktop.png\` and \`--viewport-size=390,844\` for mobile; a browser tool for interaction states (hover, focus, an error) when one is available; the page HTML and CSS for headings, labels, alt text, landmarks, and declared values | Ask for screenshots at desktop and mobile width |
8
+ | Screenshot or image | Read the image directly | none |
9
+ | Code only | Render it first (see \`ryux-visual-qa\`) | Work from the code and state that it was not rendered |
10
+
11
+ Stay read-only: do not edit the Figma file, the pen.dev document, or the site. Record what you
12
+ captured: the frames or URLs, the viewports, and the tools.`;