@longtq2501/next-spring-skills 1.5.0 β†’ 1.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.
Files changed (41) hide show
  1. package/README.md +9 -0
  2. package/package.json +1 -1
  3. package/skills/SKILL.md +24 -0
  4. package/skills/debug-and-fix.md +64 -0
  5. package/skills/nextjs/design-intelligence.md +76 -0
  6. package/skills/nextjs/performance.md +11 -0
  7. package/skills/nextjs/ui-libraries.md +12 -5
  8. package/skills/spring/query_optimization.md +1 -0
  9. package/skills/spring/repository_design.md +7 -4
  10. package/skills/spring/service_design.md +23 -3
  11. package/skills/ui-ux-pro-max/SKILL.md +292 -0
  12. package/skills/ui-ux-pro-max/data/charts.csv +26 -0
  13. package/skills/ui-ux-pro-max/data/colors.csv +97 -0
  14. package/skills/ui-ux-pro-max/data/icons.csv +101 -0
  15. package/skills/ui-ux-pro-max/data/landing.csv +31 -0
  16. package/skills/ui-ux-pro-max/data/products.csv +97 -0
  17. package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  18. package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  19. package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  20. package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  21. package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  22. package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  23. package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  24. package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  25. package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  26. package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  27. package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  28. package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  29. package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  30. package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  31. package/skills/ui-ux-pro-max/data/styles.csv +68 -0
  32. package/skills/ui-ux-pro-max/data/typography.csv +58 -0
  33. package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  34. package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  35. package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  36. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-314.pyc +0 -0
  37. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-314.pyc +0 -0
  38. package/skills/ui-ux-pro-max/scripts/__pycache__/search.cpython-314.pyc +0 -0
  39. package/skills/ui-ux-pro-max/scripts/core.py +253 -0
  40. package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  41. package/skills/ui-ux-pro-max/scripts/search.py +114 -0
package/README.md CHANGED
@@ -27,6 +27,15 @@ npx @longtq2501/next-spring-skills
27
27
 
28
28
  This will copy the `skills/` directory and `AGENT.md` into your current project folder.
29
29
 
30
+ Meta-Prompt:
31
+ ```bash
32
+ "Implement [Frontend Task] following Design Intelligence + Next.js Performance standards."
33
+
34
+ "Implement [Backend Task] following Spring Boot Pro Max standards (Performance & Clean Code)."
35
+
36
+ "Resolve [Error Description] following Debug & Fix Pro Max standards."
37
+ ```
38
+
30
39
  ## Workflow
31
40
 
32
41
  This repository is designed for **AI-Human Collaboration**. For every new task:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longtq2501/next-spring-skills",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "Standardized best practices and code patterns for Next.js and Spring Boot",
5
5
  "bin": {
6
6
  "next-spring-skills": "bin/cli.js"
package/skills/SKILL.md CHANGED
@@ -92,6 +92,30 @@ See [performance.md](./nextjs/performance.md) for React optimization and data fe
92
92
 
93
93
  ---
94
94
 
95
+ ## Design Intelligence (Pro Max)
96
+
97
+ Standardized design systems, color palettes, and UX guidelines.
98
+
99
+ ### Core Database
100
+ See [SKILL.md](./ui-ux-pro-max/SKILL.md) for styles, palettes, and font pairings.
101
+
102
+ ### Next.js Integration
103
+ See [design-intelligence.md](./nextjs/design-intelligence.md) for mapping design to high-performance code.
104
+
105
+ ---
106
+
107
+ ## Troubleshooting & Debugging (Pro Max)
108
+
109
+ Systematic workflows for identifying and fixing complex issues.
110
+
111
+ ### Unified Workflow
112
+ See [debug-and-fix.md](./debug-and-fix.md) for the 5-step debugging process (Observation β†’ Verification).
113
+
114
+ ### Next.js Debug Tricks
115
+ See [debug-tricks.md](./nextjs/debug-tricks.md) for `nezt/mcp` and build path debugging.
116
+
117
+ ---
118
+
95
119
  ## AI Agent Workflow
96
120
 
97
121
  ### Interaction Protocol
@@ -0,0 +1,64 @@
1
+ # Skill: Debug & Fix (Pro Max Standards)
2
+
3
+ Systematic workflow for identifying root causes and applying high-performance fixes across Next.js and Spring Boot.
4
+
5
+ ## 1. The Pro Max Debugging Workflow
6
+
7
+ Follow these 5 steps for ANY issue (Bug, Performance, or UX):
8
+
9
+ ### Step 1: Observation & Data Collection
10
+ - **Frontend**: Check Browser Console, Network Tab, and `next-development.log`.
11
+ - **Backend**: Check Spring Boot logs (`log.info/error`) and Hibernate SQL output.
12
+ - **Tools**: Use `curl -X POST /_next/mcp` to get real-time dev server errors.
13
+
14
+ ### Step 2: Hypothesis Generation
15
+ Based on the data, identify the most likely layer of failure:
16
+ - **UI/UX**: Component state, Tailwind classes, or React lifecycle.
17
+ - **Logic**: Frontend hooks or Backend Service implementation.
18
+ - **Performance**: DB Query (N+1), heavy JS bundle, or inefficient re-renders.
19
+
20
+ ### Step 3: Isolation & Reproduction
21
+ - **Bisect**: Comment out components/logic to find the exact line causing the crash.
22
+ - **Repro**: Define the exact sequence of user actions that triggers the issue.
23
+ - **Mock**: Use `MockMVC` (Backend) or `Vitest` (Frontend) to isolate the unit.
24
+
25
+ ### Step 4: Resolution (Clean Fix)
26
+ Apply the fix according to project standards:
27
+ - **Frontend**: Use `useMemo`, `useCallback`, or `next/image`.
28
+ - **Backend**: Use proper Enum comparison (`==`), custom exceptions, and DB-level filtering.
29
+ - **Refactor**: If the fix introduces complexity, refactor surrounding code to maintain readability.
30
+
31
+ ### Step 5: Verification & Documentation
32
+ - **Verify**: Test the fix across different viewports and states.
33
+ - **Update Ledger**: Update `ISSUES.md` (Archive) with root cause and impact.
34
+ - **Regression**: Ensure no other features were broken.
35
+
36
+ ---
37
+
38
+ ## 2. Standard Issue Categories
39
+
40
+ | Category | Priority | Lead Indicator | Standard Action |
41
+ |----------|----------|----------------|-----------------|
42
+ | **Performance** | P0/P1 | LCP > 2.5s / API > 2s | `query_optimization.md` / `performance.md` |
43
+ | **Logic/Bug** | P0/P1 | 500 Error / Crash | `error_handling_design.md` / `debug-tricks.md` |
44
+ | **UX/UI** | P2/P3 | Visual glitch / Delay | `ux-feedback.md` / `design-intelligence.md` |
45
+
46
+ ---
47
+
48
+ ## 3. Universal Trigger Prompt
49
+
50
+ To trigger this workflow for a specific issue, use:
51
+
52
+ > **"Sα»­a lα»—i [MΓ΄ tαΊ£ lα»—i] theo chuαΊ©n Debug & Fix Pro Max."**
53
+
54
+ **What this triggers in me:**
55
+ 1. **Log Analysis**: I will proactively look for logs/errors in the workspace.
56
+ 2. **Systematic Plan**: I will update `ISSUES.md` and propose a scoped fix.
57
+ 3. **Verified Execution**: I will implement the fix and verify it before delivery.
58
+
59
+ ---
60
+
61
+ ## Related Skills
62
+ - **Agent Workflow**: `skills/agent-workflow.md` (Ledger management)
63
+ - **Debug Tricks**: `skills/nextjs/debug-tricks.md` (Next.js specific tools)
64
+ - **Performance**: `skills/nextjs/performance.md` & `skills/spring/performance_optimization.md`
@@ -0,0 +1,76 @@
1
+ # Skill: Design Intelligence (Next.js 15 + UI/UX Pro Max)
2
+
3
+ Bridge the gap between pure design logic and high-performance Next.js implementation.
4
+
5
+ ## 1. The Design Workflow
6
+
7
+ When building a new feature or page, follow this hierarchical retrieval pattern:
8
+
9
+ 1. **Analyze**: Extract product type and style keywords from the request.
10
+ 2. **Generate**: Run the design system generator (use `--design-system`).
11
+ 3. **Integrate**: Map the generated variables to shadcn/ui or Tailwind tokens.
12
+
13
+ ### Generator Command
14
+ ```bash
15
+ python3 skills/ui-ux-pro-max/scripts/search.py "<product_type> <keywords>" --design-system
16
+ ```
17
+
18
+ ---
19
+
20
+ ## 2. Integrated Implementation Patterns
21
+
22
+ ### Mapping to shadcn/ui
23
+ Generated design system variables should be mapped to `globals.css` to respect the high-performance theming engine of shadcn.
24
+
25
+ // Bad: Hardcoding values in components
26
+ <div style={{ backgroundColor: '#0080FF' }}>...</div>
27
+
28
+ // Good: Map to CSS variables
29
+ // globals.css
30
+ :root {
31
+ --primary: 221.2 83.2% 53.3%; /* From generated palette */
32
+ --radius: 0.75rem; /* From generated style */
33
+ }
34
+
35
+ ### Performance-Aware Effects
36
+ High-end effects must use Next.js optimized patterns to maintain 60FPS.
37
+
38
+ | Style | Next.js Implementation Detail |
39
+ |-------|-------------------------------|
40
+ | **Glassmorphism** | Use `backdrop-blur` sparingly. Prefer `bg-white/80` in light mode for contrast. |
41
+ | **Parallax** | Use `will-change: transform` and Framer Motion's `useScroll`. |
42
+ | **Dark Mode** | Use `next-themes` to prevent hydration mismatch. |
43
+
44
+ ---
45
+
46
+ ## 3. Tooling & Automation
47
+
48
+ ### Automated Design System (Hierarchical)
49
+ Always use the `--persist` flag when starting a project to create a `MASTER.md` file.
50
+
51
+ ```bash
52
+ python3 skills/ui-ux-pro-max/scripts/search.py "fintech dashboard glassmorphism" --design-system --persist -p "BankPro"
53
+ ```
54
+
55
+ 1. Read `design-system/MASTER.md` for global rules.
56
+ 2. Check for page-specific overrides in `design-system/pages/<page_name>.md`.
57
+
58
+ ---
59
+
60
+ ## 4. Quick Trigger Prompt (Universal)
61
+
62
+ To trigger the full power of this integration for ANY task or project, use this concise prompt:
63
+
64
+ > **"Triển khai [Task] theo chuαΊ©n Design Intelligence + Next.js Performance."**
65
+
66
+ **What this triggers in me:**
67
+ 1. **Search**: I will automatically query `skills/ui-ux-pro-max/` for the best design system.
68
+ 2. **Plan**: I will create a `task.md` with integrated design & performance phases.
69
+ 3. **Execute**: I will use CSS variables for theming and Next.js Best Practices for code.
70
+
71
+ ---
72
+
73
+ ## Related Skills
74
+ - **UI Libraries**: `skills/nextjs/ui-libraries.md` (Integration with shadcn/ui)
75
+ - **Performance**: `skills/nextjs/performance.md` (Visual Performance rules)
76
+ - **Design Database**: `skills/ui-ux-pro-max/SKILL.md` (Original CSV data)
@@ -52,6 +52,17 @@ Ensure the server or CDN uses GZIP/Brotli to compress JSON responses.
52
52
 
53
53
  ---
54
54
 
55
+ ## 4. Visual Performance (Design Intelligence)
56
+
57
+ Design choices impact technical performance. Balance aesthetics with the 60FPS target:
58
+
59
+ 1. **Glassmorphism**: Limit `backdrop-blur` usage. Multiple layers can cause heavy CPU/GPU load on lower-end devices.
60
+ 2. **Animations**: Use `will-change: transform` for hardware acceleration. Avoid animating `width`, `height`, or `margin`.
61
+ 3. **SVGs vs Emojis**: Never use emojis for UI icons. SVGs offer superior performance (vector), accessibility (aria-label), and brand consistency.
62
+
63
+ ---
64
+
55
65
  ## Related Skills
66
+ - **Design Intelligence**: `skills/nextjs/design-intelligence.md`
56
67
  - **Interactivity & Animation**: `skills/nextjs/interactivity.md`
57
68
  - **UI State Management**: `skills/nextjs/ui-state.md`
@@ -74,9 +74,16 @@ Use CSS variables in `globals.css` for theming instead of hardcoding colors in T
74
74
  }
75
75
  ```
76
76
 
77
- ## Common Libraries in Next.js
77
+ ## Design System Integration (Pro Max)
78
78
 
79
- - **shadcn/ui**: All-purpose, clean, professional.
80
- - **Radix UI**: Foundational primitives.
81
- - **Headless UI**: Good for Tailwind + simple components.
82
- - **Magic UI / Aceternity UI**: For high-end marketing and background effects (often uses Framer Motion).
79
+ For professional projects, do not choose colors or styles manually. Use the Design Intelligence system:
80
+
81
+ 1. **Generate**: Run `python3 skills/ui-ux-pro-max/scripts/search.py` to get recommended palettes and styles.
82
+ 2. **Map**: Translate generated CSS variables to `globals.css`.
83
+ 3. **Audit**: Follow the `Pre-Delivery Checklist` in `skills/ui-ux-pro-max/SKILL.md` (no emojis, cursor pointers, etc.).
84
+
85
+ ---
86
+
87
+ ## Related Skills
88
+ - **Design Intelligence**: `skills/nextjs/design-intelligence.md`
89
+ - **Component Aesthetics**: `skills/nextjs/component-aesthetics.md`
@@ -10,6 +10,7 @@ Advanced patterns for scaling and optimizing database access in high-traffic app
10
10
  3. **Composite Indexing**: Query under 10ms by indexing multiple columns used in WHERE/JOIN.
11
11
  4. **Leftmost Prefix**: Lead with the most selective column in composite indexes.
12
12
  5. **Slow Query Guards**: Use `@QueryHints` to set timeouts and prevent resource starvation.
13
+ 6. **P95 Targets**: Ensure API response time < 2s by optimizing database index paths.
13
14
 
14
15
  ---
15
16
 
@@ -14,8 +14,9 @@ public interface MyRepository extends JpaRepository<MyEntity, Long> {
14
14
  2. **@Query (JPQL)**: Use for 3+ conditions or joins.
15
15
  3. **Named Parameters**: Always use `@Param("name")` instead of `?1`.
16
16
  4. **Aggregations**: Always wrap with `COALESCE(SUM(...), 0)` to avoid NPE.
17
- 5. **Paginated Results**: Use `Page<T>` for UI, `Slice<T>` for infinite scroll.
18
- 6. **Native Queries**: Use ONLY for UPSERT or join-table operations.
17
+ 5. **Filtering**: Always filter in DB (`WHERE`) instead of loading into Java memory.
18
+ 6. **Constants**: Replace magic numbers (e.g., Page size) with named constants.
19
+ 7. **Paginated Results**: Use `Page<T>` for UI, `Slice<T>` for infinite scroll.
19
20
 
20
21
  **Performance note:** JOIN FETCH, `@EntityGraph`, `@BatchSize`, and N+1 avoidance are covered in `skills/spring/query_optimization.md`. This skill focuses on **design and structure** β€” what type of query to write and how to name/organize it.
21
22
 
@@ -96,8 +97,10 @@ boolean existsByStudentIdAndLessonId(Long studentId, Long lessonId);
96
97
  // ❌ Too complex β€” derived query becomes unreadable
97
98
  List<SessionRecord> findByStudentIdAndTutorIdAndMonthAndPaidAndStatusNotIn(...);
98
99
 
99
- // βœ… Use @Query for anything with 3+ conditions or joins
100
- @Query("SELECT sr FROM SessionRecord sr WHERE ...")
100
+ // βœ… Use @Query for anything with 3+ conditions or joins.
101
+ // Standard: Filter in DB to save memory and CPU.
102
+ @Query("SELECT sr FROM SessionRecord sr WHERE sr.tutor.id = :id AND sr.status = :status")
103
+ List<SessionRecord> findByTutorAndStatus(@Param("id") Long id, @Param("status") Status status);
101
104
  ```
102
105
 
103
106
  **Rule of thumb:** derived query with more than 2 conditions β†’ switch to `@Query`.
@@ -11,9 +11,10 @@ public class MyServiceImpl implements MyService { ... }
11
11
  ### Critical Rules
12
12
  1. **Always split interface/impl** β€” inject the interface, hide the implementation.
13
13
  2. **Method Order**: Validate β†’ Load β†’ Mutate β†’ Save β†’ Return.
14
- 3. **Transactions**: Use `@Transactional(readOnly = true)` for GET, and `@Transactional` for POST/PUT/DELETE.
15
- 4. **Exceptions**: Throw domain-specific exceptions (ResourceNotFound, AlreadyExists).
16
- 5. **Mapping**: Use private `mapToResponse()` or a dedicated Mapper.
14
+ 3. **Transactions**: Use `@Transactional(readOnly = true)` for GET, and `@Transactional` for POST/PUT/DELETE. Split heavy logic from write transactions.
15
+ 4. **Exceptions**: Throw domain-specific exceptions. **NEVER** swallow exceptions (e.g., JSON processing).
16
+ 5. **Enums**: Always compare using `==`. Never use `.name().equals()`.
17
+ 6. **Mapping**: Use private `mapToResponse()` or a dedicated Mapper.
17
18
 
18
19
  ### πŸ“„ Templates
19
20
  - [Standard Service Template](./templates/ServiceTemplate.java)
@@ -180,6 +181,18 @@ public TutorResponse createTutor(TutorRequest request) {
180
181
  Tutor tutor = tutorRepository.save(newTutor); // step 2 β€” if this fails, step 1 rolls back
181
182
  return mapToResponse(tutor);
182
183
  }
184
+
185
+ // Pro Tip: Split heavy processing from the write transaction to reduce lock time
186
+ public void processHeavyReport() {
187
+ // 1. Load data (readOnly)
188
+ Data data = service.getData(id);
189
+
190
+ // 2. Heavy CPU calculation (No transaction)
191
+ Result result = calculate(data);
192
+
193
+ // 3. Save result (Write transaction)
194
+ service.saveResult(result);
195
+ }
183
196
  ```
184
197
 
185
198
  ---
@@ -317,6 +330,13 @@ throw new RuntimeException("Tutor not found with id: " + id);
317
330
  throw new ResourceNotFoundException("Tutor not found with id: " + id); // -> 404
318
331
  throw new AlreadyExistsException("Email already exists: " + email); // -> 409
319
332
  throw new InvalidInputException("Password must be at least 8 characters"); // -> 400
333
+
334
+ // Rule: Never swallow technical exceptions. Re-throw or wrap them.
335
+ try {
336
+ return objectMapper.writeValueAsString(data);
337
+ } catch (JsonProcessingException e) {
338
+ throw new TechnicalException("Failed to serialize data", e); // Correct
339
+ }
320
340
  ```
321
341
 
322
342
  **Common exception β†’ HTTP status mapping:**
@@ -0,0 +1,292 @@
1
+ ---
2
+ name: ui-ux-pro-max
3
+ description: UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks.
4
+ ---
5
+ # ui-ux-pro-max
6
+
7
+ Comprehensive design guide for web and mobile applications. Contains 67 styles, 96 color palettes, 57 font pairings, 99 UX guidelines, and 25 chart types across 13 technology stacks. Searchable database with priority-based recommendations.
8
+
9
+ ## Prerequisites
10
+
11
+ Check if Python is installed:
12
+
13
+ ```bash
14
+ python3 --version || python --version
15
+ ```
16
+
17
+ If Python is not installed, install it based on user's OS:
18
+
19
+ **macOS:**
20
+ ```bash
21
+ brew install python3
22
+ ```
23
+
24
+ **Ubuntu/Debian:**
25
+ ```bash
26
+ sudo apt update && sudo apt install python3
27
+ ```
28
+
29
+ **Windows:**
30
+ ```powershell
31
+ winget install Python.Python.3.12
32
+ ```
33
+
34
+ ---
35
+
36
+ ## How to Use This Skill
37
+
38
+ When user requests UI/UX work (design, build, create, implement, review, fix, improve), follow this workflow:
39
+
40
+ ### Step 1: Analyze User Requirements
41
+
42
+ Extract key information from user request:
43
+ - **Product type**: SaaS, e-commerce, portfolio, dashboard, landing page, etc.
44
+ - **Style keywords**: minimal, playful, professional, elegant, dark mode, etc.
45
+ - **Industry**: healthcare, fintech, gaming, education, etc.
46
+ - **Stack**: React, Vue, Next.js, or default to `html-tailwind`
47
+
48
+ ### Step 2: Generate Design System (REQUIRED)
49
+
50
+ **Always start with `--design-system`** to get comprehensive recommendations with reasoning:
51
+
52
+ ```bash
53
+ python3 skills/ui-ux-pro-max/scripts/search.py "<product_type> <industry> <keywords>" --design-system [-p "Project Name"]
54
+ ```
55
+
56
+ This command:
57
+ 1. Searches 5 domains in parallel (product, style, color, landing, typography)
58
+ 2. Applies reasoning rules from `ui-reasoning.csv` to select best matches
59
+ 3. Returns complete design system: pattern, style, colors, typography, effects
60
+ 4. Includes anti-patterns to avoid
61
+
62
+ **Example:**
63
+ ```bash
64
+ python3 skills/ui-ux-pro-max/scripts/search.py "beauty spa wellness service" --design-system -p "Serenity Spa"
65
+ ```
66
+
67
+ ### Step 2b: Persist Design System (Master + Overrides Pattern)
68
+
69
+ To save the design system for hierarchical retrieval across sessions, add `--persist`:
70
+
71
+ ```bash
72
+ python3 skills/ui-ux-pro-max/scripts/search.py "<query>" --design-system --persist -p "Project Name"
73
+ ```
74
+
75
+ This creates:
76
+ - `design-system/MASTER.md` β€” Global Source of Truth with all design rules
77
+ - `design-system/pages/` β€” Folder for page-specific overrides
78
+
79
+ **With page-specific override:**
80
+ ```bash
81
+ python3 skills/ui-ux-pro-max/scripts/search.py "<query>" --design-system --persist -p "Project Name" --page "dashboard"
82
+ ```
83
+
84
+ This also creates:
85
+ - `design-system/pages/dashboard.md` β€” Page-specific deviations from Master
86
+
87
+ **How hierarchical retrieval works:**
88
+ 1. When building a specific page (e.g., "Checkout"), first check `design-system/pages/checkout.md`
89
+ 2. If the page file exists, its rules **override** the Master file
90
+ 3. If not, use `design-system/MASTER.md` exclusively
91
+
92
+ ### Step 3: Supplement with Detailed Searches (as needed)
93
+
94
+ After getting the design system, use domain searches to get additional details:
95
+
96
+ ```bash
97
+ python3 skills/ui-ux-pro-max/scripts/search.py "<keyword>" --domain <domain> [-n <max_results>]
98
+ ```
99
+
100
+ **When to use detailed searches:**
101
+
102
+ | Need | Domain | Example |
103
+ |------|--------|---------|
104
+ | More style options | `style` | `--domain style "glassmorphism dark"` |
105
+ | Chart recommendations | `chart` | `--domain chart "real-time dashboard"` |
106
+ | UX best practices | `ux` | `--domain ux "animation accessibility"` |
107
+ | Alternative fonts | `typography` | `--domain typography "elegant luxury"` |
108
+ | Landing structure | `landing` | `--domain landing "hero social-proof"` |
109
+
110
+ ### Step 4: Stack Guidelines (Default: html-tailwind)
111
+
112
+ Get implementation-specific best practices. If user doesn't specify a stack, **default to `html-tailwind`**.
113
+
114
+ ```bash
115
+ python3 skills/ui-ux-pro-max/scripts/search.py "<keyword>" --stack html-tailwind
116
+ ```
117
+
118
+ Available stacks: `html-tailwind`, `react`, `nextjs`, `vue`, `svelte`, `swiftui`, `react-native`, `flutter`, `shadcn`, `jetpack-compose`
119
+
120
+ ---
121
+
122
+ ## Search Reference
123
+
124
+ ### Available Domains
125
+
126
+ | Domain | Use For | Example Keywords |
127
+ |--------|---------|------------------|
128
+ | `product` | Product type recommendations | SaaS, e-commerce, portfolio, healthcare, beauty, service |
129
+ | `style` | UI styles, colors, effects | glassmorphism, minimalism, dark mode, brutalism |
130
+ | `typography` | Font pairings, Google Fonts | elegant, playful, professional, modern |
131
+ | `color` | Color palettes by product type | saas, ecommerce, healthcare, beauty, fintech, service |
132
+ | `landing` | Page structure, CTA strategies | hero, hero-centric, testimonial, pricing, social-proof |
133
+ | `chart` | Chart types, library recommendations | trend, comparison, timeline, funnel, pie |
134
+ | `ux` | Best practices, anti-patterns | animation, accessibility, z-index, loading |
135
+ | `react` | React/Next.js performance | waterfall, bundle, suspense, memo, rerender, cache |
136
+ | `web` | Web interface guidelines | aria, focus, keyboard, semantic, virtualize |
137
+ | `prompt` | AI prompts, CSS keywords | (style name) |
138
+
139
+ ### Available Stacks
140
+
141
+ | Stack | Focus |
142
+ |-------|-------|
143
+ | `html-tailwind` | Tailwind utilities, responsive, a11y (DEFAULT) |
144
+ | `react` | State, hooks, performance, patterns |
145
+ | `nextjs` | SSR, routing, images, API routes |
146
+ | `vue` | Composition API, Pinia, Vue Router |
147
+ | `svelte` | Runes, stores, SvelteKit |
148
+ | `swiftui` | Views, State, Navigation, Animation |
149
+ | `react-native` | Components, Navigation, Lists |
150
+ | `flutter` | Widgets, State, Layout, Theming |
151
+ | `shadcn` | shadcn/ui components, theming, forms, patterns |
152
+ | `jetpack-compose` | Composables, Modifiers, State Hoisting, Recomposition |
153
+
154
+ ---
155
+
156
+ ## Example Workflow
157
+
158
+ **User request:** "LΓ m landing page cho dα»‹ch vα»₯ chΔƒm sΓ³c da chuyΓͺn nghiệp"
159
+
160
+ ### Step 1: Analyze Requirements
161
+ - Product type: Beauty/Spa service
162
+ - Style keywords: elegant, professional, soft
163
+ - Industry: Beauty/Wellness
164
+ - Stack: html-tailwind (default)
165
+
166
+ ### Step 2: Generate Design System (REQUIRED)
167
+
168
+ ```bash
169
+ python3 skills/ui-ux-pro-max/scripts/search.py "beauty spa wellness service elegant" --design-system -p "Serenity Spa"
170
+ ```
171
+
172
+ **Output:** Complete design system with pattern, style, colors, typography, effects, and anti-patterns.
173
+
174
+ ### Step 3: Supplement with Detailed Searches (as needed)
175
+
176
+ ```bash
177
+ # Get UX guidelines for animation and accessibility
178
+ python3 skills/ui-ux-pro-max/scripts/search.py "animation accessibility" --domain ux
179
+
180
+ # Get alternative typography options if needed
181
+ python3 skills/ui-ux-pro-max/scripts/search.py "elegant luxury serif" --domain typography
182
+ ```
183
+
184
+ ### Step 4: Stack Guidelines
185
+
186
+ ```bash
187
+ python3 skills/ui-ux-pro-max/scripts/search.py "layout responsive form" --stack html-tailwind
188
+ ```
189
+
190
+ **Then:** Synthesize design system + detailed searches and implement the design.
191
+
192
+ ---
193
+
194
+ ## Output Formats
195
+
196
+ The `--design-system` flag supports two output formats:
197
+
198
+ ```bash
199
+ # ASCII box (default) - best for terminal display
200
+ python3 skills/ui-ux-pro-max/scripts/search.py "fintech crypto" --design-system
201
+
202
+ # Markdown - best for documentation
203
+ python3 skills/ui-ux-pro-max/scripts/search.py "fintech crypto" --design-system -f markdown
204
+ ```
205
+
206
+ ---
207
+
208
+ ## Tips for Better Results
209
+
210
+ 1. **Be specific with keywords** - "healthcare SaaS dashboard" > "app"
211
+ 2. **Search multiple times** - Different keywords reveal different insights
212
+ 3. **Combine domains** - Style + Typography + Color = Complete design system
213
+ 4. **Always check UX** - Search "animation", "z-index", "accessibility" for common issues
214
+ 5. **Use stack flag** - Get implementation-specific best practices
215
+ 6. **Iterate** - If first search doesn't match, try different keywords
216
+
217
+ ---
218
+
219
+ ## Common Rules for Professional UI
220
+
221
+ These are frequently overlooked issues that make UI look unprofessional:
222
+
223
+ ### Icons & Visual Elements
224
+
225
+ | Rule | Do | Don't |
226
+ |------|----|----- |
227
+ | **No emoji icons** | Use SVG icons (Heroicons, Lucide, Simple Icons) | Use emojis like 🎨 πŸš€ βš™οΈ as UI icons |
228
+ | **Stable hover states** | Use color/opacity transitions on hover | Use scale transforms that shift layout |
229
+ | **Correct brand logos** | Research official SVG from Simple Icons | Guess or use incorrect logo paths |
230
+ | **Consistent icon sizing** | Use fixed viewBox (24x24) with w-6 h-6 | Mix different icon sizes randomly |
231
+
232
+ ### Interaction & Cursor
233
+
234
+ | Rule | Do | Don't |
235
+ |------|----|----- |
236
+ | **Cursor pointer** | Add `cursor-pointer` to all clickable/hoverable cards | Leave default cursor on interactive elements |
237
+ | **Hover feedback** | Provide visual feedback (color, shadow, border) | No indication element is interactive |
238
+ | **Smooth transitions** | Use `transition-colors duration-200` | Instant state changes or too slow (>500ms) |
239
+
240
+ ### Light/Dark Mode Contrast
241
+
242
+ | Rule | Do | Don't |
243
+ |------|----|----- |
244
+ | **Glass card light mode** | Use `bg-white/80` or higher opacity | Use `bg-white/10` (too transparent) |
245
+ | **Text contrast light** | Use `#0F172A` (slate-900) for text | Use `#94A3B8` (slate-400) for body text |
246
+ | **Muted text light** | Use `#475569` (slate-600) minimum | Use gray-400 or lighter |
247
+ | **Border visibility** | Use `border-gray-200` in light mode | Use `border-white/10` (invisible) |
248
+
249
+ ### Layout & Spacing
250
+
251
+ | Rule | Do | Don't |
252
+ |------|----|----- |
253
+ | **Floating navbar** | Add `top-4 left-4 right-4` spacing | Stick navbar to `top-0 left-0 right-0` |
254
+ | **Content padding** | Account for fixed navbar height | Let content hide behind fixed elements |
255
+ | **Consistent max-width** | Use same `max-w-6xl` or `max-w-7xl` | Mix different container widths |
256
+
257
+ ---
258
+
259
+ ## Pre-Delivery Checklist
260
+
261
+ Before delivering UI code, verify these items:
262
+
263
+ ### Visual Quality
264
+ - [ ] No emojis used as icons (use SVG instead)
265
+ - [ ] All icons from consistent icon set (Heroicons/Lucide)
266
+ - [ ] Brand logos are correct (verified from Simple Icons)
267
+ - [ ] Hover states don't cause layout shift
268
+ - [ ] Use theme colors directly (bg-primary) not var() wrapper
269
+
270
+ ### Interaction
271
+ - [ ] All clickable elements have `cursor-pointer`
272
+ - [ ] Hover states provide clear visual feedback
273
+ - [ ] Transitions are smooth (150-300ms)
274
+ - [ ] Focus states visible for keyboard navigation
275
+
276
+ ### Light/Dark Mode
277
+ - [ ] Light mode text has sufficient contrast (4.5:1 minimum)
278
+ - [ ] Glass/transparent elements visible in light mode
279
+ - [ ] Borders visible in both modes
280
+ - [ ] Test both modes before delivery
281
+
282
+ ### Layout
283
+ - [ ] Floating elements have proper spacing from edges
284
+ - [ ] No content hidden behind fixed navbars
285
+ - [ ] Responsive at 375px, 768px, 1024px, 1440px
286
+ - [ ] No horizontal scroll on mobile
287
+
288
+ ### Accessibility
289
+ - [ ] All images have alt text
290
+ - [ ] Form inputs have labels
291
+ - [ ] Color is not the only indicator
292
+ - [ ] `prefers-reduced-motion` respected
@@ -0,0 +1,26 @@
1
+ No,Data Type,Keywords,Best Chart Type,Secondary Options,Color Guidance,Performance Impact,Accessibility Notes,Library Recommendation,Interactive Level
2
+ 1,Trend Over Time,"trend, time-series, line, growth, timeline, progress",Line Chart,"Area Chart, Smooth Area",Primary: #0080FF. Multiple series: use distinct colors. Fill: 20% opacity,⚑ Excellent (optimized),βœ“ Clear line patterns for colorblind users. Add pattern overlays.,"Chart.js, Recharts, ApexCharts",Hover + Zoom
3
+ 2,Compare Categories,"compare, categories, bar, comparison, ranking",Bar Chart (Horizontal or Vertical),"Column Chart, Grouped Bar",Each bar: distinct color. Category: grouped same color. Sorted: descending order,⚑ Excellent,βœ“ Easy to compare. Add value labels on bars for clarity.,"Chart.js, Recharts, D3.js",Hover + Sort
4
+ 3,Part-to-Whole,"part-to-whole, pie, donut, percentage, proportion, share",Pie Chart or Donut,"Stacked Bar, Treemap",Colors: 5-6 max. Contrasting palette. Large slices first. Use labels.,⚑ Good (limit 6 slices),⚠ Hard for accessibility. Better: Stacked bar with legend. Avoid pie if >5 items.,"Chart.js, Recharts, D3.js",Hover + Drill
5
+ 4,Correlation/Distribution,"correlation, distribution, scatter, relationship, pattern",Scatter Plot or Bubble Chart,"Heat Map, Matrix",Color axis: gradient (blue-red). Size: relative. Opacity: 0.6-0.8 to show density,⚠ Moderate (many points),⚠ Provide data table alternative. Use pattern + color distinction.,"D3.js, Plotly, Recharts",Hover + Brush
6
+ 5,Heatmap/Intensity,"heatmap, heat-map, intensity, density, matrix",Heat Map or Choropleth,"Grid Heat Map, Bubble Heat",Gradient: Cool (blue) to Hot (red). Scale: clear legend. Divergent for ±data,⚑ Excellent (color CSS),⚠ Colorblind: Use pattern overlay. Provide numerical legend.,"D3.js, Plotly, ApexCharts",Hover + Zoom
7
+ 6,Geographic Data,"geographic, map, location, region, geo, spatial","Choropleth Map, Bubble Map",Geographic Heat Map,Regional: single color gradient or categorized colors. Legend: clear scale,⚠ Moderate (rendering),⚠ Include text labels for regions. Provide data table alternative.,"D3.js, Mapbox, Leaflet",Pan + Zoom + Drill
8
+ 7,Funnel/Flow,funnel/flow,"Funnel Chart, Sankey",Waterfall (for flows),Stages: gradient (starting color β†’ ending color). Show conversion %,⚑ Good,βœ“ Clear stage labels + percentages. Good for accessibility if labeled.,"D3.js, Recharts, Custom SVG",Hover + Drill
9
+ 8,Performance vs Target,performance-vs-target,Gauge Chart or Bullet Chart,"Dial, Thermometer",Performance: Redβ†’Yellowβ†’Green gradient. Target: marker line. Threshold colors,⚑ Good,βœ“ Add numerical value + percentage label beside gauge.,"D3.js, ApexCharts, Custom SVG",Hover
10
+ 9,Time-Series Forecast,time-series-forecast,Line with Confidence Band,Ribbon Chart,Actual: solid line #0080FF. Forecast: dashed #FF9500. Band: light shading,⚑ Good,βœ“ Clearly distinguish actual vs forecast. Add legend.,"Chart.js, ApexCharts, Plotly",Hover + Toggle
11
+ 10,Anomaly Detection,anomaly-detection,Line Chart with Highlights,Scatter with Alert,Normal: blue #0080FF. Anomaly: red #FF0000 circle/square marker + alert,⚑ Good,βœ“ Circle/marker for anomalies. Add text alert annotation.,"D3.js, Plotly, ApexCharts",Hover + Alert
12
+ 11,Hierarchical/Nested Data,hierarchical/nested-data,Treemap,"Sunburst, Nested Donut, Icicle",Parent: distinct hues. Children: lighter shades. White borders 2-3px.,⚠ Moderate,⚠ Poor - provide table alternative. Label large areas.,"D3.js, Recharts, ApexCharts",Hover + Drilldown
13
+ 12,Flow/Process Data,flow/process-data,Sankey Diagram,"Alluvial, Chord Diagram",Gradient from source to target. Opacity 0.4-0.6 for flows.,⚠ Moderate,⚠ Poor - provide flow table alternative.,"D3.js (d3-sankey), Plotly",Hover + Drilldown
14
+ 13,Cumulative Changes,cumulative-changes,Waterfall Chart,"Stacked Bar, Cascade",Increases: #4CAF50. Decreases: #F44336. Start: #2196F3. End: #0D47A1.,⚑ Good,βœ“ Good - clear directional colors with labels.,"ApexCharts, Highcharts, Plotly",Hover
15
+ 14,Multi-Variable Comparison,multi-variable-comparison,Radar/Spider Chart,"Parallel Coordinates, Grouped Bar",Single: #0080FF 20% fill. Multiple: distinct colors per dataset.,⚑ Good,⚠ Moderate - limit 5-8 axes. Add data table.,"Chart.js, Recharts, ApexCharts",Hover + Toggle
16
+ 15,Stock/Trading OHLC,stock/trading-ohlc,Candlestick Chart,"OHLC Bar, Heikin-Ashi",Bullish: #26A69A. Bearish: #EF5350. Volume: 40% opacity below.,⚑ Good,⚠ Moderate - provide OHLC data table.,"Lightweight Charts (TradingView), ApexCharts",Real-time + Hover + Zoom
17
+ 16,Relationship/Connection Data,relationship/connection-data,Network Graph,"Hierarchical Tree, Adjacency Matrix",Node types: categorical colors. Edges: #90A4AE 60% opacity.,❌ Poor (500+ nodes struggles),❌ Very Poor - provide adjacency list alternative.,"D3.js (d3-force), Vis.js, Cytoscape.js",Drilldown + Hover + Drag
18
+ 17,Distribution/Statistical,distribution/statistical,Box Plot,"Violin Plot, Beeswarm",Box: #BBDEFB. Border: #1976D2. Median: #D32F2F. Outliers: #F44336.,⚑ Excellent,"βœ“ Good - include stats table (min, Q1, median, Q3, max).","Plotly, D3.js, Chart.js (plugin)",Hover
19
+ 18,Performance vs Target (Compact),performance-vs-target-(compact),Bullet Chart,"Gauge, Progress Bar","Ranges: #FFCDD2, #FFF9C4, #C8E6C9. Performance: #1976D2. Target: black 3px.",⚑ Excellent,βœ“ Excellent - compact with clear values.,"D3.js, Plotly, Custom SVG",Hover
20
+ 19,Proportional/Percentage,proportional/percentage,Waffle Chart,"Pictogram, Stacked Bar 100%",10x10 grid. 3-5 categories max. 2-3px spacing between squares.,⚑ Good,βœ“ Good - better than pie for accessibility.,"D3.js, React-Waffle, Custom CSS Grid",Hover
21
+ 20,Hierarchical Proportional,hierarchical-proportional,Sunburst Chart,"Treemap, Icicle, Circle Packing",Center to outer: darker to lighter. 15-20% lighter per level.,⚠ Moderate,⚠ Poor - provide hierarchy table alternative.,"D3.js (d3-hierarchy), Recharts, ApexCharts",Drilldown + Hover
22
+ 21,Root Cause Analysis,"root cause, decomposition, tree, hierarchy, drill-down, ai-split",Decomposition Tree,"Decision Tree, Flow Chart",Nodes: #2563EB (Primary) vs #EF4444 (Negative impact). Connectors: Neutral grey.,⚠ Moderate (calculation heavy),βœ“ clear hierarchy. Allow keyboard navigation for nodes.,"Power BI (native), React-Flow, Custom D3.js",Drill + Expand
23
+ 22,3D Spatial Data,"3d, spatial, immersive, terrain, molecular, volumetric",3D Scatter/Surface Plot,"Volumetric Rendering, Point Cloud",Depth cues: lighting/shading. Z-axis: color gradient (cool to warm).,❌ Heavy (WebGL required),❌ Poor - requires alternative 2D view or data table.,"Three.js, Deck.gl, Plotly 3D",Rotate + Zoom + VR
24
+ 23,Real-Time Streaming,"streaming, real-time, ticker, live, velocity, pulse",Streaming Area Chart,"Ticker Tape, Moving Gauge",Current: Bright Pulse (#00FF00). History: Fading opacity. Grid: Dark.,⚑ Optimized (canvas/webgl),⚠ Flashing elements - provide pause button. High contrast.,Smoothed D3.js, CanvasJS
25
+ 24,Sentiment/Emotion,"sentiment, emotion, nlp, opinion, feeling",Word Cloud with Sentiment,"Sentiment Arc, Radar Chart",Positive: #22C55E. Negative: #EF4444. Neutral: #94A3B8. Size = Frequency.,⚑ Good,⚠ Word clouds poor for screen readers. Use list view.,"D3-cloud, Highcharts, Nivo",Hover + Filter
26
+ 25,Process Mining,"process, mining, variants, path, bottleneck, log",Process Map / Graph,"Directed Acyclic Graph (DAG), Petri Net",Happy path: #10B981 (Thick). Deviations: #F59E0B (Thin). Bottlenecks: #EF4444.,⚠ Moderate to Heavy,⚠ Complex graphs hard to navigate. Provide path summary.,"React-Flow, Cytoscape.js, Recharts",Drag + Node-Click