@elsahafy/ux-mcp-server 2.0.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.
@@ -0,0 +1,253 @@
1
+ {
2
+ "name": "Nielsen's 10 Usability Heuristics",
3
+ "description": "General principles for interaction design by Jakob Nielsen",
4
+ "heuristics": [
5
+ {
6
+ "id": 1,
7
+ "name": "Visibility of System Status",
8
+ "description": "The design should always keep users informed about what is going on through appropriate feedback within a reasonable amount of time",
9
+ "examples": [
10
+ "Loading spinners and progress bars",
11
+ "Success/error toast notifications",
12
+ "Button states (loading, disabled, active)",
13
+ "Form validation feedback",
14
+ "Upload progress indicators",
15
+ "Auto-save indicators"
16
+ ],
17
+ "bad_examples": [
18
+ "Long operations with no feedback",
19
+ "Buttons that don't show loading state",
20
+ "Forms that fail silently"
21
+ ],
22
+ "implementation_tips": [
23
+ "Show loading state for operations > 200ms",
24
+ "Use skeleton screens for content loading",
25
+ "Provide progress percentages for long operations",
26
+ "Confirm successful actions with visual feedback"
27
+ ]
28
+ },
29
+ {
30
+ "id": 2,
31
+ "name": "Match Between System and Real World",
32
+ "description": "The design should speak the users' language, using familiar words, phrases, and concepts",
33
+ "examples": [
34
+ "Use 'trash' or 'delete' instead of 'destroy'",
35
+ "Calendar widgets show weeks starting on cultural norm",
36
+ "Icons match real-world metaphors (envelope for email)",
37
+ "Date formats match user's locale"
38
+ ],
39
+ "bad_examples": [
40
+ "Technical jargon in user-facing messages",
41
+ "Error codes without explanations",
42
+ "Unfamiliar icons without labels"
43
+ ],
44
+ "implementation_tips": [
45
+ "Avoid technical terminology",
46
+ "Use culturally appropriate metaphors",
47
+ "Follow platform conventions",
48
+ "Localize content and formats"
49
+ ]
50
+ },
51
+ {
52
+ "id": 3,
53
+ "name": "User Control and Freedom",
54
+ "description": "Users often perform actions by mistake and need a clearly marked 'emergency exit'",
55
+ "examples": [
56
+ "Undo/Redo functionality",
57
+ "Cancel buttons on forms and modals",
58
+ "Breadcrumbs for navigation",
59
+ "Back button support",
60
+ "Clear way to exit flows",
61
+ "Confirmation dialogs for destructive actions"
62
+ ],
63
+ "bad_examples": [
64
+ "No way to undo destructive actions",
65
+ "Forced multi-step flows with no exit",
66
+ "Modal dialogs without close button"
67
+ ],
68
+ "implementation_tips": [
69
+ "Always provide 'Cancel' alongside 'Submit'",
70
+ "Support browser back button",
71
+ "Allow users to exit wizards mid-flow",
72
+ "Implement undo for destructive actions"
73
+ ]
74
+ },
75
+ {
76
+ "id": 4,
77
+ "name": "Consistency and Standards",
78
+ "description": "Users should not have to wonder whether different words, situations, or actions mean the same thing",
79
+ "examples": [
80
+ "Consistent button placement (e.g., 'Submit' always bottom-right)",
81
+ "Same icon represents same action throughout",
82
+ "Uniform color scheme for statuses (green=success, red=error)",
83
+ "Consistent navigation structure",
84
+ "Standard form field patterns"
85
+ ],
86
+ "bad_examples": [
87
+ "Save button in different locations on different pages",
88
+ "Same action uses different icons",
89
+ "Inconsistent terminology (logout vs sign out)"
90
+ ],
91
+ "implementation_tips": [
92
+ "Create and follow design system",
93
+ "Use component library for consistency",
94
+ "Document naming conventions",
95
+ "Follow platform guidelines (iOS HIG, Material Design)"
96
+ ]
97
+ },
98
+ {
99
+ "id": 5,
100
+ "name": "Error Prevention",
101
+ "description": "Good designs prevent problems from occurring in the first place",
102
+ "examples": [
103
+ "Confirmation dialogs for destructive actions",
104
+ "Disabled submit button until form is valid",
105
+ "Input constraints (min/max, pattern validation)",
106
+ "Type-ahead suggestions",
107
+ "Auto-formatting (phone numbers, credit cards)",
108
+ "Warning before leaving unsaved changes"
109
+ ],
110
+ "bad_examples": [
111
+ "No validation until form submission",
112
+ "Easy to accidentally delete important data",
113
+ "No warnings for irreversible actions"
114
+ ],
115
+ "implementation_tips": [
116
+ "Validate inputs as user types",
117
+ "Use input types (email, tel, number)",
118
+ "Implement 'Are you sure?' for destructive actions",
119
+ "Prevent double-submission of forms"
120
+ ]
121
+ },
122
+ {
123
+ "id": 6,
124
+ "name": "Recognition Rather than Recall",
125
+ "description": "Minimize memory load by making elements, actions, and options visible",
126
+ "examples": [
127
+ "Dropdown menus instead of command line",
128
+ "Auto-complete in search boxes",
129
+ "Recently used items",
130
+ "Visual previews instead of file names",
131
+ "Tooltips on hover",
132
+ "Visible navigation breadcrumbs"
133
+ ],
134
+ "bad_examples": [
135
+ "Hidden features requiring memorization",
136
+ "Complex keyboard shortcuts with no hints",
137
+ "No search history or suggestions"
138
+ ],
139
+ "implementation_tips": [
140
+ "Show available options visibly",
141
+ "Provide search with autocomplete",
142
+ "Display keyboard shortcuts in tooltips",
143
+ "Keep navigation always visible"
144
+ ]
145
+ },
146
+ {
147
+ "id": 7,
148
+ "name": "Flexibility and Efficiency of Use",
149
+ "description": "Provide accelerators for expert users while remaining accessible to novices",
150
+ "examples": [
151
+ "Keyboard shortcuts for common actions",
152
+ "Bulk operations",
153
+ "Templates and saved preferences",
154
+ "Search filters and advanced search",
155
+ "Customizable dashboards",
156
+ "Quick actions menu"
157
+ ],
158
+ "bad_examples": [
159
+ "Must always go through multi-step wizard",
160
+ "No keyboard shortcuts",
161
+ "Can't customize frequent workflows"
162
+ ],
163
+ "implementation_tips": [
164
+ "Implement keyboard shortcuts (show in tooltips)",
165
+ "Allow skipping optional steps in wizards",
166
+ "Provide both simple and advanced modes",
167
+ "Remember user preferences"
168
+ ]
169
+ },
170
+ {
171
+ "id": 8,
172
+ "name": "Aesthetic and Minimalist Design",
173
+ "description": "Interfaces should not contain information that is irrelevant or rarely needed",
174
+ "examples": [
175
+ "Progressive disclosure (hide advanced options)",
176
+ "Clear visual hierarchy",
177
+ "Whitespace for breathing room",
178
+ "Focused single-column layouts",
179
+ "Collapse/expand sections for optional content"
180
+ ],
181
+ "bad_examples": [
182
+ "Cluttered interfaces with every feature visible",
183
+ "Too many options on one screen",
184
+ "Competing visual elements"
185
+ ],
186
+ "implementation_tips": [
187
+ "Show only what's needed for current task",
188
+ "Use progressive disclosure for advanced features",
189
+ "Remove unnecessary decorative elements",
190
+ "Group related information"
191
+ ]
192
+ },
193
+ {
194
+ "id": 9,
195
+ "name": "Help Users Recognize, Diagnose, and Recover from Errors",
196
+ "description": "Error messages should be expressed in plain language, precisely indicate the problem, and suggest a solution",
197
+ "examples": [
198
+ "Specific error messages: 'Password must contain at least 8 characters'",
199
+ "Inline validation with suggestions",
200
+ "Highlight problematic fields",
201
+ "Provide actionable next steps",
202
+ "Link to help documentation"
203
+ ],
204
+ "bad_examples": [
205
+ "Generic errors: 'An error occurred'",
206
+ "Technical error codes without explanation",
207
+ "Errors that don't say how to fix"
208
+ ],
209
+ "implementation_tips": [
210
+ "Use plain language (no error codes alone)",
211
+ "Explain what went wrong and why",
212
+ "Suggest specific actions to resolve",
213
+ "Keep user's input when showing errors"
214
+ ]
215
+ },
216
+ {
217
+ "id": 10,
218
+ "name": "Help and Documentation",
219
+ "description": "Provide help and documentation that is easy to search and focused on the user's task",
220
+ "examples": [
221
+ "Contextual help tooltips",
222
+ "FAQ section with search",
223
+ "Interactive tutorials",
224
+ "Inline examples and placeholders",
225
+ "Video guides for complex features",
226
+ "Searchable documentation"
227
+ ],
228
+ "bad_examples": [
229
+ "PDF manuals with no search",
230
+ "Help text hidden or hard to find",
231
+ "Generic help that doesn't address specific features"
232
+ ],
233
+ "implementation_tips": [
234
+ "Provide contextual help where needed",
235
+ "Use placeholder text to show format",
236
+ "Offer tooltips on complex features",
237
+ "Create searchable knowledge base"
238
+ ]
239
+ }
240
+ ],
241
+ "evaluation_questions": [
242
+ "Does the user always know what's happening? (Visibility)",
243
+ "Is the language familiar to users? (Match Real World)",
244
+ "Can users easily undo actions? (User Control)",
245
+ "Is the interface consistent? (Consistency)",
246
+ "Are errors prevented before they occur? (Error Prevention)",
247
+ "Are options visible vs requiring memorization? (Recognition)",
248
+ "Are there shortcuts for power users? (Flexibility)",
249
+ "Is the design clean and focused? (Minimalist)",
250
+ "Are error messages helpful and actionable? (Error Recovery)",
251
+ "Is help available when needed? (Help & Documentation)"
252
+ ]
253
+ }
@@ -0,0 +1,347 @@
1
+ {
2
+ "name": "Performance Best Practices",
3
+ "description": "Core Web Vitals, performance optimization, and loading strategies",
4
+ "core_web_vitals": {
5
+ "description": "Google's metrics for user experience quality",
6
+ "metrics": {
7
+ "LCP": {
8
+ "name": "Largest Contentful Paint",
9
+ "description": "Measures loading performance - when the largest content element becomes visible",
10
+ "good": "≤ 2.5 seconds",
11
+ "needs_improvement": "2.5 - 4.0 seconds",
12
+ "poor": "> 4.0 seconds",
13
+ "how_to_measure": "Chrome DevTools → Performance → LCP in User Timing",
14
+ "optimization_strategies": [
15
+ "Optimize server response times (TTFB)",
16
+ "Eliminate render-blocking resources",
17
+ "Optimize and compress images",
18
+ "Preload critical resources",
19
+ "Use CDN for static assets",
20
+ "Implement lazy loading for below-fold content",
21
+ "Minimize CSS and JavaScript",
22
+ "Use modern image formats (WebP, AVIF)"
23
+ ],
24
+ "common_culprits": [
25
+ "Large unoptimized images",
26
+ "Slow server response",
27
+ "Render-blocking CSS/JS",
28
+ "Client-side rendering without SSR"
29
+ ]
30
+ },
31
+ "FID": {
32
+ "name": "First Input Delay",
33
+ "description": "Measures interactivity - time from user interaction to browser response",
34
+ "good": "≤ 100 milliseconds",
35
+ "needs_improvement": "100 - 300 milliseconds",
36
+ "poor": "> 300 milliseconds",
37
+ "replaced_by": "INP (Interaction to Next Paint) as of 2024",
38
+ "optimization_strategies": [
39
+ "Break up long tasks (>50ms)",
40
+ "Optimize JavaScript execution",
41
+ "Use web workers for heavy computation",
42
+ "Minimize third-party script impact",
43
+ "Use code splitting",
44
+ "Defer non-critical JavaScript",
45
+ "Reduce JavaScript bundle size"
46
+ ]
47
+ },
48
+ "INP": {
49
+ "name": "Interaction to Next Paint",
50
+ "description": "Measures overall responsiveness - time from interaction to visual update",
51
+ "good": "≤ 200 milliseconds",
52
+ "needs_improvement": "200 - 500 milliseconds",
53
+ "poor": "> 500 milliseconds",
54
+ "replaces": "FID (First Input Delay)",
55
+ "optimization_strategies": [
56
+ "Minimize main thread work",
57
+ "Reduce input delay",
58
+ "Optimize event handlers",
59
+ "Use requestIdleCallback for non-urgent work",
60
+ "Debounce/throttle frequent events",
61
+ "Optimize DOM updates",
62
+ "Use CSS animations over JavaScript when possible"
63
+ ]
64
+ },
65
+ "CLS": {
66
+ "name": "Cumulative Layout Shift",
67
+ "description": "Measures visual stability - unexpected layout shifts during page load",
68
+ "good": "≤ 0.1",
69
+ "needs_improvement": "0.1 - 0.25",
70
+ "poor": "> 0.25",
71
+ "optimization_strategies": [
72
+ "Always include width and height on images and videos",
73
+ "Reserve space for ads and embeds",
74
+ "Avoid inserting content above existing content",
75
+ "Use CSS aspect-ratio for responsive elements",
76
+ "Preload custom fonts",
77
+ "Use font-display: optional or swap",
78
+ "Avoid animations that trigger layout"
79
+ ],
80
+ "common_culprits": [
81
+ "Images without dimensions",
82
+ "Ads/embeds without reserved space",
83
+ "Web fonts causing FOIT/FOUT",
84
+ "Dynamically injected content",
85
+ "Animations triggering layout"
86
+ ]
87
+ }
88
+ }
89
+ },
90
+ "loading_strategies": {
91
+ "critical_rendering_path": {
92
+ "description": "Optimize the sequence of steps browser takes to render page",
93
+ "steps": [
94
+ "1. Parse HTML → DOM tree",
95
+ "2. Parse CSS → CSSOM tree",
96
+ "3. Combine DOM + CSSOM → Render tree",
97
+ "4. Layout (calculate positions)",
98
+ "5. Paint (draw pixels)"
99
+ ],
100
+ "optimization": [
101
+ "Minimize critical resources (HTML, CSS, JS)",
102
+ "Minimize critical bytes",
103
+ "Minimize critical path length (round trips)"
104
+ ]
105
+ },
106
+ "resource_hints": {
107
+ "dns_prefetch": {
108
+ "tag": "<link rel='dns-prefetch' href='https://example.com'>",
109
+ "use": "Resolve domain names in advance",
110
+ "when": "Third-party resources (fonts, analytics, APIs)"
111
+ },
112
+ "preconnect": {
113
+ "tag": "<link rel='preconnect' href='https://example.com'>",
114
+ "use": "Establish connection (DNS + TCP + TLS)",
115
+ "when": "Critical third-party resources",
116
+ "note": "More expensive than dns-prefetch, use sparingly"
117
+ },
118
+ "prefetch": {
119
+ "tag": "<link rel='prefetch' href='/next-page.html'>",
120
+ "use": "Load resources for next navigation",
121
+ "when": "Predictable user journeys",
122
+ "priority": "Lowest priority"
123
+ },
124
+ "preload": {
125
+ "tag": "<link rel='preload' as='script' href='critical.js'>",
126
+ "use": "Load critical resources early",
127
+ "when": "Critical CSS, fonts, above-fold images",
128
+ "types": "script, style, font, image, fetch",
129
+ "important": "Must be used within 3 seconds or warning"
130
+ },
131
+ "modulepreload": {
132
+ "tag": "<link rel='modulepreload' href='module.js'>",
133
+ "use": "Preload ES modules and dependencies",
134
+ "when": "Critical JavaScript modules"
135
+ }
136
+ },
137
+ "lazy_loading": {
138
+ "images": {
139
+ "native": "<img src='image.jpg' loading='lazy' alt='Description'>",
140
+ "when": "Below-the-fold images",
141
+ "avoid": "Above-the-fold images (hurts LCP)",
142
+ "browser_support": "All modern browsers"
143
+ },
144
+ "iframes": {
145
+ "native": "<iframe src='embed.html' loading='lazy'></iframe>",
146
+ "when": "Third-party embeds, videos",
147
+ "benefit": "Saves bandwidth, improves performance"
148
+ },
149
+ "javascript": {
150
+ "dynamic_import": "const module = await import('./heavy-module.js');",
151
+ "when": "Features not needed on initial load",
152
+ "benefit": "Reduces initial bundle size"
153
+ }
154
+ },
155
+ "code_splitting": {
156
+ "description": "Split JavaScript into smaller chunks loaded on demand",
157
+ "strategies": [
158
+ "Route-based: Load code for each route separately",
159
+ "Component-based: Lazy load heavy components",
160
+ "Vendor splitting: Separate third-party libraries"
161
+ ],
162
+ "implementation": {
163
+ "webpack": "Use dynamic import() syntax",
164
+ "vite": "Automatic code splitting",
165
+ "next_js": "Automatic route-based splitting"
166
+ }
167
+ }
168
+ },
169
+ "image_optimization": {
170
+ "formats": {
171
+ "AVIF": {
172
+ "description": "Next-gen format, best compression",
173
+ "compression": "50% smaller than JPEG",
174
+ "support": "Modern browsers (95%+)",
175
+ "use": "Photos, complex images"
176
+ },
177
+ "WebP": {
178
+ "description": "Modern format, excellent compression",
179
+ "compression": "25-35% smaller than JPEG",
180
+ "support": "All modern browsers",
181
+ "use": "General purpose replacement for JPEG/PNG"
182
+ },
183
+ "JPEG": {
184
+ "description": "Traditional photo format",
185
+ "use": "Fallback for older browsers",
186
+ "optimization": "Use quality 80-85, progressive encoding"
187
+ },
188
+ "PNG": {
189
+ "description": "Lossless format for graphics",
190
+ "use": "Logos, icons with transparency",
191
+ "optimization": "Compress with tools like pngquant"
192
+ },
193
+ "SVG": {
194
+ "description": "Vector graphics",
195
+ "use": "Icons, logos, simple illustrations",
196
+ "optimization": "Minify with SVGO, inline when small"
197
+ }
198
+ },
199
+ "responsive_images": {
200
+ "srcset": "Provide multiple sizes for different screens",
201
+ "picture": "Art direction or format switching",
202
+ "sizes": "Tell browser which size to use when",
203
+ "example": "<img\n srcset='small.jpg 400w, medium.jpg 800w, large.jpg 1200w'\n sizes='(max-width: 600px) 400px, (max-width: 900px) 800px, 1200px'\n src='medium.jpg'\n alt='Description'\n width='800'\n height='600'\n loading='lazy'\n/>"
204
+ },
205
+ "optimization_tools": [
206
+ "ImageOptim (Mac)",
207
+ "Squoosh (Web)",
208
+ "Sharp (Node.js)",
209
+ "ImageMagick (CLI)",
210
+ "Next.js Image Component (automatic)"
211
+ ]
212
+ },
213
+ "caching_strategies": {
214
+ "http_caching": {
215
+ "cache_control": {
216
+ "immutable": "Cache-Control: public, max-age=31536000, immutable",
217
+ "use": "Hashed assets (main.a1b2c3.js)",
218
+ "benefit": "Never revalidate, perfect for build artifacts"
219
+ },
220
+ "stale_while_revalidate": {
221
+ "header": "Cache-Control: max-age=3600, stale-while-revalidate=86400",
222
+ "use": "API responses, frequently updated content",
223
+ "benefit": "Instant response from cache while updating in background"
224
+ },
225
+ "no_cache": {
226
+ "header": "Cache-Control: no-cache",
227
+ "use": "HTML pages, critical resources",
228
+ "note": "Revalidates every time (not 'don't cache')"
229
+ }
230
+ },
231
+ "service_worker": {
232
+ "strategies": [
233
+ "Cache First: Serve from cache, fallback to network",
234
+ "Network First: Try network, fallback to cache",
235
+ "Stale While Revalidate: Cache + background update",
236
+ "Network Only: Always fetch fresh",
237
+ "Cache Only: Offline-first"
238
+ ],
239
+ "use_cases": {
240
+ "cache_first": "Static assets, images, fonts",
241
+ "network_first": "API calls, dynamic content",
242
+ "stale_while_revalidate": "News feeds, timelines"
243
+ }
244
+ }
245
+ },
246
+ "performance_budget": {
247
+ "description": "Set limits to prevent performance regression",
248
+ "recommended_budgets": {
249
+ "JavaScript": "< 200 KB (gzipped) for initial bundle",
250
+ "CSS": "< 50 KB (gzipped)",
251
+ "Images": "< 500 KB total above-fold",
252
+ "Fonts": "< 100 KB (subset fonts)",
253
+ "Total page weight": "< 1 MB on first load",
254
+ "LCP": "< 2.5 seconds",
255
+ "FID/INP": "< 100/200 milliseconds",
256
+ "CLS": "< 0.1"
257
+ },
258
+ "enforcement": [
259
+ "Lighthouse CI in build pipeline",
260
+ "bundlesize package for bundle limits",
261
+ "WebPageTest for real-world testing",
262
+ "Performance monitoring (Sentry, New Relic)"
263
+ ]
264
+ },
265
+ "monitoring": {
266
+ "real_user_monitoring": {
267
+ "tools": [
268
+ "Google Analytics 4 (Web Vitals)",
269
+ "Sentry Performance",
270
+ "New Relic Browser",
271
+ "Cloudflare Web Analytics"
272
+ ],
273
+ "metrics_to_track": [
274
+ "Core Web Vitals (LCP, INP, CLS)",
275
+ "TTFB (Time to First Byte)",
276
+ "Page load time",
277
+ "Bounce rate by performance tier",
278
+ "Performance by device type/network"
279
+ ]
280
+ },
281
+ "synthetic_monitoring": {
282
+ "tools": [
283
+ "Lighthouse CI",
284
+ "WebPageTest",
285
+ "Chrome DevTools Performance",
286
+ "SpeedCurve"
287
+ ],
288
+ "frequency": "Every deployment"
289
+ }
290
+ },
291
+ "quick_wins": [
292
+ {
293
+ "optimization": "Enable compression (gzip/brotli)",
294
+ "impact": "60-80% size reduction",
295
+ "effort": "Low (server config)"
296
+ },
297
+ {
298
+ "optimization": "Optimize images (WebP, lazy loading)",
299
+ "impact": "30-50% faster LCP",
300
+ "effort": "Medium"
301
+ },
302
+ {
303
+ "optimization": "Minify CSS/JS",
304
+ "impact": "10-30% size reduction",
305
+ "effort": "Low (build tool)"
306
+ },
307
+ {
308
+ "optimization": "Use CDN",
309
+ "impact": "30-50% faster TTFB",
310
+ "effort": "Low"
311
+ },
312
+ {
313
+ "optimization": "Remove unused CSS/JS",
314
+ "impact": "20-40% size reduction",
315
+ "effort": "Medium"
316
+ },
317
+ {
318
+ "optimization": "Defer non-critical CSS",
319
+ "impact": "Faster first paint",
320
+ "effort": "Low"
321
+ },
322
+ {
323
+ "optimization": "Preload critical resources",
324
+ "impact": "Faster LCP",
325
+ "effort": "Low"
326
+ },
327
+ {
328
+ "optimization": "Add width/height to images",
329
+ "impact": "Zero CLS",
330
+ "effort": "Low"
331
+ }
332
+ ],
333
+ "checklist": [
334
+ "Run Lighthouse audit (aim for 90+ performance score)",
335
+ "Measure Core Web Vitals (use Chrome UX Report or RUM)",
336
+ "Optimize images (format, size, lazy loading)",
337
+ "Minimize CSS/JS (remove unused code)",
338
+ "Enable compression (gzip or brotli)",
339
+ "Use CDN for static assets",
340
+ "Implement caching strategy",
341
+ "Add resource hints (preconnect, preload)",
342
+ "Defer non-critical JavaScript",
343
+ "Avoid layout shifts (set dimensions)",
344
+ "Monitor performance in production",
345
+ "Set and enforce performance budgets"
346
+ ]
347
+ }