@hegemonart/get-design-done 1.16.0 → 1.19.0
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.
- package/.claude-plugin/marketplace.json +12 -4
- package/.claude-plugin/plugin.json +22 -4
- package/CHANGELOG.md +111 -0
- package/README.md +27 -2
- package/agents/design-auditor.md +65 -1
- package/agents/design-context-builder.md +6 -1
- package/agents/design-doc-writer.md +21 -0
- package/agents/design-executor.md +22 -4
- package/agents/design-pattern-mapper.md +62 -0
- package/agents/design-phase-researcher.md +1 -1
- package/agents/motion-mapper.md +74 -9
- package/agents/token-mapper.md +8 -0
- package/package.json +16 -2
- package/reference/components/README.md +27 -23
- package/reference/components/alert.md +198 -0
- package/reference/components/badge.md +202 -0
- package/reference/components/breadcrumbs.md +198 -0
- package/reference/components/chip.md +209 -0
- package/reference/components/command-palette.md +228 -0
- package/reference/components/date-picker.md +227 -0
- package/reference/components/file-upload.md +219 -0
- package/reference/components/list.md +217 -0
- package/reference/components/menu.md +212 -0
- package/reference/components/navbar.md +211 -0
- package/reference/components/pagination.md +205 -0
- package/reference/components/progress.md +210 -0
- package/reference/components/rich-text-editor.md +226 -0
- package/reference/components/sidebar.md +211 -0
- package/reference/components/skeleton.md +197 -0
- package/reference/components/slider.md +208 -0
- package/reference/components/stepper.md +220 -0
- package/reference/components/table.md +229 -0
- package/reference/components/toast.md +200 -0
- package/reference/components/tree.md +225 -0
- package/reference/css-grid-layout.md +835 -0
- package/reference/data-visualization.md +333 -0
- package/reference/external/NOTICE.hyperframes +28 -0
- package/reference/form-patterns.md +245 -0
- package/reference/image-optimization.md +582 -0
- package/reference/information-architecture.md +255 -0
- package/reference/motion-advanced.md +754 -0
- package/reference/motion-easings.md +381 -0
- package/reference/motion-interpolate.md +282 -0
- package/reference/motion-spring.md +234 -0
- package/reference/motion-transition-taxonomy.md +155 -0
- package/reference/motion.md +20 -0
- package/reference/onboarding-progressive-disclosure.md +250 -0
- package/reference/output-contracts/motion-map.schema.json +135 -0
- package/reference/platforms.md +346 -0
- package/reference/registry.json +445 -220
- package/reference/registry.schema.json +4 -0
- package/reference/rtl-cjk-cultural.md +353 -0
- package/reference/user-research.md +360 -0
- package/reference/variable-fonts-loading.md +532 -0
- package/scripts/lib/easings.cjs +280 -0
- package/scripts/lib/parse-contract.cjs +220 -0
- package/scripts/lib/spring.cjs +160 -0
- package/scripts/tests/test-motion-provenance.sh +64 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# Onboarding & Progressive Disclosure
|
|
2
|
+
|
|
3
|
+
New-user experience is the highest-leverage surface in any product. A user who does not reach the aha moment in the first session almost never returns. These guidelines encode the research and failure patterns accumulated across thousands of product launches into concrete, actionable rules.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. First-Run Pattern Matrix
|
|
8
|
+
|
|
9
|
+
Four dominant patterns exist for first-run experiences. Choosing the wrong one for your product type is one of the most common causes of early churn.
|
|
10
|
+
|
|
11
|
+
| Pattern | When to use | Cognitive load | Completion rate signal | Best for product type |
|
|
12
|
+
|---|---|---|---|---|
|
|
13
|
+
| **Empty-state onboarding** | Product value is only visible once data exists; blank canvas is the default state | Low — user acts on their own terms | First meaningful action taken (e.g. first item created) | Creation tools, CRMs, project trackers |
|
|
14
|
+
| **Product tour** | Interface is dense or non-obvious; terminology requires context | Medium — user is passive during tour | Tour completion rate (misleading — see note) | Feature-rich SaaS dashboards, admin tools |
|
|
15
|
+
| **Checklist-style** | Value comes from setup completion; multiple required steps exist | Medium-high — visible task debt | Checklist completion %, items checked per session | Configuration-heavy tools, integrations |
|
|
16
|
+
| **Progressive disclosure** | Product has many features but a clear primary use case; depth should follow intent | Low at entry, scales with engagement | Feature adoption breadth over time | Consumer apps, platforms with power users |
|
|
17
|
+
|
|
18
|
+
**Empty-state onboarding** works because the blank state communicates what belongs there. A well-designed empty state — with a clear headline, one CTA, and an illustrative hint — removes the need for any separate tutorial. The first action the user takes is the onboarding. The empty state must not look like an error; it should look like an invitation. Use an illustration or icon that visually previews the populated state, so users understand what they are working toward.
|
|
19
|
+
|
|
20
|
+
**Product tours** have notoriously misleading completion metrics. A user who clicks through all seven steps of a tour has not learned the product; they have dismissed it. Tours are most defensible when they label unfamiliar terminology (e.g. "This is your Workspace — all your projects live here") rather than demonstrating features the user should simply use. If you do run a tour, keep it to five steps maximum, make every step skippable, and allow re-entry from a persistent help menu.
|
|
21
|
+
|
|
22
|
+
**Checklist-style onboarding** creates explicit visible progress. The risk is that users who skip to step 4 feel the overhead of incomplete items above them. Keep checklists short (five items maximum) and mark steps as skippable where appropriate. Celebrate completion with a visual reward. Progress bars within checklists should start at roughly 20% complete before the user takes any action — starting at zero signals a daunting amount of work ahead.
|
|
23
|
+
|
|
24
|
+
**Progressive disclosure** is the correct default for most modern products. Surface only what is needed at each stage of the user's journey and reveal depth as intent emerges. The cost of this approach is instrumentation: you must know what your users are actually doing in order to know what to surface next. Without event tracking and funnel analysis, progressive disclosure devolves into guesswork about which features to promote and when.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 2. Feature Discovery Patterns
|
|
29
|
+
|
|
30
|
+
### Tooltip Hints
|
|
31
|
+
|
|
32
|
+
Tooltips surface contextual information at the moment of relevance without blocking interaction. Follow these placement rules strictly:
|
|
33
|
+
|
|
34
|
+
- Position tooltips above the target element by default; fall back to right, left, then below only when viewport space requires it.
|
|
35
|
+
- Never place a tooltip over the element it describes — it should annotate without obscuring.
|
|
36
|
+
- A dismiss button (×) is required on any tooltip that is not triggered by hover alone. Users must always have a clear, explicit path to close.
|
|
37
|
+
- Cap tooltip hints at **three per session**. A fourth tooltip in the same session means the user has seen enough hints that the interface should simply be better, not that more hints are needed.
|
|
38
|
+
- Do not re-show a dismissed tooltip within the same session. Respecting the dismissal is the contract.
|
|
39
|
+
|
|
40
|
+
### Spotlight / Coach Marks
|
|
41
|
+
|
|
42
|
+
Spotlight overlays draw attention to a specific UI element by dimming the surrounding interface. Use them only for genuinely non-obvious interaction points — elements whose purpose or location a reasonable user would not discover through normal exploration.
|
|
43
|
+
|
|
44
|
+
Never use coach marks for:
|
|
45
|
+
|
|
46
|
+
- Buttons with clear labels and standard placements (Save, Submit, Add)
|
|
47
|
+
- Navigation items that follow a platform convention (hamburger menu, tab bar, breadcrumb)
|
|
48
|
+
- Anything that should be self-evident from the design itself
|
|
49
|
+
|
|
50
|
+
If a feature requires a spotlight to be understood, the spotlight is a symptom. The root cause is an affordance problem in the design that should be fixed first.
|
|
51
|
+
|
|
52
|
+
### Pulsing Nudges
|
|
53
|
+
|
|
54
|
+
Animation draws the eye. That is precisely why animation budgets must be strictly managed:
|
|
55
|
+
|
|
56
|
+
- **Only one pulsing element may be active on screen at any time.** Two simultaneous pulses cancel each other's signal and create anxiety rather than direction.
|
|
57
|
+
- Stop showing the pulse after the user has seen it across **three separate sessions** without interacting. After three exposures without action, the user has seen the nudge and chosen not to act. Continuing to pulse is nagging, not guidance.
|
|
58
|
+
- Use a subtle scale pulse (1.0 → 1.08 → 1.0, ease-in-out, 1.2s, 2-second delay between cycles) rather than color flashing, which creates accessibility issues for users with photosensitive conditions.
|
|
59
|
+
- Store the "seen count" in persistent state (user record or localStorage as a fallback) so the counter survives page reloads.
|
|
60
|
+
|
|
61
|
+
### Contextual Help
|
|
62
|
+
|
|
63
|
+
Help icons, drawers, and inline `?` affordances provide depth on demand without occupying primary UI real estate:
|
|
64
|
+
|
|
65
|
+
- Place `?` icons immediately to the right of the label they annotate, at the same vertical center.
|
|
66
|
+
- Use a help drawer (slide-in panel) when the content exceeds three sentences. Modals are inappropriate for help content because they block the interface the user is trying to understand.
|
|
67
|
+
- Distinguish between hover-triggered tooltips (quick factual answers, ≤ 20 words) and click-triggered drawers (procedural explanations, examples, links to documentation).
|
|
68
|
+
- Help icons should use a consistent icon throughout the product — do not mix `?`, `ℹ`, and `…` as help affordances in the same interface.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 3. Tutorial Sequencing
|
|
73
|
+
|
|
74
|
+
### Before Value, Not Before Use
|
|
75
|
+
|
|
76
|
+
The most common tutorial design mistake is gating access to the product behind tutorial completion. This inverts the relationship between value and instruction. The correct principle is: **teach before the moment of value, not before the moment of entry.**
|
|
77
|
+
|
|
78
|
+
A user who has already experienced value will sit through a brief explanation of how to get more value. A user who has not yet experienced anything will resent being forced through a walkthrough of a product they are not yet convinced is worth their time.
|
|
79
|
+
|
|
80
|
+
Concretely: let the user reach their first meaningful outcome, then surface the "here's how to go further" guidance immediately after.
|
|
81
|
+
|
|
82
|
+
### Activation Metric vs. Habituation Metric
|
|
83
|
+
|
|
84
|
+
These two metrics measure different things and should never be conflated:
|
|
85
|
+
|
|
86
|
+
**Activation metric** — the event that indicates a user has experienced the product's core value for the first time. It is a binary event measured once. Examples: first project created, first file synced, first message sent.
|
|
87
|
+
|
|
88
|
+
**Habituation metric** — the behavioral pattern that indicates a user has formed a habit around the product. It is a frequency measure over a time window. Examples: 3 sessions per week for 4 consecutive weeks, 5 actions per session on 7 of the last 10 days.
|
|
89
|
+
|
|
90
|
+
Activation predicts retention at day 7. Habituation predicts retention at day 30 and beyond. Optimizing only for activation produces users who try the product once and never return. Optimizing for habituation without a clear activation path means most users never get far enough to form the habit.
|
|
91
|
+
|
|
92
|
+
### Tutorial Abandonment and Step Budget
|
|
93
|
+
|
|
94
|
+
Research across SaaS products consistently shows that **mean drop-off occurs at step 3** in multi-step onboarding flows. Users who reach step 4 are disproportionately engaged; steps beyond 4 reach a small fraction of users.
|
|
95
|
+
|
|
96
|
+
The implication is direct: **keep required onboarding to three steps or fewer.** Optional depth can exist beyond step 3, but nothing essential to basic product use should require more than three steps to reach.
|
|
97
|
+
|
|
98
|
+
If your product genuinely requires more than three setup steps before value is deliverable, that is a product architecture problem, not an onboarding problem.
|
|
99
|
+
|
|
100
|
+
### Deferred Tutorial
|
|
101
|
+
|
|
102
|
+
Users who land in a product for the first time are in a state of orienting, not learning. They are trying to understand whether the product is relevant to them, not how to become experts.
|
|
103
|
+
|
|
104
|
+
Surface a "Start guided tour" CTA on the **second session**, not the first. By the second session, the user has self-selected — they came back, which means something in the first session was interesting enough to return to. They are now in a learning state, not an evaluation state, and will benefit from structured guidance.
|
|
105
|
+
|
|
106
|
+
First-session tutorials should be limited to a single contextual hint or a dismissible welcome banner — not a step-by-step walkthrough.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 4. The 5-Second Rule
|
|
111
|
+
|
|
112
|
+
Within five seconds of landing on a product for the first time, users form judgments on three dimensions that are extremely difficult to revise:
|
|
113
|
+
|
|
114
|
+
1. **Value proposition clarity** — Do I understand what this product does and who it is for?
|
|
115
|
+
2. **Trust signals** — Does this look credible, maintained, and professional?
|
|
116
|
+
3. **Visual confidence** — Does the design itself inspire confidence in the product's quality?
|
|
117
|
+
|
|
118
|
+
These are not conscious evaluations. They are fast, affective responses to visual and linguistic signals. A product that fails the 5-second test loses users before any feature or flow is ever reached.
|
|
119
|
+
|
|
120
|
+
**How to test:** Show the homepage or first screen to a user for exactly five seconds (a timer-based first-click test works well). Then hide the screen and ask: "What does this product do? Who is it for? Would you trust it with your data?" Correct answers on all three indicate the screen passes.
|
|
121
|
+
|
|
122
|
+
**What passing looks like:**
|
|
123
|
+
- The headline names the outcome, not the mechanism ("Ship faster without context switching" rather than "A collaborative project management platform")
|
|
124
|
+
- At least one social proof or trust signal is visible above the fold (customer count, recognizable logo, security badge)
|
|
125
|
+
- The visual design is internally consistent — font pairing, spacing, and color are coherent enough that the product feels intentional
|
|
126
|
+
|
|
127
|
+
A screen that takes longer than five seconds to parse is not being evaluated — it is being abandoned.
|
|
128
|
+
|
|
129
|
+
**Common failures:**
|
|
130
|
+
|
|
131
|
+
| Signal | Why it fails the test |
|
|
132
|
+
|---|---|
|
|
133
|
+
| Headline is the product's name only | Communicates nothing about value or audience |
|
|
134
|
+
| Hero image is abstract or decorative | Wastes the most valuable visual real estate |
|
|
135
|
+
| No price or pricing signal | Triggers "is this for me?" uncertainty |
|
|
136
|
+
| Social proof is below the fold | Trust is not established before the judgment is made |
|
|
137
|
+
| CTA is "Learn more" | Does not indicate what action the user should take |
|
|
138
|
+
|
|
139
|
+
Run the 5-second test on every major entry point: homepage, onboarding email landing, in-app feature announcements, and pricing page. Each is a first impression for a different user segment.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 5. Aha-Moment Mapping
|
|
144
|
+
|
|
145
|
+
### Defining the Aha Moment
|
|
146
|
+
|
|
147
|
+
The aha moment is the first time a user experiences the core value the product was built to deliver. It is not a feature adoption event and not an engagement metric — it is the specific moment when the product's promise becomes real and personal to the user.
|
|
148
|
+
|
|
149
|
+
Without a defined aha moment, onboarding cannot be optimized because there is no agreed destination to optimize toward.
|
|
150
|
+
|
|
151
|
+
### Reference Examples
|
|
152
|
+
|
|
153
|
+
The most cited aha moments in product history illustrate what the concept means in practice:
|
|
154
|
+
|
|
155
|
+
- **Twitter**: Users who followed at least 10 accounts within their first 48 hours retained at a dramatically higher rate than those who did not. The aha moment was not "post a tweet" — it was "see a feed of people you actually care about."
|
|
156
|
+
- **Slack**: Teams that exchanged at least 2,000 messages retained at over 90%. The aha moment emerged from the accumulated experience of communication flow, not from any single interaction.
|
|
157
|
+
- **Dropbox**: Users who synced at least one file experienced the aha moment. The product's promise — "your files everywhere" — only became real once the first file was genuinely accessible on a second device.
|
|
158
|
+
|
|
159
|
+
In all three cases, the aha moment is an outcome state, not a feature interaction. This distinction matters for instrumentation.
|
|
160
|
+
|
|
161
|
+
### Instrumentation and Cohort Analysis
|
|
162
|
+
|
|
163
|
+
To find your product's aha moment, run the following analysis:
|
|
164
|
+
|
|
165
|
+
1. **Define candidate activation events** — identify 5–10 behavioral events that plausibly represent first value (first export, first share, first search with results, first item added, etc.).
|
|
166
|
+
2. **Build retention cohorts by activation event** — for each candidate event, create two cohorts: users who performed the event in their first session vs. users who did not. Measure day-7 and day-30 retention for each cohort.
|
|
167
|
+
3. **Identify the event with the largest retention delta** — the event whose presence most strongly predicts that users will still be active 30 days later is your aha moment proxy.
|
|
168
|
+
4. **Validate with qualitative research** — confirm with user interviews that users who performed the event actually experienced a moment of genuine value, not just navigated through a flow.
|
|
169
|
+
5. **Reduce the time-to-aha** — once the event is identified, redesign onboarding to move the user toward that event as quickly as possible, removing every unnecessary step in between.
|
|
170
|
+
|
|
171
|
+
The aha moment is a hypothesis that must be re-evaluated as the product evolves. A feature change or new user segment can shift the activation event.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 6. Anti-Patterns
|
|
176
|
+
|
|
177
|
+
### Forced Tours
|
|
178
|
+
|
|
179
|
+
A forced tour blocks access to the product until the user completes a tutorial sequence. This pattern consistently destroys retention because it starts the relationship with a power imbalance: the product demands the user's time before delivering any value in return.
|
|
180
|
+
|
|
181
|
+
Users who complete forced tours do so under duress, not interest. Their completion rate looks healthy in analytics, but their recall of tour content is near zero. More critically, the forced-tour experience establishes a negative first emotional association with the product that carries forward into subsequent sessions.
|
|
182
|
+
|
|
183
|
+
**Never gate the product behind tutorial completion.** The skip button is not a concession — it is a requirement.
|
|
184
|
+
|
|
185
|
+
### Blocking Modal Overlays
|
|
186
|
+
|
|
187
|
+
Modal overlays that cover the interface to display instructional content are problematic on two grounds. First, they prevent the user from interacting with the very interface they are being instructed about — learning by doing is impossible when the interface is obscured. Second, full-screen modal overlays frequently fail WCAG 2.1 Success Criterion 1.3.4 (Orientation) and 2.1.2 (No Keyboard Trap) when implemented without proper focus management, making them inaccessible to keyboard and screen reader users.
|
|
188
|
+
|
|
189
|
+
Use inline empty states, contextual tooltips, or side drawers for instructional content. Reserve modals for actions that require a decision before proceeding, not for passive information delivery.
|
|
190
|
+
|
|
191
|
+
### Tooltip Spam
|
|
192
|
+
|
|
193
|
+
Displaying more than three tooltips simultaneously creates cognitive overload. The user cannot process multiple concurrent annotations — they will either dismiss all of them without reading or abandon the session. Three concurrent tooltips is already at the upper threshold of what users will tolerate; two is better; one is the correct default.
|
|
194
|
+
|
|
195
|
+
If your interface requires more than three tooltips to be usable, the interface needs redesign, not more tooltips.
|
|
196
|
+
|
|
197
|
+
### Feature Announcements on Every Login
|
|
198
|
+
|
|
199
|
+
Surfaces that display feature announcement banners, modals, or toasts on every login train users to dismiss without reading. After two or three sessions of seeing a banner, dismissal becomes an automatic motor behavior, not a reading behavior. This renders the announcement channel useless for future communications that actually matter.
|
|
200
|
+
|
|
201
|
+
Feature announcements should be shown once per feature, in context (near the new feature), and only to users for whom the feature is relevant. A user who has never used the reporting module should not see an announcement about reporting improvements.
|
|
202
|
+
|
|
203
|
+
### Onboarding for Features They Did Not Request
|
|
204
|
+
|
|
205
|
+
Proactively onboarding users to features they have not expressed interest in violates their intent. A user who opened the product to complete a specific task and is instead walked through an unrelated feature experiences the tutorial as an interruption, not a benefit.
|
|
206
|
+
|
|
207
|
+
Progressive disclosure exists precisely to prevent this: surface depth in response to observed intent, not on a broadcast schedule. If a user navigates to a feature for the first time, that is the correct moment to offer brief guidance. If they have never navigated to it, it is not the correct moment to introduce it.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 7. Measuring Onboarding Health
|
|
212
|
+
|
|
213
|
+
Onboarding is only improvable if it is measured. The following metrics form the minimum instrumentation layer for any product with an intentional onboarding strategy.
|
|
214
|
+
|
|
215
|
+
**Time-to-activation** measures how long it takes a new user to reach the defined activation event from their first login. Expressed as a median and p75 (the slowest 25% of activating users). A rising time-to-activation without a corresponding increase in activation rate indicates that the activation path has grown longer or more confusing.
|
|
216
|
+
|
|
217
|
+
**Activation rate** is the percentage of new users who reach the activation event within a defined window (typically 7 days). Baseline activation rates vary widely by product category, but any activation rate below 40% warrants investigation. An activation rate above 70% is a strong signal.
|
|
218
|
+
|
|
219
|
+
**Onboarding funnel drop-off** tracks step-by-step completion rates through any sequential onboarding flow. Every step should be instrumented individually. Drop-off above 30% at any single step is a red flag requiring immediate qualitative investigation — user interviews, session recordings, or both.
|
|
220
|
+
|
|
221
|
+
**Feature discovery breadth** measures how many distinct features or feature areas a user touches in their first 14 days. Low breadth in early sessions is not necessarily a problem — focused users often have the highest retention — but anomalously low breadth combined with low retention indicates that users are not finding the product's range of value.
|
|
222
|
+
|
|
223
|
+
| Metric | Healthy range | Warning threshold |
|
|
224
|
+
|---|---|---|
|
|
225
|
+
| Time-to-activation (median) | < 5 minutes | > 20 minutes |
|
|
226
|
+
| Activation rate (7-day) | > 50% | < 30% |
|
|
227
|
+
| Step drop-off (any single step) | < 20% | > 35% |
|
|
228
|
+
| Day-7 retention | > 40% | < 20% |
|
|
229
|
+
| Day-30 retention | > 20% | < 10% |
|
|
230
|
+
|
|
231
|
+
These thresholds are reference points drawn from cross-industry SaaS benchmarks. They will vary by product category, pricing model, and acquisition channel. Calibrate against your own historical baseline before treating any single number as universal.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Quick-Reference Decision Rules
|
|
236
|
+
|
|
237
|
+
The rules below consolidate the most common judgment calls into explicit thresholds. Apply them as defaults; deviate only with data.
|
|
238
|
+
|
|
239
|
+
| Question | Rule |
|
|
240
|
+
|---|---|
|
|
241
|
+
| How many tooltip hints per session? | Maximum 3 |
|
|
242
|
+
| How many pulsing elements on screen? | Maximum 1 |
|
|
243
|
+
| How many steps in required onboarding? | Maximum 3 |
|
|
244
|
+
| When to surface guided tour CTA? | Second session, not first |
|
|
245
|
+
| When to stop showing a pulsing nudge? | After 3 sessions seen without interaction |
|
|
246
|
+
| Can a tutorial block product access? | Never |
|
|
247
|
+
| How many concurrent tooltips? | Maximum 1 (hard ceiling 3) |
|
|
248
|
+
| How often to repeat a feature announcement? | Once per feature, in context |
|
|
249
|
+
| What determines the aha moment? | Largest day-30 retention delta across cohorts |
|
|
250
|
+
| What does passing the 5-second test require? | Correct answers on value, audience, and trust |
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "motion-map.schema.json",
|
|
4
|
+
"title": "Motion Map Output Contract",
|
|
5
|
+
"description": "Schema for the structured JSON block emitted by motion-mapper at the top of .design/map/motion.md. Every detected animation binding must conform to this schema.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["schema_version", "generated_at", "animations"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"schema_version": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"const": "1.0.0",
|
|
13
|
+
"description": "Schema version — bump when adding required fields"
|
|
14
|
+
},
|
|
15
|
+
"generated_at": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "date-time",
|
|
18
|
+
"description": "ISO-8601 timestamp of when this map was generated"
|
|
19
|
+
},
|
|
20
|
+
"summary": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"description": "Aggregate counts for quick review",
|
|
23
|
+
"properties": {
|
|
24
|
+
"total_animations": { "type": "integer", "minimum": 0 },
|
|
25
|
+
"custom_easings": { "type": "integer", "minimum": 0 },
|
|
26
|
+
"reduced_motion_compliant": { "type": "boolean" },
|
|
27
|
+
"libraries": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"items": { "type": "string" },
|
|
30
|
+
"description": "Animation libraries detected (e.g., framer-motion, gsap, css-only)"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"animations": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"description": "One entry per detected animation binding",
|
|
37
|
+
"items": {
|
|
38
|
+
"$ref": "#/definitions/AnimationBinding"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"definitions": {
|
|
43
|
+
"AnimationBinding": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"required": ["id", "location", "easing", "duration_class", "trigger"],
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"properties": {
|
|
48
|
+
"id": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "Unique identifier for this binding, e.g., 'toast-enter-opacity'"
|
|
51
|
+
},
|
|
52
|
+
"location": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"required": ["file", "line"],
|
|
55
|
+
"properties": {
|
|
56
|
+
"file": { "type": "string", "description": "Relative path from project root" },
|
|
57
|
+
"line": { "type": "integer", "minimum": 1 }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"description": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "Human-readable description of what this animation does"
|
|
63
|
+
},
|
|
64
|
+
"easing": {
|
|
65
|
+
"oneOf": [
|
|
66
|
+
{
|
|
67
|
+
"type": "string",
|
|
68
|
+
"enum": [
|
|
69
|
+
"linear",
|
|
70
|
+
"quad", "quad-in", "quad-out", "quad-in-out",
|
|
71
|
+
"cubic", "cubic-in", "cubic-out", "cubic-in-out",
|
|
72
|
+
"poly", "poly-in", "poly-out", "poly-in-out",
|
|
73
|
+
"sin", "sin-in", "sin-out", "sin-in-out",
|
|
74
|
+
"circle", "circle-in", "circle-out", "circle-in-out",
|
|
75
|
+
"exp", "exp-in", "exp-out", "exp-in-out",
|
|
76
|
+
"elastic", "elastic-in", "elastic-out", "elastic-in-out",
|
|
77
|
+
"back", "back-in", "back-out", "back-in-out",
|
|
78
|
+
"bounce", "bounce-in", "bounce-out", "bounce-in-out",
|
|
79
|
+
"bezier"
|
|
80
|
+
],
|
|
81
|
+
"description": "One of the 12 canonical easing presets from reference/motion-easings.md"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"type": "object",
|
|
85
|
+
"required": ["type", "justification"],
|
|
86
|
+
"properties": {
|
|
87
|
+
"type": { "type": "string", "const": "custom" },
|
|
88
|
+
"value": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"description": "The actual easing value (cubic-bezier string, spring config, etc.)"
|
|
91
|
+
},
|
|
92
|
+
"justification": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"description": "Why a canonical easing was not sufficient. Must be non-empty."
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"transition_family": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"enum": ["3d", "blur", "cover", "destruction", "dissolve", "distortion", "grid", "light"],
|
|
103
|
+
"description": "Optional: one of the 8 transition families from reference/motion-transition-taxonomy.md. Omit for micro-interactions where no family applies."
|
|
104
|
+
},
|
|
105
|
+
"duration_class": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"enum": ["instant", "quick", "standard", "slow", "narrative"],
|
|
108
|
+
"description": "Duration classification. instant: <100ms, quick: 100-200ms, standard: 200-400ms, slow: 400-800ms, narrative: >800ms"
|
|
109
|
+
},
|
|
110
|
+
"duration_ms": {
|
|
111
|
+
"type": "integer",
|
|
112
|
+
"minimum": 0,
|
|
113
|
+
"description": "Actual duration in milliseconds, if known"
|
|
114
|
+
},
|
|
115
|
+
"trigger": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"enum": ["user-gesture", "state-change", "scroll-progress", "time", "loop"],
|
|
118
|
+
"description": "What drives this animation"
|
|
119
|
+
},
|
|
120
|
+
"reduced_motion_handled": {
|
|
121
|
+
"type": "boolean",
|
|
122
|
+
"description": "Whether this animation respects prefers-reduced-motion"
|
|
123
|
+
},
|
|
124
|
+
"library": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"description": "Animation library used, e.g., 'framer-motion', 'gsap', 'css-transition', 'waapi'"
|
|
127
|
+
},
|
|
128
|
+
"notes": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"description": "Optional free-form notes for the reviewer"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|