@lenne.tech/cli 1.0.0 → 1.0.2

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 (37) hide show
  1. package/build/commands/claude/install-commands.js +337 -0
  2. package/build/commands/claude/install-mcps.js +256 -0
  3. package/build/commands/claude/install-skills.js +91 -20
  4. package/build/commands/server/add-property.js +22 -41
  5. package/build/extensions/server.js +142 -46
  6. package/build/lib/mcp-registry.js +71 -0
  7. package/build/templates/claude-commands/code-cleanup.md +82 -0
  8. package/build/templates/claude-commands/commit-message.md +21 -0
  9. package/build/templates/claude-commands/mr-description-clipboard.md +48 -0
  10. package/build/templates/claude-commands/mr-description.md +33 -0
  11. package/build/templates/claude-commands/sec-review.md +62 -0
  12. package/build/templates/claude-commands/skill-optimize.md +481 -0
  13. package/build/templates/claude-commands/test-generate.md +45 -0
  14. package/build/templates/claude-skills/building-stories-with-tdd/SKILL.md +265 -0
  15. package/build/templates/claude-skills/building-stories-with-tdd/code-quality.md +276 -0
  16. package/build/templates/claude-skills/building-stories-with-tdd/database-indexes.md +182 -0
  17. package/build/templates/claude-skills/building-stories-with-tdd/examples.md +1383 -0
  18. package/build/templates/claude-skills/building-stories-with-tdd/handling-existing-tests.md +197 -0
  19. package/build/templates/claude-skills/building-stories-with-tdd/reference.md +1427 -0
  20. package/build/templates/claude-skills/building-stories-with-tdd/security-review.md +307 -0
  21. package/build/templates/claude-skills/building-stories-with-tdd/workflow.md +1004 -0
  22. package/build/templates/claude-skills/generating-nest-servers/SKILL.md +303 -0
  23. package/build/templates/claude-skills/generating-nest-servers/configuration.md +285 -0
  24. package/build/templates/claude-skills/generating-nest-servers/declare-keyword-warning.md +133 -0
  25. package/build/templates/claude-skills/generating-nest-servers/description-management.md +226 -0
  26. package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/examples.md +138 -5
  27. package/build/templates/claude-skills/generating-nest-servers/framework-guide.md +259 -0
  28. package/build/templates/claude-skills/generating-nest-servers/quality-review.md +864 -0
  29. package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/reference.md +83 -13
  30. package/build/templates/claude-skills/generating-nest-servers/security-rules.md +371 -0
  31. package/build/templates/claude-skills/generating-nest-servers/verification-checklist.md +262 -0
  32. package/build/templates/claude-skills/generating-nest-servers/workflow-process.md +1061 -0
  33. package/build/templates/claude-skills/{lt-cli → using-lt-cli}/SKILL.md +22 -10
  34. package/build/templates/claude-skills/{lt-cli → using-lt-cli}/examples.md +7 -3
  35. package/build/templates/claude-skills/{lt-cli → using-lt-cli}/reference.md +10 -3
  36. package/package.json +2 -2
  37. package/build/templates/claude-skills/nest-server-generator/SKILL.md +0 -2833
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: nest-server-generator-declare-keyword
3
+ version: 1.0.0
4
+ description: Critical warning about using the declare keyword in TypeScript classes
5
+ ---
6
+
7
+ # 🚨 CRITICAL: NEVER USE `declare` KEYWORD FOR PROPERTIES
8
+
9
+ ## Table of Contents
10
+ - [WRONG - Using `declare`](#-wrong---using-declare)
11
+ - [CORRECT - Without `declare`](#-correct---without-declare)
12
+ - [Why This Matters](#why-this-matters)
13
+ - [When You Might Be Tempted to Use `declare`](#when-you-might-be-tempted-to-use-declare)
14
+ - [Correct Approach Instead](#correct-approach-instead)
15
+ - [Examples](#examples)
16
+ - [Remember](#remember)
17
+
18
+ **⚠️ IMPORTANT RULE: DO NOT use the `declare` keyword when defining properties in classes!**
19
+
20
+ The `declare` keyword in TypeScript signals that a property is only a type declaration without a runtime value. This prevents decorators from being properly applied and overridden.
21
+
22
+ ---
23
+
24
+ ## ❌ WRONG - Using `declare`
25
+
26
+ ```typescript
27
+ export class ProductCreateInput extends ProductInput {
28
+ declare name: string; // ❌ WRONG - Decorator won't be applied!
29
+ declare price: number; // ❌ WRONG - Decorator won't be applied!
30
+ }
31
+ ```
32
+
33
+ ---
34
+
35
+ ## ✅ CORRECT - Without `declare`
36
+
37
+ ```typescript
38
+ export class ProductCreateInput extends ProductInput {
39
+ @UnifiedField({ description: 'Product name' })
40
+ name: string; // ✅ CORRECT - Decorator works properly
41
+
42
+ @UnifiedField({ description: 'Product price' })
43
+ price: number; // ✅ CORRECT - Decorator works properly
44
+ }
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Why This Matters
50
+
51
+ 1. **Decorators require actual properties**: `@UnifiedField()`, `@Restricted()`, and other decorators need actual property declarations to attach metadata
52
+ 2. **Override behavior**: When extending classes, using `declare` prevents decorators from being properly overridden
53
+ 3. **Runtime behavior**: `declare` properties don't exist at runtime, breaking the decorator system
54
+
55
+ ---
56
+
57
+ ## When You Might Be Tempted to Use `declare`
58
+
59
+ - ❌ When extending a class and wanting to change a decorator
60
+ - ❌ When TypeScript shows "property is declared but never used"
61
+ - ❌ When dealing with inheritance and property redefinition
62
+
63
+ ---
64
+
65
+ ## Correct Approach Instead
66
+
67
+ Use the `override` keyword (when appropriate) but NEVER `declare`:
68
+
69
+ ```typescript
70
+ export class ProductCreateInput extends ProductInput {
71
+ // ✅ Use override when useDefineForClassFields is enabled
72
+ override name: string;
73
+
74
+ // ✅ Apply decorators directly - they will override parent decorators
75
+ @UnifiedField({ description: 'Product name', isOptional: false })
76
+ override price: number;
77
+ }
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Examples
83
+
84
+ ### ❌ WRONG - Using declare
85
+
86
+ ```typescript
87
+ // This will BREAK decorator functionality
88
+ export class AddressInput extends Address {
89
+ declare street: string;
90
+ declare city: string;
91
+ declare zipCode: string;
92
+ }
93
+ ```
94
+
95
+ ### ✅ CORRECT - Without declare
96
+
97
+ ```typescript
98
+ // This works properly
99
+ export class AddressInput extends Address {
100
+ @UnifiedField({ description: 'Street' })
101
+ street: string;
102
+
103
+ @UnifiedField({ description: 'City' })
104
+ city: string;
105
+
106
+ @UnifiedField({ description: 'Zip code' })
107
+ zipCode: string;
108
+ }
109
+ ```
110
+
111
+ ### ✅ CORRECT - With override
112
+
113
+ ```typescript
114
+ // This also works when extending decorated properties
115
+ export class AddressInput extends Address {
116
+ @UnifiedField({ description: 'Street', isOptional: false })
117
+ override street: string;
118
+
119
+ @UnifiedField({ description: 'City', isOptional: false })
120
+ override city: string;
121
+
122
+ @UnifiedField({ description: 'Zip code', isOptional: true })
123
+ override zipCode?: string;
124
+ }
125
+ ```
126
+
127
+ ---
128
+
129
+ ## Remember
130
+
131
+ **`declare` = no decorators = broken functionality!**
132
+
133
+ Always use actual property declarations with decorators, optionally with the `override` keyword when extending classes.
@@ -0,0 +1,226 @@
1
+ ---
2
+ name: nest-server-generator-description-management
3
+ version: 1.0.0
4
+ description: Guidelines for consistent description management across all generated components
5
+ ---
6
+
7
+ # 🚨 CRITICAL: Description Management
8
+
9
+ ## Table of Contents
10
+ - [Step 1: ALWAYS Extract Descriptions from User Input](#-step-1-always-extract-descriptions-from-user-input)
11
+ - [Step 2: Format Descriptions Correctly](#-step-2-format-descriptions-correctly)
12
+ - [Step 3: Apply Descriptions EVERYWHERE (Most Critical!)](#-step-3-apply-descriptions-everywhere-most-critical)
13
+ - [Common Mistakes to AVOID](#-common-mistakes-to-avoid)
14
+ - [Verification Checklist](#-verification-checklist)
15
+ - [If You Forget](#-if-you-forget)
16
+ - [Quick Reference](#quick-reference)
17
+
18
+ **⚠️ COMMON MISTAKE:** Descriptions are often applied inconsistently or only partially. You MUST follow this process for EVERY component.
19
+
20
+ ---
21
+
22
+ ## 🔍 Step 1: ALWAYS Extract Descriptions from User Input
23
+
24
+ **BEFORE generating ANY code, scan the user's specification for description hints:**
25
+
26
+ 1. **Look for comments after `//`**:
27
+ ```
28
+ Module: Product
29
+ - name: string // Product name
30
+ - price: number // Produktpreis
31
+ - stock?: number // Current stock level
32
+ ```
33
+
34
+ 2. **Extract ALL comments** and store them for each property
35
+ 3. **Identify language** (English or German)
36
+
37
+ ---
38
+
39
+ ## 📝 Step 2: Format Descriptions Correctly
40
+
41
+ **Rule**: `"ENGLISH_DESCRIPTION (DEUTSCHE_BESCHREIBUNG)"`
42
+
43
+ ### Processing Logic
44
+
45
+ | User Input | Language | Formatted Description |
46
+ |------------|----------|----------------------|
47
+ | `// Product name` | English | `'Product name'` |
48
+ | `// Produktname` | German | `'Product name (Produktname)'` |
49
+ | `// Straße` | German | `'Street (Straße)'` |
50
+ | `// Postleizahl` (typo) | German | `'Postal code (Postleitzahl)'` |
51
+ | (no comment) | - | Create meaningful English description |
52
+
53
+ ### ⚠️ CRITICAL - Preserving Original Text
54
+
55
+ **1. Fix spelling errors ONLY:**
56
+ - ✅ Correct typos: `Postleizahl` → `Postleitzahl` (missing 't')
57
+ - ✅ Fix character errors: `Starße` → `Straße` (wrong character)
58
+ - ✅ Correct English typos: `Prodcut name` → `Product name`
59
+
60
+ **2. DO NOT change the wording:**
61
+ - ❌ NEVER rephrase: `Straße` → `Straßenname` (NO!)
62
+ - ❌ NEVER expand: `Produkt` → `Produktbezeichnung` (NO!)
63
+ - ❌ NEVER improve: `Name` → `Full name` (NO!)
64
+ - ❌ NEVER translate differently: `Name` → `Title` (NO!)
65
+
66
+ **3. Why this is critical:**
67
+ - User comments may be **predefined terms** from requirements
68
+ - External systems may **reference these exact terms**
69
+ - Changing wording breaks **external integrations**
70
+
71
+ ### Examples
72
+
73
+ ```
74
+ ✅ CORRECT:
75
+ // Straße → 'Street (Straße)' (only translated)
76
+ // Starße → 'Street (Straße)' (typo fixed, then translated)
77
+ // Produkt → 'Product (Produkt)' (keep original word)
78
+ // Strasse → 'Street (Straße)' (ss→ß corrected, then translated)
79
+
80
+ ❌ WRONG:
81
+ // Straße → 'Street name (Straßenname)' (changed wording!)
82
+ // Produkt → 'Product name (Produktname)' (added word!)
83
+ // Name → 'Full name (Vollständiger Name)' (rephrased!)
84
+ ```
85
+
86
+ **Rule Summary**: Fix typos, preserve wording, translate accurately.
87
+
88
+ ---
89
+
90
+ ## ✅ Step 3: Apply Descriptions EVERYWHERE (Most Critical!)
91
+
92
+ **🚨 YOU MUST apply the SAME description to ALL of these locations:**
93
+
94
+ ### For Module Properties
95
+
96
+ **1. Model file** (`<module>.model.ts`):
97
+ ```typescript
98
+ @UnifiedField({ description: 'Product name (Produktname)' })
99
+ name: string;
100
+ ```
101
+
102
+ **2. Create Input** (`<module>-create.input.ts`):
103
+ ```typescript
104
+ @UnifiedField({ description: 'Product name (Produktname)' })
105
+ name: string;
106
+ ```
107
+
108
+ **3. Update Input** (`<module>.input.ts`):
109
+ ```typescript
110
+ @UnifiedField({ description: 'Product name (Produktname)' })
111
+ name?: string;
112
+ ```
113
+
114
+ ### For SubObject Properties
115
+
116
+ **1. Object file** (`<object>.object.ts`):
117
+ ```typescript
118
+ @UnifiedField({ description: 'Street (Straße)' })
119
+ street: string;
120
+ ```
121
+
122
+ **2. Object Create Input** (`<object>-create.input.ts`):
123
+ ```typescript
124
+ @UnifiedField({ description: 'Street (Straße)' })
125
+ street: string;
126
+ ```
127
+
128
+ **3. Object Update Input** (`<object>.input.ts`):
129
+ ```typescript
130
+ @UnifiedField({ description: 'Street (Straße)' })
131
+ street?: string;
132
+ ```
133
+
134
+ ### For Object/Module Type Decorators
135
+
136
+ Apply descriptions to the class decorators as well:
137
+
138
+ ```typescript
139
+ @ObjectType({ description: 'Address information (Adressinformationen)' })
140
+ export class Address { ... }
141
+
142
+ @InputType({ description: 'Address information (Adressinformationen)' })
143
+ export class AddressInput { ... }
144
+
145
+ @ObjectType({ description: 'Product entity (Produkt-Entität)' })
146
+ export class Product extends CoreModel { ... }
147
+ ```
148
+
149
+ ---
150
+
151
+ ## ⛔ Common Mistakes to AVOID
152
+
153
+ 1. ❌ **Partial application**: Descriptions only in Models, not in Inputs
154
+ 2. ❌ **Inconsistent format**: German-only in some places, English-only in others
155
+ 3. ❌ **Missing descriptions**: No descriptions when user provided comments
156
+ 4. ❌ **Ignoring Object inputs**: Forgetting to add descriptions to SubObject Input files
157
+ 5. ❌ **Wrong format**: Using `(ENGLISH)` instead of `ENGLISH (DEUTSCH)`
158
+ 6. ❌ **Changing wording**: Rephrasing user's original terms
159
+ 7. ❌ **Adding words**: Expanding user's terminology
160
+
161
+ ---
162
+
163
+ ## ✅ Verification Checklist
164
+
165
+ After generating code, ALWAYS verify:
166
+
167
+ - [ ] All user comments/descriptions extracted from specification
168
+ - [ ] All descriptions follow format: `"ENGLISH (DEUTSCH)"` or `"ENGLISH"`
169
+ - [ ] Model properties have descriptions
170
+ - [ ] Create Input properties have SAME descriptions
171
+ - [ ] Update Input properties have SAME descriptions
172
+ - [ ] Object properties have descriptions
173
+ - [ ] Object Input properties have SAME descriptions
174
+ - [ ] Class-level `@ObjectType()` and `@InputType()` have descriptions
175
+ - [ ] NO German-only descriptions (must be translated)
176
+ - [ ] NO inconsistencies between files
177
+ - [ ] Original wording preserved (only typos fixed)
178
+
179
+ ---
180
+
181
+ ## 🔄 If You Forget
182
+
183
+ **If you generate code and realize descriptions are missing or inconsistent:**
184
+
185
+ 1. **STOP** - Don't continue with other phases
186
+ 2. **Go back** and add/fix ALL descriptions
187
+ 3. **Verify** using the checklist above
188
+ 4. **Then continue** with remaining phases
189
+
190
+ **Remember**: Descriptions are NOT optional "nice-to-have" - they are MANDATORY for:
191
+ - API documentation (Swagger/GraphQL)
192
+ - Code maintainability
193
+ - Developer experience
194
+ - Bilingual projects (German/English teams)
195
+
196
+ ---
197
+
198
+ ## Quick Reference
199
+
200
+ ### Format Rules
201
+
202
+ ```
203
+ English input → 'Product name'
204
+ German input → 'Product name (Produktname)'
205
+ No input → Create meaningful description
206
+ Typo input → Fix typo, then translate
207
+ Mixed input → Standardize to 'ENGLISH (DEUTSCH)'
208
+ ```
209
+
210
+ ### Application Checklist
211
+
212
+ For **each property**:
213
+ - [ ] Model file
214
+ - [ ] Create Input file
215
+ - [ ] Update Input file
216
+
217
+ For **each class**:
218
+ - [ ] @ObjectType() decorator
219
+ - [ ] @InputType() decorator (if applicable)
220
+
221
+ ### Remember
222
+
223
+ - **Consistency is critical** - Same description everywhere
224
+ - **Preserve wording** - Only fix typos, never rephrase
225
+ - **Bilingual format** - Always use "ENGLISH (DEUTSCH)" for German terms
226
+ - **Verification** - Check all files before proceeding
@@ -1,11 +1,18 @@
1
1
  ---
2
2
  name: nest-server-generator-examples
3
- version: 1.0.0
3
+ version: 1.0.1
4
4
  description: Complete examples for generating NestJS server structures from specifications
5
5
  ---
6
6
 
7
7
  # NestJS Server Generator Examples
8
8
 
9
+ ## Table of Contents
10
+ - [Example 1: Library Management System](#example-1-library-management-system)
11
+ - [Example 2: Hotel Booking System (Minimal)](#example-2-hotel-booking-system-minimal)
12
+ - [Key Patterns Demonstrated](#key-patterns-demonstrated)
13
+ - [Best Practices from Examples](#best-practices-from-examples)
14
+ - [Quality Review Workflow Example](#quality-review-workflow-example)
15
+
9
16
  ## Example 1: Library Management System
10
17
 
11
18
  This example demonstrates all features:
@@ -209,18 +216,144 @@ Manually update `book.input.ts` and `book-create.input.ts`:
209
216
 
210
217
  #### Step 5: Update Descriptions
211
218
 
212
- Update all generated files to follow pattern: `"ENGLISH (DEUTSCH)"`:
219
+ **⚠️ CRITICAL STEP - Extract descriptions from original specification and apply EVERYWHERE!**
220
+
221
+ **Step 5.1: Extract from specification**
222
+
223
+ Go back to the original specification and identify ALL comments:
224
+
225
+ ```
226
+ SubObject: Address
227
+ - street: string // Straße
228
+ - city: string // City name
229
+ - zipCode: string // Postleitzahl
230
+
231
+ Module: Book
232
+ Model: Book
233
+ Extends: BaseItem
234
+ - isbn: string // ISBN-Nummer
235
+ - author: string // Author name
236
+ - publisher?: string // Verlag
237
+ ```
238
+
239
+ **Extracted mapping:**
240
+ - Address.street → "Straße" (German)
241
+ - Address.city → "City name" (English)
242
+ - Address.zipCode → "Postleitzahl" (German)
243
+ - Book.isbn → "ISBN-Nummer" (German)
244
+ - Book.author → "Author name" (English)
245
+ - Book.publisher → "Verlag" (German)
246
+
247
+ **Step 5.2: Format descriptions**
248
+
249
+ Apply format rules:
250
+ - German → Translate and add: `ENGLISH (DEUTSCH)`
251
+ - English → Keep as-is
252
+ - **Fix typos only, preserve original wording!**
253
+
254
+ ```
255
+ Address.street → 'Street (Straße)' (preserve word "Straße", don't change to "Straßenname")
256
+ Address.city → 'City name'
257
+ Address.zipCode → 'Postal code (Postleitzahl)'
258
+ Book.isbn → 'ISBN number (ISBN-Nummer)'
259
+ Book.author → 'Author name'
260
+ Book.publisher → 'Publisher (Verlag)' (preserve word "Verlag", don't expand)
261
+ ```
262
+
263
+ **⚠️ CRITICAL - Preserve Original Wording:**
264
+
265
+ User comments may be predefined terms or referenced by external systems.
266
+
267
+ **Examples of correct handling**:
268
+ ```
269
+ ✅ CORRECT:
270
+ // Straße → 'Street (Straße)' (just translate)
271
+ // Postleizahl → 'Postal code (Postleitzahl)' (fix typo, preserve word)
272
+ // Produkt → 'Product (Produkt)' (don't add "name")
273
+ // Status → 'Status (Status)' (same word)
274
+
275
+ ❌ WRONG:
276
+ // Straße → 'Street name (Straßenname)' (changed word!)
277
+ // Produkt → 'Product name (Produktname)' (added word!)
278
+ // Titel → 'Product title (Produkttitel)' (changed "Titel"!)
279
+ ```
280
+
281
+ **Step 5.3: Apply to ALL files**
282
+
283
+ For Address SubObject (3 files):
213
284
 
214
285
  ```typescript
215
- // Before:
216
- @UnifiedField({ description: 'ISBN number' })
286
+ // File: src/server/common/objects/address/address.object.ts
287
+ @UnifiedField({ description: 'Street (Straße)' })
288
+ street: string;
289
+
290
+ @UnifiedField({ description: 'City name' })
291
+ city: string;
292
+
293
+ @UnifiedField({ description: 'Postal code (Postleitzahl)' })
294
+ zipCode: string;
295
+
296
+ // File: src/server/common/objects/address/address-create.input.ts
297
+ @UnifiedField({ description: 'Street (Straße)' })
298
+ street: string;
299
+
300
+ @UnifiedField({ description: 'City name' })
301
+ city: string;
302
+
303
+ @UnifiedField({ description: 'Postal code (Postleitzahl)' })
304
+ zipCode: string;
305
+
306
+ // File: src/server/common/objects/address/address.input.ts
307
+ @UnifiedField({ description: 'Street (Straße)' })
308
+ street?: string;
309
+
310
+ @UnifiedField({ description: 'City name' })
311
+ city?: string;
312
+
313
+ @UnifiedField({ description: 'Postal code (Postleitzahl)' })
314
+ zipCode?: string;
315
+ ```
316
+
317
+ For Book Module (3 files):
318
+
319
+ ```typescript
320
+ // File: src/server/modules/book/book.model.ts
321
+ @UnifiedField({ description: 'ISBN number (ISBN-Nummer)' })
217
322
  isbn: string;
218
323
 
219
- // After:
324
+ @UnifiedField({ description: 'Author name' })
325
+ author: string;
326
+
327
+ @UnifiedField({ description: 'Publisher (Verlag)' })
328
+ publisher?: string;
329
+
330
+ // File: src/server/modules/book/inputs/book-create.input.ts
220
331
  @UnifiedField({ description: 'ISBN number (ISBN-Nummer)' })
221
332
  isbn: string;
333
+
334
+ @UnifiedField({ description: 'Author name' })
335
+ author: string;
336
+
337
+ @UnifiedField({ description: 'Publisher (Verlag)' })
338
+ publisher?: string;
339
+
340
+ // File: src/server/modules/book/inputs/book.input.ts
341
+ @UnifiedField({ description: 'ISBN number (ISBN-Nummer)' })
342
+ isbn?: string;
343
+
344
+ @UnifiedField({ description: 'Author name' })
345
+ author?: string;
346
+
347
+ @UnifiedField({ description: 'Publisher (Verlag)' })
348
+ publisher?: string;
222
349
  ```
223
350
 
351
+ **Verification:**
352
+ - ✅ Same description in ALL 3 files for each property
353
+ - ✅ All German descriptions translated
354
+ - ✅ All user comments extracted and applied
355
+ - ✅ No inconsistencies
356
+
224
357
  #### Step 6: Create Enum Files
225
358
 
226
359
  ```typescript