@smartsoft001-mobilems/claude-plugins 2.84.0 → 2.86.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 (136) hide show
  1. package/.claude-plugin/marketplace.json +2 -6
  2. package/README.md +97 -0
  3. package/package.json +2 -2
  4. package/plugins/flow/scripts/refresh-mobilems-api-spec.sh +372 -0
  5. package/plugins/flow/skills/mobilems-docs-reader/SKILL.md +116 -0
  6. package/plugins/flow-external/scripts/refresh-mobilems-api-spec.sh +372 -0
  7. package/plugins/flow-external/skills/mobilems-docs-reader/SKILL.md +116 -0
  8. package/plugins/flow-legacy/scripts/refresh-mobilems-api-spec.sh +372 -0
  9. package/plugins/flow-legacy/skills/mobilems-docs-reader/SKILL.md +116 -0
  10. package/plugins/mobilems/.claude-plugin/README.md +30 -0
  11. package/plugins/mobilems/.claude-plugin/plugin.json +5 -0
  12. package/plugins/mobilems/scripts/refresh-mobilems-api-spec.sh +372 -0
  13. package/plugins/mobilems/skills/mobilems-docs-reader/SKILL.md +116 -0
  14. package/plugins/flow/.claude-plugin/README.md +0 -91
  15. package/plugins/flow/.claude-plugin/merge-permissions.js +0 -97
  16. package/plugins/flow/.claude-plugin/plugin.json +0 -5
  17. package/plugins/flow/.claude-plugin/settings.template.json +0 -86
  18. package/plugins/flow/agents/angular-component-scaffolder.md +0 -175
  19. package/plugins/flow/agents/angular-directive-builder.md +0 -153
  20. package/plugins/flow/agents/angular-guard-builder.md +0 -243
  21. package/plugins/flow/agents/angular-jest-test-writer.md +0 -474
  22. package/plugins/flow/agents/angular-pipe-builder.md +0 -169
  23. package/plugins/flow/agents/angular-resolver-builder.md +0 -286
  24. package/plugins/flow/agents/angular-service-builder.md +0 -161
  25. package/plugins/flow/agents/angular-signal-state-builder.md +0 -339
  26. package/plugins/flow/agents/angular-test-diagnostician.md +0 -279
  27. package/plugins/flow/agents/angular-testbed-configurator.md +0 -315
  28. package/plugins/flow/agents/arch-scaffolder.md +0 -278
  29. package/plugins/flow/agents/e2e-data-testid-injector.md +0 -197
  30. package/plugins/flow/agents/e2e-project-scaffolder.md +0 -194
  31. package/plugins/flow/agents/e2e-test-writer.md +0 -350
  32. package/plugins/flow/agents/shared-agent-evolver.md +0 -294
  33. package/plugins/flow/agents/shared-build-verifier.md +0 -160
  34. package/plugins/flow/agents/shared-config-updater.md +0 -310
  35. package/plugins/flow/agents/shared-coverage-enforcer.md +0 -184
  36. package/plugins/flow/agents/shared-error-handler.md +0 -217
  37. package/plugins/flow/agents/shared-file-creator.md +0 -344
  38. package/plugins/flow/agents/shared-impl-orchestrator.md +0 -312
  39. package/plugins/flow/agents/shared-impl-reporter.md +0 -339
  40. package/plugins/flow/agents/shared-impl-teammate.md +0 -201
  41. package/plugins/flow/agents/shared-linear-subtask-iterator.md +0 -337
  42. package/plugins/flow/agents/shared-logic-implementer.md +0 -243
  43. package/plugins/flow/agents/shared-maia-api.md +0 -26
  44. package/plugins/flow/agents/shared-parallelization-analyzer.md +0 -343
  45. package/plugins/flow/agents/shared-performance-validator.md +0 -168
  46. package/plugins/flow/agents/shared-plan-perspective.md +0 -269
  47. package/plugins/flow/agents/shared-project-standardizer.md +0 -205
  48. package/plugins/flow/agents/shared-report-synthesizer.md +0 -188
  49. package/plugins/flow/agents/shared-review-teammate.md +0 -189
  50. package/plugins/flow/agents/shared-security-scanner.md +0 -186
  51. package/plugins/flow/agents/shared-style-enforcer.md +0 -230
  52. package/plugins/flow/agents/shared-subtask-dependency-analyzer.md +0 -188
  53. package/plugins/flow/agents/shared-tdd-developer.md +0 -350
  54. package/plugins/flow/agents/shared-team-coordinator.md +0 -189
  55. package/plugins/flow/agents/shared-test-fixer.md +0 -186
  56. package/plugins/flow/agents/shared-test-runner.md +0 -191
  57. package/plugins/flow/agents/shared-ui-classifier.md +0 -263
  58. package/plugins/flow/agents/shared-verification-orchestrator.md +0 -194
  59. package/plugins/flow/agents/shared-verification-runner.md +0 -140
  60. package/plugins/flow/agents/ui-a11y-validator.md +0 -305
  61. package/plugins/flow/agents/ui-screenshot-reporter.md +0 -329
  62. package/plugins/flow/agents/ui-web-designer.md +0 -214
  63. package/plugins/flow/skills/a11y-audit/SKILL.md +0 -214
  64. package/plugins/flow/skills/angular-patterns/SKILL.md +0 -191
  65. package/plugins/flow/skills/browser-capture/SKILL.md +0 -238
  66. package/plugins/flow/skills/commit/SKILL.md +0 -259
  67. package/plugins/flow/skills/debug-helper/SKILL.md +0 -375
  68. package/plugins/flow/skills/impl/SKILL.md +0 -992
  69. package/plugins/flow/skills/linear-suggestion/SKILL.md +0 -132
  70. package/plugins/flow/skills/maia-files-delete/SKILL.md +0 -59
  71. package/plugins/flow/skills/maia-files-upload/SKILL.md +0 -57
  72. package/plugins/flow/skills/nx-conventions/SKILL.md +0 -326
  73. package/plugins/flow/skills/plan/SKILL.md +0 -1003
  74. package/plugins/flow/skills/push/SKILL.md +0 -737
  75. package/plugins/flow/skills/review/SKILL.md +0 -443
  76. package/plugins/flow/skills/test-e2e/SKILL.md +0 -161
  77. package/plugins/flow/skills/test-unit/SKILL.md +0 -456
  78. package/plugins/flow-external/.claude-plugin/README.md +0 -152
  79. package/plugins/flow-external/.claude-plugin/merge-permissions.js +0 -80
  80. package/plugins/flow-external/.claude-plugin/plugin.json +0 -5
  81. package/plugins/flow-external/.claude-plugin/settings.template.json +0 -78
  82. package/plugins/flow-external/agents/angular-component-scaffolder.md +0 -269
  83. package/plugins/flow-external/agents/angular-directive-builder.md +0 -130
  84. package/plugins/flow-external/agents/angular-guard-builder.md +0 -70
  85. package/plugins/flow-external/agents/angular-pipe-builder.md +0 -82
  86. package/plugins/flow-external/agents/angular-resolver-builder.md +0 -74
  87. package/plugins/flow-external/agents/angular-service-builder.md +0 -160
  88. package/plugins/flow-external/agents/angular-state-builder.md +0 -254
  89. package/plugins/flow-external/agents/shared-build-verifier.md +0 -67
  90. package/plugins/flow-external/agents/shared-impl-orchestrator.md +0 -88
  91. package/plugins/flow-external/agents/shared-impl-reporter.md +0 -107
  92. package/plugins/flow-external/agents/shared-linear-subtask-iterator.md +0 -70
  93. package/plugins/flow-external/agents/shared-ui-classifier.md +0 -38
  94. package/plugins/flow-external/agents/ui-web-designer.md +0 -179
  95. package/plugins/flow-external/skills/a11y-audit/SKILL.md +0 -96
  96. package/plugins/flow-external/skills/angular-cli-conventions/SKILL.md +0 -267
  97. package/plugins/flow-external/skills/angular-patterns/SKILL.md +0 -170
  98. package/plugins/flow-external/skills/browser-capture/SKILL.md +0 -68
  99. package/plugins/flow-external/skills/commit/SKILL.md +0 -114
  100. package/plugins/flow-external/skills/debug-helper/SKILL.md +0 -131
  101. package/plugins/flow-external/skills/impl/SKILL.md +0 -217
  102. package/plugins/flow-external/skills/linear-suggestion/SKILL.md +0 -62
  103. package/plugins/flow-external/skills/maia-files-delete/SKILL.md +0 -34
  104. package/plugins/flow-external/skills/maia-files-upload/SKILL.md +0 -41
  105. package/plugins/flow-external/skills/plan/SKILL.md +0 -302
  106. package/plugins/flow-external/skills/push/SKILL.md +0 -210
  107. package/plugins/flow-legacy/.claude-plugin/README.md +0 -143
  108. package/plugins/flow-legacy/.claude-plugin/merge-permissions.js +0 -94
  109. package/plugins/flow-legacy/.claude-plugin/plugin.json +0 -5
  110. package/plugins/flow-legacy/.claude-plugin/settings.template.json +0 -79
  111. package/plugins/flow-legacy/agents/angular-component-scaffolder.md +0 -323
  112. package/plugins/flow-legacy/agents/angular-directive-builder.md +0 -258
  113. package/plugins/flow-legacy/agents/angular-guard-builder.md +0 -322
  114. package/plugins/flow-legacy/agents/angular-pipe-builder.md +0 -227
  115. package/plugins/flow-legacy/agents/angular-resolver-builder.md +0 -332
  116. package/plugins/flow-legacy/agents/angular-service-builder.md +0 -271
  117. package/plugins/flow-legacy/agents/angular-state-builder.md +0 -479
  118. package/plugins/flow-legacy/agents/shared-impl-orchestrator.md +0 -174
  119. package/plugins/flow-legacy/agents/shared-impl-reporter.md +0 -204
  120. package/plugins/flow-legacy/agents/shared-linear-subtask-iterator.md +0 -187
  121. package/plugins/flow-legacy/agents/shared-tdd-developer.md +0 -306
  122. package/plugins/flow-legacy/agents/shared-test-runner.md +0 -131
  123. package/plugins/flow-legacy/agents/shared-ui-classifier.md +0 -145
  124. package/plugins/flow-legacy/skills/a11y-audit/SKILL.md +0 -214
  125. package/plugins/flow-legacy/skills/angular-patterns/SKILL.md +0 -346
  126. package/plugins/flow-legacy/skills/browser-capture/SKILL.md +0 -238
  127. package/plugins/flow-legacy/skills/commit/SKILL.md +0 -215
  128. package/plugins/flow-legacy/skills/debug-helper/SKILL.md +0 -395
  129. package/plugins/flow-legacy/skills/impl/SKILL.md +0 -710
  130. package/plugins/flow-legacy/skills/linear-suggestion/SKILL.md +0 -132
  131. package/plugins/flow-legacy/skills/maia-files-delete/SKILL.md +0 -59
  132. package/plugins/flow-legacy/skills/maia-files-upload/SKILL.md +0 -57
  133. package/plugins/flow-legacy/skills/nx-conventions/SKILL.md +0 -368
  134. package/plugins/flow-legacy/skills/plan/SKILL.md +0 -708
  135. package/plugins/flow-legacy/skills/push/SKILL.md +0 -623
  136. package/plugins/flow-legacy/skills/test-unit/SKILL.md +0 -500
@@ -1,217 +0,0 @@
1
- ---
2
- name: shared-error-handler
3
- description: Standardize error handling patterns across the application. Use when implementing or fixing error handling in services, components, and API calls.
4
- tools: Read, Edit, Glob, Grep
5
- model: sonnet
6
- color: "#2563EB"
7
- ---
8
-
9
- You are an expert at implementing consistent error handling patterns for this Angular frontend application.
10
-
11
- ## Primary Responsibility
12
-
13
- Ensure error handling is consistent, user-friendly, and follows project patterns.
14
-
15
- ## When to Use
16
-
17
- - Implementing error handling in new code
18
- - Fixing inconsistent error handling
19
- - Adding user-friendly error messages
20
- - Handling HTTP errors in services
21
-
22
- ## Project-Specific Error Handling Patterns
23
-
24
- This is an Angular-only frontend application. Error handling follows these patterns:
25
-
26
- ### Service Level - Silent Fallback (Lists)
27
-
28
- For data fetching that returns lists, use silent fallback with empty array:
29
-
30
- ```typescript
31
- import { catchError, map, Observable, of } from 'rxjs';
32
-
33
- @Injectable({ providedIn: 'root' })
34
- export class DataService {
35
- private readonly httpClient = inject(HttpClient);
36
-
37
- loadFilterDictionary(dictionary: string): Observable<Item[]> {
38
- return this.httpClient.get<{ data: { items: Item[] } }>(url).pipe(
39
- map((response) => response?.data?.items ?? []),
40
- catchError((error) => {
41
- console.warn('Error loading filter dictionary:', error);
42
- return of([]);
43
- }),
44
- );
45
- }
46
- }
47
- ```
48
-
49
- ### Service Level - toSignal with Initial Value
50
-
51
- For signal-based data, use `toSignal` with `initialValue`:
52
-
53
- ```typescript
54
- loadPromotedObjects(): Signal<IObject[]> {
55
- return toSignal(
56
- this.httpClient
57
- .get<{ data: { items: IObject[] } }>(url)
58
- .pipe(map((response) => response?.data?.items ?? [])),
59
- { initialValue: [] },
60
- );
61
- }
62
- ```
63
-
64
- ### Component Level - Form Submission with Error Messages
65
-
66
- For form submissions, handle errors with translated messages:
67
-
68
- ```typescript
69
- @Component({...})
70
- export class FormComponent {
71
- private readonly translateService = inject(TranslateService);
72
- private readonly dataService = inject(DataService);
73
-
74
- errorMessage = '';
75
- isSuccess = false;
76
-
77
- handleSubmit(): void {
78
- if (this.form.invalid) {
79
- return;
80
- }
81
-
82
- this.errorMessage = '';
83
-
84
- this.dataService.submitForm(this.form.value).subscribe({
85
- next: () => {
86
- this.isSuccess = true;
87
- },
88
- error: (error) => {
89
- this.handleError(error);
90
- },
91
- });
92
- }
93
-
94
- private handleError(error: HttpErrorResponse): void {
95
- const status = error.status;
96
-
97
- if (status === 429) {
98
- this.errorMessage = this.translateService.instant('ERRORS.rateLimit');
99
- } else if (status === 422) {
100
- this.errorMessage = this.translateService.instant('ERRORS.alreadyExists');
101
- } else if (status === 400) {
102
- this.errorMessage = this.translateService.instant('ERRORS.invalidData');
103
- } else {
104
- this.errorMessage = this.translateService.instant('ERRORS.generic');
105
- }
106
- }
107
- }
108
- ```
109
-
110
- ### Template - Error Display
111
-
112
- Display errors in template with proper styling:
113
-
114
- ```html
115
- @if (errorMessage) {
116
- <div
117
- class="smart-p-4 smart-bg-red-50 dark:smart-bg-red-900/20 smart-border smart-border-red-200 dark:smart-border-red-800 smart-rounded-md"
118
- >
119
- <p class="smart-text-sm smart-text-red-800 dark:smart-text-dark-yellow">
120
- {{ errorMessage }}
121
- </p>
122
- </div>
123
- }
124
- ```
125
-
126
- ### Form Validation Errors
127
-
128
- Show validation errors inline:
129
-
130
- ```html
131
- @if (submittedAttempt && emailControl.invalid) {
132
- <div class="smart-text-sm smart-text-red-600 dark:smart-text-dark-yellow">
133
- @if (emailControl.errors?.['required']) {
134
- <div>{{ 'ERRORS.emailRequired' | translate }}</div>
135
- } @if (emailControl.errors?.['pattern']) {
136
- <div>{{ 'ERRORS.emailInvalid' | translate }}</div>
137
- }
138
- </div>
139
- }
140
- ```
141
-
142
- ## Error Handling Rules
143
-
144
- 1. **Silent fallback for lists** - Return empty array `[]` on error for list endpoints
145
- 2. **User-friendly messages** - Use `TranslateService` for all error messages
146
- 3. **Status-based handling** - Check HTTP status codes for specific error types
147
- 4. **console.warn for debugging** - Log warnings, not errors, for silent failures
148
- 5. **No global error throwing** - Handle errors locally, don't propagate
149
- 6. **Null coalescing** - Always use `?.` and `?? []` for safe access
150
-
151
- ## HTTP Status Code Handling
152
-
153
- | Status | Meaning | Translation Key |
154
- | ------ | ---------------- | ---------------------- |
155
- | 400 | Invalid request | `ERRORS.invalidData` |
156
- | 401 | Unauthorized | `ERRORS.unauthorized` |
157
- | 403 | Forbidden | `ERRORS.forbidden` |
158
- | 404 | Not found | `ERRORS.notFound` |
159
- | 422 | Validation error | `ERRORS.alreadyExists` |
160
- | 429 | Rate limit | `ERRORS.rateLimit` |
161
- | 500+ | Server error | `ERRORS.generic` |
162
-
163
- ## Anti-patterns
164
-
165
- ```typescript
166
- // BAD: Throwing errors up the chain
167
- throw new Error('Something went wrong');
168
-
169
- // BAD: Using console.error for expected failures
170
- console.error('Failed to load data'); // Use console.warn instead
171
-
172
- // BAD: Exposing technical details
173
- this.errorMessage = error.message; // Use translated message instead
174
-
175
- // BAD: Not providing fallback value
176
- return this.httpClient.get(url); // Always handle errors
177
-
178
- // GOOD: Silent fallback with warning
179
- return this.httpClient.get(url).pipe(
180
- catchError((error) => {
181
- console.warn('Failed to load:', error);
182
- return of([]);
183
- }),
184
- );
185
- ```
186
-
187
- ## Checklist
188
-
189
- - [ ] List endpoints return empty array on error
190
- - [ ] Form submissions show translated error messages
191
- - [ ] Error messages use `TranslateService`
192
- - [ ] `console.warn` used instead of `console.error` for expected failures
193
- - [ ] Safe navigation (`?.`) and null coalescing (`??`) used
194
- - [ ] Error display styled with `smart-` Tailwind classes
195
-
196
- ## Output Format
197
-
198
- ```markdown
199
- ## Error Handling Report
200
-
201
- ### Pattern Applied
202
-
203
- Silent fallback for list endpoint / Form submission with translated errors
204
-
205
- ### Files Updated
206
-
207
- | File | Changes |
208
- | ------------------- | --------------------------------------------- |
209
- | `data.service.ts` | Added catchError with empty array fallback |
210
- | `form.component.ts` | Added error handling with translated messages |
211
-
212
- ### Error Cases Handled
213
-
214
- - 422: Already exists
215
- - 429: Rate limit
216
- - Default: Generic error message
217
- ```
@@ -1,344 +0,0 @@
1
- ---
2
- name: shared-file-creator
3
- description: Create new files with proper templates and boilerplate. Use when creating components, services, modules, or any new source files.
4
- tools: Read, Write, Glob, Grep
5
- model: sonnet
6
- color: "#2563EB"
7
- ---
8
-
9
- You are an expert at creating new source files with proper templates and boilerplate for this Angular frontend application.
10
-
11
- ## Primary Responsibility
12
-
13
- Create new files that follow project conventions, include proper imports, and have correct boilerplate.
14
-
15
- ## When to Use
16
-
17
- - Creating new Angular components, services, pipes, directives
18
- - Creating new TypeScript files (models, interfaces, utils)
19
- - Creating test files alongside source files
20
-
21
- ## Project-Specific File Templates
22
-
23
- ### Angular Standalone Component
24
-
25
- ```typescript
26
- import {
27
- Component,
28
- signal,
29
- computed,
30
- inject,
31
- input,
32
- output,
33
- } from '@angular/core';
34
- import { TranslatePipe } from '@ngx-translate/core';
35
-
36
- import { CapitalizePipe } from '@msr/angular';
37
-
38
- @Component({
39
- selector: 'app-feature-name',
40
- standalone: true,
41
- imports: [TranslatePipe, CapitalizePipe],
42
- templateUrl: './feature-name.component.html',
43
- })
44
- export class FeatureNameComponent {
45
- // Inputs using input() API
46
- readonly data = input<DataType>();
47
- readonly isRequired = input.required<boolean>();
48
-
49
- // Outputs using output() API
50
- readonly selected = output<DataType>();
51
-
52
- // Signals for local state
53
- readonly isLoading = signal(false);
54
-
55
- // Computed values for derived state
56
- readonly displayText = computed(() => this.data()?.name ?? '');
57
-
58
- // Injected services
59
- private readonly dataService = inject(DataService);
60
- }
61
- ```
62
-
63
- ### Angular Component with Inline Template
64
-
65
- ```typescript
66
- import { Component, inject, input } from '@angular/core';
67
- import { Router } from '@angular/router';
68
- import { TranslatePipe } from '@ngx-translate/core';
69
-
70
- import { CapitalizePipe } from '@msr/angular';
71
-
72
- @Component({
73
- selector: 'app-feature-name',
74
- template: `
75
- <div class="smart-container">
76
- @if (isLoading()) {
77
- <app-loader />
78
- } @else {
79
- <ul>
80
- @for (item of items(); track item.id) {
81
- <li class="smart-p-4 smart-bg-white dark:smart-bg-black">
82
- {{ item.name | translate | capitalize }}
83
- </li>
84
- } @empty {
85
- <li>{{ 'COMMON.noData' | translate }}</li>
86
- }
87
- </ul>
88
- }
89
- </div>
90
- `,
91
- imports: [TranslatePipe, CapitalizePipe],
92
- })
93
- export class FeatureNameComponent {
94
- private readonly router = inject(Router);
95
-
96
- readonly items = input<Item[]>([]);
97
- readonly isLoading = signal(false);
98
-
99
- navigate(route: string): void {
100
- this.router.navigate([route]);
101
- }
102
- }
103
- ```
104
-
105
- ### Angular Service
106
-
107
- ```typescript
108
- import { Injectable, inject, signal } from '@angular/core';
109
- import { HttpClient } from '@angular/common/http';
110
- import { toSignal } from '@angular/core/rxjs-interop';
111
- import { catchError, map, Observable, of } from 'rxjs';
112
-
113
- import { environment } from '@msr/angular';
114
-
115
- @Injectable({
116
- providedIn: 'root',
117
- })
118
- export class FeatureNameService {
119
- private readonly httpClient = inject(HttpClient);
120
- private readonly apiUrl = environment.apiUrl;
121
-
122
- // Signal-based data fetching
123
- readonly items = toSignal(this.loadItems(), { initialValue: [] });
124
-
125
- private loadItems(): Observable<Item[]> {
126
- return this.httpClient
127
- .get<{ data: { items: Item[] } }>(`${this.apiUrl}/items`)
128
- .pipe(
129
- map((response) => response?.data?.items ?? []),
130
- catchError((error) => {
131
- console.warn('Error loading items:', error);
132
- return of([]);
133
- }),
134
- );
135
- }
136
-
137
- // Method that returns Observable
138
- getById(id: string): Observable<Item | null> {
139
- return this.httpClient
140
- .get<{ data: Item }>(`${this.apiUrl}/items/${id}`)
141
- .pipe(
142
- map((response) => response?.data ?? null),
143
- catchError((error) => {
144
- console.warn('Error loading item:', error);
145
- return of(null);
146
- }),
147
- );
148
- }
149
- }
150
- ```
151
-
152
- ### Angular Pipe
153
-
154
- ```typescript
155
- import { Pipe, PipeTransform } from '@angular/core';
156
-
157
- @Pipe({
158
- name: 'featureName',
159
- standalone: true,
160
- })
161
- export class FeatureNamePipe implements PipeTransform {
162
- transform(value: string): string {
163
- if (!value) return '';
164
- return value; // Transform logic
165
- }
166
- }
167
- ```
168
-
169
- ### Angular Directive
170
-
171
- ```typescript
172
- import { Directive, ElementRef, inject, input, effect } from '@angular/core';
173
-
174
- @Directive({
175
- selector: '[appFeatureName]',
176
- standalone: true,
177
- })
178
- export class FeatureNameDirective {
179
- private readonly el = inject(ElementRef);
180
-
181
- readonly appFeatureName = input<string>();
182
-
183
- constructor() {
184
- effect(() => {
185
- const value = this.appFeatureName();
186
- if (value) {
187
- // Apply directive logic
188
- }
189
- });
190
- }
191
- }
192
- ```
193
-
194
- ### TypeScript Interface
195
-
196
- **IMPORTANT**: All interfaces MUST use the `I` prefix (e.g., `IFeatureName`, `IContactFormData`).
197
-
198
- ```typescript
199
- export interface IFeatureName {
200
- id: string;
201
- name: string;
202
- // properties
203
- }
204
-
205
- export type FeatureNameType = 'option1' | 'option2';
206
- ```
207
-
208
- ### Test File (Jest)
209
-
210
- ```typescript
211
- import { TestBed } from '@angular/core/testing';
212
- import { HttpClientTestingModule } from '@angular/common/http/testing';
213
-
214
- import { FeatureNameService } from './feature-name.service';
215
-
216
- describe('@shared-angular: FeatureNameService', () => {
217
- let service: FeatureNameService;
218
-
219
- beforeEach(() => {
220
- TestBed.configureTestingModule({
221
- imports: [HttpClientTestingModule],
222
- providers: [FeatureNameService],
223
- });
224
-
225
- service = TestBed.inject(FeatureNameService);
226
- });
227
-
228
- afterEach(() => {
229
- jest.clearAllMocks();
230
- });
231
-
232
- it('should be created', () => {
233
- expect(service).toBeTruthy();
234
- });
235
-
236
- // Add meaningful tests
237
- });
238
- ```
239
-
240
- ### Component Test File (Jest)
241
-
242
- ```typescript
243
- import { ComponentFixture, TestBed } from '@angular/core/testing';
244
- import { TranslateModule } from '@ngx-translate/core';
245
-
246
- import { FeatureNameComponent } from './feature-name.component';
247
-
248
- describe('@shared-angular: FeatureNameComponent', () => {
249
- let component: FeatureNameComponent;
250
- let fixture: ComponentFixture<FeatureNameComponent>;
251
-
252
- beforeEach(async () => {
253
- await TestBed.configureTestingModule({
254
- imports: [FeatureNameComponent, TranslateModule.forRoot()],
255
- }).compileComponents();
256
-
257
- fixture = TestBed.createComponent(FeatureNameComponent);
258
- component = fixture.componentInstance;
259
- fixture.detectChanges();
260
- });
261
-
262
- afterEach(() => {
263
- jest.clearAllMocks();
264
- });
265
-
266
- it('should create', () => {
267
- expect(component).toBeTruthy();
268
- });
269
- });
270
- ```
271
-
272
- ## Naming Conventions
273
-
274
- | Type | File Name | Class/Interface Name |
275
- | --------- | --------------------------- | ------------------------------- |
276
- | Component | `feature-name.component.ts` | `FeatureNameComponent` |
277
- | Service | `feature-name.service.ts` | `FeatureNameService` |
278
- | Directive | `feature-name.directive.ts` | `FeatureNameDirective` |
279
- | Pipe | `feature-name.pipe.ts` | `FeatureNamePipe` |
280
- | Guard | `feature-name.guard.ts` | `featureNameGuard` (function) |
281
- | Interface | `feature-name.model.ts` | `IFeatureName` (I prefix!) |
282
- | Model | `feature-name.model.ts` | `IFeatureNameModel` (I prefix!) |
283
-
284
- ## Project Import Paths
285
-
286
- | Import Type | Path Format |
287
- | -------------- | ------------------------------------- |
288
- | Shared lib | `@msr/angular` |
289
- | Feature shell | `@msr/museum-{feature}/shell/angular` |
290
- | Feature domain | `@msr/museum-{feature}/domain` |
291
- | Environment | `@msr/angular` (exports environment) |
292
-
293
- ## Creation Rules
294
-
295
- 1. **Check for existing files** - Don't overwrite existing files
296
- 2. **Use correct template** - Match file type to appropriate template
297
- 3. **Follow naming conventions** - Use kebab-case for files, PascalCase for classes
298
- 4. **Include test file** - Create `.spec.ts` alongside source file
299
- 5. **Update exports** - Add to relevant `index.ts` barrel files
300
- 6. **Use @msr/ imports** - Always use project path aliases
301
-
302
- ## Process
303
-
304
- 1. **Determine file type** - Identify what kind of file is needed
305
- 2. **Check naming** - Verify proper naming convention
306
- 3. **Select template** - Use appropriate boilerplate
307
- 4. **Customize content** - Fill in specific details
308
- 5. **Create test file** - Add corresponding test file
309
- 6. **Update exports** - Add to index.ts if needed
310
-
311
- ## Barrel Export Pattern
312
-
313
- When adding new files, update the relevant `index.ts`:
314
-
315
- ```typescript
316
- // components/index.ts
317
- import { NewComponent } from './new/new.component';
318
-
319
- export * from './new/new.component';
320
-
321
- export const COMPONENTS = [
322
- // existing components...
323
- NewComponent,
324
- ];
325
- ```
326
-
327
- ## Output Format
328
-
329
- ```markdown
330
- ## Files Created
331
-
332
- ### Source File
333
-
334
- `libs/shared/angular/src/lib/components/feature-name/feature-name.component.ts`
335
-
336
- ### Test File
337
-
338
- `libs/shared/angular/src/lib/components/feature-name/feature-name.component.spec.ts`
339
-
340
- ### Exports Updated
341
-
342
- - Added to `libs/shared/angular/src/lib/components/index.ts`
343
- - Added to COMPONENTS array
344
- ```