@lenne.tech/cli 1.0.1 → 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.
- package/build/commands/claude/install-commands.js +10 -5
- package/build/commands/claude/install-mcps.js +256 -0
- package/build/commands/claude/install-skills.js +90 -23
- package/build/lib/mcp-registry.js +71 -0
- package/build/templates/claude-commands/commit-message.md +21 -0
- package/build/templates/claude-commands/skill-optimize.md +431 -90
- package/build/templates/claude-skills/building-stories-with-tdd/SKILL.md +265 -0
- package/build/templates/claude-skills/{story-tdd → building-stories-with-tdd}/code-quality.md +10 -0
- package/build/templates/claude-skills/{story-tdd → building-stories-with-tdd}/database-indexes.md +9 -0
- package/build/templates/claude-skills/{story-tdd → building-stories-with-tdd}/examples.md +115 -64
- package/build/templates/claude-skills/building-stories-with-tdd/handling-existing-tests.md +197 -0
- package/build/templates/claude-skills/{story-tdd → building-stories-with-tdd}/reference.md +276 -29
- package/build/templates/claude-skills/{story-tdd → building-stories-with-tdd}/security-review.md +8 -0
- package/build/templates/claude-skills/building-stories-with-tdd/workflow.md +1004 -0
- package/build/templates/claude-skills/generating-nest-servers/SKILL.md +303 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/configuration.md +6 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/declare-keyword-warning.md +9 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/description-management.md +9 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/examples.md +7 -0
- package/build/templates/claude-skills/generating-nest-servers/framework-guide.md +259 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/quality-review.md +9 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/reference.md +16 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/security-rules.md +13 -0
- package/build/templates/claude-skills/generating-nest-servers/verification-checklist.md +262 -0
- package/build/templates/claude-skills/generating-nest-servers/workflow-process.md +1061 -0
- package/build/templates/claude-skills/{lt-cli → using-lt-cli}/SKILL.md +22 -10
- package/build/templates/claude-skills/{lt-cli → using-lt-cli}/examples.md +7 -3
- package/build/templates/claude-skills/{lt-cli → using-lt-cli}/reference.md +10 -3
- package/package.json +2 -2
- package/build/templates/claude-skills/nest-server-generator/SKILL.md +0 -1891
- package/build/templates/claude-skills/story-tdd/SKILL.md +0 -1173
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nest-server-generator-verification
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Comprehensive verification checklist for generated NestJS modules and objects - covers code generation, descriptions, API tests with security-first approach, test coverage requirements, and security rules compliance
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Verification Checklist
|
|
8
|
+
|
|
9
|
+
## Table of Contents
|
|
10
|
+
- [Code Generation](#code-generation)
|
|
11
|
+
- [API Tests - Security First](#api-tests---security-first)
|
|
12
|
+
- [Test Coverage - Comprehensive Testing](#test-coverage---comprehensive-testing)
|
|
13
|
+
- [Security Rules Compliance](#security-rules-compliance)
|
|
14
|
+
- [Test Organization Structure](#test-organization-structure)
|
|
15
|
+
- [Quick Verification Workflow](#quick-verification-workflow)
|
|
16
|
+
- [Common Verification Failures](#common-verification-failures)
|
|
17
|
+
- [Success Criteria](#success-criteria)
|
|
18
|
+
|
|
19
|
+
After generation, verify all items in this comprehensive checklist:
|
|
20
|
+
|
|
21
|
+
## Code Generation
|
|
22
|
+
|
|
23
|
+
- [ ] All SubObjects created
|
|
24
|
+
- [ ] All Objects created
|
|
25
|
+
- [ ] All Modules created
|
|
26
|
+
- [ ] All properties in alphabetical order
|
|
27
|
+
- [ ] **DESCRIPTIONS (Critical - check thoroughly):**
|
|
28
|
+
- [ ] All user-provided comments (after `//`) extracted from specification
|
|
29
|
+
- [ ] All German descriptions translated to format: `ENGLISH (DEUTSCH)`
|
|
30
|
+
- [ ] All English descriptions kept as-is (spelling corrected)
|
|
31
|
+
- [ ] ALL Module Models have descriptions on all properties
|
|
32
|
+
- [ ] ALL Module CreateInputs have SAME descriptions
|
|
33
|
+
- [ ] ALL Module UpdateInputs have SAME descriptions
|
|
34
|
+
- [ ] ALL SubObjects have descriptions on all properties
|
|
35
|
+
- [ ] ALL SubObject CreateInputs have SAME descriptions
|
|
36
|
+
- [ ] ALL SubObject UpdateInputs have SAME descriptions
|
|
37
|
+
- [ ] ALL `@ObjectType()` decorators have descriptions
|
|
38
|
+
- [ ] ALL `@InputType()` decorators have descriptions
|
|
39
|
+
- [ ] NO inconsistencies (same property, different descriptions in different files)
|
|
40
|
+
- [ ] NO German-only descriptions (must be translated)
|
|
41
|
+
- [ ] Inheritance properly implemented
|
|
42
|
+
- [ ] Required fields correctly set in CreateInputs
|
|
43
|
+
- [ ] Enum files created in `src/server/common/enums/`
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## API Tests - Security First
|
|
48
|
+
|
|
49
|
+
**🚨 CRITICAL: Security analysis MUST be completed BEFORE writing ANY test!**
|
|
50
|
+
|
|
51
|
+
### Permission Analysis (BEFORE Writing Tests)
|
|
52
|
+
- [ ] **Permission analysis completed BEFORE writing tests**
|
|
53
|
+
- [ ] **Analyzed ALL `@Roles()` decorators in controllers/resolvers**
|
|
54
|
+
- [ ] **Read complete `securityCheck()` method in models**
|
|
55
|
+
- [ ] **Understood permission hierarchy (specific overrides general)**
|
|
56
|
+
|
|
57
|
+
### Test User Matrix (Principle of Least Privilege)
|
|
58
|
+
- [ ] **Tests use LEAST privileged user (never admin when less works)**
|
|
59
|
+
- [ ] **S_EVERYONE endpoints tested WITHOUT token**
|
|
60
|
+
- [ ] **S_USER endpoints tested with REGULAR user (not admin)**
|
|
61
|
+
- [ ] **UPDATE/DELETE tested with CREATOR token (not admin)**
|
|
62
|
+
|
|
63
|
+
### Security Validation Tests (MANDATORY)
|
|
64
|
+
- [ ] **Tests verify unauthorized access FAILS (401/403)**
|
|
65
|
+
- [ ] **Tests verify non-creators CANNOT update/delete**
|
|
66
|
+
- [ ] **Tests verify required fields**
|
|
67
|
+
- [ ] **Security validation tests exist (permission failures)**
|
|
68
|
+
|
|
69
|
+
### General Test Requirements
|
|
70
|
+
- [ ] API tests created for all modules
|
|
71
|
+
- [ ] Tests cover all CRUD operations
|
|
72
|
+
- [ ] All tests pass
|
|
73
|
+
- [ ] No TypeScript errors
|
|
74
|
+
- [ ] Lint passes
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Test Coverage - Comprehensive Testing
|
|
79
|
+
|
|
80
|
+
**🎯 GOAL: Achieve the HIGHEST possible test coverage**
|
|
81
|
+
|
|
82
|
+
### Functional Coverage
|
|
83
|
+
- [ ] **Every endpoint has at least one successful test**
|
|
84
|
+
- [ ] **Every endpoint has at least one failure test (unauthorized/validation)**
|
|
85
|
+
- [ ] **All query parameters tested (filters, sorting, pagination)**
|
|
86
|
+
- [ ] **All validation rules tested (required fields, min/max, patterns)**
|
|
87
|
+
- [ ] **All relationships tested (creating/updating/deleting with references)**
|
|
88
|
+
- [ ] **Edge cases tested (empty results, non-existent IDs, duplicate values)**
|
|
89
|
+
- [ ] **Error handling tested (400, 401, 403, 404, 409 status codes)**
|
|
90
|
+
- [ ] **Data integrity tested (cascading deletes, orphan prevention)**
|
|
91
|
+
- [ ] **Business logic tested (custom methods, computed properties)**
|
|
92
|
+
- [ ] **Performance tested (large datasets, pagination limits)**
|
|
93
|
+
|
|
94
|
+
### Coverage Requirements
|
|
95
|
+
- Minimum 80% line coverage for services
|
|
96
|
+
- Minimum 90% line coverage for resolvers/controllers
|
|
97
|
+
- 100% coverage for critical security logic (securityCheck, permission guards)
|
|
98
|
+
- 100% coverage for all endpoints (success AND failure cases)
|
|
99
|
+
- 100% coverage for all permission combinations
|
|
100
|
+
- All public methods tested
|
|
101
|
+
- All error paths tested
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Security Rules Compliance
|
|
106
|
+
|
|
107
|
+
**🚨 CRITICAL: These MUST be checked before completing**
|
|
108
|
+
|
|
109
|
+
### Security Decorator Rules
|
|
110
|
+
- [ ] **NO `@Restricted()` decorators removed from Controllers/Resolvers/Models/Objects**
|
|
111
|
+
- [ ] **NO `@Roles()` decorators weakened to make tests pass**
|
|
112
|
+
- [ ] **NO `securityCheck()` logic modified to bypass security**
|
|
113
|
+
- [ ] **Class-level `@Restricted(ADMIN)` kept as security fallback**
|
|
114
|
+
|
|
115
|
+
### Security Change Management
|
|
116
|
+
- [ ] **All security changes discussed and approved by developer**
|
|
117
|
+
- [ ] **All security changes documented with approval and reason**
|
|
118
|
+
- [ ] **Tests adapted to security requirements (not vice versa)**
|
|
119
|
+
|
|
120
|
+
### Test User Management
|
|
121
|
+
- [ ] **Appropriate test users created for each permission level**
|
|
122
|
+
- [ ] **Permission hierarchy understood and respected (specific overrides general)**
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Test Organization Structure
|
|
127
|
+
|
|
128
|
+
Use this structure for comprehensive, organized tests:
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
describe('ProductResolver', () => {
|
|
132
|
+
// Setup
|
|
133
|
+
describe('Setup', () => {
|
|
134
|
+
beforeAll(async () => {
|
|
135
|
+
// Initialize test environment
|
|
136
|
+
// Create test users with different roles
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
afterAll(async () => {
|
|
140
|
+
// Cleanup all test data
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// Happy path tests
|
|
145
|
+
describe('CREATE operations', () => {
|
|
146
|
+
it('should create product as regular user', ...);
|
|
147
|
+
it('should create product with all optional fields', ...);
|
|
148
|
+
it('should create product with relationships', ...);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
describe('READ operations', () => {
|
|
152
|
+
it('should get product by ID', ...);
|
|
153
|
+
it('should list all products with pagination', ...);
|
|
154
|
+
it('should filter products by criteria', ...);
|
|
155
|
+
it('should sort products by field', ...);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
describe('UPDATE operations', () => {
|
|
159
|
+
it('should update product as creator', ...);
|
|
160
|
+
it('should update product as admin', ...);
|
|
161
|
+
it('should update with partial data', ...);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
describe('DELETE operations', () => {
|
|
165
|
+
it('should delete product as creator', ...);
|
|
166
|
+
it('should delete product as admin', ...);
|
|
167
|
+
it('should handle cascading deletes', ...);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// Security tests (MANDATORY)
|
|
171
|
+
describe('Security Validation', () => {
|
|
172
|
+
it('should FAIL to create without auth', ...);
|
|
173
|
+
it('should FAIL to update as non-creator', ...);
|
|
174
|
+
it('should FAIL to delete as non-creator', ...);
|
|
175
|
+
it('should FAIL to access with invalid token', ...);
|
|
176
|
+
it('should FAIL to read private data as different user', ...);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// Validation tests
|
|
180
|
+
describe('Input Validation', () => {
|
|
181
|
+
it('should FAIL with missing required fields', ...);
|
|
182
|
+
it('should FAIL with invalid field values', ...);
|
|
183
|
+
it('should FAIL with duplicate values', ...);
|
|
184
|
+
it('should FAIL with invalid references', ...);
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// Edge cases
|
|
188
|
+
describe('Edge Cases', () => {
|
|
189
|
+
it('should handle non-existent ID (404)', ...);
|
|
190
|
+
it('should handle empty list results', ...);
|
|
191
|
+
it('should handle concurrent updates', ...);
|
|
192
|
+
it('should handle circular references', ...);
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Quick Verification Workflow
|
|
200
|
+
|
|
201
|
+
1. **Code Generation:**
|
|
202
|
+
- Run through all Code Generation checkboxes
|
|
203
|
+
- Pay special attention to DESCRIPTIONS - most common error!
|
|
204
|
+
|
|
205
|
+
2. **API Tests - Security First:**
|
|
206
|
+
- Complete Permission Analysis BEFORE writing tests
|
|
207
|
+
- Create appropriate test users
|
|
208
|
+
- Write security validation tests FIRST
|
|
209
|
+
- Then write functional tests
|
|
210
|
+
|
|
211
|
+
3. **Test Coverage:**
|
|
212
|
+
- Review coverage report
|
|
213
|
+
- Add tests for any uncovered code
|
|
214
|
+
- Aim for 90%+ overall coverage
|
|
215
|
+
|
|
216
|
+
4. **Security Rules:**
|
|
217
|
+
- Double-check no decorators were removed
|
|
218
|
+
- Verify all security changes documented
|
|
219
|
+
- Confirm tests adapted to security (not vice versa)
|
|
220
|
+
|
|
221
|
+
5. **Final Validation:**
|
|
222
|
+
- Run all tests: `npm test`
|
|
223
|
+
- Check TypeScript: `npm run build`
|
|
224
|
+
- Run linter: `npm run lint`
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Common Verification Failures
|
|
229
|
+
|
|
230
|
+
### ❌ Missing Descriptions
|
|
231
|
+
**Problem:** Forgot to add descriptions to CreateInput or UpdateInput
|
|
232
|
+
**Fix:** Add SAME description from Model to ALL Input files
|
|
233
|
+
|
|
234
|
+
### ❌ Wrong Test Privileges
|
|
235
|
+
**Problem:** Using admin token when S_USER would work
|
|
236
|
+
**Fix:** Review @Roles decorator, use least privileged user
|
|
237
|
+
|
|
238
|
+
### ❌ Missing Security Tests
|
|
239
|
+
**Problem:** No tests for unauthorized access
|
|
240
|
+
**Fix:** Add describe('Security Validation') block with 401/403 tests
|
|
241
|
+
|
|
242
|
+
### ❌ Inconsistent Descriptions
|
|
243
|
+
**Problem:** Different descriptions for same property in different files
|
|
244
|
+
**Fix:** Standardize to one description across Model + CreateInput + UpdateInput
|
|
245
|
+
|
|
246
|
+
### ❌ Security Decorator Removed
|
|
247
|
+
**Problem:** Removed @Restricted to make test pass
|
|
248
|
+
**Fix:** Keep decorator, fix test to use proper authentication
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Success Criteria
|
|
253
|
+
|
|
254
|
+
✅ **All checkboxes checked**
|
|
255
|
+
✅ **All tests pass**
|
|
256
|
+
✅ **No TypeScript errors**
|
|
257
|
+
✅ **Lint passes**
|
|
258
|
+
✅ **Coverage > 90%**
|
|
259
|
+
✅ **Security rules maintained**
|
|
260
|
+
✅ **Descriptions consistent**
|
|
261
|
+
|
|
262
|
+
**When all criteria met → Generation complete! 🎉**
|