@smartsoft001-mobilems/claude-plugins 2.58.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 (52) hide show
  1. package/.claude-plugin/marketplace.json +14 -0
  2. package/package.json +13 -0
  3. package/plugins/flow/.claude-plugin/plugin.json +5 -0
  4. package/plugins/flow/agents/angular-component-scaffolder.md +174 -0
  5. package/plugins/flow/agents/angular-directive-builder.md +152 -0
  6. package/plugins/flow/agents/angular-guard-builder.md +242 -0
  7. package/plugins/flow/agents/angular-jest-test-writer.md +473 -0
  8. package/plugins/flow/agents/angular-pipe-builder.md +168 -0
  9. package/plugins/flow/agents/angular-resolver-builder.md +285 -0
  10. package/plugins/flow/agents/angular-service-builder.md +160 -0
  11. package/plugins/flow/agents/angular-signal-state-builder.md +338 -0
  12. package/plugins/flow/agents/angular-test-diagnostician.md +278 -0
  13. package/plugins/flow/agents/angular-testbed-configurator.md +314 -0
  14. package/plugins/flow/agents/arch-scaffolder.md +277 -0
  15. package/plugins/flow/agents/shared-build-verifier.md +159 -0
  16. package/plugins/flow/agents/shared-config-updater.md +309 -0
  17. package/plugins/flow/agents/shared-coverage-enforcer.md +183 -0
  18. package/plugins/flow/agents/shared-error-handler.md +216 -0
  19. package/plugins/flow/agents/shared-file-creator.md +343 -0
  20. package/plugins/flow/agents/shared-impl-orchestrator.md +309 -0
  21. package/plugins/flow/agents/shared-impl-reporter.md +338 -0
  22. package/plugins/flow/agents/shared-linear-subtask-iterator.md +336 -0
  23. package/plugins/flow/agents/shared-logic-implementer.md +242 -0
  24. package/plugins/flow/agents/shared-maia-api.md +25 -0
  25. package/plugins/flow/agents/shared-performance-validator.md +167 -0
  26. package/plugins/flow/agents/shared-project-standardizer.md +204 -0
  27. package/plugins/flow/agents/shared-security-scanner.md +185 -0
  28. package/plugins/flow/agents/shared-style-enforcer.md +229 -0
  29. package/plugins/flow/agents/shared-tdd-developer.md +349 -0
  30. package/plugins/flow/agents/shared-test-fixer.md +185 -0
  31. package/plugins/flow/agents/shared-test-runner.md +190 -0
  32. package/plugins/flow/agents/shared-ui-classifier.md +229 -0
  33. package/plugins/flow/agents/shared-verification-orchestrator.md +193 -0
  34. package/plugins/flow/agents/shared-verification-runner.md +139 -0
  35. package/plugins/flow/agents/ui-a11y-validator.md +304 -0
  36. package/plugins/flow/agents/ui-screenshot-reporter.md +328 -0
  37. package/plugins/flow/agents/ui-web-designer.md +213 -0
  38. package/plugins/flow/commands/commit.md +131 -0
  39. package/plugins/flow/commands/impl.md +625 -0
  40. package/plugins/flow/commands/plan.md +598 -0
  41. package/plugins/flow/commands/push.md +584 -0
  42. package/plugins/flow/skills/a11y-audit/SKILL.md +214 -0
  43. package/plugins/flow/skills/angular-patterns/SKILL.md +191 -0
  44. package/plugins/flow/skills/browser-capture/SKILL.md +238 -0
  45. package/plugins/flow/skills/debug-helper/SKILL.md +375 -0
  46. package/plugins/flow/skills/maia-files-delete/SKILL.md +60 -0
  47. package/plugins/flow/skills/maia-files-upload/SKILL.md +58 -0
  48. package/plugins/flow/skills/nx-conventions/SKILL.md +327 -0
  49. package/plugins/flow/skills/test-unit/SKILL.md +456 -0
  50. package/src/index.d.ts +6 -0
  51. package/src/index.js +10 -0
  52. package/src/index.js.map +1 -0
@@ -0,0 +1,456 @@
1
+ ---
2
+ name: test-unit
3
+ description: Write unit tests following project conventions. Generates Jest tests for Angular components, services, and NestJS services using AAA pattern.
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Glob
10
+ - Grep
11
+ ---
12
+
13
+ # Unit Test Skill
14
+
15
+ Write unit tests following project conventions using Jest framework with AAA (Arrange-Act-Assert) pattern.
16
+
17
+ ## Testing Framework
18
+
19
+ - **Framework**: Jest for all unit tests
20
+ - **File naming**: `{name}.spec.ts` alongside source files
21
+ - **Test runner**: Nx (`nx test {project}`)
22
+
23
+ ## Test File Location
24
+
25
+ Place test files next to the source files they test:
26
+
27
+ ```
28
+ feature/
29
+ ├── feature.service.ts
30
+ ├── feature.service.spec.ts
31
+ ├── feature.component.ts
32
+ └── feature.component.spec.ts
33
+ ```
34
+
35
+ ## Naming Convention
36
+
37
+ - **Describe blocks**: `@{package-name}: ClassName`
38
+ - **Test format**: `it('should...')` with clear behavior description
39
+
40
+ ## Test Structure (AAA Pattern)
41
+
42
+ Always use Arrange-Act-Assert pattern with blank line separation (no comments):
43
+
44
+ ```typescript
45
+ it('should perform expected operation', () => {
46
+ const input = 'test';
47
+
48
+ const result = service.performOperation(input);
49
+
50
+ expect(result).toBe('expected output');
51
+ });
52
+ ```
53
+
54
+ ## Angular Component Testing
55
+
56
+ ### Basic Component Test
57
+
58
+ ```typescript
59
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
60
+
61
+ import { FeatureComponent } from './feature.component';
62
+
63
+ describe('@mms/shared-angular: FeatureComponent', () => {
64
+ let component: FeatureComponent;
65
+ let fixture: ComponentFixture<FeatureComponent>;
66
+
67
+ beforeEach(async () => {
68
+ await TestBed.configureTestingModule({
69
+ imports: [FeatureComponent], // Standalone components
70
+ }).compileComponents();
71
+
72
+ fixture = TestBed.createComponent(FeatureComponent);
73
+ component = fixture.componentInstance;
74
+ fixture.detectChanges();
75
+ });
76
+
77
+ it('should create', () => {
78
+ expect(component).toBeTruthy();
79
+ });
80
+
81
+ it('should display expected content', () => {
82
+ component.title = 'Test Title';
83
+ fixture.detectChanges();
84
+
85
+ const compiled = fixture.nativeElement;
86
+ expect(compiled.querySelector('h1')?.textContent).toContain('Test Title');
87
+ });
88
+ });
89
+ ```
90
+
91
+ ### Testing Signal-based Components
92
+
93
+ ```typescript
94
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
95
+ import { signal } from '@angular/core';
96
+
97
+ import { SignalComponent } from './signal.component';
98
+
99
+ describe('@mms/shared-angular: SignalComponent', () => {
100
+ let component: SignalComponent;
101
+ let fixture: ComponentFixture<SignalComponent>;
102
+
103
+ beforeEach(async () => {
104
+ await TestBed.configureTestingModule({
105
+ imports: [SignalComponent],
106
+ }).compileComponents();
107
+
108
+ fixture = TestBed.createComponent(SignalComponent);
109
+ component = fixture.componentInstance;
110
+ fixture.detectChanges();
111
+ });
112
+
113
+ it('should update when signal changes', () => {
114
+ component.count.set(5);
115
+ fixture.detectChanges();
116
+
117
+ expect(fixture.nativeElement.textContent).toContain('5');
118
+ });
119
+
120
+ it('should compute derived value', () => {
121
+ component.items.set([1, 2, 3]);
122
+
123
+ expect(component.total()).toBe(6);
124
+ });
125
+ });
126
+ ```
127
+
128
+ ### Testing Components with input()/output()
129
+
130
+ ```typescript
131
+ describe('@mms/shared-angular: InputOutputComponent', () => {
132
+ let component: InputOutputComponent;
133
+ let fixture: ComponentFixture<InputOutputComponent>;
134
+
135
+ beforeEach(async () => {
136
+ await TestBed.configureTestingModule({
137
+ imports: [InputOutputComponent],
138
+ }).compileComponents();
139
+
140
+ fixture = TestBed.createComponent(InputOutputComponent);
141
+ component = fixture.componentInstance;
142
+ });
143
+
144
+ it('should accept input value', () => {
145
+ fixture.componentRef.setInput('value', 'test');
146
+ fixture.detectChanges();
147
+
148
+ expect(component.value()).toBe('test');
149
+ });
150
+
151
+ it('should emit output event', () => {
152
+ const spy = jest.fn();
153
+ component.changed.subscribe(spy);
154
+
155
+ component.emitChange('new value');
156
+
157
+ expect(spy).toHaveBeenCalledWith('new value');
158
+ });
159
+ });
160
+ ```
161
+
162
+ ### Testing with Services
163
+
164
+ ```typescript
165
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
166
+
167
+ import { FeatureComponent } from './feature.component';
168
+ import { DataService } from './data.service';
169
+
170
+ describe('@mms/shared-angular: FeatureComponent', () => {
171
+ let component: FeatureComponent;
172
+ let fixture: ComponentFixture<FeatureComponent>;
173
+ let mockDataService: jest.Mocked<DataService>;
174
+
175
+ beforeEach(async () => {
176
+ mockDataService = {
177
+ getData: jest.fn().mockReturnValue(of(['item1', 'item2'])),
178
+ saveData: jest.fn().mockReturnValue(of(true)),
179
+ } as unknown as jest.Mocked<DataService>;
180
+
181
+ await TestBed.configureTestingModule({
182
+ imports: [FeatureComponent],
183
+ providers: [{ provide: DataService, useValue: mockDataService }],
184
+ }).compileComponents();
185
+
186
+ fixture = TestBed.createComponent(FeatureComponent);
187
+ component = fixture.componentInstance;
188
+ fixture.detectChanges();
189
+ });
190
+
191
+ it('should load data on init', () => {
192
+ expect(mockDataService.getData).toHaveBeenCalled();
193
+ expect(component.items()).toEqual(['item1', 'item2']);
194
+ });
195
+ });
196
+ ```
197
+
198
+ ## Angular Service Testing
199
+
200
+ ```typescript
201
+ import { TestBed } from '@angular/core/testing';
202
+ import {
203
+ HttpTestingController,
204
+ provideHttpClientTesting,
205
+ } from '@angular/common/http/testing';
206
+ import { provideHttpClient } from '@angular/common/http';
207
+
208
+ import { DataService } from './data.service';
209
+
210
+ describe('@mms/shared-angular: DataService', () => {
211
+ let service: DataService;
212
+ let httpMock: HttpTestingController;
213
+
214
+ beforeEach(() => {
215
+ TestBed.configureTestingModule({
216
+ providers: [DataService, provideHttpClient(), provideHttpClientTesting()],
217
+ });
218
+
219
+ service = TestBed.inject(DataService);
220
+ httpMock = TestBed.inject(HttpTestingController);
221
+ });
222
+
223
+ afterEach(() => {
224
+ httpMock.verify();
225
+ });
226
+
227
+ it('should be created', () => {
228
+ expect(service).toBeTruthy();
229
+ });
230
+
231
+ it('should fetch data', () => {
232
+ const mockData = [{ id: 1, name: 'Test' }];
233
+
234
+ service.getData().subscribe((data) => {
235
+ expect(data).toEqual(mockData);
236
+ });
237
+
238
+ const req = httpMock.expectOne('/api/data');
239
+ expect(req.request.method).toBe('GET');
240
+ req.flush(mockData);
241
+ });
242
+ });
243
+ ```
244
+
245
+ ## NestJS Service Testing
246
+
247
+ ### Basic Service Test
248
+
249
+ ```typescript
250
+ import { TestingModule, Test } from '@nestjs/testing';
251
+
252
+ import { FeatureService } from './feature.service';
253
+
254
+ describe('@mms/module-name: FeatureService', () => {
255
+ let service: FeatureService;
256
+ let module: TestingModule;
257
+
258
+ beforeEach(async () => {
259
+ module = await Test.createTestingModule({
260
+ providers: [FeatureService],
261
+ }).compile();
262
+
263
+ service = module.get<FeatureService>(FeatureService);
264
+ });
265
+
266
+ afterEach(async () => {
267
+ await module.close();
268
+ });
269
+
270
+ it('should be defined', () => {
271
+ expect(service).toBeDefined();
272
+ });
273
+
274
+ it('should perform expected operation', () => {
275
+ const input = 'test';
276
+
277
+ const result = service.performOperation(input);
278
+
279
+ expect(result).toBe('expected output');
280
+ });
281
+ });
282
+ ```
283
+
284
+ ### Service with Repository
285
+
286
+ ```typescript
287
+ import { TestingModule, Test } from '@nestjs/testing';
288
+ import { getRepositoryToken } from '@nestjs/typeorm';
289
+
290
+ import { UserService } from './user.service';
291
+ import { User } from './user.entity';
292
+
293
+ describe('@mms/module-name: UserService', () => {
294
+ let service: UserService;
295
+ let module: TestingModule;
296
+ let mockRepository: Record<string, jest.Mock>;
297
+
298
+ beforeEach(async () => {
299
+ mockRepository = {
300
+ findOne: jest.fn(),
301
+ find: jest.fn(),
302
+ save: jest.fn(),
303
+ update: jest.fn(),
304
+ delete: jest.fn(),
305
+ };
306
+
307
+ module = await Test.createTestingModule({
308
+ providers: [
309
+ UserService,
310
+ {
311
+ provide: getRepositoryToken(User),
312
+ useValue: mockRepository,
313
+ },
314
+ ],
315
+ }).compile();
316
+
317
+ service = module.get<UserService>(UserService);
318
+ });
319
+
320
+ afterEach(async () => {
321
+ await module.close();
322
+ });
323
+
324
+ it('should find user by id', async () => {
325
+ const mockUser = { id: '1', name: 'Test User' };
326
+ mockRepository.findOne.mockResolvedValue(mockUser);
327
+
328
+ const result = await service.findById('1');
329
+
330
+ expect(result).toEqual(mockUser);
331
+ expect(mockRepository.findOne).toHaveBeenCalledWith({ where: { id: '1' } });
332
+ });
333
+ });
334
+ ```
335
+
336
+ ## Mocking Patterns
337
+
338
+ ### HTTP Client Mock
339
+
340
+ ```typescript
341
+ const mockHttpClient = {
342
+ get: jest.fn(),
343
+ post: jest.fn(),
344
+ put: jest.fn(),
345
+ delete: jest.fn(),
346
+ };
347
+ ```
348
+
349
+ ### Service Mock
350
+
351
+ ```typescript
352
+ const mockService = {
353
+ getData: jest.fn().mockReturnValue(of(mockData)),
354
+ createItem: jest.fn().mockReturnValue(of(mockItem)),
355
+ updateItem: jest.fn().mockReturnValue(of(updatedMockItem)),
356
+ };
357
+ ```
358
+
359
+ ### LocalStorage Mock
360
+
361
+ ```typescript
362
+ let localStorageMock: any;
363
+
364
+ beforeEach(() => {
365
+ localStorageMock = (() => {
366
+ let store: Record<string, string> = {};
367
+ return {
368
+ getItem: jest.fn((key: string) => store[key] || null),
369
+ setItem: jest.fn((key: string, value: string) => {
370
+ store[key] = value;
371
+ }),
372
+ removeItem: jest.fn((key: string) => {
373
+ delete store[key];
374
+ }),
375
+ clear: jest.fn(() => {
376
+ store = {};
377
+ }),
378
+ };
379
+ })();
380
+ Object.defineProperty(window, 'localStorage', { value: localStorageMock });
381
+ });
382
+ ```
383
+
384
+ ## Test Data Factory Pattern
385
+
386
+ ```typescript
387
+ export const createMockUser = (overrides: Partial<User> = {}): User => ({
388
+ id: 'test-id',
389
+ login: 'testuser',
390
+ name: 'Test',
391
+ surname: 'User',
392
+ email: 'test@example.com',
393
+ phoneNumber: '+1234567890',
394
+ del: false,
395
+ createdAt: new Date(),
396
+ updatedAt: new Date(),
397
+ ...overrides,
398
+ });
399
+ ```
400
+
401
+ ## Test Commands
402
+
403
+ ```bash
404
+ # Run tests for specific project
405
+ nx test web
406
+ nx test shared-angular
407
+
408
+ # Run tests in watch mode
409
+ nx test web --watch
410
+
411
+ # Run tests with coverage
412
+ nx test web --coverage
413
+
414
+ # Run all tests
415
+ nx run-many --target=test
416
+
417
+ # Run specific test file
418
+ nx test shared-angular --testFile=feature.service.spec.ts
419
+ ```
420
+
421
+ ## What to Test
422
+
423
+ - Business logic in services
424
+ - Component behavior and state changes
425
+ - Public API contracts
426
+ - Error handling scenarios
427
+ - Input validation
428
+ - Edge cases and boundary conditions
429
+
430
+ ## What NOT to Test
431
+
432
+ - Third-party libraries
433
+ - Framework internals (Angular/NestJS)
434
+ - Simple getters/setters without logic
435
+ - Auto-generated code
436
+ - Private methods directly (test through public API)
437
+
438
+ ## Workflow
439
+
440
+ 1. **Read source file** to understand the code being tested
441
+ 2. **Create test file** with `.spec.ts` extension next to source
442
+ 3. **Write describe block** with package and class name
443
+ 4. **Add beforeEach** with TestBed/Test setup
444
+ 5. **Write tests** using AAA pattern
445
+ 6. **Run tests** with `nx test {project}`
446
+ 7. **Fix failures** and ensure all pass
447
+
448
+ ## Best Practices
449
+
450
+ 1. **One assertion per test** when practical
451
+ 2. **Descriptive test names** that explain behavior
452
+ 3. **Independent tests** - no shared state between tests
453
+ 4. **Mock external dependencies** - isolate unit under test
454
+ 5. **Test edge cases** - empty arrays, null values, boundaries
455
+ 6. **Keep tests fast** - avoid real HTTP calls or timers
456
+ 7. **Clean up** - use afterEach for cleanup when needed
package/src/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @smartsoft001-mobilems/claude-plugins
3
+ *
4
+ * This library contains Claude Code plugin configuration files (MD/JSON).
5
+ */
6
+ export declare const CLAUDE_PLUGINS_VERSION = "1.0.0";
package/src/index.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * @smartsoft001-mobilems/claude-plugins
4
+ *
5
+ * This library contains Claude Code plugin configuration files (MD/JSON).
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.CLAUDE_PLUGINS_VERSION = void 0;
9
+ exports.CLAUDE_PLUGINS_VERSION = '1.0.0';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/shared/claude-plugins/src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEU,QAAA,sBAAsB,GAAG,OAAO,CAAC"}