@mytechtoday/augment-extensions 1.2.2 → 1.3.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.
Files changed (57) hide show
  1. package/augment-extensions/visual-design/CHANGELOG.md +132 -0
  2. package/augment-extensions/visual-design/README.md +255 -0
  3. package/augment-extensions/visual-design/__tests__/README.md +119 -0
  4. package/augment-extensions/visual-design/__tests__/style-selector.test.ts +172 -0
  5. package/augment-extensions/visual-design/__tests__/vendor-styles.test.ts +214 -0
  6. package/augment-extensions/visual-design/domains/other/ai-prompt-helper.ts +157 -0
  7. package/augment-extensions/visual-design/domains/other/dotnet-application.ts +156 -0
  8. package/augment-extensions/visual-design/domains/other/linux-platform.ts +156 -0
  9. package/augment-extensions/visual-design/domains/other/mobile-application.ts +157 -0
  10. package/augment-extensions/visual-design/domains/other/motion-picture.ts +156 -0
  11. package/augment-extensions/visual-design/domains/other/os-application.ts +156 -0
  12. package/augment-extensions/visual-design/domains/other/print-campaigns.ts +158 -0
  13. package/augment-extensions/visual-design/domains/other/web-app.ts +157 -0
  14. package/augment-extensions/visual-design/domains/other/website.ts +161 -0
  15. package/augment-extensions/visual-design/domains/other/windows-platform.ts +156 -0
  16. package/augment-extensions/visual-design/domains/web-page-styles/amazon-cloudscape.ts +506 -0
  17. package/augment-extensions/visual-design/domains/web-page-styles/google-modern.ts +615 -0
  18. package/augment-extensions/visual-design/domains/web-page-styles/microsoft-fluent.ts +531 -0
  19. package/augment-extensions/visual-design/examples/README.md +97 -0
  20. package/augment-extensions/visual-design/examples/ai-prompt-generation.md +233 -0
  21. package/augment-extensions/visual-design/examples/basic-usage.md +216 -0
  22. package/augment-extensions/visual-design/examples/domain-workflows.md +257 -0
  23. package/augment-extensions/visual-design/examples/vendor-comparison.md +247 -0
  24. package/augment-extensions/visual-design/module.json +78 -0
  25. package/augment-extensions/visual-design/style-selector.ts +177 -0
  26. package/augment-extensions/visual-design/types.ts +302 -0
  27. package/augment-extensions/visual-design/visual-design-core.ts +469 -0
  28. package/augment-extensions/workflows/adr-support/README.md +227 -0
  29. package/augment-extensions/workflows/adr-support/__tests__/adr-validator.test.ts +203 -0
  30. package/augment-extensions/workflows/adr-support/adr-validator.ts +162 -0
  31. package/augment-extensions/workflows/adr-support/examples/complete-lifecycle-example.md +449 -0
  32. package/augment-extensions/workflows/adr-support/examples/integration-example.md +580 -0
  33. package/augment-extensions/workflows/adr-support/examples/superseding-example.md +436 -0
  34. package/augment-extensions/workflows/adr-support/module.json +112 -0
  35. package/augment-extensions/workflows/adr-support/rules/adr-creation.md +372 -0
  36. package/augment-extensions/workflows/adr-support/rules/beads-integration.md +443 -0
  37. package/augment-extensions/workflows/adr-support/rules/conflict-detection.md +486 -0
  38. package/augment-extensions/workflows/adr-support/rules/decision-detection.md +362 -0
  39. package/augment-extensions/workflows/adr-support/rules/lifecycle-management.md +427 -0
  40. package/augment-extensions/workflows/adr-support/rules/openspec-integration.md +465 -0
  41. package/augment-extensions/workflows/adr-support/rules/template-selection.md +405 -0
  42. package/augment-extensions/workflows/adr-support/rules/validation-rules.md +543 -0
  43. package/augment-extensions/workflows/adr-support/schemas/adr-config.json +191 -0
  44. package/augment-extensions/workflows/adr-support/schemas/adr-metadata.json +172 -0
  45. package/augment-extensions/workflows/adr-support/templates/business-case.md +235 -0
  46. package/augment-extensions/workflows/adr-support/templates/madr-elaborate.md +197 -0
  47. package/augment-extensions/workflows/adr-support/templates/madr-simple.md +68 -0
  48. package/augment-extensions/workflows/adr-support/templates/nygard.md +84 -0
  49. package/cli/dist/utils/__tests__/adr-validator.example.d.ts +6 -0
  50. package/cli/dist/utils/__tests__/adr-validator.example.d.ts.map +1 -0
  51. package/cli/dist/utils/__tests__/adr-validator.example.js +148 -0
  52. package/cli/dist/utils/__tests__/adr-validator.example.js.map +1 -0
  53. package/cli/dist/utils/adr-validator.d.ts +65 -0
  54. package/cli/dist/utils/adr-validator.d.ts.map +1 -0
  55. package/cli/dist/utils/adr-validator.js +203 -0
  56. package/cli/dist/utils/adr-validator.js.map +1 -0
  57. package/package.json +1 -1
@@ -0,0 +1,132 @@
1
+ # Changelog
2
+
3
+ All notable changes to the Visual Design module will be documented in this file.
4
+
5
+ ## [1.0.0] - 2026-02-05
6
+
7
+ ### Added
8
+
9
+ #### Core Module
10
+ - **visual-design-core.ts**: 8 design elements, 11 design principles, 5 skill categories
11
+ - **types.ts**: Comprehensive TypeScript interface definitions
12
+ - **style-selector.ts**: Vendor priority logic with fallback chain (google → microsoft → amazon)
13
+
14
+ #### Vendor Design Systems
15
+ - **Google Modern (Material 3 Expressive)**: Dynamic color theming, rounded corners, springy motion
16
+ - **Microsoft Fluent 2**: Acrylic/Mica materials, Segoe UI Variable, cross-platform consistency
17
+ - **Amazon Cloudscape**: Enterprise dashboards, Amazon Ember typography, component-heavy patterns
18
+
19
+ #### Domain Styles
20
+ - **Website**: Multi-page structure, SEO-optimized layouts, content-focused
21
+ - **Web-app**: SPA architecture, interactive components, state management
22
+ - **Mobile Application**: Touch-first design, native iOS/Android patterns
23
+ - **.NET Application**: XAML-based UI, MVVM architecture, WPF/WinForms/MAUI
24
+ - **Linux Platform**: GNOME/KDE HIG compliance, GTK/Qt integration
25
+ - **Windows Platform**: Windows 11 design, Acrylic/Mica materials, WinUI 3
26
+ - **Motion Picture**: Cinematography principles, color grading, visual storytelling
27
+ - **AI Prompt Helper**: Platform-specific prompts for Midjourney/DALL-E/Stable Diffusion
28
+ - **Print Campaigns**: CMYK color, 300 DPI, physical media constraints
29
+ - **OS Application**: General operating system application patterns
30
+
31
+ #### Testing
32
+ - **style-selector.test.ts**: 20+ tests for vendor priority and fallback logic
33
+ - **vendor-styles.test.ts**: Integration tests for all vendor design systems
34
+ - **Test README**: Comprehensive test documentation
35
+
36
+ #### Examples
37
+ - **basic-usage.md**: Getting started guide with Google Material 3
38
+ - **domain-workflows.md**: Workflows for all 9 domain styles
39
+ - **vendor-comparison.md**: Detailed comparison of Google/Microsoft/Amazon
40
+ - **ai-prompt-generation.md**: AI image generation prompt examples
41
+
42
+ #### Documentation
43
+ - **README.md**: Complete module overview with architecture, usage, and examples
44
+ - **module.json**: Module metadata with all contents listed
45
+ - **CHANGELOG.md**: This file
46
+
47
+ ### Features
48
+
49
+ - ✅ Default vendor priority chain: google → microsoft → amazon
50
+ - ✅ Configurable vendor preferences via .augment/extensions.json
51
+ - ✅ 8 core design elements (Color, Typography, Layout, Imagery, Iconography, Spacing, Motion, Elevation)
52
+ - ✅ 11 design principles (Balance, Contrast, Hierarchy, Unity, Emphasis, Rhythm, Proportion, White Space, Consistency, Accessibility, Responsiveness)
53
+ - ✅ 5 skill categories (Visual Design Fundamentals, UI Design, UX Design, Technical Implementation, Design Tools & Workflow)
54
+ - ✅ 3 vendor design systems (Google, Microsoft, Amazon)
55
+ - ✅ 10 domain-specific styles
56
+ - ✅ Comprehensive test coverage (100% for core modules)
57
+ - ✅ Extensive usage examples
58
+ - ✅ WCAG 2.1 AA accessibility compliance
59
+ - ✅ Responsive design patterns
60
+ - ✅ Cross-platform support
61
+
62
+ ### Technical Details
63
+
64
+ - **Total Character Count**: ~85,000 characters
65
+ - **TypeScript**: Fully typed with comprehensive interfaces
66
+ - **Testing**: Jest with 100% coverage for core modules
67
+ - **Documentation**: Inline JSDoc comments throughout
68
+ - **Examples**: 5 comprehensive example files
69
+ - **Domains**: 10 domain-specific style implementations
70
+ - **Vendors**: 3 major design system implementations
71
+
72
+ ### Installation
73
+
74
+ ```bash
75
+ # Link the module
76
+ augx link visual-design
77
+
78
+ # View module content
79
+ augx show visual-design
80
+
81
+ # View specific vendor
82
+ augx show visual-design/google-modern
83
+ ```
84
+
85
+ ### Usage
86
+
87
+ ```typescript
88
+ import { defaultStyleSelector } from './style-selector';
89
+ import { WEBSITE_DOMAIN } from './domains/other/website';
90
+
91
+ // Get default vendor style (Google)
92
+ const vendorStyle = defaultStyleSelector.selectVendorStyle();
93
+
94
+ // Apply to website domain
95
+ const websiteDesign = {
96
+ ...vendorStyle,
97
+ domain: WEBSITE_DOMAIN
98
+ };
99
+ ```
100
+
101
+ ### Contributors
102
+
103
+ - Augment AI Agent
104
+ - Kyle (mytech-today-now)
105
+
106
+ ### License
107
+
108
+ Part of Augment Extensions. See repository root for license information.
109
+
110
+ ---
111
+
112
+ ## Future Enhancements
113
+
114
+ Potential additions for future versions:
115
+
116
+ - Additional web page styles (Flat Design, Neumorphism, Glassmorphism, etc.)
117
+ - More domain styles (Gaming, E-commerce, Healthcare, etc.)
118
+ - Additional vendor systems (Apple Human Interface Guidelines, etc.)
119
+ - Advanced animation patterns
120
+ - Design token system
121
+ - Figma/Sketch integration
122
+ - Component library templates
123
+ - Accessibility testing tools
124
+ - Performance optimization guidelines
125
+ - Dark mode variants for all vendors
126
+ - Internationalization support
127
+ - Right-to-left (RTL) layout support
128
+
129
+ ---
130
+
131
+ **Note**: This is version 1.0.0 - the initial release of the Visual Design module.
132
+
@@ -0,0 +1,255 @@
1
+ # Visual Design System Module
2
+
3
+ Comprehensive visual design module for Augment AI with vendor-specific design systems and domain-specific styles.
4
+
5
+ ## Overview
6
+
7
+ This module provides AI agents with structured visual design knowledge including:
8
+ - **Design Elements**: Color, typography, layout, imagery, iconography, spacing, motion, elevation
9
+ - **Design Principles**: Balance, contrast, hierarchy, unity, emphasis, rhythm, proportion, white space, consistency, accessibility, responsiveness
10
+ - **Vendor Design Systems**: Google Material 3 Expressive, Microsoft Fluent 2, Amazon Cloudscape
11
+ - **Domain Styles**: Website, Web-app, Mobile, .NET Application, Linux, Windows, Motion Picture, AI Prompt Helper, Print Campaigns
12
+ - **Default Fallback**: google → microsoft → amazon
13
+
14
+ ## Architecture
15
+
16
+ ```
17
+ visual-design/
18
+ ├── module.json # Module metadata
19
+ ├── README.md # This file
20
+ ├── visual-design-core.ts # Core design elements, principles, skills
21
+ ├── types.ts # TypeScript interfaces
22
+ ├── style-selector.ts # Vendor priority logic
23
+ ├── domains/
24
+ │ ├── web-page-styles/
25
+ │ │ ├── google-modern.ts # Material 3 Expressive
26
+ │ │ ├── microsoft-fluent.ts # Fluent 2
27
+ │ │ └── amazon-cloudscape.ts# Cloudscape + amazon.com
28
+ │ └── other/
29
+ │ ├── website.ts # Multi-page websites
30
+ │ ├── web-app.ts # Single-page applications
31
+ │ ├── mobile-application.ts # iOS/Android apps
32
+ │ ├── dotnet-application.ts # WPF/WinForms/MAUI
33
+ │ ├── linux-platform.ts # GNOME/KDE applications
34
+ │ ├── windows-platform.ts # Windows 11 applications
35
+ │ ├── motion-picture.ts # Film/TV/web-series
36
+ │ ├── ai-prompt-helper.ts # AI image generation prompts
37
+ │ ├── print-campaigns.ts # Flyers, posters, banners
38
+ │ └── os-application.ts # General OS applications
39
+ ├── __tests__/ # Unit and integration tests
40
+ │ ├── README.md # Test documentation
41
+ │ ├── style-selector.test.ts # Style selector tests
42
+ │ └── vendor-styles.test.ts # Vendor integration tests
43
+ └── examples/ # Usage examples
44
+ ├── README.md # Examples overview
45
+ ├── basic-usage.md # Getting started
46
+ ├── domain-workflows.md # Domain-specific workflows
47
+ ├── vendor-comparison.md # Vendor style comparison
48
+ └── ai-prompt-generation.md # AI prompt examples
49
+ ```
50
+
51
+ ## Vendor Priority Order
52
+
53
+ The module uses a default fallback chain:
54
+
55
+ 1. **Google Modern** (Material 3 Expressive) - Primary
56
+ 2. **Microsoft Fluent 2** - Secondary
57
+ 3. **Amazon Cloudscape** - Tertiary
58
+
59
+ This can be overridden in `.augment/extensions.json`:
60
+
61
+ ```json
62
+ {
63
+ "linked": ["visual-design"],
64
+ "config": {
65
+ "visual-design": {
66
+ "vendorPriority": ["microsoft", "google", "amazon"]
67
+ }
68
+ }
69
+ }
70
+ ```
71
+
72
+ ## Installation
73
+
74
+ ```bash
75
+ # Link the module
76
+ augx link visual-design
77
+
78
+ # View module content
79
+ augx show visual-design
80
+
81
+ # View specific vendor style
82
+ augx show visual-design/google-modern
83
+ ```
84
+
85
+ ## Usage
86
+
87
+ ### For AI Agents
88
+
89
+ When generating visual designs:
90
+
91
+ 1. **Query the module**: `augx show visual-design`
92
+ 2. **Select vendor style**: Use default priority or user-specified preference
93
+ 3. **Apply design elements**: Color, typography, layout, spacing, etc.
94
+ 4. **Follow design principles**: Balance, contrast, hierarchy, accessibility
95
+ 5. **Generate output**: HTML/CSS, design specs, or visual mockups
96
+
97
+ ### Example Prompt
98
+
99
+ ```
100
+ Using the visual-design module with Google Modern style, create a landing page
101
+ for a SaaS product with:
102
+ - Hero section with CTA
103
+ - Feature cards (3 columns)
104
+ - Testimonials section
105
+ - Footer with links
106
+
107
+ Apply Material 3 Expressive characteristics: dynamic color theming, rounded
108
+ corners, and accessible contrast ratios.
109
+ ```
110
+
111
+ ## Design Elements (8)
112
+
113
+ 1. **Color** - Palettes, contrast, accessibility
114
+ 2. **Typography** - Fonts, hierarchy, readability
115
+ 3. **Layout** - Grid systems, alignment, flow
116
+ 4. **Imagery** - Photos, illustrations, aspect ratios
117
+ 5. **Iconography** - Icon sets, sizes, styles
118
+ 6. **Spacing** - Margins, padding, rhythm
119
+ 7. **Motion** - Animations, transitions, easing
120
+ 8. **Elevation** - Shadows, depth, layering
121
+
122
+ ## Design Principles (11)
123
+
124
+ 1. **Balance** - Visual weight distribution
125
+ 2. **Contrast** - Differentiation and emphasis
126
+ 3. **Hierarchy** - Information priority
127
+ 4. **Unity** - Cohesive visual language
128
+ 5. **Emphasis** - Focal points
129
+ 6. **Rhythm** - Repetition and pattern
130
+ 7. **Proportion** - Size relationships
131
+ 8. **White Space** - Breathing room
132
+ 9. **Consistency** - Predictable patterns
133
+ 10. **Accessibility** - WCAG 2.1 AA compliance
134
+ 11. **Responsiveness** - Multi-device adaptation
135
+
136
+ ## Skill Categories (5)
137
+
138
+ 1. **Color Theory** - Palettes, harmony, psychology
139
+ 2. **Typography** - Font pairing, hierarchy, readability
140
+ 3. **Layout Design** - Grid systems, composition, flow
141
+ 4. **Visual Hierarchy** - Emphasis, contrast, scale
142
+ 5. **Accessibility** - WCAG compliance, inclusive design
143
+
144
+ ## Vendor Characteristics
145
+
146
+ ### Google Modern (Material 3 Expressive)
147
+ - Dynamic color theming with tonal palettes
148
+ - Rounded corners (8px-24px)
149
+ - Springy motion with easing curves
150
+ - High accessibility standards (WCAG 2.1 AA+)
151
+
152
+ ### Microsoft Fluent 2
153
+ - Acrylic and Mica materials for depth
154
+ - Segoe UI Variable typography
155
+ - Cross-platform consistency
156
+ - Subtle shadows and elevation
157
+
158
+ ### Amazon Cloudscape
159
+ - Enterprise dashboard patterns
160
+ - Amazon Ember typography
161
+ - Component-heavy architecture
162
+ - Data visualization focus
163
+
164
+ ## Domain Styles
165
+
166
+ ### Website Domain
167
+ - Multi-page structure with consistent navigation
168
+ - SEO-optimized layouts
169
+ - Content-focused typography
170
+ - Blog post templates
171
+ - Contact forms and landing pages
172
+
173
+ ### Web-app Domain
174
+ - Single-page application architecture
175
+ - App-like navigation (sidebar, tabs)
176
+ - Interactive components (charts, tables)
177
+ - State management patterns
178
+ - Real-time data updates
179
+
180
+ ### Mobile Application Domain
181
+ - Touch-first interaction design
182
+ - Native navigation patterns (iOS/Android)
183
+ - Gesture-based interactions
184
+ - Bottom navigation and tab bars
185
+ - Safe area inset handling
186
+
187
+ ### .NET Application Domain
188
+ - XAML-based UI definition
189
+ - MVVM architecture pattern
190
+ - WPF/WinForms/MAUI controls
191
+ - Cross-platform with .NET MAUI
192
+ - Visual Studio designer support
193
+
194
+ ### Linux Platform Domain
195
+ - GNOME HIG / KDE HIG compliance
196
+ - GTK/Qt integration
197
+ - Desktop environment theming
198
+ - System integration (notifications, tray)
199
+
200
+ ### Windows Platform Domain
201
+ - Windows 11 design principles
202
+ - Acrylic/Mica materials
203
+ - Fluent Design System
204
+ - WinUI 3 controls
205
+
206
+ ### Motion Picture Design Domain
207
+ - Cinematography principles
208
+ - Color grading techniques
209
+ - Composition rules (rule of thirds)
210
+ - Visual storytelling
211
+ - Motion graphics for film/TV/web-series
212
+
213
+ ### AI Prompt Helper Domain
214
+ - Platform-specific prompt templates (Midjourney, DALL-E, Stable Diffusion)
215
+ - Style keyword suggestions
216
+ - Composition guidance
217
+ - Lighting and mood descriptors
218
+
219
+ ### Print Campaigns Domain
220
+ - Print-specific color (CMYK)
221
+ - High resolution (300 DPI)
222
+ - Bleed and safe zones
223
+ - Physical media constraints
224
+ - Large-format typography for posters, flyers, banners, billboards
225
+
226
+ ## Examples
227
+
228
+ The `examples/` directory contains comprehensive usage examples:
229
+
230
+ - **basic-usage.md**: Getting started with the module
231
+ - **domain-workflows.md**: Domain-specific workflows for all 9 domains
232
+ - **vendor-comparison.md**: Detailed comparison of Google/Microsoft/Amazon styles
233
+ - **ai-prompt-generation.md**: AI image generation prompt examples
234
+
235
+ ## Testing
236
+
237
+ The `__tests__/` directory contains comprehensive test coverage:
238
+
239
+ - **style-selector.test.ts**: Tests for vendor priority chain and fallback logic
240
+ - **vendor-styles.test.ts**: Integration tests for all vendor design systems
241
+ - **README.md**: Test documentation and usage instructions
242
+
243
+ All tests validate:
244
+ - ✅ Default vendor priority chain (google → microsoft → amazon)
245
+ - ✅ Custom priority configuration
246
+ - ✅ Vendor preference handling
247
+ - ✅ Fallback logic for invalid vendors
248
+ - ✅ Cross-vendor consistency
249
+ - ✅ Required properties validation
250
+ - ✅ Accessibility standards (WCAG 2.1 AA)
251
+
252
+ ## License
253
+
254
+ Part of Augment Extensions. See repository root for license information.
255
+
@@ -0,0 +1,119 @@
1
+ # Visual Design Module Tests
2
+
3
+ Comprehensive unit and integration tests for the Visual Design module.
4
+
5
+ ## Test Files
6
+
7
+ ### `style-selector.test.ts`
8
+ Tests for the style selector module, including:
9
+ - Default vendor priority chain (google → microsoft → amazon)
10
+ - Custom priority configuration
11
+ - Vendor preference handling
12
+ - Fallback logic
13
+ - Case-insensitive vendor matching
14
+ - Helper functions (getVendorStyle, hasVendorStyle, getAllVendorStyles)
15
+
16
+ ### `vendor-styles.test.ts`
17
+ Integration tests for all vendor design systems:
18
+ - **Google Modern (Material 3 Expressive)**: Color palette, typography, layout, motion, elevation, components
19
+ - **Microsoft Fluent 2**: Color palette, typography, layout, motion, elevation, components
20
+ - **Amazon Cloudscape**: Color palette, typography, layout, motion, elevation, components
21
+ - **Cross-vendor consistency**: Ensures all vendors implement required properties
22
+
23
+ ## Running Tests
24
+
25
+ ### Prerequisites
26
+ ```bash
27
+ npm install --save-dev jest @types/jest ts-jest
28
+ ```
29
+
30
+ ### Run All Tests
31
+ ```bash
32
+ npm test
33
+ ```
34
+
35
+ ### Run Specific Test File
36
+ ```bash
37
+ npm test style-selector.test.ts
38
+ npm test vendor-styles.test.ts
39
+ ```
40
+
41
+ ### Run with Coverage
42
+ ```bash
43
+ npm test -- --coverage
44
+ ```
45
+
46
+ ## Test Coverage
47
+
48
+ The test suite covers:
49
+ - ✅ Style selector creation and configuration
50
+ - ✅ Default vendor priority chain
51
+ - ✅ Custom vendor priority chains
52
+ - ✅ Vendor preference handling
53
+ - ✅ Fallback logic for invalid vendors
54
+ - ✅ Case-insensitive vendor matching
55
+ - ✅ All vendor style implementations
56
+ - ✅ Cross-vendor consistency checks
57
+ - ✅ Required properties validation
58
+ - ✅ Accessibility standards validation
59
+ - ✅ Responsive grid systems
60
+ - ✅ Spacing systems
61
+
62
+ ## Expected Test Results
63
+
64
+ All tests should pass with 100% coverage of:
65
+ - `style-selector.ts`
66
+ - `domains/web-page-styles/google-modern.ts`
67
+ - `domains/web-page-styles/microsoft-fluent.ts`
68
+ - `domains/web-page-styles/amazon-cloudscape.ts`
69
+
70
+ ## Adding New Tests
71
+
72
+ When adding new vendor styles or features:
73
+
74
+ 1. **Add vendor style tests** in `vendor-styles.test.ts`:
75
+ ```typescript
76
+ describe('New Vendor Style', () => {
77
+ it('should have correct vendor identifier', () => {
78
+ expect(NEW_VENDOR.vendor).toBe('vendor-name');
79
+ });
80
+ // Add more tests...
81
+ });
82
+ ```
83
+
84
+ 2. **Update style selector tests** in `style-selector.test.ts`:
85
+ ```typescript
86
+ it('should select new vendor when specified', () => {
87
+ const style = selectVendorStyle({ vendor: 'new-vendor' });
88
+ expect(style).toBe(NEW_VENDOR);
89
+ });
90
+ ```
91
+
92
+ 3. **Update cross-vendor tests** to include the new vendor in the array.
93
+
94
+ ## Continuous Integration
95
+
96
+ These tests are designed to run in CI/CD pipelines:
97
+ - Fast execution (< 5 seconds)
98
+ - No external dependencies
99
+ - Deterministic results
100
+ - Clear error messages
101
+
102
+ ## Troubleshooting
103
+
104
+ ### Import Errors
105
+ If you encounter import errors, ensure:
106
+ - TypeScript is configured correctly (`tsconfig.json`)
107
+ - All dependencies are installed
108
+ - File paths are correct
109
+
110
+ ### Type Errors
111
+ If you encounter type errors:
112
+ - Check that `types.ts` exports all required interfaces
113
+ - Verify vendor style implementations match the `VendorStyle` interface
114
+ - Ensure test files import types correctly
115
+
116
+ ## License
117
+
118
+ Part of Augment Extensions. See repository root for license information.
119
+
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Style Selector Tests
3
+ *
4
+ * Comprehensive unit and integration tests for the style selector module,
5
+ * including vendor priority, fallback logic, and preference handling.
6
+ */
7
+
8
+ import {
9
+ createStyleSelector,
10
+ defaultStyleSelector,
11
+ selectVendorStyle,
12
+ getVendorStyle,
13
+ getAllVendorStyles,
14
+ hasVendorStyle,
15
+ DEFAULT_VENDOR_PRIORITY
16
+ } from '../style-selector';
17
+ import { GOOGLE_MODERN } from '../domains/web-page-styles/google-modern';
18
+ import { MICROSOFT_FLUENT } from '../domains/web-page-styles/microsoft-fluent';
19
+ import { AMAZON_CLOUDSCAPE } from '../domains/web-page-styles/amazon-cloudscape';
20
+
21
+ describe('Style Selector', () => {
22
+ describe('DEFAULT_VENDOR_PRIORITY', () => {
23
+ it('should have correct default priority order', () => {
24
+ expect(DEFAULT_VENDOR_PRIORITY).toEqual(['google', 'microsoft', 'amazon']);
25
+ });
26
+ });
27
+
28
+ describe('createStyleSelector', () => {
29
+ it('should create selector with default priority', () => {
30
+ const selector = createStyleSelector();
31
+ expect(selector.vendorPriority).toEqual(['google', 'microsoft', 'amazon']);
32
+ expect(selector.fallbackChain).toEqual(['google', 'microsoft', 'amazon']);
33
+ });
34
+
35
+ it('should create selector with custom priority', () => {
36
+ const customPriority = ['amazon', 'microsoft', 'google'];
37
+ const selector = createStyleSelector(customPriority);
38
+ expect(selector.vendorPriority).toEqual(customPriority);
39
+ expect(selector.fallbackChain).toEqual(customPriority);
40
+ });
41
+ });
42
+
43
+ describe('defaultStyleSelector', () => {
44
+ it('should be initialized with default priority', () => {
45
+ expect(defaultStyleSelector.vendorPriority).toEqual(['google', 'microsoft', 'amazon']);
46
+ });
47
+
48
+ it('should select Google Modern by default', () => {
49
+ const style = defaultStyleSelector.selectStyle();
50
+ expect(style).toBe(GOOGLE_MODERN);
51
+ expect(style.vendor).toBe('google');
52
+ });
53
+ });
54
+
55
+ describe('selectStyle with preferences', () => {
56
+ it('should select Google Modern when vendor is "google"', () => {
57
+ const style = defaultStyleSelector.selectStyle({ vendor: 'google' });
58
+ expect(style).toBe(GOOGLE_MODERN);
59
+ expect(style.vendor).toBe('google');
60
+ });
61
+
62
+ it('should select Microsoft Fluent when vendor is "microsoft"', () => {
63
+ const style = defaultStyleSelector.selectStyle({ vendor: 'microsoft' });
64
+ expect(style).toBe(MICROSOFT_FLUENT);
65
+ expect(style.vendor).toBe('microsoft');
66
+ });
67
+
68
+ it('should select Amazon Cloudscape when vendor is "amazon"', () => {
69
+ const style = defaultStyleSelector.selectStyle({ vendor: 'amazon' });
70
+ expect(style).toBe(AMAZON_CLOUDSCAPE);
71
+ expect(style.vendor).toBe('amazon');
72
+ });
73
+
74
+ it('should be case-insensitive for vendor names', () => {
75
+ const styleUpper = defaultStyleSelector.selectStyle({ vendor: 'GOOGLE' });
76
+ const styleMixed = defaultStyleSelector.selectStyle({ vendor: 'GoOgLe' });
77
+ expect(styleUpper).toBe(GOOGLE_MODERN);
78
+ expect(styleMixed).toBe(GOOGLE_MODERN);
79
+ });
80
+
81
+ it('should fallback to priority chain for invalid vendor', () => {
82
+ const style = defaultStyleSelector.selectStyle({ vendor: 'invalid' });
83
+ expect(style).toBe(GOOGLE_MODERN); // First in default priority
84
+ });
85
+
86
+ it('should fallback to Google Modern when no vendor matches', () => {
87
+ const selector = createStyleSelector(['nonexistent']);
88
+ const style = selector.selectStyle();
89
+ expect(style).toBe(GOOGLE_MODERN);
90
+ });
91
+ });
92
+
93
+ describe('selectStyle with custom priority', () => {
94
+ it('should respect custom priority order', () => {
95
+ const selector = createStyleSelector(['amazon', 'microsoft', 'google']);
96
+ const style = selector.selectStyle();
97
+ expect(style).toBe(AMAZON_CLOUDSCAPE);
98
+ });
99
+
100
+ it('should fallback through custom chain', () => {
101
+ const selector = createStyleSelector(['invalid1', 'microsoft', 'google']);
102
+ const style = selector.selectStyle();
103
+ expect(style).toBe(MICROSOFT_FLUENT);
104
+ });
105
+ });
106
+
107
+ describe('selectVendorStyle', () => {
108
+ it('should select Google Modern by default', () => {
109
+ const style = selectVendorStyle();
110
+ expect(style).toBe(GOOGLE_MODERN);
111
+ });
112
+
113
+ it('should respect vendor preference', () => {
114
+ const style = selectVendorStyle({ vendor: 'microsoft' });
115
+ expect(style).toBe(MICROSOFT_FLUENT);
116
+ });
117
+ });
118
+
119
+ describe('getVendorStyle', () => {
120
+ it('should return Google Modern for "google"', () => {
121
+ expect(getVendorStyle('google')).toBe(GOOGLE_MODERN);
122
+ });
123
+
124
+ it('should return Microsoft Fluent for "microsoft"', () => {
125
+ expect(getVendorStyle('microsoft')).toBe(MICROSOFT_FLUENT);
126
+ });
127
+
128
+ it('should return Amazon Cloudscape for "amazon"', () => {
129
+ expect(getVendorStyle('amazon')).toBe(AMAZON_CLOUDSCAPE);
130
+ });
131
+
132
+ it('should return undefined for invalid vendor', () => {
133
+ expect(getVendorStyle('invalid')).toBeUndefined();
134
+ });
135
+
136
+ it('should be case-insensitive', () => {
137
+ expect(getVendorStyle('GOOGLE')).toBe(GOOGLE_MODERN);
138
+ expect(getVendorStyle('MicroSoft')).toBe(MICROSOFT_FLUENT);
139
+ });
140
+ });
141
+
142
+ describe('getAllVendorStyles', () => {
143
+ it('should return all three vendor styles', () => {
144
+ const styles = getAllVendorStyles();
145
+ expect(styles).toHaveLength(3);
146
+ expect(styles).toContain(GOOGLE_MODERN);
147
+ expect(styles).toContain(MICROSOFT_FLUENT);
148
+ expect(styles).toContain(AMAZON_CLOUDSCAPE);
149
+ });
150
+ });
151
+
152
+ describe('hasVendorStyle', () => {
153
+ it('should return true for valid vendors', () => {
154
+ expect(hasVendorStyle('google')).toBe(true);
155
+ expect(hasVendorStyle('microsoft')).toBe(true);
156
+ expect(hasVendorStyle('amazon')).toBe(true);
157
+ });
158
+
159
+ it('should return false for invalid vendors', () => {
160
+ expect(hasVendorStyle('invalid')).toBe(false);
161
+ expect(hasVendorStyle('apple')).toBe(false);
162
+ expect(hasVendorStyle('')).toBe(false);
163
+ });
164
+
165
+ it('should be case-insensitive', () => {
166
+ expect(hasVendorStyle('GOOGLE')).toBe(true);
167
+ expect(hasVendorStyle('MicroSoft')).toBe(true);
168
+ expect(hasVendorStyle('AMAZON')).toBe(true);
169
+ });
170
+ });
171
+ });
172
+