@lenne.tech/cli 1.0.0 → 1.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 (25) hide show
  1. package/build/commands/claude/install-commands.js +332 -0
  2. package/build/commands/claude/install-skills.js +5 -1
  3. package/build/commands/server/add-property.js +22 -41
  4. package/build/extensions/server.js +142 -46
  5. package/build/templates/claude-commands/code-cleanup.md +82 -0
  6. package/build/templates/claude-commands/mr-description-clipboard.md +48 -0
  7. package/build/templates/claude-commands/mr-description.md +33 -0
  8. package/build/templates/claude-commands/sec-review.md +62 -0
  9. package/build/templates/claude-commands/skill-optimize.md +140 -0
  10. package/build/templates/claude-commands/test-generate.md +45 -0
  11. package/build/templates/claude-skills/nest-server-generator/SKILL.md +372 -1314
  12. package/build/templates/claude-skills/nest-server-generator/configuration.md +279 -0
  13. package/build/templates/claude-skills/nest-server-generator/declare-keyword-warning.md +124 -0
  14. package/build/templates/claude-skills/nest-server-generator/description-management.md +217 -0
  15. package/build/templates/claude-skills/nest-server-generator/examples.md +131 -5
  16. package/build/templates/claude-skills/nest-server-generator/quality-review.md +855 -0
  17. package/build/templates/claude-skills/nest-server-generator/reference.md +67 -13
  18. package/build/templates/claude-skills/nest-server-generator/security-rules.md +358 -0
  19. package/build/templates/claude-skills/story-tdd/SKILL.md +1173 -0
  20. package/build/templates/claude-skills/story-tdd/code-quality.md +266 -0
  21. package/build/templates/claude-skills/story-tdd/database-indexes.md +173 -0
  22. package/build/templates/claude-skills/story-tdd/examples.md +1332 -0
  23. package/build/templates/claude-skills/story-tdd/reference.md +1180 -0
  24. package/build/templates/claude-skills/story-tdd/security-review.md +299 -0
  25. package/package.json +1 -1
@@ -0,0 +1,48 @@
1
+ ---
2
+ description: Generate MR description and save to clipboard
3
+ ---
4
+
5
+ Create a comprehensive summary of the changes in English for a Merge Request description.
6
+
7
+ Please structure the description as follows:
8
+ - **Summary**: Brief summary (1-2 sentences)
9
+ - **Changes**: List of the most important changes
10
+ - **Technical Details**: Relevant technical details if necessary
11
+ - **Testing**: How was it tested / how can it be tested
12
+
13
+ Keep it short and concise - focus on what's essential for code reviewers.
14
+
15
+ **IMPORTANT - CLIPBOARD WORKFLOW:**
16
+
17
+ 1. First, create the MR description in this format:
18
+
19
+ ```markdown
20
+ ## Summary
21
+ [Your summary here]
22
+
23
+ ## Changes
24
+ - Change 1
25
+ - Change 2
26
+
27
+ ## Technical Details
28
+ [Details if necessary]
29
+
30
+ ## Testing
31
+ [Testing approach]
32
+ ```
33
+
34
+ 2. After presenting the description, provide this shell command:
35
+
36
+ ```bash
37
+ cat << 'EOF' | pbcopy
38
+ [PASTE THE EXACT MR DESCRIPTION HERE]
39
+ EOF
40
+ echo "✅ MR description copied to clipboard!"
41
+ ```
42
+
43
+ 3. User can run this command to copy the description to clipboard automatically.
44
+
45
+ **Platform-specific commands:**
46
+ - macOS: `pbcopy`
47
+ - Linux: `xclip -selection clipboard` or `xsel --clipboard`
48
+ - Windows: `clip`
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Generate Merge Request description
3
+ ---
4
+
5
+ Create a comprehensive summary of the changes in English so I can use it as a description in a Merge Request. Only include the essential points.
6
+
7
+ Please structure the description as follows:
8
+ - **Summary**: Brief summary (1-2 sentences)
9
+ - **Changes**: List of the most important changes
10
+ - **Technical Details**: Relevant technical details if necessary
11
+ - **Testing**: How was it tested / how can it be tested
12
+
13
+ Keep it short and concise - focus on what's essential for code reviewers.
14
+
15
+ **IMPORTANT OUTPUT FORMAT:**
16
+ Present the final MR description in a clearly marked code block that is easy to copy:
17
+
18
+ ```markdown
19
+ ## Summary
20
+ [Your summary here]
21
+
22
+ ## Changes
23
+ - Change 1
24
+ - Change 2
25
+
26
+ ## Technical Details
27
+ [Details if necessary]
28
+
29
+ ## Testing
30
+ [Testing approach]
31
+ ```
32
+
33
+ Then add: "✂️ **Copy the markdown block above to use it in your Merge Request.**"
@@ -0,0 +1,62 @@
1
+ ---
2
+ description: Perform security review of code changes
3
+ ---
4
+
5
+ Perform a complete security review:
6
+
7
+ ## 🔐 1. Controller/Resolver Security
8
+
9
+ Check all modified Controller/Resolver files:
10
+ - [ ] Were @Restricted decorators removed or weakened?
11
+ - [ ] Were @Roles decorators made more permissive?
12
+ - [ ] Are there new endpoints without security decorators?
13
+ - [ ] Are the roles appropriate (not too open)?
14
+
15
+ ## 🔐 2. Model Security
16
+
17
+ Check all modified Model files:
18
+ - [ ] Is securityCheck() method correctly implemented?
19
+ - [ ] Admin check: `user?.hasRole(RoleEnum.ADMIN)`
20
+ - [ ] Creator check: `equalIds(user, this.createdBy)`
21
+ - [ ] Were security checks weakened?
22
+ - [ ] Are sensitive properties protected with @Restricted?
23
+
24
+ ## 🔐 3. Input Validation
25
+
26
+ Check all Input/DTO files:
27
+ - [ ] Are all inputs validated?
28
+ - [ ] Required fields correctly marked?
29
+ - [ ] Type safety ensured?
30
+ - [ ] No unsafe data types (e.g., any)?
31
+
32
+ ## 🔐 4. Ownership & Authorization
33
+
34
+ Check service methods:
35
+ - [ ] Update/Delete: Ownership checks present?
36
+ - [ ] Check: `userId === object.createdBy` OR `user.isAdmin`
37
+ - [ ] serviceOptions.roles correctly set?
38
+ - [ ] No authorization bypasses?
39
+
40
+ ## 🔐 5. Data Exposure
41
+
42
+ Check GraphQL/REST responses:
43
+ - [ ] Sensitive fields marked with `hideField: true`?
44
+ - [ ] Passwords/Tokens not in responses?
45
+ - [ ] securityCheck() filters correctly?
46
+
47
+ ## 🔐 6. Test Coverage
48
+
49
+ Check tests:
50
+ - [ ] Security failure tests present (403 responses)?
51
+ - [ ] Tests with different roles (Admin, User, Other)?
52
+ - [ ] Ownership tests present?
53
+
54
+ ## 📋 Report
55
+
56
+ Create a list of all findings:
57
+ - **Critical**: Severe security issues
58
+ - **Warning**: Potential problems
59
+ - **Info**: Improvement suggestions
60
+ - **OK**: Everything secure
61
+
62
+ **On Critical/Warning findings: STOP and inform the developer!**
@@ -0,0 +1,140 @@
1
+ ---
2
+ description: Optimize Claude skill files if too large
3
+ ---
4
+
5
+ Analyze and optimize large skill files for better Claude Code performance:
6
+
7
+ ## 📊 1. Skill File Analysis
8
+
9
+ Analyze all skill files:
10
+ ```bash
11
+ # Count lines of all SKILL.md files
12
+ find src/templates/claude-skills -name "SKILL.md" -exec wc -l {} \;
13
+
14
+ # Or more detailed
15
+ for skill in src/templates/claude-skills/*/SKILL.md; do
16
+ lines=$(wc -l < "$skill")
17
+ name=$(basename $(dirname "$skill"))
18
+ echo "$name: $lines lines"
19
+ done
20
+ ```
21
+
22
+ ## 🎯 2. Determine Optimization Needs
23
+
24
+ **Target Sizes:**
25
+ - ✅ **Optimal:** 500-800 lines (fastest loading)
26
+ - ⚠️ **Acceptable:** 800-1,800 lines (borderline)
27
+ - ❌ **Too Large:** > 1,800 lines (MUST be optimized)
28
+
29
+ Identify files over 1,800 lines for optimization.
30
+
31
+ ## 📑 3. Identify Large Sections
32
+
33
+ For each oversized SKILL.md:
34
+ ```bash
35
+ # Show sections with line numbers
36
+ grep -n "^## " SKILL.md
37
+
38
+ # Calculate section sizes
39
+ # Sections > 200 lines are candidates for extraction
40
+ ```
41
+
42
+ **Typical large sections:**
43
+ - Quality Review processes (often 500-1000 lines)
44
+ - Security Rules (often 300-500 lines)
45
+ - Configuration Guides (often 200-300 lines)
46
+ - Test Guidelines (often 400-600 lines)
47
+ - Example Collections (often 300-500 lines)
48
+
49
+ ## 🔧 4. Perform Modularization
50
+
51
+ For each large section (> 200 lines):
52
+
53
+ **A. Extract section:**
54
+ ```bash
55
+ # Create separate .md file
56
+ # e.g., security-rules.md, quality-review.md, configuration.md
57
+ ```
58
+
59
+ **B. Add frontmatter:**
60
+ ```markdown
61
+ ---
62
+ name: skill-name-section-name
63
+ version: 1.0.0
64
+ description: What this file contains
65
+ ---
66
+ ```
67
+
68
+ **C. Replace in SKILL.md:**
69
+ ```markdown
70
+ ## Section Name
71
+
72
+ **📖 For complete [section topic] with all details, see: `section-file.md`**
73
+
74
+ **Quick overview:**
75
+ - Key point 1
76
+ - Key point 2
77
+ - Key point 3
78
+
79
+ **Critical reminders:**
80
+ - [ ] Important checkpoint 1
81
+ - [ ] Important checkpoint 2
82
+ ```
83
+
84
+ ## 📏 5. Extraction Strategy
85
+
86
+ **What to extract:**
87
+ - ✅ Detailed process descriptions
88
+ - ✅ Extensive examples
89
+ - ✅ Long checklists
90
+ - ✅ Reference documentation
91
+ - ✅ Troubleshooting guides
92
+
93
+ **What NOT to extract:**
94
+ - ❌ Core workflow (Phases 1-7)
95
+ - ❌ Critical warnings (Security, declare keyword)
96
+ - ❌ Command syntax (brief reference)
97
+ - ❌ Skill description and "When to Use"
98
+
99
+ ## ✅ 6. Quality Assurance
100
+
101
+ After each extraction:
102
+ - [ ] SKILL.md has clear reference (📖) to detail file
103
+ - [ ] Detail file has frontmatter
104
+ - [ ] Compact summary remains in SKILL.md
105
+ - [ ] No information is lost
106
+ - [ ] Line count significantly reduced
107
+
108
+ ## 📊 7. Measure Success
109
+
110
+ ```bash
111
+ # Before/After comparison
112
+ echo "Original: 3,309 lines"
113
+ echo "After optimization: $(wc -l < SKILL.md) lines"
114
+ echo "Reduction: $((3309 - $(wc -l < SKILL.md))) lines"
115
+ echo "Percentage: $(echo "scale=1; (3309 - $(wc -l < SKILL.md)) * 100 / 3309" | bc)%"
116
+ ```
117
+
118
+ **Success if:**
119
+ - ✅ SKILL.md under 1,800 lines (ideal: under 1,500)
120
+ - ✅ 5-8 modular detail files created
121
+ - ✅ 30-50% reduction achieved
122
+ - ✅ All information still available
123
+
124
+ ## 🎯 8. Create Report
125
+
126
+ Create summary:
127
+ ```
128
+ === Skill Optimization Report ===
129
+
130
+ 📁 Optimized Skills:
131
+ - skill-name: 3,309 → 1,890 lines (-43%)
132
+
133
+ 📄 Created Detail Files:
134
+ - security-rules.md (9.2K)
135
+ - quality-review.md (29K)
136
+ - configuration.md (7.0K)
137
+ ...
138
+
139
+ ✅ All skills now within optimal range!
140
+ ```
@@ -0,0 +1,45 @@
1
+ ---
2
+ description: Generate comprehensive tests for changes
3
+ ---
4
+
5
+ Analyze recent changes and create appropriate tests:
6
+
7
+ 1. **Identify all changed/new modules**:
8
+ ```bash
9
+ git status --short
10
+ git diff --name-only
11
+ ```
12
+
13
+ 2. **For each new module** in `src/server/modules/`:
14
+ - Create E2E test in `tests/modules/<module-name>.e2e-spec.ts`
15
+ - Analyze existing tests as templates
16
+ - Fully understand TestHelper (read source code)
17
+
18
+ 3. **For each modified module**:
19
+ - Update existing test in `tests/modules/`
20
+ - Test new/changed properties
21
+ - Test changed validations
22
+
23
+ 4. **Security Testing**:
24
+ - Check @Restricted/@Roles decorators
25
+ - Test with Admin User (user.roles contains 'admin')
26
+ - Test with Creator (user.id === object.createdBy)
27
+ - Test with Other User (should fail with 403)
28
+ - Test permission failures
29
+
30
+ 5. **Test Execution**:
31
+ ```bash
32
+ npm run test:e2e
33
+ ```
34
+ - On errors: Debug with console.log
35
+ - Fix errors
36
+ - Re-run tests
37
+
38
+ 6. **Cleanup**:
39
+ - Remove all console.log statements
40
+ - Verify tests still pass
41
+
42
+ **Important:**
43
+ - NEVER weaken @Restricted/@Roles to fix tests
44
+ - ALWAYS test with least privileged user
45
+ - ALWAYS follow existing test patterns