@ngxtm/devkit 3.8.0 → 3.9.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.
- package/cli/init.js +23 -7
- package/cli/update.js +21 -6
- package/package.json +1 -1
- package/templates/base/rules/auto-skill.md +131 -0
package/cli/init.js
CHANGED
|
@@ -136,14 +136,30 @@ function installForTool(toolId, tool, projectDir, options = {}) {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
// 4. Install skills index
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
// 4. Install skills index files (for auto-skill detection)
|
|
140
|
+
const indexFiles = [
|
|
141
|
+
'skills-index.json',
|
|
142
|
+
'skills-keywords.json',
|
|
143
|
+
'skills-categories.json',
|
|
144
|
+
'skills-triggers.json'
|
|
145
|
+
];
|
|
146
|
+
for (const indexFile of indexFiles) {
|
|
147
|
+
const src = path.join(PACKAGE_ROOT, indexFile);
|
|
148
|
+
if (fs.existsSync(src)) {
|
|
149
|
+
fs.copyFileSync(src, path.join(targetDir, indexFile));
|
|
150
|
+
totalFiles++;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// 5. Install base rules (including auto-skill detection)
|
|
155
|
+
const baseRulesDir = path.join(PACKAGE_ROOT, 'templates', 'base', 'rules');
|
|
156
|
+
if (tool.rulesPath && fs.existsSync(baseRulesDir)) {
|
|
157
|
+
const destRulesDir = path.join(targetDir, tool.rulesPath, 'base');
|
|
158
|
+
const count = copyDir(baseRulesDir, destRulesDir);
|
|
159
|
+
totalFiles += count;
|
|
144
160
|
}
|
|
145
161
|
|
|
146
|
-
//
|
|
162
|
+
// 6. Create devkit.json tracking file
|
|
147
163
|
const devkitConfig = {
|
|
148
164
|
version: VERSION,
|
|
149
165
|
tool: toolId,
|
|
@@ -164,7 +180,7 @@ function installForTool(toolId, tool, projectDir, options = {}) {
|
|
|
164
180
|
);
|
|
165
181
|
totalFiles++;
|
|
166
182
|
|
|
167
|
-
//
|
|
183
|
+
// 7. Create settings.json if not exists (for tools that use it)
|
|
168
184
|
if (toolId === 'claude') {
|
|
169
185
|
const settingsPath = path.join(targetDir, 'settings.json');
|
|
170
186
|
if (!fs.existsSync(settingsPath)) {
|
package/cli/update.js
CHANGED
|
@@ -97,14 +97,29 @@ function updateToolInstallation(toolId, tool, projectDir, options = {}) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
// 5. Update skills index
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
// 5. Update skills index files
|
|
101
|
+
const indexFiles = [
|
|
102
|
+
'skills-index.json',
|
|
103
|
+
'skills-keywords.json',
|
|
104
|
+
'skills-categories.json',
|
|
105
|
+
'skills-triggers.json'
|
|
106
|
+
];
|
|
107
|
+
for (const indexFile of indexFiles) {
|
|
108
|
+
const src = path.join(PACKAGE_ROOT, indexFile);
|
|
109
|
+
if (fs.existsSync(src)) {
|
|
110
|
+
fs.copyFileSync(src, path.join(targetDir, indexFile));
|
|
111
|
+
updatedCount++;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 6. Update base rules (including auto-skill detection)
|
|
116
|
+
const baseRulesDir = path.join(PACKAGE_ROOT, 'templates', 'base', 'rules');
|
|
117
|
+
if (tool.rulesPath && fs.existsSync(baseRulesDir)) {
|
|
118
|
+
const destRulesDir = path.join(targetDir, tool.rulesPath, 'base');
|
|
119
|
+
updatedCount += copyDir(baseRulesDir, destRulesDir);
|
|
105
120
|
}
|
|
106
121
|
|
|
107
|
-
//
|
|
122
|
+
// 7. Update devkit.json
|
|
108
123
|
const newConfig = {
|
|
109
124
|
...config,
|
|
110
125
|
version: VERSION,
|
package/package.json
CHANGED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Auto-Skill Detection
|
|
2
|
+
|
|
3
|
+
> Automatically detect and suggest relevant skills based on user's task
|
|
4
|
+
|
|
5
|
+
## When to Activate
|
|
6
|
+
|
|
7
|
+
Before starting ANY coding task, you MUST check if a relevant skill exists:
|
|
8
|
+
|
|
9
|
+
1. **Analyze the user's request** - Extract key technologies, patterns, or domains
|
|
10
|
+
2. **Quick keyword match** - Check `skills-keywords.json` for exact matches
|
|
11
|
+
3. **Category browse** - If no exact match, check `skills-categories.json` for relevant category
|
|
12
|
+
4. **Suggest to user** - Present top 1-3 matching skills with brief descriptions
|
|
13
|
+
|
|
14
|
+
## Detection Flow
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
User Request → Extract Keywords → Match in skills-keywords.json
|
|
18
|
+
↓
|
|
19
|
+
Found? → Suggest: "I found /skill-name that matches your task"
|
|
20
|
+
↓ No
|
|
21
|
+
Check skills-categories.json → Browse category
|
|
22
|
+
↓
|
|
23
|
+
Found? → Suggest: "These skills in [category] might help: ..."
|
|
24
|
+
↓ No
|
|
25
|
+
Proceed without skill
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## How to Search
|
|
29
|
+
|
|
30
|
+
### Step 1: Extract Keywords
|
|
31
|
+
From user request, identify:
|
|
32
|
+
- **Technologies**: react, python, docker, postgres, etc.
|
|
33
|
+
- **Patterns**: authentication, caching, testing, deployment
|
|
34
|
+
- **Domains**: ai, security, mobile, devops
|
|
35
|
+
|
|
36
|
+
### Step 2: Keyword Lookup
|
|
37
|
+
```
|
|
38
|
+
Read: .claude/skills-keywords.json
|
|
39
|
+
Find: keywords from user request
|
|
40
|
+
Result: List of matching skill names
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Step 3: Category Fallback
|
|
44
|
+
If keywords don't match, check categories:
|
|
45
|
+
- `frontend` - React, Vue, UI/UX, CSS
|
|
46
|
+
- `backend` - Node, API, REST, GraphQL
|
|
47
|
+
- `database` - SQL, Postgres, MongoDB, Redis
|
|
48
|
+
- `ai-ml` - LLM, Agents, RAG, Embeddings
|
|
49
|
+
- `devops` - Docker, K8s, CI/CD, Cloud
|
|
50
|
+
- `testing` - Jest, Playwright, TDD
|
|
51
|
+
- `security` - Auth, OAuth, OWASP
|
|
52
|
+
- `mobile` - React Native, Flutter, iOS
|
|
53
|
+
- `git-workflow` - PR, Code Review, Branching
|
|
54
|
+
|
|
55
|
+
### Step 4: Suggest
|
|
56
|
+
|
|
57
|
+
**Format for suggestion:**
|
|
58
|
+
```
|
|
59
|
+
I found a skill that might help with your task:
|
|
60
|
+
|
|
61
|
+
📌 /skill-name - Brief description
|
|
62
|
+
|
|
63
|
+
Would you like me to use this skill? (It will load specific patterns and best practices for [domain])
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**For multiple matches:**
|
|
67
|
+
```
|
|
68
|
+
I found several skills that might help:
|
|
69
|
+
|
|
70
|
+
1. /skill-1 - Description
|
|
71
|
+
2. /skill-2 - Description
|
|
72
|
+
3. /skill-3 - Description
|
|
73
|
+
|
|
74
|
+
Which one should I use? (or say "none" to proceed without)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Auto-Activate Triggers
|
|
78
|
+
|
|
79
|
+
Some skills should auto-activate based on patterns:
|
|
80
|
+
|
|
81
|
+
| Pattern | Auto-load Skill |
|
|
82
|
+
|---------|----------------|
|
|
83
|
+
| "create PR", "pull request" | /pr-description |
|
|
84
|
+
| "code review" | /code-review |
|
|
85
|
+
| "write tests", "add tests" | /test-master |
|
|
86
|
+
| "fix bug", "debug" | /systematic-debugging |
|
|
87
|
+
| "deploy", "deployment" | Check devops category |
|
|
88
|
+
| "authenticate", "auth" | /auth-patterns |
|
|
89
|
+
| "database schema" | /database-design |
|
|
90
|
+
|
|
91
|
+
## Important Rules
|
|
92
|
+
|
|
93
|
+
1. **Don't overwhelm** - Max 3 suggestions at a time
|
|
94
|
+
2. **Be concise** - One-line descriptions only
|
|
95
|
+
3. **Ask permission** - Always ask before loading a skill
|
|
96
|
+
4. **Remember context** - If user said "none", don't suggest again for same task
|
|
97
|
+
5. **Skill stacking** - Multiple skills can be used together if relevant
|
|
98
|
+
|
|
99
|
+
## Files Reference
|
|
100
|
+
|
|
101
|
+
| File | Purpose | Size |
|
|
102
|
+
|------|---------|------|
|
|
103
|
+
| `skills-keywords.json` | Keyword → Skills mapping | ~330KB |
|
|
104
|
+
| `skills-categories.json` | Category-based index | ~108KB |
|
|
105
|
+
| `skills-triggers.json` | Trigger patterns | ~205KB |
|
|
106
|
+
| `skills-index.json` | Full skill list | ~200KB |
|
|
107
|
+
|
|
108
|
+
## Example Interactions
|
|
109
|
+
|
|
110
|
+
**User:** "Add JWT authentication to my Express API"
|
|
111
|
+
|
|
112
|
+
**Claude:**
|
|
113
|
+
```
|
|
114
|
+
I found skills that match your task:
|
|
115
|
+
|
|
116
|
+
📌 /auth-patterns - JWT, OAuth2, session management patterns
|
|
117
|
+
📌 /express-expert - Express.js best practices and middleware
|
|
118
|
+
|
|
119
|
+
Should I use these? They'll help ensure secure auth implementation.
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**User:** "Optimize my React app performance"
|
|
123
|
+
|
|
124
|
+
**Claude:**
|
|
125
|
+
```
|
|
126
|
+
I found a relevant skill:
|
|
127
|
+
|
|
128
|
+
📌 /react-performance - React optimization patterns, memo, lazy loading, profiling
|
|
129
|
+
|
|
130
|
+
Want me to apply these optimization patterns?
|
|
131
|
+
```
|