metacoding 1.5.1 → 2.0.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 (95) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +108 -514
  3. package/lib/cli.d.ts.map +1 -1
  4. package/lib/cli.js +18 -19
  5. package/lib/cli.js.map +1 -1
  6. package/lib/commands/init.d.ts +8 -14
  7. package/lib/commands/init.d.ts.map +1 -1
  8. package/lib/commands/init.js +105 -387
  9. package/lib/commands/init.js.map +1 -1
  10. package/lib/commands/update.d.ts +9 -9
  11. package/lib/commands/update.d.ts.map +1 -1
  12. package/lib/commands/update.js +141 -320
  13. package/lib/commands/update.js.map +1 -1
  14. package/lib/services/backup.d.ts +1 -1
  15. package/lib/services/backup.d.ts.map +1 -1
  16. package/lib/services/backup.js +10 -6
  17. package/lib/services/backup.js.map +1 -1
  18. package/lib/services/filesystem.d.ts.map +1 -1
  19. package/lib/services/filesystem.js +11 -5
  20. package/lib/services/filesystem.js.map +1 -1
  21. package/lib/services/gitignore-manager.js +5 -5
  22. package/lib/services/gitignore-manager.js.map +1 -1
  23. package/lib/services/project-detector.d.ts +9 -8
  24. package/lib/services/project-detector.d.ts.map +1 -1
  25. package/lib/services/project-detector.js +79 -197
  26. package/lib/services/project-detector.js.map +1 -1
  27. package/lib/services/skill-manager.d.ts +23 -0
  28. package/lib/services/skill-manager.d.ts.map +1 -0
  29. package/lib/services/skill-manager.js +212 -0
  30. package/lib/services/skill-manager.js.map +1 -0
  31. package/lib/types/index.d.ts +5 -15
  32. package/lib/types/index.d.ts.map +1 -1
  33. package/package.json +9 -17
  34. package/skills/metacoding-workflow/SKILL.md +52 -0
  35. package/skills/metacoding-workflow/agents/openai.yaml +4 -0
  36. package/skills/metacoding-workflow/assets/templates/changelog-entry.md +6 -0
  37. package/skills/metacoding-workflow/assets/templates/project-context.md +18 -0
  38. package/skills/metacoding-workflow/assets/templates/repeated-task-checklist.md +8 -0
  39. package/skills/metacoding-workflow/assets/templates/task-entry.md +9 -0
  40. package/skills/metacoding-workflow/assets/templates/test-plan.md +8 -0
  41. package/skills/metacoding-workflow/references/javascript.md +7 -0
  42. package/skills/metacoding-workflow/references/node.md +7 -0
  43. package/skills/metacoding-workflow/references/platform-adaptation.md +37 -0
  44. package/skills/metacoding-workflow/references/python.md +7 -0
  45. package/skills/metacoding-workflow/references/react.md +7 -0
  46. package/skills/metacoding-workflow/references/repository-organization.md +84 -0
  47. package/skills/metacoding-workflow/references/typescript.md +7 -0
  48. package/skills/metacoding-workflow/references/workflow-rules.md +54 -0
  49. package/skills/vendor-templates/claude-agent.md.template +41 -0
  50. package/lib/services/assistant-adapter.d.ts +0 -18
  51. package/lib/services/assistant-adapter.d.ts.map +0 -1
  52. package/lib/services/assistant-adapter.js +0 -246
  53. package/lib/services/assistant-adapter.js.map +0 -1
  54. package/lib/services/cursor.d.ts +0 -47
  55. package/lib/services/cursor.d.ts.map +0 -1
  56. package/lib/services/cursor.js +0 -314
  57. package/lib/services/cursor.js.map +0 -1
  58. package/lib/services/template-manager.d.ts +0 -23
  59. package/lib/services/template-manager.d.ts.map +0 -1
  60. package/lib/services/template-manager.js +0 -374
  61. package/lib/services/template-manager.js.map +0 -1
  62. package/lib/services/vscode.d.ts +0 -10
  63. package/lib/services/vscode.d.ts.map +0 -1
  64. package/lib/services/vscode.js +0 -108
  65. package/lib/services/vscode.js.map +0 -1
  66. package/templates/assistants/AGENTS.md +0 -203
  67. package/templates/assistants/CLAUDE.md +0 -156
  68. package/templates/assistants/GEMINI.md +0 -193
  69. package/templates/general/code-review.instructions.md +0 -265
  70. package/templates/general/copilot-instructions.md +0 -427
  71. package/templates/general/docs-update.instructions.md +0 -275
  72. package/templates/general/release.instructions.md +0 -242
  73. package/templates/general/template.json +0 -9
  74. package/templates/general/test-runner.instructions.md +0 -188
  75. package/templates/javascript/javascript.coding.instructions.md +0 -500
  76. package/templates/javascript/javascript.docs.instructions.md +0 -563
  77. package/templates/javascript/javascript.testing.instructions.md +0 -686
  78. package/templates/javascript/template.json +0 -36
  79. package/templates/node/nodejs.coding.instructions.md +0 -249
  80. package/templates/node/nodejs.docs.instructions.md +0 -261
  81. package/templates/node/nodejs.testing.instructions.md +0 -373
  82. package/templates/node/template.json +0 -23
  83. package/templates/python/python.coding.instructions.md +0 -338
  84. package/templates/python/python.docs.instructions.md +0 -1178
  85. package/templates/python/python.testing.instructions.md +0 -1073
  86. package/templates/python/template.json +0 -75
  87. package/templates/react/react.coding.instructions.md +0 -694
  88. package/templates/react/react.docs.instructions.md +0 -451
  89. package/templates/react/react.testing.instructions.md +0 -192
  90. package/templates/react/template.json +0 -14
  91. package/templates/react/test-runner.instructions.md +0 -135
  92. package/templates/typescript/template.json +0 -16
  93. package/templates/typescript/typescript.coding.instructions.md +0 -368
  94. package/templates/typescript/typescript.docs.instructions.md +0 -760
  95. package/templates/typescript/typescript.testing.instructions.md +0 -739
@@ -1,760 +0,0 @@
1
- ---
2
- description: 'TypeScript/Node.js-specific documentation standards and JSDoc patterns'
3
- applyTo: '**/*.{ts,js}'
4
- ---
5
-
6
- # TypeScript/Node.js Documentation Standards
7
-
8
- ## JSDoc Documentation Standards
9
-
10
- ### Function Documentation
11
-
12
- ````typescript
13
- /**
14
- * Retrieves user information by ID with caching support.
15
- *
16
- * This function first checks the cache for existing user data before
17
- * making a database query. If the user is not found in cache, it queries
18
- * the database and stores the result in cache for future requests.
19
- *
20
- * @param userId - The unique identifier for the user
21
- * @param options - Configuration options for the retrieval
22
- * @param options.useCache - Whether to use cached data if available (default: true)
23
- * @param options.cacheTimeout - Cache timeout in milliseconds (default: 300000)
24
- * @returns Promise that resolves to user data or null if not found
25
- *
26
- * @throws {ValidationError} When userId format is invalid
27
- * @throws {DatabaseConnectionError} When database connection fails
28
- *
29
- * @example
30
- * ```typescript
31
- * // Basic usage
32
- * const user = await getUserById('123');
33
- *
34
- * // With options
35
- * const user = await getUserById('123', {
36
- * useCache: false,
37
- * cacheTimeout: 600000
38
- * });
39
- *
40
- * // Error handling
41
- * try {
42
- * const user = await getUserById('invalid-id');
43
- * } catch (error) {
44
- * if (error instanceof ValidationError) {
45
- * console.log('Invalid user ID format');
46
- * }
47
- * }
48
- * ```
49
- *
50
- * @since 1.2.0
51
- * @see {@link User} for user data structure
52
- * @see {@link UserRepository.findById} for underlying database query
53
- */
54
- async function getUserById(
55
- userId: string,
56
- options: GetUserOptions = {}
57
- ): Promise<User | null> {
58
- // Implementation here
59
- }
60
- ````
61
-
62
- ### Class Documentation
63
-
64
- ````typescript
65
- /**
66
- * Service for managing user data with caching and validation.
67
- *
68
- * The UserService provides a high-level interface for user operations,
69
- * including automatic caching, input validation, and error handling.
70
- * All operations are logged for debugging and monitoring purposes.
71
- *
72
- * @example
73
- * ```typescript
74
- * const userService = new UserService({
75
- * repository: new UserRepository(database),
76
- * cache: new RedisCache(),
77
- * logger: new Logger('UserService')
78
- * });
79
- *
80
- * // Create a new user
81
- * const user = await userService.createUser({
82
- * name: 'John Doe',
83
- * email: 'john@example.com'
84
- * });
85
- *
86
- * // Retrieve user with caching
87
- * const foundUser = await userService.getUserById(user.id);
88
- * ```
89
- *
90
- * @public
91
- * @since 1.0.0
92
- */
93
- export class UserService {
94
- /**
95
- * User repository for database operations.
96
- * @private
97
- */
98
- private readonly repository: UserRepository;
99
-
100
- /**
101
- * Cache instance for storing frequently accessed user data.
102
- * @private
103
- */
104
- private readonly cache: CacheService;
105
-
106
- /**
107
- * Logger instance for service operations.
108
- * @private
109
- */
110
- private readonly logger: Logger;
111
-
112
- /**
113
- * Creates a new UserService instance.
114
- *
115
- * @param dependencies - Service dependencies
116
- * @param dependencies.repository - Repository for user data persistence
117
- * @param dependencies.cache - Cache service for performance optimization
118
- * @param dependencies.logger - Logger for operation tracking
119
- *
120
- * @throws {Error} When required dependencies are not provided
121
- */
122
- constructor(dependencies: UserServiceDependencies) {
123
- if (!dependencies.repository) {
124
- throw new Error('UserRepository is required');
125
- }
126
-
127
- this.repository = dependencies.repository;
128
- this.cache = dependencies.cache;
129
- this.logger = dependencies.logger || new NullLogger();
130
- }
131
-
132
- /**
133
- * Creates a new user with validation and duplicate checking.
134
- *
135
- * @param userData - Data for the new user
136
- * @returns Promise resolving to the created user with generated ID
137
- *
138
- * @throws {ValidationError} When user data is invalid
139
- * @throws {DuplicateEmailError} When email already exists
140
- *
141
- * @example
142
- * ```typescript
143
- * const newUser = await userService.createUser({
144
- * name: 'Jane Doe',
145
- * email: 'jane@example.com',
146
- * preferences: { theme: 'dark' }
147
- * });
148
- * ```
149
- */
150
- async createUser(userData: CreateUserData): Promise<User> {
151
- // Implementation here
152
- }
153
- }
154
- ````
155
-
156
- ### Interface and Type Documentation
157
-
158
- ````typescript
159
- /**
160
- * Configuration options for user retrieval operations.
161
- *
162
- * @public
163
- */
164
- export interface GetUserOptions {
165
- /**
166
- * Whether to use cached data if available.
167
- * @defaultValue true
168
- */
169
- useCache?: boolean;
170
-
171
- /**
172
- * Cache timeout in milliseconds.
173
- * @defaultValue 300000 (5 minutes)
174
- */
175
- cacheTimeout?: number;
176
-
177
- /**
178
- * Additional fields to include in the response.
179
- * @defaultValue []
180
- */
181
- includeFields?: Array<'preferences' | 'metadata' | 'lastLogin'>;
182
- }
183
-
184
- /**
185
- * User data structure returned by the API.
186
- *
187
- * @example
188
- * ```typescript
189
- * const user: User = {
190
- * id: '123e4567-e89b-12d3-a456-426614174000',
191
- * name: 'John Doe',
192
- * email: 'john@example.com',
193
- * createdAt: new Date('2023-01-01T00:00:00Z'),
194
- * updatedAt: new Date('2023-06-01T12:00:00Z'),
195
- * isActive: true,
196
- * preferences: {
197
- * theme: 'dark',
198
- * notifications: true
199
- * }
200
- * };
201
- * ```
202
- *
203
- * @public
204
- */
205
- export interface User {
206
- /** Unique identifier for the user (UUID v4 format) */
207
- id: string;
208
-
209
- /** Full name of the user */
210
- name: string;
211
-
212
- /**
213
- * Email address (unique across all users)
214
- * @format email
215
- */
216
- email: string;
217
-
218
- /** Timestamp when the user was created */
219
- createdAt: Date;
220
-
221
- /** Timestamp when the user was last updated */
222
- updatedAt: Date;
223
-
224
- /**
225
- * Whether the user account is active
226
- * @defaultValue true
227
- */
228
- isActive: boolean;
229
-
230
- /**
231
- * User preferences and settings
232
- * @optional
233
- */
234
- preferences?: UserPreferences;
235
- }
236
-
237
- /**
238
- * Discriminated union type for different user roles.
239
- *
240
- * @example
241
- * ```typescript
242
- * function handleUser(user: UserRole) {
243
- * switch (user.type) {
244
- * case 'admin':
245
- * // user.permissions is available here
246
- * console.log('Admin permissions:', user.permissions);
247
- * break;
248
- * case 'member':
249
- * // user.membershipLevel is available here
250
- * console.log('Membership level:', user.membershipLevel);
251
- * break;
252
- * case 'guest':
253
- * // user.expiresAt is available here
254
- * console.log('Guest expires at:', user.expiresAt);
255
- * break;
256
- * }
257
- * }
258
- * ```
259
- */
260
- export type UserRole =
261
- | { type: 'admin'; permissions: string[] }
262
- | { type: 'member'; membershipLevel: 'basic' | 'premium' }
263
- | { type: 'guest'; expiresAt: Date };
264
- ````
265
-
266
- ### Error Class Documentation
267
-
268
- ````typescript
269
- /**
270
- * Error thrown when user validation fails.
271
- *
272
- * This error includes detailed information about which validation
273
- * rules failed and can be used to provide specific feedback to users.
274
- *
275
- * @example
276
- * ```typescript
277
- * try {
278
- * await userService.createUser(invalidData);
279
- * } catch (error) {
280
- * if (error instanceof ValidationError) {
281
- * console.log('Validation failed:', error.details);
282
- * error.details.forEach(detail => {
283
- * console.log(`${detail.field}: ${detail.message}`);
284
- * });
285
- * }
286
- * }
287
- * ```
288
- *
289
- * @public
290
- */
291
- export class ValidationError extends Error {
292
- /**
293
- * Detailed information about validation failures.
294
- * Each entry contains the field name and specific error message.
295
- */
296
- public readonly details: ValidationDetail[];
297
-
298
- /**
299
- * Error code for programmatic handling.
300
- * @defaultValue 'VALIDATION_ERROR'
301
- */
302
- public readonly code: string = 'VALIDATION_ERROR';
303
-
304
- /**
305
- * Creates a new ValidationError.
306
- *
307
- * @param message - High-level error message
308
- * @param details - Specific validation failure details
309
- */
310
- constructor(message: string, details: ValidationDetail[]) {
311
- super(message);
312
- this.name = 'ValidationError';
313
- this.details = details;
314
- }
315
-
316
- /**
317
- * Returns a formatted string of all validation errors.
318
- *
319
- * @returns Multi-line string with each validation error on a separate line
320
- */
321
- getFormattedDetails(): string {
322
- return this.details
323
- .map((detail) => `${detail.field}: ${detail.message}`)
324
- .join('\n');
325
- }
326
- }
327
- ````
328
-
329
- ### Module and Namespace Documentation
330
-
331
- ````typescript
332
- /**
333
- * @fileoverview User management utilities and services.
334
- *
335
- * This module provides a comprehensive set of tools for managing user data,
336
- * including validation, caching, and database operations. It follows the
337
- * repository pattern for data access and includes extensive error handling.
338
- *
339
- * @example
340
- * ```typescript
341
- * import { UserService, ValidationError } from './user-module';
342
- *
343
- * const userService = new UserService(dependencies);
344
- *
345
- * try {
346
- * const user = await userService.createUser(userData);
347
- * console.log('User created:', user.id);
348
- * } catch (error) {
349
- * if (error instanceof ValidationError) {
350
- * console.error('Validation failed:', error.getFormattedDetails());
351
- * }
352
- * }
353
- * ```
354
- *
355
- * @author Development Team <dev@example.com>
356
- * @since 1.0.0
357
- * @version 2.1.0
358
- */
359
-
360
- /**
361
- * Namespace containing user-related utility functions.
362
- *
363
- * @namespace UserUtils
364
- */
365
- export namespace UserUtils {
366
- /**
367
- * Validates email format using RFC 5322 compliant regex.
368
- *
369
- * @param email - Email address to validate
370
- * @returns True if email format is valid
371
- *
372
- * @example
373
- * ```typescript
374
- * if (UserUtils.isValidEmail('user@example.com')) {
375
- * console.log('Valid email format');
376
- * }
377
- * ```
378
- */
379
- export function isValidEmail(email: string): boolean {
380
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
381
- return emailRegex.test(email);
382
- }
383
-
384
- /**
385
- * Generates a display name from user data.
386
- *
387
- * @param user - User object
388
- * @returns Formatted display name
389
- *
390
- * @internal
391
- */
392
- export function getDisplayName(user: Pick<User, 'name' | 'email'>): string {
393
- return user.name || user.email.split('@')[0];
394
- }
395
- }
396
- ````
397
-
398
- ### API Route Documentation
399
-
400
- ````typescript
401
- /**
402
- * @fileoverview User API routes and handlers.
403
- *
404
- * This module defines REST API endpoints for user management operations.
405
- * All endpoints require authentication except for user registration.
406
- *
407
- * @version 2.0.0
408
- */
409
-
410
- import { Router, Request, Response } from 'express';
411
-
412
- /**
413
- * User-related API endpoints.
414
- *
415
- * @example
416
- * ```typescript
417
- * import express from 'express';
418
- * import { userRoutes } from './routes/user-routes';
419
- *
420
- * const app = express();
421
- * app.use('/api/users', userRoutes);
422
- * ```
423
- */
424
- export const userRoutes = Router();
425
-
426
- /**
427
- * GET /api/users/:id - Retrieve user by ID.
428
- *
429
- * @route GET /api/users/:id
430
- * @param {string} id - User ID (UUID format)
431
- * @returns {User} User object if found
432
- * @returns {404} Not found if user doesn't exist
433
- * @returns {400} Bad request if ID format is invalid
434
- *
435
- * @example
436
- * ```bash
437
- * curl -X GET /api/users/123e4567-e89b-12d3-a456-426614174000 \
438
- * -H "Authorization: Bearer YOUR_TOKEN"
439
- * ```
440
- *
441
- * @example Response
442
- * ```json
443
- * {
444
- * "id": "123e4567-e89b-12d3-a456-426614174000",
445
- * "name": "John Doe",
446
- * "email": "john@example.com",
447
- * "createdAt": "2023-01-01T00:00:00.000Z",
448
- * "isActive": true
449
- * }
450
- * ```
451
- */
452
- userRoutes.get('/:id', async (req: Request, res: Response) => {
453
- // Implementation here
454
- });
455
-
456
- /**
457
- * POST /api/users - Create a new user.
458
- *
459
- * @route POST /api/users
460
- * @param {CreateUserData} body - User data for creation
461
- * @returns {User} Created user object with generated ID
462
- * @returns {400} Bad request if validation fails
463
- * @returns {409} Conflict if email already exists
464
- *
465
- * @example Request Body
466
- * ```json
467
- * {
468
- * "name": "Jane Doe",
469
- * "email": "jane@example.com",
470
- * "preferences": {
471
- * "theme": "dark",
472
- * "notifications": true
473
- * }
474
- * }
475
- * ```
476
- */
477
- userRoutes.post('/', async (req: Request, res: Response) => {
478
- // Implementation here
479
- });
480
- ````
481
-
482
- ### Configuration and Constants Documentation
483
-
484
- ````typescript
485
- /**
486
- * @fileoverview Application configuration and constants.
487
- *
488
- * This module contains all configuration values and constants used
489
- * throughout the application. Values are loaded from environment
490
- * variables with sensible defaults for development.
491
- */
492
-
493
- /**
494
- * Database configuration settings.
495
- *
496
- * @example
497
- * ```typescript
498
- * import { DatabaseConfig } from './config';
499
- *
500
- * const connection = new DatabaseConnection(DatabaseConfig);
501
- * ```
502
- */
503
- export const DatabaseConfig = {
504
- /**
505
- * Database connection URL.
506
- * @env DATABASE_URL
507
- * @defaultValue 'postgresql://localhost:5432/myapp_dev'
508
- */
509
- url: process.env.DATABASE_URL || 'postgresql://localhost:5432/myapp_dev',
510
-
511
- /**
512
- * Maximum number of database connections in pool.
513
- * @env DB_POOL_SIZE
514
- * @defaultValue 10
515
- */
516
- poolSize: parseInt(process.env.DB_POOL_SIZE || '10', 10),
517
-
518
- /**
519
- * Connection timeout in milliseconds.
520
- * @env DB_TIMEOUT
521
- * @defaultValue 30000
522
- */
523
- timeout: parseInt(process.env.DB_TIMEOUT || '30000', 10),
524
- } as const;
525
-
526
- /**
527
- * User validation constants.
528
- *
529
- * These constants define the validation rules for user data
530
- * and are used throughout the application for consistency.
531
- */
532
- export const UserValidation = {
533
- /** Minimum length for user names */
534
- NAME_MIN_LENGTH: 2,
535
-
536
- /** Maximum length for user names */
537
- NAME_MAX_LENGTH: 100,
538
-
539
- /** Maximum length for email addresses */
540
- EMAIL_MAX_LENGTH: 254,
541
-
542
- /** Regex pattern for valid email format */
543
- EMAIL_PATTERN: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
544
-
545
- /** List of reserved usernames that cannot be used */
546
- RESERVED_NAMES: ['admin', 'root', 'system', 'api'] as const,
547
- } as const;
548
- ````
549
-
550
- ## Node.js Specific Documentation
551
-
552
- ### Process and Environment Documentation
553
-
554
- ````typescript
555
- /**
556
- * @fileoverview Process management and graceful shutdown handling.
557
- *
558
- * This module handles process lifecycle events and ensures graceful
559
- * shutdown of the application with proper cleanup of resources.
560
- */
561
-
562
- /**
563
- * Graceful shutdown manager for Node.js applications.
564
- *
565
- * Handles SIGINT and SIGTERM signals to ensure clean shutdown
566
- * with proper cleanup of database connections, file handles, and
567
- * other resources.
568
- *
569
- * @example
570
- * ```typescript
571
- * const shutdownManager = new GracefulShutdown();
572
- *
573
- * shutdownManager.addHandler('database', async () => {
574
- * await database.disconnect();
575
- * });
576
- *
577
- * shutdownManager.addHandler('server', async () => {
578
- * await server.close();
579
- * });
580
- *
581
- * shutdownManager.start();
582
- * ```
583
- */
584
- export class GracefulShutdown {
585
- /**
586
- * Map of cleanup handlers by name.
587
- * @private
588
- */
589
- private handlers = new Map<string, () => Promise<void>>();
590
-
591
- /**
592
- * Whether shutdown process has started.
593
- * @private
594
- */
595
- private isShuttingDown = false;
596
-
597
- /**
598
- * Adds a cleanup handler for a named resource.
599
- *
600
- * @param name - Unique name for the handler
601
- * @param handler - Async function to clean up the resource
602
- *
603
- * @throws {Error} If handler name already exists
604
- */
605
- addHandler(name: string, handler: () => Promise<void>): void {
606
- if (this.handlers.has(name)) {
607
- throw new Error(`Handler '${name}' already exists`);
608
- }
609
- this.handlers.set(name, handler);
610
- }
611
- }
612
- ````
613
-
614
- ### Stream Documentation
615
-
616
- ````typescript
617
- /**
618
- * Custom transform stream for processing large datasets.
619
- *
620
- * This stream processes data in chunks to handle large files
621
- * efficiently without loading everything into memory at once.
622
- *
623
- * @example
624
- * ```typescript
625
- * import fs from 'fs';
626
- * import { DataProcessor } from './data-processor';
627
- *
628
- * const processor = new DataProcessor({
629
- * batchSize: 1000,
630
- * transform: (chunk) => chunk.toUpperCase()
631
- * });
632
- *
633
- * fs.createReadStream('input.txt')
634
- * .pipe(processor)
635
- * .pipe(fs.createWriteStream('output.txt'));
636
- * ```
637
- */
638
- export class DataProcessor extends Transform {
639
- /**
640
- * Number of items to process in each batch.
641
- * @private
642
- */
643
- private readonly batchSize: number;
644
-
645
- /**
646
- * Function to transform each data chunk.
647
- * @private
648
- */
649
- private readonly transformFn: (chunk: string) => string;
650
-
651
- /**
652
- * Creates a new DataProcessor stream.
653
- *
654
- * @param options - Processor configuration
655
- * @param options.batchSize - Number of items per batch
656
- * @param options.transform - Function to transform each chunk
657
- */
658
- constructor(options: DataProcessorOptions) {
659
- super({ objectMode: true });
660
- this.batchSize = options.batchSize || 100;
661
- this.transformFn = options.transform || ((x) => x);
662
- }
663
- }
664
- ````
665
-
666
- ## README and Package Documentation
667
-
668
- ### Package.json Documentation Guidelines
669
-
670
- ```json
671
- {
672
- "name": "user-management-service",
673
- "version": "2.1.0",
674
- "description": "Comprehensive user management service with caching, validation, and REST API",
675
- "main": "dist/index.js",
676
- "types": "dist/index.d.ts",
677
- "scripts": {
678
- "build": "tsc",
679
- "test": "jest",
680
- "test:coverage": "jest --coverage",
681
- "test:watch": "jest --watch",
682
- "lint": "eslint src/**/*.ts",
683
- "lint:fix": "eslint src/**/*.ts --fix",
684
- "start": "node dist/index.js",
685
- "dev": "ts-node src/index.ts",
686
- "docs": "typedoc src --out docs"
687
- },
688
- "keywords": [
689
- "user-management",
690
- "authentication",
691
- "rest-api",
692
- "typescript",
693
- "caching"
694
- ],
695
- "author": "Your Name <your.email@example.com>",
696
- "license": "MIT",
697
- "repository": {
698
- "type": "git",
699
- "url": "https://github.com/username/user-management-service.git"
700
- },
701
- "bugs": {
702
- "url": "https://github.com/username/user-management-service/issues"
703
- },
704
- "homepage": "https://github.com/username/user-management-service#readme"
705
- }
706
- ```
707
-
708
- ### TypeDoc Configuration
709
-
710
- ```javascript
711
- // typedoc.json
712
- {
713
- "entryPoints": ["src/index.ts"],
714
- "out": "docs",
715
- "excludePrivate": true,
716
- "excludeProtected": false,
717
- "excludeInternal": false,
718
- "categorizeByGroup": true,
719
- "sort": ["source-order"],
720
- "kindSortOrder": [
721
- "Module",
722
- "Namespace",
723
- "Enum",
724
- "Class",
725
- "Interface",
726
- "Function",
727
- "Variable"
728
- ],
729
- "theme": "default",
730
- "readme": "README.md",
731
- "includeVersion": true
732
- }
733
- ```
734
-
735
- ## Repeated TypeScript Documentation Tasks and Checklist Templates
736
-
737
- For any recurring TypeScript documentation process (such as API releases, type definition updates, or migration guides), always use a dedicated checklist template to ensure all necessary documentation steps are followed and nothing is missed.
738
-
739
- - **TypeScript Documentation Checklist Template Principle:**
740
- - Maintain a template checklist file for each repeated TypeScript documentation process (e.g., `api-release-docs-checklist.md`, `type-migration-docs-checklist.md`).
741
- - For each new instance (e.g., each API release or migration), copy the template checklist and tag it with the relevant version or context, preserving the original template for future use.
742
- - Systematically work through the checklist for every instance of the repeated documentation task, marking each step as completed.
743
- - Proactively identify any TypeScript documentation process that would benefit from a checklist and prompt the user to use or create one if it does not exist.
744
- - If, during execution, you or the user identify missing or unclear documentation steps, update the template checklist to improve future reliability.
745
-
746
- **Examples of repeated TypeScript documentation tasks requiring checklists:**
747
-
748
- - API releases (JSDoc updates, type definition exports, example verification, TypeDoc generation)
749
- - TypeScript version migrations (type system changes, breaking changes documentation, compatibility guides)
750
- - Package documentation (README updates, API reference generation, installation guides, usage examples)
751
- - Type definition updates (interface changes, generic constraints, utility type documentation)
752
- - Node.js documentation (environment setup, deployment guides, configuration documentation)
753
- - Any other TypeScript documentation process with multiple required steps or risk of omission
754
-
755
- **Agent Guidance for TypeScript Documentation Tasks:**
756
-
757
- - Always check for the existence of a TypeScript documentation checklist template before starting a repeated documentation task.
758
- - If a template does not exist, prompt the user to create one and assist in drafting it.
759
- - When using a documentation checklist, copy it for the specific instance (e.g., `api-release-v3.2.0.md`), and work through each step systematically.
760
- - If new documentation steps are discovered or improvements are needed, update the template and inform the user.